dizinini ReservationOrder
değiştirin.
dizinini (kiracı) ReservationOrder
ve altındaki tümünü Reservation
belirtilen kiracı kimliğiyle değiştirme
POST https://management.azure.com/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory?api-version=2022-11-01
URI Parametreleri
Name |
İçinde |
Gerekli |
Tür |
Description |
reservationOrderId
|
path |
True
|
string
|
Rezervasyonun Sipariş Kimliği
|
api-version
|
query |
True
|
string
|
Desteklenen sürüm.
|
İstek Gövdesi
Name |
Tür |
Description |
destinationTenantId
|
string
|
Rezervasyon siparişinin aktarıldığı kiracı kimliği GUID'si
|
Yanıtlar
Name |
Tür |
Description |
200 OK
|
ChangeDirectoryResponse
|
Dizin değiştirme işleminden Reservation sonra oluşturulanların listesi.
|
Other Status Codes
|
Error
|
Beklenmeyen hata
|
Örnekler
ChangeDirectory
Sample Request
POST https://management.azure.com/providers/Microsoft.Capacity/reservationOrders/a075419f-44cc-497f-b68a-14ee811d48b9/changeDirectory?api-version=2022-11-01
{
"destinationTenantId": "906655ea-30be-4587-9d12-b50e077b0f32"
}
import com.azure.resourcemanager.reservations.models.ChangeDirectoryRequest;
/** Samples for ReservationOrder ChangeDirectory. */
public final class Main {
/*
* x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ChangeDirectoryReservationOrder.json
*/
/**
* Sample code: ChangeDirectory.
*
* @param manager Entry point to ReservationsManager.
*/
public static void changeDirectory(com.azure.resourcemanager.reservations.ReservationsManager manager) {
manager
.reservationOrders()
.changeDirectoryWithResponse(
"a075419f-44cc-497f-b68a-14ee811d48b9",
new ChangeDirectoryRequest().withDestinationTenantId("906655ea-30be-4587-9d12-b50e077b0f32"),
com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.reservations import AzureReservationAPI
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-reservations
# USAGE
python change_directory_reservation_order.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = AzureReservationAPI(
credential=DefaultAzureCredential(),
)
response = client.reservation_order.change_directory(
reservation_order_id="a075419f-44cc-497f-b68a-14ee811d48b9",
body={"destinationTenantId": "906655ea-30be-4587-9d12-b50e077b0f32"},
)
print(response)
# x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ChangeDirectoryReservationOrder.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armreservations_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/reservations/armreservations/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/1e7b408f3323e7f5424745718fe62c7a043a2337/specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ChangeDirectoryReservationOrder.json
func ExampleReservationOrderClient_ChangeDirectory() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armreservations.NewClientFactory(cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewReservationOrderClient().ChangeDirectory(ctx, "a075419f-44cc-497f-b68a-14ee811d48b9", armreservations.ChangeDirectoryRequest{
DestinationTenantID: to.Ptr("906655ea-30be-4587-9d12-b50e077b0f32"),
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.ChangeDirectoryResponse = armreservations.ChangeDirectoryResponse{
// ReservationOrder: &armreservations.ChangeDirectoryResult{
// Name: to.Ptr("VM_RI_10-02-2020_15-21"),
// Error: to.Ptr("error string"),
// ID: to.Ptr("a075419f-44cc-497f-b68a-14ee811d48b9"),
// IsSucceeded: to.Ptr(true),
// },
// Reservations: []*armreservations.ChangeDirectoryResult{
// {
// Name: to.Ptr("VM_RI_10-02-2020_15-21"),
// Error: to.Ptr("error string"),
// ID: to.Ptr("1f14354c-dc12-4c8d-8090-6f295a3a34aa"),
// IsSucceeded: to.Ptr(true),
// }},
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureReservationAPI } = require("@azure/arm-reservations");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id
*
* @summary Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id
* x-ms-original-file: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ChangeDirectoryReservationOrder.json
*/
async function changeDirectory() {
const reservationOrderId = "a075419f-44cc-497f-b68a-14ee811d48b9";
const body = {
destinationTenantId: "906655ea-30be-4587-9d12-b50e077b0f32",
};
const credential = new DefaultAzureCredential();
const client = new AzureReservationAPI(credential);
const result = await client.reservationOrder.changeDirectory(reservationOrderId, body);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Azure;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Reservations;
using Azure.ResourceManager.Reservations.Models;
// Generated from example definition: specification/reservations/resource-manager/Microsoft.Capacity/stable/2022-11-01/examples/ChangeDirectoryReservationOrder.json
// this example is just showing the usage of "ReservationOrder_ChangeDirectory" operation, for the dependent resources, they will have to be created separately.
// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this ReservationOrderResource created on azure
// for more information of creating ReservationOrderResource, please refer to the document of ReservationOrderResource
Guid reservationOrderId = Guid.Parse("a075419f-44cc-497f-b68a-14ee811d48b9");
ResourceIdentifier reservationOrderResourceId = ReservationOrderResource.CreateResourceIdentifier(reservationOrderId);
ReservationOrderResource reservationOrder = client.GetReservationOrderResource(reservationOrderResourceId);
// invoke the operation
ChangeDirectoryContent content = new ChangeDirectoryContent()
{
DestinationTenantId = Guid.Parse("906655ea-30be-4587-9d12-b50e077b0f32"),
};
ChangeDirectoryDetail result = await reservationOrder.ChangeDirectoryAsync(content);
Console.WriteLine($"Succeeded: {result}");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"reservationOrder": {
"id": "a075419f-44cc-497f-b68a-14ee811d48b9",
"name": "VM_RI_10-02-2020_15-21",
"isSucceeded": true,
"error": "error string"
},
"reservations": [
{
"id": "1f14354c-dc12-4c8d-8090-6f295a3a34aa",
"name": "VM_RI_10-02-2020_15-21",
"isSucceeded": true,
"error": "error string"
}
]
}
Tanımlar
ChangeDirectoryRequest
Rezervasyonun değişiklik dizini için istek gövdesi.
Name |
Tür |
Description |
destinationTenantId
|
string
|
Rezervasyon siparişinin aktarıldığı kiracı kimliği GUID'si
|
ChangeDirectoryResponse
Dizin yanıtlarını değiştirme
Name |
Tür |
Description |
reservationOrder
|
ChangeDirectoryResult
|
Rezervasyon siparişi veya rezervasyon için dizin sonucunu değiştirme
|
reservations
|
ChangeDirectoryResult[]
|
Rezervasyon siparişi veya rezervasyon için dizin sonucunu değiştirme
|
ChangeDirectoryResult
Rezervasyon siparişi veya rezervasyon için dizin sonucunu değiştirme
Name |
Tür |
Description |
error
|
string
|
İşlem başarısız olursa hata nedeni. Null değilse
|
id
|
string
|
Rezervasyon siparişinin veya rezervasyonun tanımlayıcısı
|
isSucceeded
|
boolean
|
Bu rezervasyon siparişinde veya rezervasyonda dizin değiştirme işlemi başarılı olursa true
|
name
|
string
|
Rezervasyon siparişinin veya rezervasyonun adı
|
Error
Hata bilgileri
Name |
Tür |
Description |
error
|
ExtendedErrorInfo
|
Hata kodu ve hata iletisi de dahil olmak üzere genişletilmiş hata bilgileri
|
ErrorResponseCode
Hizmetin gelen isteği işleyememe nedenini açıklayan hata kodu
Name |
Tür |
Description |
ActivateQuoteFailed
|
string
|
|
AppliedScopesNotAssociatedWithCommerceAccount
|
string
|
|
AppliedScopesSameAsExisting
|
string
|
|
AuthorizationFailed
|
string
|
|
BadRequest
|
string
|
|
BillingCustomerInputError
|
string
|
|
BillingError
|
string
|
|
BillingPaymentInstrumentHardError
|
string
|
|
BillingPaymentInstrumentSoftError
|
string
|
|
BillingScopeIdCannotBeChanged
|
string
|
|
BillingTransientError
|
string
|
|
CalculatePriceFailed
|
string
|
|
CapacityUpdateScopesFailed
|
string
|
|
ClientCertificateThumbprintNotSet
|
string
|
|
CreateQuoteFailed
|
string
|
|
Forbidden
|
string
|
|
FulfillmentConfigurationError
|
string
|
|
FulfillmentError
|
string
|
|
FulfillmentOutOfStockError
|
string
|
|
FulfillmentTransientError
|
string
|
|
HttpMethodNotSupported
|
string
|
|
InternalServerError
|
string
|
|
InvalidAccessToken
|
string
|
|
InvalidFulfillmentRequestParameters
|
string
|
|
InvalidHealthCheckType
|
string
|
|
InvalidLocationId
|
string
|
|
InvalidRefundQuantity
|
string
|
|
InvalidRequestContent
|
string
|
|
InvalidRequestUri
|
string
|
|
InvalidReservationId
|
string
|
|
InvalidReservationOrderId
|
string
|
|
InvalidSingleAppliedScopesCount
|
string
|
|
InvalidSubscriptionId
|
string
|
|
InvalidTenantId
|
string
|
|
MissingAppliedScopesForSingle
|
string
|
|
MissingTenantId
|
string
|
|
NoValidReservationsToReRate
|
string
|
|
NonsupportedAccountId
|
string
|
|
NotSpecified
|
string
|
|
NotSupportedCountry
|
string
|
|
OperationCannotBePerformedInCurrentState
|
string
|
|
OperationFailed
|
string
|
|
PatchValuesSameAsExisting
|
string
|
|
PaymentInstrumentNotFound
|
string
|
|
PurchaseError
|
string
|
|
ReRateOnlyAllowedForEA
|
string
|
|
RefundLimitExceeded
|
string
|
|
ReservationIdNotInReservationOrder
|
string
|
|
ReservationOrderCreationFailed
|
string
|
|
ReservationOrderIdAlreadyExists
|
string
|
|
ReservationOrderNotEnabled
|
string
|
|
ReservationOrderNotFound
|
string
|
|
RiskCheckFailed
|
string
|
|
RoleAssignmentCreationFailed
|
string
|
|
SelfServiceRefundNotSupported
|
string
|
|
ServerTimeout
|
string
|
|
UnauthenticatedRequestsThrottled
|
string
|
|
UnsupportedReservationTerm
|
string
|
|
ExtendedErrorInfo
Hata kodu ve hata iletisi de dahil olmak üzere genişletilmiş hata bilgileri
Name |
Tür |
Description |
code
|
ErrorResponseCode
|
Hizmetin gelen isteği işleyememe nedenini açıklayan hata kodu
|
message
|
string
|
|