From 6fce2d3c44212af8bbb7ce548c36a159be1d7a47 Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Mon, 7 Oct 2019 17:43:10 -0700 Subject: [PATCH 1/6] New Version for subscription RP --- .../examples/cancelSubscription.json | 13 + .../examples/enableSubscription.json | 13 + .../examples/renameSubscription.json | 16 ++ .../2019-10-01-preview/subscriptions.json | 266 ++++++++++++++++++ 4 files changed, 308 insertions(+) create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/cancelSubscription.json create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/enableSubscription.json create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/renameSubscription.json create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/subscriptions.json diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/cancelSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/cancelSubscription.json new file mode 100644 index 000000000000..56fdb0884237 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-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" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/enableSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/enableSubscription.json new file mode 100644 index 000000000000..eb3b770d1e8a --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/enableSubscription.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "7948bcee-488c-47ce-941c-38e20ede803d", + "api-version": "2019-03-01-preview" + }, + "responses": { + "200": { + "body": { + "value": "7948bcee-488c-47ce-941c-38e20ede803d" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/renameSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/renameSubscription.json new file mode 100644 index 000000000000..c673259dde23 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/renameSubscription.json @@ -0,0 +1,16 @@ +{ + "parameters": { + "subscriptionId": "83aa47df-e3e9-49ff-877b-94304bf3d3ad", + "api-version": "2019-10-01-preview", + "body": { + "SubscriptionName": "Test Sub" + } + }, + "responses": { + "200": { + "body": { + "value": "83aa47df-e3e9-49ff-877b-94304bf3d3ad" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/subscriptions.json new file mode 100644 index 000000000000..10e9143f3a75 --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/subscriptions.json @@ -0,0 +1,266 @@ +{ + "swagger": "2.0", + "info": { + "version": "2019-10-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": { + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel": { + "post": { + "operationId": "Subscription_Cancel", + "x-ms-examples": { + "cancelSubscription": { + "$ref": "./examples/cancelSubscription.json" + } + }, + "description": "The operation to cancel a subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/CanceledSubscriptionId" + } + }, + "default": { + "description": "Describes the error if the operation is not successful.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename": { + "post": { + "operationId": "Subscription_Rename", + "x-ms-examples": { + "renameSubscription": { + "$ref": "./examples/renameSubscription.json" + } + }, + "description": "The operation to rename a 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": "Describes the error if the operation is not successful.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable": { + "post": { + "operationId": "Subscription_Enable", + "x-ms-examples": { + "enableSubscription": { + "$ref": "./examples/enableSubscription.json" + } + }, + "description": "The operation to enable a subscription", + "parameters": [ + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/EnabledSubscriptionId" + } + }, + "default": { + "description": "Describes the error if the operation is not successful.", + "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": "The ID of the canceled subscription", + "properties": { + "value": { + "description": "The ID of the canceled subscription", + "type": "string", + "readOnly": true + } + } + }, + "RenamedSubscriptionId": { + "description": "The ID of the subscriptions that is being renamed", + "properties": { + "value": { + "description": "The ID of the subscriptions that is being renamed", + "type": "string", + "readOnly": true + } + } + }, + "EnabledSubscriptionId": { + "description": "The ID of the subscriptions that is being enabled", + "properties": { + "value": { + "description": "The ID of the subscriptions that is being enabled", + "type": "string", + "readOnly": true + } + } + }, + "SubscriptionName": { + "type": "object", + "description": "The 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-10-01-preview" + }, + "subscriptionIdParameter": { + "name": "subscriptionId", + "x-ms-parameter-location": "method", + "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" + } + } + } +} From 0296ef51ae6c88c760b1947a059561015ff7be43 Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Fri, 4 Dec 2020 13:47:47 -0800 Subject: [PATCH 2/6] S360 fixes --- .../examples/getSubscriptionOperation.json | 19 ++++++++ .../2018-03-01-preview/subscriptions.json | 44 +++++++++++++++++ .../stable/2016-06-01/subscriptions.json | 48 +++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/examples/getSubscriptionOperation.json diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/examples/getSubscriptionOperation.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/examples/getSubscriptionOperation.json new file mode 100644 index 000000000000..d3296400b9cf --- /dev/null +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/examples/getSubscriptionOperation.json @@ -0,0 +1,19 @@ +{ + "parameters": { + "operationId": "e4b8d068-f574-462a-a76f-6fa0afc613c9", + "api-version": "2018-03-01-preview" + }, + "responses": { + "202": { + "headers": { + "Location": "/providers/Microsoft.Subscription/subscriptionOperations/e4b8d068-f574-462a-a76f-6fa0afc613c9?api-version=2018-03-01-preview", + "Retry-After": 8 + } + }, + "200": { + "body": { + "subscriptionLink": "/subscriptions/4df8d5c2-1b7e-4dd5-bc61-640704bde633" + } + } + } +} diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json index a62e75833824..503fa6d6fecb 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json @@ -46,6 +46,50 @@ ] } }, + "/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": { + "200": { + "description": "Successful completion of the asynchronous operation", + "schema": { + "$ref": "#/definitions/SubscriptionCreationResult" + } + }, + "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" + } + } + } + }, + "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/enrollmentAccounts/{enrollmentAccountName}/providers/Microsoft.Subscription/createSubscription": { "post": { "description": "Creates an Azure subscription", diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json index 60771a02d266..6baed8c11f14 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json @@ -61,6 +61,12 @@ "schema": { "$ref": "#/definitions/LocationListResult" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } } }, "x-ms-pageable": { @@ -94,6 +100,12 @@ "schema": { "$ref": "#/definitions/Subscription" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } } } } @@ -121,6 +133,12 @@ "schema": { "$ref": "#/definitions/SubscriptionListResult" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } } }, "x-ms-pageable": { @@ -151,6 +169,12 @@ "schema": { "$ref": "#/definitions/TenantListResult" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponseBody" + } } }, "x-ms-pageable": { @@ -332,6 +356,30 @@ "nextLink" ], "description": "Tenant Ids information." + }, + "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" + } + } + }, + "ErrorResponseBody": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorResponse" + } + } } }, "parameters": { From 7a8a6d8d2900629b03aa814dad88a0dc246f4335 Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Thu, 10 Dec 2020 17:03:14 -0800 Subject: [PATCH 3/6] Update readme.md --- specification/subscription/resource-manager/readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/specification/subscription/resource-manager/readme.md b/specification/subscription/resource-manager/readme.md index af2761560070..60e9657946a6 100644 --- a/specification/subscription/resource-manager/readme.md +++ b/specification/subscription/resource-manager/readme.md @@ -77,7 +77,6 @@ These settings apply only when `--tag=package-2019-03-preview` is specified on t input-file: - Microsoft.Subscription/preview/2019-03-01-preview/subscriptions.json - Microsoft.Subscription/preview/2018-11-01-preview/subscriptions.json -- Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json - Microsoft.Subscription/preview/2018-03-01-preview/operations.json - Microsoft.Subscription/stable/2016-06-01/subscriptions.json title: SubscriptionClient From b716c042e6f30a61d9d01562d2d1bebc65151b0b Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Thu, 10 Dec 2020 17:28:35 -0800 Subject: [PATCH 4/6] Update subscriptions.json --- .../preview/2018-03-01-preview/subscriptions.json | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json index 503fa6d6fecb..4a9f13bb7ddd 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json @@ -71,9 +71,16 @@ }, "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" + "type": "integer", + "format": "int64" } } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } } }, "parameters": [ From b998d228905224dd0f9b74ccfbb96b4c9b21773f Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Thu, 10 Dec 2020 17:41:52 -0800 Subject: [PATCH 5/6] Update subscriptions.json --- .../stable/2016-06-01/subscriptions.json | 48 ------------------- 1 file changed, 48 deletions(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json index 6baed8c11f14..60771a02d266 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/subscriptions.json @@ -61,12 +61,6 @@ "schema": { "$ref": "#/definitions/LocationListResult" } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponseBody" - } } }, "x-ms-pageable": { @@ -100,12 +94,6 @@ "schema": { "$ref": "#/definitions/Subscription" } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponseBody" - } } } } @@ -133,12 +121,6 @@ "schema": { "$ref": "#/definitions/SubscriptionListResult" } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponseBody" - } } }, "x-ms-pageable": { @@ -169,12 +151,6 @@ "schema": { "$ref": "#/definitions/TenantListResult" } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/ErrorResponseBody" - } } }, "x-ms-pageable": { @@ -356,30 +332,6 @@ "nextLink" ], "description": "Tenant Ids information." - }, - "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" - } - } - }, - "ErrorResponseBody": { - "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.", - "type": "object", - "properties": { - "error": { - "description": "The details of the error.", - "$ref": "#/definitions/ErrorResponse" - } - } } }, "parameters": { From e825f8ae5d57fa34193c2cb47d8d27f69832f7f3 Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Thu, 10 Dec 2020 18:27:53 -0800 Subject: [PATCH 6/6] Update subscriptions.json --- .../preview/2018-03-01-preview/subscriptions.json | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json index 4a9f13bb7ddd..2cfd7b72a0ce 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2018-03-01-preview/subscriptions.json @@ -79,7 +79,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/ErrorResponseBody" } } }, @@ -217,6 +217,16 @@ } } }, + "ErrorResponseBody": { + "description": "Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.", + "type": "object", + "properties": { + "error": { + "description": "The details of the error.", + "$ref": "#/definitions/ErrorResponse" + } + } + }, "AdPrincipal": { "description": "Active Directory Principal who’ll get owner access on the new subscription.", "properties": {