Skip to content

Commit fe1e439

Browse files
corquiriSean Oh
andauthored
Add change directory to reservations spec 2020-10-01-preview (#11555)
* 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>
1 parent 2ce850e commit fe1e439

File tree

3 files changed

+270
-1
lines changed

3 files changed

+270
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"parameters": {
3+
"api-version": "2020-10-01-preview",
4+
"reservationOrderId": "a075419f-44cc-497f-b68a-14ee811d48b9",
5+
"body": {
6+
"destinationTenantId": "906655ea-30be-4587-9d12-b50e077b0f32"
7+
}
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"reservationOrder": {
13+
"id": "a075419f-44cc-497f-b68a-14ee811d48b9",
14+
"name": "VM_RI_10-02-2020_15-21",
15+
"isSucceeded": true,
16+
"error": "error string"
17+
},
18+
"reservations": [
19+
{
20+
"id": "1f14354c-dc12-4c8d-8090-6f295a3a34aa",
21+
"name": "VM_RI_10-02-2020_15-21",
22+
"isSucceeded": true,
23+
"error": "error string"
24+
}
25+
]
26+
}
27+
}
28+
}
29+
}
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "Azure Reservation API",
5+
"description": "This API describe Azure Reservation",
6+
"version": "2020-11-15-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"produces": [
13+
"application/json"
14+
],
15+
"consumes": [
16+
"application/json"
17+
],
18+
"securityDefinitions": {
19+
"azure_auth": {
20+
"type": "oauth2",
21+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
22+
"flow": "implicit",
23+
"description": "Azure Active Directory OAuth2 Flow",
24+
"scopes": {
25+
"user_impersonation": "impersonate your user account"
26+
}
27+
}
28+
},
29+
"paths": {
30+
"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/changeDirectory": {
31+
"post": {
32+
"summary": "Change directory of `ReservationOrder`.",
33+
"description": "Change directory (tenant) of `ReservationOrder` and all `Reservation` under it to specified tenant id",
34+
"operationId": "ReservationOrder_ChangeDirectory",
35+
"x-ms-examples": {
36+
"ChangeDirectory": {
37+
"$ref": "./examples/ChangeDirectoryReservationOrder.json"
38+
}
39+
},
40+
"parameters": [
41+
{
42+
"$ref": "#/parameters/ReservationOrderIdParameter"
43+
},
44+
{
45+
"$ref": "#/parameters/ApiVersionParameter"
46+
},
47+
{
48+
"$ref": "#/parameters/ChangeDirectoryParameter"
49+
}
50+
],
51+
"tags": [
52+
"ReservationOrder, ChangeDirectory"
53+
],
54+
"responses": {
55+
"200": {
56+
"description": "List of `Reservation`s created after the change directory operation.",
57+
"schema": {
58+
"$ref": "#/definitions/ChangeDirectoryResponse"
59+
}
60+
},
61+
"default": {
62+
"description": "Unexpected error",
63+
"schema": {
64+
"$ref": "#/definitions/Error"
65+
}
66+
}
67+
}
68+
}
69+
}
70+
},
71+
"definitions": {
72+
"ChangeDirectoryRequest": {
73+
"type": "object",
74+
"properties": {
75+
"destinationTenantId": {
76+
"description": "Tenant id GUID that reservation order is to be transferred to",
77+
"type": "string"
78+
}
79+
}
80+
},
81+
"ChangeDirectoryResponse": {
82+
"type": "object",
83+
"description": "Change directory response",
84+
"properties": {
85+
"reservationOrder": {
86+
"$ref": "#/definitions/ChangeDirectoryResult"
87+
},
88+
"reservations": {
89+
"type": "array",
90+
"items": {
91+
"$ref": "#/definitions/ChangeDirectoryResult"
92+
}
93+
}
94+
}
95+
},
96+
"ChangeDirectoryResult": {
97+
"type": "object",
98+
"description": "Change directory result for reservation order or reservation",
99+
"properties": {
100+
"id": {
101+
"type": "string",
102+
"description": "Identifier of the reservation order or reservation"
103+
},
104+
"name": {
105+
"type": "string",
106+
"description": "Name of the reservation order or reservation"
107+
},
108+
"isSucceeded": {
109+
"description": "True if change directory operation succeeded on this reservation order or reservation",
110+
"type": "boolean"
111+
},
112+
"error": {
113+
"type": "string",
114+
"description": "Error reason if operation failed. Null otherwise"
115+
}
116+
}
117+
},
118+
"Error": {
119+
"type": "object",
120+
"properties": {
121+
"error": {
122+
"$ref": "#/definitions/ExtendedErrorInfo"
123+
}
124+
}
125+
},
126+
"ExtendedErrorInfo": {
127+
"type": "object",
128+
"properties": {
129+
"code": {
130+
"$ref": "#/definitions/ErrorResponseCode"
131+
},
132+
"message": {
133+
"type": "string"
134+
}
135+
}
136+
},
137+
"ErrorResponseCode": {
138+
"type": "string",
139+
"enum": [
140+
"NotSpecified",
141+
"InternalServerError",
142+
"ServerTimeout",
143+
"AuthorizationFailed",
144+
"BadRequest",
145+
"ClientCertificateThumbprintNotSet",
146+
"InvalidRequestContent",
147+
"OperationFailed",
148+
"HttpMethodNotSupported",
149+
"InvalidRequestUri",
150+
"MissingTenantId",
151+
"InvalidTenantId",
152+
"InvalidReservationOrderId",
153+
"InvalidReservationId",
154+
"ReservationIdNotInReservationOrder",
155+
"ReservationOrderNotFound",
156+
"InvalidSubscriptionId",
157+
"InvalidAccessToken",
158+
"InvalidLocationId",
159+
"UnauthenticatedRequestsThrottled",
160+
"InvalidHealthCheckType",
161+
"Forbidden",
162+
"BillingScopeIdCannotBeChanged",
163+
"AppliedScopesNotAssociatedWithCommerceAccount",
164+
"PatchValuesSameAsExisting",
165+
"RoleAssignmentCreationFailed",
166+
"ReservationOrderCreationFailed",
167+
"ReservationOrderNotEnabled",
168+
"CapacityUpdateScopesFailed",
169+
"UnsupportedReservationTerm",
170+
"ReservationOrderIdAlreadyExists",
171+
"RiskCheckFailed",
172+
"CreateQuoteFailed",
173+
"ActivateQuoteFailed",
174+
"NonsupportedAccountId",
175+
"PaymentInstrumentNotFound",
176+
"MissingAppliedScopesForSingle",
177+
"NoValidReservationsToReRate",
178+
"ReRateOnlyAllowedForEA",
179+
"OperationCannotBePerformedInCurrentState",
180+
"InvalidSingleAppliedScopesCount",
181+
"InvalidFulfillmentRequestParameters",
182+
"NotSupportedCountry",
183+
"InvalidRefundQuantity",
184+
"PurchaseError",
185+
"BillingCustomerInputError",
186+
"BillingPaymentInstrumentSoftError",
187+
"BillingPaymentInstrumentHardError",
188+
"BillingTransientError",
189+
"BillingError",
190+
"FulfillmentConfigurationError",
191+
"FulfillmentOutOfStockError",
192+
"FulfillmentTransientError",
193+
"FulfillmentError",
194+
"CalculatePriceFailed"
195+
],
196+
"x-ms-enum": {
197+
"name": "ErrorResponseCode",
198+
"modelAsString": true
199+
}
200+
}
201+
},
202+
"parameters": {
203+
"ReservationOrderIdParameter": {
204+
"name": "reservationOrderId",
205+
"x-ms-parameter-location": "method",
206+
"in": "path",
207+
"required": true,
208+
"type": "string",
209+
"description": "Order Id of the reservation"
210+
},
211+
"ApiVersionParameter": {
212+
"name": "api-version",
213+
"in": "query",
214+
"description": "Supported version for this document is 2020-10-01-preview",
215+
"required": true,
216+
"type": "string"
217+
},
218+
"ChangeDirectoryParameter": {
219+
"name": "body",
220+
"x-ms-parameter-location": "method",
221+
"in": "body",
222+
"required": true,
223+
"description": "Information needed to change directory of reservation order",
224+
"schema": {
225+
"$ref": "#/definitions/ChangeDirectoryRequest"
226+
}
227+
}
228+
}
229+
}

specification/reservations/resource-manager/readme.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ These are the global settings for the Reservations API.
2626

2727
``` yaml
2828
openapi-type: arm
29-
tag: package-2020-10-preview
29+
tag: package-2020-11-preview
30+
```
31+
32+
### Tag: package-2020-11-preview
33+
34+
These settings apply only when `--tag=package-2020-11-preview` is specified on the command line.
35+
36+
```yaml $(tag) == 'package-2020-11-preview'
37+
input-file:
38+
- Microsoft.Capacity/preview/2019-07-19/quota.json
39+
- Microsoft.Capacity/preview/2020-10-01-preview/reservations.json
40+
- Microsoft.Capacity/preview/2020-11-15-preview/reservationsChangeDirectory.json
3041
```
3142

3243
### Tag: package-2020-10-preview

0 commit comments

Comments
 (0)