Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add change directory to reservations spec 2020-10-01-preview #11555

Merged
merged 9 commits into from
Nov 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"parameters": {
"api-version": "2020-10-01-preview",
"reservationOrderId": "a075419f-44cc-497f-b68a-14ee811d48b9",
"body": {
"destinationTenantId": "906655ea-30be-4587-9d12-b50e077b0f32"
}
},
"responses": {
"200": {
"body": {
"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"
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,229 @@
{
"swagger": "2.0",
"info": {
"title": "Azure Reservation API",
"description": "This API describe Azure Reservation",
"version": "2020-11-15-preview"
},
"host": "management.azure.com",
"schemes": [
"https"
],
"produces": [
"application/json"
],
"consumes": [
"application/json"
],
"securityDefinitions": {
"azure_auth": {
"type": "oauth2",
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
"flow": "implicit",
"description": "Azure Active Directory OAuth2 Flow",
"scopes": {
"user_impersonation": "impersonate your user account"
}
}
},
"paths": {
"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory": {
"post": {
"summary": "Change directory of `ReservationOrder`.",
"description": "Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id",
"operationId": "ReservationOrder_ChangeDirectory",
"x-ms-examples": {
"ChangeDirectory": {
"$ref": "./examples/ChangeDirectoryReservationOrder.json"
}
},
"parameters": [
{
"$ref": "#/parameters/ReservationOrderIdParameter"
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/ChangeDirectoryParameter"
}
],
"tags": [
"ReservationOrder, ChangeDirectory"
],
"responses": {
"200": {
"description": "List of `Reservation`s created after the change directory operation.",
"schema": {
"$ref": "#/definitions/ChangeDirectoryResponse"
}
},
"default": {
"description": "Unexpected error",
"schema": {
"$ref": "#/definitions/Error"
}
}
}
}
}
},
"definitions": {
"ChangeDirectoryRequest": {
"type": "object",
"properties": {
"destinationTenantId": {
"description": "Tenant id GUID that reservation order is to be transferred to",
"type": "string"
}
}
},
"ChangeDirectoryResponse": {
"type": "object",
"description": "Change directory response",
"properties": {
"reservationOrder": {
"$ref": "#/definitions/ChangeDirectoryResult"
},
"reservations": {
"type": "array",
"items": {
"$ref": "#/definitions/ChangeDirectoryResult"
}
}
}
},
"ChangeDirectoryResult": {
"type": "object",
"description": "Change directory result for reservation order or reservation",
"properties": {
"id": {
"type": "string",
"description": "Identifier of the reservation order or reservation"
},
"name": {
"type": "string",
"description": "Name of the reservation order or reservation"
},
"isSucceeded": {
"description": "True if change directory operation succeeded on this reservation order or reservation",
"type": "boolean"
},
"error": {
"type": "string",
"description": "Error reason if operation failed. Null otherwise"
}
}
},
"Error": {
"type": "object",
"properties": {
"error": {
"$ref": "#/definitions/ExtendedErrorInfo"
}
}
},
"ExtendedErrorInfo": {
"type": "object",
"properties": {
"code": {
"$ref": "#/definitions/ErrorResponseCode"
},
"message": {
"type": "string"
}
}
},
"ErrorResponseCode": {
"type": "string",
"enum": [
"NotSpecified",
"InternalServerError",
"ServerTimeout",
"AuthorizationFailed",
"BadRequest",
"ClientCertificateThumbprintNotSet",
"InvalidRequestContent",
"OperationFailed",
"HttpMethodNotSupported",
"InvalidRequestUri",
"MissingTenantId",
"InvalidTenantId",
"InvalidReservationOrderId",
"InvalidReservationId",
"ReservationIdNotInReservationOrder",
"ReservationOrderNotFound",
"InvalidSubscriptionId",
"InvalidAccessToken",
"InvalidLocationId",
"UnauthenticatedRequestsThrottled",
"InvalidHealthCheckType",
"Forbidden",
"BillingScopeIdCannotBeChanged",
"AppliedScopesNotAssociatedWithCommerceAccount",
"PatchValuesSameAsExisting",
"RoleAssignmentCreationFailed",
"ReservationOrderCreationFailed",
"ReservationOrderNotEnabled",
"CapacityUpdateScopesFailed",
"UnsupportedReservationTerm",
"ReservationOrderIdAlreadyExists",
"RiskCheckFailed",
"CreateQuoteFailed",
"ActivateQuoteFailed",
"NonsupportedAccountId",
"PaymentInstrumentNotFound",
"MissingAppliedScopesForSingle",
"NoValidReservationsToReRate",
"ReRateOnlyAllowedForEA",
"OperationCannotBePerformedInCurrentState",
"InvalidSingleAppliedScopesCount",
"InvalidFulfillmentRequestParameters",
"NotSupportedCountry",
"InvalidRefundQuantity",
"PurchaseError",
"BillingCustomerInputError",
"BillingPaymentInstrumentSoftError",
"BillingPaymentInstrumentHardError",
"BillingTransientError",
"BillingError",
"FulfillmentConfigurationError",
"FulfillmentOutOfStockError",
"FulfillmentTransientError",
"FulfillmentError",
"CalculatePriceFailed"
],
"x-ms-enum": {
"name": "ErrorResponseCode",
"modelAsString": true
}
}
},
"parameters": {
"ReservationOrderIdParameter": {
"name": "reservationOrderId",
"x-ms-parameter-location": "method",
"in": "path",
"required": true,
"type": "string",
"description": "Order Id of the reservation"
},
"ApiVersionParameter": {
"name": "api-version",
"in": "query",
"description": "Supported version for this document is 2020-10-01-preview",
"required": true,
"type": "string"
},
"ChangeDirectoryParameter": {
"name": "body",
"x-ms-parameter-location": "method",
"in": "body",
"required": true,
"description": "Information needed to change directory of reservation order",
"schema": {
"$ref": "#/definitions/ChangeDirectoryRequest"
}
}
}
}
13 changes: 12 additions & 1 deletion specification/reservations/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,18 @@ These are the global settings for the Reservations API.

``` yaml
openapi-type: arm
tag: package-2020-10-preview
tag: package-2020-11-preview
```

### Tag: package-2020-11-preview

These settings apply only when `--tag=package-2020-11-preview` is specified on the command line.

```yaml $(tag) == 'package-2020-11-preview'
input-file:
- Microsoft.Capacity/preview/2019-07-19/quota.json
- Microsoft.Capacity/preview/2020-10-01-preview/reservations.json
- Microsoft.Capacity/preview/2020-11-15-preview/reservationsChangeDirectory.json
```

### Tag: package-2020-10-preview
Expand Down