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/4] 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 7640b3ec0090daf60930fb46affc4e132ffe45c6 Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Wed, 15 Jan 2020 15:15:31 -0800 Subject: [PATCH 2/4] Update subscriptions.json Removing incorrect parameters that are no longer supported by APIs --- .../2019-10-01-preview/subscriptions.json | 27 ------------------- 1 file changed, 27 deletions(-) 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 index 7d9d0a2b8f94..7ee7f3ed5763 100644 --- 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 @@ -542,32 +542,16 @@ "MS-AZR-0017P", "MS-AZR-0148P" ] - }, - "additionalParameters": { - "description": "Additional, untyped parameters to support custom subscription creation scenarios.", - "type": "object", - "additionalProperties": { - "type": "object" - } } } }, "ModernSubscriptionCreationParameters": { "description": "The parameters required to create a new subscription.", - "required": [ - "displayName", - "billingProfileId", - "skuId" - ], "properties": { "displayName": { "description": "The friendly name of the subscription.", "type": "string" }, - "billingProfileId": { - "description": "The ARM ID of the billing profile for which you want to create the subscription.", - "type": "string" - }, "skuId": { "description": "The SKU ID of the Azure plan. Azure plan determines the pricing and service-level agreement of the subscription. Use 001 for Microsoft Azure Plan and 002 for Microsoft Azure Plan for DevTest.", "type": "string" @@ -583,13 +567,6 @@ "managementGroupId": { "description": "The identifier of the management group to which this subscription will be associated.", "type": "string" - }, - "additionalParameters": { - "description": "Additional, untyped parameters to support custom subscription creation scenarios.", - "type": "object", - "additionalProperties": { - "type": "object" - } } } }, @@ -611,10 +588,6 @@ "resellerId": { "description": "Reseller ID, basically MPN Id.", "type": "string" - }, - "serviceProviderId": { - "description": "Service provider ID, basically MPN Id.", - "type": "string" } } } From 979c529c109021b773b6bfe3c2f1b79955525263 Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Wed, 15 Jan 2020 15:25:27 -0800 Subject: [PATCH 3/4] FIx --- .../examples/createLegacySubscription.json | 8 +------- .../2019-10-01-preview/examples/createSubscription.json | 1 - 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createLegacySubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createLegacySubscription.json index e0e193269f79..65ad499728a9 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createLegacySubscription.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createLegacySubscription.json @@ -12,13 +12,7 @@ { "objectId": "67439a9e-8519-4016-a630-f5f805eba567" } - ], - "additionalParameters": { - "customData": { - "key1": "value1", - "key2": true - } - } + ] } }, "responses": { diff --git a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createSubscription.json b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createSubscription.json index 366082444c31..84f6fd17ba23 100644 --- a/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createSubscription.json +++ b/specification/subscription/resource-manager/Microsoft.Subscription/preview/2019-10-01-preview/examples/createSubscription.json @@ -6,7 +6,6 @@ "api-version": "2019-10-01-preview", "body": { "displayName": "Contoso MCA subscription", - "billingProfileId": "/providers/Microsoft.Billing/billingAccounts/0aa27f2b-ec7f-5a65-71f6-a5ff0897bd55:ae0dae1e-de9a-41f6-8257-76b055d98372_2019-05-31/billingProfiles/27VR-HDWX-BG7-TGB", "skuId": "0001", "costCenter": "135366376", "owner": { From aed21e4c30eca6eb21c0f9cc1b4003c373d6ea69 Mon Sep 17 00:00:00 2001 From: navysingla <47647464+navysingla@users.noreply.github.com> Date: Wed, 15 Jan 2020 17:38:25 -0800 Subject: [PATCH 4/4] Update subscriptions.json --- .../preview/2019-10-01-preview/subscriptions.json | 4 ++++ 1 file changed, 4 insertions(+) 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 index 7ee7f3ed5763..a065c890aa85 100644 --- 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 @@ -547,6 +547,10 @@ }, "ModernSubscriptionCreationParameters": { "description": "The parameters required to create a new subscription.", + "required": [ + "displayName", + "skuId" + ], "properties": { "displayName": { "description": "The friendly name of the subscription.",