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..d93c7f851a1b --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/createSubscription.json @@ -0,0 +1,32 @@ +{ + "parameters": { + "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", + "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" + }, + "additionalParameters": { + } + } + }, + "responses": { + "202": { + "headers": { + "Location": + "/providers/Microsoft.Subscription/subscriptionOperations/aeb76128-ebde-4f5a-a9ed-e7bbf2dbc994?api-version=2018-11-01-preview", + "Retry-After": 8 + } + }, + "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..e0713487bc1d --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/examples/getOperations.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "api-version": "2018-11-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.Subscription/createSubscription/action", + "display": { + "provider": "Microsoft Subscription", + "resource": "Resources", + "operation": "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..a78d675da35b --- /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": 8 + } + }, + "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..befc022f5aac --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json @@ -0,0 +1,330 @@ +{ + "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": "integer" + } + } + }, + "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/{billingAccountName}/invoiceSections/{invoiceSectionName}/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": "integer" + } + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "parameters": [ + { + "name": "billingAccountName", + "in": "path", + "description": "The name of the commerce root billing account.", + "required": true, + "type": "string" + }, + { + "name": "invoiceSectionName", + "in": "path", + "description": "The name 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" + }, + "costCenter": { + "description": "optional customer cost center", + "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.