From 30a2740c1ef0ec7715bd8ae16cad101eb6ba496b Mon Sep 17 00:00:00 2001 From: Menton Joe Frable Date: Fri, 23 Mar 2018 09:33:53 -0700 Subject: [PATCH 1/6] fix readme.md to include 2016/06/01 with 2018/03/01 always --- specification/subscription/resource-manager/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index e384044734b9..d4babf711553 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -42,6 +42,9 @@ These settings apply only when `--tag=package-2018-03-preview` is specified on t ``` yaml $(tag) == 'package-2018-03-preview' input-file: - Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json +- Microsoft.Subscription/stable/2016-06-01/subscriptions.json +title: SubscriptionClient +description: The subscription client ``` ### Tag: package-2017-11-preview From 2f49c4eeacddcd444556e9c61e838d9d413b5117 Mon Sep 17 00:00:00 2001 From: Menton Joe Frable Date: Tue, 13 Nov 2018 09:26:28 -0800 Subject: [PATCH 2/6] add 2018-11-01-preview --- .../examples/createSubscription.json | 31 ++ .../examples/getOperations.json | 22 ++ .../examples/getSubscriptionOperation.json | 19 + .../2018-11-01-preview/subscriptions.json | 326 ++++++++++++++++++ .../subscription/resource-manager/readme.md | 14 +- 5 files changed, 411 insertions(+), 1 deletion(-) create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json new file mode 100644 index 000000000000..57cd52666ca8 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json @@ -0,0 +1,31 @@ +{ + "parameters": { + "billingAccountId": "12a6eed9-5d39-4103-a5db-2db1db0a8c67", + "invoiceSectionId": "b859d705-1ed7-4769-9d4b-19238e9e8ac2_10_31", + "api-version": "2018-11-01-preview", + "body": { + "displayName": "Test Ea Azure Sub", + "billingProfileId": "/providers/Microsoft.Billing/billingAccounts/12a6eed9-5d39-4103-a5db-2db1db0a8c67/billingProfiles/dbcb81c8-cda9-4b01-b9fc-831e6a2e152e", + "skuId": "0001", + "owner": { + "objectId": "973034ff-acb7-409c-b731-e789672c7b31" + }, + "additionalParameters": { + } + } + }, + "responses": { + "202": { + "headers": { + "Location": + "/providers/Microsoft.Subscription/subscriptionOperations/aeb76128-ebde-4f5a-a9ed-e7bbf2dbc994?api-version=2018-11-01-preview", + "Retry-After": "60" + } + }, + "200": { + "body": { + "subscriptionLink": "/subscriptions/d0d6ee57-6530-4fca-93a6-b755a070be35" + } + } + } +} \ No newline at end of file diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json new file mode 100644 index 000000000000..143aac675b40 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.Subscription/createOperation/action", + "display": { + "provider": "Microsoft Subscription", + "resource": "Resources", + "operation": "Create a subscription", + "description": "Create an Azure subscription." + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json new file mode 100644 index 000000000000..a8c15bb4abc1 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "operationId": "e4b8d068-f574-462a-a76f-6fa0afc613c9", + "api-version": "2018-11-01-preview" + }, + "responses": { + "202": { + "headers": { + "Location": "/providers/Microsoft.Subscription/subscriptionOperations/e4b8d068-f574-462a-a76f-6fa0afc613c9?api-version=2018-11-01-preview", + "Retry-After": "60" + } + }, + "200": { + "body": { + "subscriptionLink": "/subscriptions/4df8d5c2-1b7e-4dd5-bc61-640704bde633" + } + } + } +} \ No newline at end of file diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json new file mode 100644 index 000000000000..b8f597fbb35c --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json @@ -0,0 +1,326 @@ +{ + "swagger": "2.0", + "info": { + "version": "2018-11-01-preview", + "title": "SubscriptionClient", + "description": "Subscription client provides an interface to create and manage Azure subscriptions programmatically." + }, + "schemes": [ + "https" + ], + "host": "management.azure.com", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": { + "/providers/Microsoft.Subscription/operations": { + "get": { + "description": "Lists all of the available Microsoft.Subscription API operations.", + "operationId": "Operations_List", + "x-ms-examples": { + "getOperations": { + "$ref": "./examples/getOperations.json" + } + }, + "parameters": [ + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/OperationListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/providers/Microsoft.Subscription/subscriptionOperations/{operationId}": { + "get": { + "description": "Get the status of the pending Microsoft.Subscription API operations.", + "operationId": "SubscriptionOperation_Get", + "x-ms-examples": { + "getPendingSubscriptionOperations": { + "$ref": "./examples/getSubscriptionOperation.json" + } + }, + "responses": { + "202": { + "description": "Accepted. Subscription update is in progress.", + "headers": { + "Location": { + "description": "The URL where the status of the asynchronous operation can be checked.", + "type": "string" + }, + "Retry-After": { + "description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.", + "type": "string" + } + } + }, + "200": { + "description": "Successful completion of the asynchronous operation", + "schema": { + "$ref": "#/definitions/SubscriptionCreationResult" + } + } + }, + "parameters": [ + { + "name": "operationId", + "in": "path", + "description": "The operation ID, which can be found from the Location field in the generate recommendation response header.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ] + } + }, + "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/providers/Microsoft.Subscription/createSubscription": { + "post": { + "description": "Creates an Azure subscription", + "operationId": "SubscriptionFactory_CreateSubscription", + "x-ms-examples": { + "createSubscription": { + "$ref": "./examples/createSubscription.json" + } + }, + "x-ms-long-running-operation": true, + "responses": { + "200": { + "description": "Normal response for a successful query. The response body will contain the data that matches the filters specified in the query parameters.", + "schema": { + "$ref": "#/definitions/SubscriptionCreationResult" + } + }, + "202": { + "description": "Accepted. Subscription creation is in progress.", + "headers": { + "Location": { + "description": "GET this URL to retrieve the status of the asynchronous operation.", + "type": "string" + }, + "Retry-After": { + "description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.", + "type": "string" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "parameters": [ + { + "name": "billingAccountId", + "in": "path", + "description": "The id of the commerce root billing account.", + "required": true, + "type": "string" + }, + { + "name": "invoiceSectionId", + "in": "path", + "description": "The id of the invoice section.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/apiVersionParameter" + }, + { + "name": "body", + "in": "body", + "description": "The subscription creation parameters.", + "required": true, + "schema": { + "$ref": "#/definitions/SubscriptionCreationParameters" + } + } + ] + } + } + }, + "definitions": { + "SubscriptionCreationResult": { + "description": "The created subscription object.", + "properties": { + "subscriptionLink": { + "description": "The link to the new subscription.", + "type": "string" + } + } + }, + "SubscriptionCreationParameters": { + "description": "Subscription Creation Parameters required to create a new Azure subscription.", + "properties": { + "displayName": { + "description": "The display name of the subscription.", + "type": "string" + }, + "billingProfileId": { + "description": "The ARM id of the billing profile.", + "type": "string" + }, + "skuId": { + "description": "The commerce id of the sku.", + "type": "string" + }, + "owner": { + "description": "rbac owner of the subscription", + "$ref": "#/definitions/AdPrincipal" + }, + "additionalParameters": { + "description": "Additional, untyped parameters to support custom subscription creation scenarios.", + "type": "object", + "additionalProperties": { + "type": "object" + } + } + } + }, + "ErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "AdPrincipal": { + "description": "Active Directory Principal for subscription creation delegated permission", + "properties": { + "objectId": { + "description": "Object id of the Principal", + "type": "string" + } + }, + "required": [ + "objectId" + ] + }, + "SubscriptionOperationListResult": { + "description": "A list of pending subscription operations.", + "properties": { + "value": { + "description": "A list of pending SubscriptionOperations", + "type": "array", + "items": { + "$ref": "#/definitions/SubscriptionOperation" + } + } + } + }, + "SubscriptionOperation": { + "description": "status of the subscription POST operation.", + "properties": { + "id": { + "type": "string", + "description": "The operation Id.", + "readOnly": true + }, + "status": { + "description": "Status of the pending subscription", + "type": "string" + }, + "statusDetail": { + "description": "Status Detail of the pending subscription", + "type": "string" + } + } + }, + "OperationListResult": { + "description": "Result of the request to list operations. It contains a list of operations and a URL link to get the next set of results.", + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/Operation" + }, + "description": "List of operations." + }, + "nextLink": { + "type": "string", + "description": "URL to get the next set of operation list results if there are any." + } + } + }, + "Operation": { + "description": "REST API operation", + "type": "object", + "properties": { + "name": { + "description": "Operation name: {provider}/{resource}/{operation}", + "type": "string" + }, + "display": { + "description": "The object that represents the operation.", + "properties": { + "provider": { + "description": "Service provider: Microsoft.Subscription", + "type": "string" + }, + "resource": { + "description": "Resource on which the operation is performed: Profile, endpoint, etc.", + "type": "string" + }, + "operation": { + "description": "Operation type: Read, write, delete, etc.", + "type": "string" + } + } + } + } + } + }, + "parameters": { + "apiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Version of the API to be used with the client request. Current version is 2015-06-01" + } + }, + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "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" + } + } + } +} \ No newline at end of file diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index 74498b7f5e58..676edf37cb20 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -31,10 +31,22 @@ These are the global settings for the Subscription API. ``` yaml openapi-type: arm -tag: package-2018-03-preview +tag: package-2018-11-preview ``` +### Tag: package-2018-11-preview + +These settings apply only when `--tag=package-2018-03-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2018-11-preview' +input-file: +- Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json +- Microsoft.Subscription/stable/2016-06-01/subscriptions.json +title: SubscriptionClient +description: The subscription client +``` + ### Tag: package-2018-03-preview These settings apply only when `--tag=package-2018-03-preview` is specified on the command line. From 773f997f858f7abf72c71e83d4e2bd2bede9c60a Mon Sep 17 00:00:00 2001 From: Menton Joe Frable Date: Tue, 13 Nov 2018 10:49:33 -0800 Subject: [PATCH 3/6] pr feedbac --- .../examples/createSubscription.json | 6 +++--- .../2018-11-01-preview/examples/getOperations.json | 2 +- .../examples/getSubscriptionOperation.json | 2 +- .../preview/2018-11-01-preview/subscriptions.json | 14 +++++++------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json index 57cd52666ca8..19df1da8a661 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json @@ -1,7 +1,7 @@ { "parameters": { - "billingAccountId": "12a6eed9-5d39-4103-a5db-2db1db0a8c67", - "invoiceSectionId": "b859d705-1ed7-4769-9d4b-19238e9e8ac2_10_31", + "billingAccountName": "12a6eed9-5d39-4103-a5db-2db1db0a8c67", + "invoiceSectionName": "b859d705-1ed7-4769-9d4b-19238e9e8ac2_10_31", "api-version": "2018-11-01-preview", "body": { "displayName": "Test Ea Azure Sub", @@ -19,7 +19,7 @@ "headers": { "Location": "/providers/Microsoft.Subscription/subscriptionOperations/aeb76128-ebde-4f5a-a9ed-e7bbf2dbc994?api-version=2018-11-01-preview", - "Retry-After": "60" + "Retry-After": 8 } }, "200": { diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json index 143aac675b40..8ab5f7367454 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json @@ -7,7 +7,7 @@ "body": { "value": [ { - "name": "Microsoft.Subscription/createOperation/action", + "name": "Microsoft.Subscription/createSubscription/action", "display": { "provider": "Microsoft Subscription", "resource": "Resources", diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json index a8c15bb4abc1..a78d675da35b 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getSubscriptionOperation.json @@ -7,7 +7,7 @@ "202": { "headers": { "Location": "/providers/Microsoft.Subscription/subscriptionOperations/e4b8d068-f574-462a-a76f-6fa0afc613c9?api-version=2018-11-01-preview", - "Retry-After": "60" + "Retry-After": 8 } }, "200": { diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json index b8f597fbb35c..d34aecb5c2db 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json @@ -65,7 +65,7 @@ }, "Retry-After": { "description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.", - "type": "string" + "type": "integer" } } }, @@ -90,7 +90,7 @@ ] } }, - "/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}/providers/Microsoft.Subscription/createSubscription": { + "/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoiceSections/{invoiceSectionName}/providers/Microsoft.Subscription/createSubscription": { "post": { "description": "Creates an Azure subscription", "operationId": "SubscriptionFactory_CreateSubscription", @@ -116,7 +116,7 @@ }, "Retry-After": { "description": "The amount of delay to use while the status of the operation is checked. The value is expressed in seconds.", - "type": "string" + "type": "integer" } } }, @@ -129,16 +129,16 @@ }, "parameters": [ { - "name": "billingAccountId", + "name": "billingAccountName", "in": "path", - "description": "The id of the commerce root billing account.", + "description": "The name of the commerce root billing account.", "required": true, "type": "string" }, { - "name": "invoiceSectionId", + "name": "invoiceSectionName", "in": "path", - "description": "The id of the invoice section.", + "description": "The name of the invoice section.", "required": true, "type": "string" }, From 12d37418b4bbb531987236bd303be45d994b3f3c Mon Sep 17 00:00:00 2001 From: Menton Joe Frable Date: Wed, 14 Nov 2018 08:55:00 -0800 Subject: [PATCH 4/6] add cost center --- .../2018-11-01-preview/examples/createSubscription.json | 1 + .../preview/2018-11-01-preview/subscriptions.json | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json index 19df1da8a661..d93c7f851a1b 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json @@ -7,6 +7,7 @@ "displayName": "Test Ea Azure Sub", "billingProfileId": "/providers/Microsoft.Billing/billingAccounts/12a6eed9-5d39-4103-a5db-2db1db0a8c67/billingProfiles/dbcb81c8-cda9-4b01-b9fc-831e6a2e152e", "skuId": "0001", + "costCenter": "myCostCenter123", "owner": { "objectId": "973034ff-acb7-409c-b731-e789672c7b31" }, diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json index d34aecb5c2db..befc022f5aac 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json @@ -183,6 +183,10 @@ "description": "The commerce id of the sku.", "type": "string" }, + "costCenter": { + "description": "optional customer cost center", + "type": "string" + }, "owner": { "description": "rbac owner of the subscription", "$ref": "#/definitions/AdPrincipal" From 5639d3aec57b1522b993d17fa7424c10ac8caf15 Mon Sep 17 00:00:00 2001 From: Menton Joe Frable Date: Mon, 19 Nov 2018 22:07:37 -0800 Subject: [PATCH 5/6] pr feedback --- .../preview/2018-11-01-preview/examples/getOperations.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json index 8ab5f7367454..0b0321efe390 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json @@ -11,8 +11,7 @@ "display": { "provider": "Microsoft Subscription", "resource": "Resources", - "operation": "Create a subscription", - "description": "Create an Azure subscription." + "operation": "Create an Azure subscription", } } ] From a75eeae7adb674844d8a80a45dd1983e22c9f884 Mon Sep 17 00:00:00 2001 From: Menton Joe Frable Date: Mon, 19 Nov 2018 22:09:32 -0800 Subject: [PATCH 6/6] pr feedback --- .../preview/2018-11-01-preview/examples/getOperations.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json index 0b0321efe390..e0713487bc1d 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json @@ -11,7 +11,7 @@ "display": { "provider": "Microsoft Subscription", "resource": "Resources", - "operation": "Create an Azure subscription", + "operation": "Create an Azure subscription" } } ]