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 befc022f5aac..ce41ae183aa1 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 @@ -56,6 +56,12 @@ } }, "responses": { + "200": { + "description": "Successful completion of the asynchronous operation", + "schema": { + "$ref": "#/definitions/SubscriptionCreationResult" + } + }, "202": { "description": "Accepted. Subscription update is in progress.", "headers": { @@ -68,12 +74,6 @@ "type": "integer" } } - }, - "200": { - "description": "Successful completion of the asynchronous operation", - "schema": { - "$ref": "#/definitions/SubscriptionCreationResult" - } } }, "parameters": [ @@ -191,10 +191,10 @@ "description": "rbac owner of the subscription", "$ref": "#/definitions/AdPrincipal" }, - "additionalParameters": { + "additionalParameters": { "description": "Additional, untyped parameters to support custom subscription creation scenarios.", "type": "object", - "additionalProperties": { + "additionalProperties": { "type": "object" } } @@ -306,7 +306,7 @@ "in": "query", "required": true, "type": "string", - "description": "Version of the API to be used with the client request. Current version is 2015-06-01" + "description": "Version of the API to be used with the client request. Current version is 2018-11-01-preview" } }, "security": [ diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/cancelSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/cancelSubscription.json new file mode 100644 index 000000000000..5c26308c88ca --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/cancelSubscription.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "83aa47df-e3e9-49ff-877b-94304bf3d3ad", + "api-version": "2019-03-01-preview" + }, + "responses": { + "200": { + "body": { + "value": "83aa47df-e3e9-49ff-877b-94304bf3d3ad" + } + } + } +} \ No newline at end of file diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/getOperations.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/getOperations.json new file mode 100644 index 000000000000..18a760d850cc --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/getOperations.json @@ -0,0 +1,29 @@ +{ + "parameters": { + "api-version": "2019-03-01-preview" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "name": "Microsoft.Subscription/cancel/action", + "display": { + "provider": "Microsoft Subscription", + "resource": "Resources", + "operation": "Cancels the subscription" + } + }, + { + "name": "Microsoft.Subscription/rename/action", + "display": { + "provider": "Microsoft Subscription", + "resource": "Resources", + "operation": "Renames the subscription" + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/renameSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/renameSubscription.json new file mode 100644 index 000000000000..c3e2e12590f3 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/examples/renameSubscription.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "subscriptionId": "83aa47df-e3e9-49ff-877b-94304bf3d3ad", + "api-version": "2019-03-01-preview", + "body": { + "SubscriptionName": "Test Sub" + } + }, + "responses": { + "200": { + "body": { + "value": "83aa47df-e3e9-49ff-877b-94304bf3d3ad" + } + } + } +} \ No newline at end of file diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json new file mode 100644 index 000000000000..f9b0a411d6d9 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json @@ -0,0 +1,252 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-03-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" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel": { + "post": { + "operationId": "Subscriptions_Cancel", + "x-ms-examples": { + "cancelSubscription": { + "$ref": "./examples/cancelSubscription.json" + } + }, + "description": "Cancels the subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/CanceledSubscriptionId" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename": { + "post": { + "operationId": "Subscriptions_Rename", + "x-ms-examples": { + "renameSubscription": { + "$ref": "./examples/renameSubscription.json" + } + }, + "description": "Renames the subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/subscriptionNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/RenamedSubscriptionId" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + } + }, + "definitions": { + "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" + } + } + }, + "CanceledSubscriptionId": { + "description": "Canceled Subscription Id", + "properties": { + "value": { + "description": "Canceled Subscription Id", + "type": "string", + "readOnly": true + } + } + }, + "RenamedSubscriptionId": { + "description": "Renamed Subscription Id", + "properties": { + "value": { + "description": "Renamed Subscription Id", + "type": "string", + "readOnly": true + } + } + }, + "SubscriptionName": { + "type": "object", + "description": "New name of the subscription.", + "properties": { + "subscriptionName": { + "type": "string", + "description": "New subscription name" + } + } + }, + "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 2019-03-01-preview" + }, + "subscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription Id." + }, + "subscriptionNameParameter": { + "name": "body", + "x-ms-parameter-location": "method", + "in": "body", + "required": true, + "description": "Subscription Name", + "schema": { + "$ref": "#/definitions/SubscriptionName" + } + } + }, + "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 676edf37cb20..7622358ed08a 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -31,9 +31,19 @@ These are the global settings for the Subscription API. ``` yaml openapi-type: arm -tag: package-2018-11-preview +tag: package-2019-03-preview ``` +### Tag: package-2019-03-preview +These settings apply only when `--tag=package-2019-03-preview` is specified on the command line. + +``` yaml $(tag) == 'package-2019-03-preview' +input-file: +- Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json +- Microsoft.Subscription/stable/2016-06-01/subscriptions.json +title: SubscriptionClient +description: The subscription client +``` ### Tag: package-2018-11-preview