Skip to content

Commit

Permalink
Add change directory to reservations spec 2020-10-01-preview (Azure#1…
Browse files Browse the repository at this point in the history
…1555)

* Add change directory to reservations spec 2020-10-01-preview

* refactoring and updating description

* prettier and spellcheck

* Revert "prettier and spellcheck"

This reverts commit b2a9735.

* Revert "refactoring and updating description"

This reverts commit 9dfdd78.

* Revert "Add change directory to reservations spec 2020-10-01-preview"

This reverts commit 064f7a9.

* moving change directory to new api version

* fixing lint error

* update default tag

Co-authored-by: Sean Oh <hyo@microsoft.com>
  • Loading branch information
2 people authored and giromm2ms committed Dec 20, 2020
1 parent 844fc5f commit 499f9b6
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 1 deletion.
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

0 comments on commit 499f9b6

Please sign in to comment.