From e86758ca52664a5017a84c67160633bc76562ed6 Mon Sep 17 00:00:00 2001 From: Vishnu Priya Ananthu Sundaram Date: Tue, 31 Mar 2020 12:03:02 -0700 Subject: [PATCH 1/5] commit 4691c2abaae8c32062d6a45d173075a35bee1ff7 Author: Rakesh Kumar Date: Wed Jan 29 17:46:01 2020 -0800 [AzureStack] User Subscription: rename NewSubscription to SubscriptionDefinition (#8257) commit 9e551f0eab4057d4c2f54c333c7aa2a1a564c125 Author: bganapa Date: Tue Nov 12 11:44:22 2019 -0800 Reset to Stackadmin2 (#7766) --- .../preview/2015-11-01/Subscriptions.json | 6 +- .../user-subscriptions/readme.azsautogen.md | 93 +++++++++++++++++++ .../user-subscriptions/readme.md | 26 ------ 3 files changed, 96 insertions(+), 29 deletions(-) create mode 100644 specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md diff --git a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json index e47cd5146f23..85b0fd60d43d 100644 --- a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json +++ b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json @@ -91,7 +91,7 @@ "$ref": "#/parameters/SubscriptionIdParameter" }, { - "$ref": "#/parameters/NewSubscriptionParameter" + "$ref": "#/parameters/SubscriptionDefinitionParameter" }, { "$ref": "#/parameters/ApiVersionParameter" @@ -263,9 +263,9 @@ "description": "Id of the subscription.", "x-ms-parameter-location": "method" }, - "NewSubscriptionParameter": { + "SubscriptionDefinitionParameter": { "description": "Subscription parameter.", - "name": "newSubscription", + "name": "subscriptionDefinition", "in": "body", "schema": { "$ref": "#/definitions/Subscription" diff --git a/specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md b/specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md new file mode 100644 index 000000000000..22b296c0fa47 --- /dev/null +++ b/specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md @@ -0,0 +1,93 @@ +# Subscriptions Admin + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for Subscriptions Admin. + +--- +## Getting Started +To build the SDK for Subscriptions Admin, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +## Configuration + +### Basic Information +These are the global settings for the Subscriptions API. + +``` yaml +title: SubscriptionClient +description: Subscription Management Client +openapi-type: arm +tag: package-2015-11-01 +``` + +## Suppression +``` yaml +directive: + - suppress: XmsResourceInPutResponse + reason: Subscription is not modelled as ARM resource in azure for legacy reasons. In Azure stack as well, Subscription is not modelled as ARM resource for azure consistency + where: + - $.paths["/subscriptions/{subscriptionId}"].put + + - suppress: R3023 + reason: No operations endpoint as not ARM resource provider. + + - suppress: SubscriptionIdParameterInOperations + reason: Subscription is the main resource in the API spec and it should not be masked in global parameters. + where: + - $.paths["/subscriptions/{subscriptionId}"].get.parameters[0] + - $.paths["/subscriptions/{subscriptionId}"].put.parameters[0] + - $.paths["/subscriptions/{subscriptionId}"].delete.parameters[0] + + - suppress: BodyTopLevelProperties + reason: Subscription is not modelled as ARM resource in azure for legacy reasons. In Azure stack as well, Subscription is not modelled as ARM resource for azure consistency. + where: + - $.definitions.Subscription.properties + + - suppress: RequiredPropertiesMissingInResourceModel + reason: Subscription is not modelled as ARM resource in azure for legacy reasons. In Azure stack as well, Subscription is not modelled as ARM resource for azure consistency. + where: + - $.definitions.Subscription + +``` + +--- +# Code Generation + +## C# + +``` yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + namespace: Microsoft.AzureStack.Management.Subscription + payload-flattening-threshold: 1 + output-folder: $(csharp-sdks-folder)/Generated + clear-output-folder: true +``` + + +``` yaml +# include the azure profile definitions from the standard location +require: $(this-folder)/../../../../profiles/readme.md + +# all the input files across all versions +input-file: + - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json + - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Offer.json + +``` + +If there are files that should not be in the `all-api-versions` set, +uncomment the `exclude-file` section below and add the file paths. + +``` yaml $(tag) == 'all-api-versions' +#exclude-file: +# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json +``` diff --git a/specification/azsadmin/resource-manager/user-subscriptions/readme.md b/specification/azsadmin/resource-manager/user-subscriptions/readme.md index 9c3540a14d15..864cf4abba65 100644 --- a/specification/azsadmin/resource-manager/user-subscriptions/readme.md +++ b/specification/azsadmin/resource-manager/user-subscriptions/readme.md @@ -101,29 +101,3 @@ These settings apply only when `--tag=package-2015-11-01 --python` is specified ``` yaml $(tag) == 'package-2015-11-01' && $(python) namespace: azure.mgmt.subscriptions.v2015_06_01_preview ``` - -## Multi-API/Profile support for AutoRest v3 generators - -AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. - -This block is updated by an automatic script. Edits may be lost! - -``` yaml $(tag) == 'all-api-versions' /* autogenerated */ -# include the azure profile definitions from the standard location -require: $(this-folder)/../../../../profiles/readme.md - -# all the input files across all versions -input-file: - - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json - - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Offer.json - -``` - -If there are files that should not be in the `all-api-versions` set, -uncomment the `exclude-file` section below and add the file paths. - -``` yaml $(tag) == 'all-api-versions' -#exclude-file: -# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json -``` - From 626b9a25569085e8a15ce87053cba291f550900c Mon Sep 17 00:00:00 2001 From: Vishnu Priya Ananthu Sundaram Date: Tue, 31 Mar 2020 16:45:04 -0700 Subject: [PATCH 2/5] Fix sub def in example --- .../preview/2015-11-01/examples/Subscriptions/Create.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json index 47b02ee55c42..828142ac96c0 100644 --- a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json +++ b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json @@ -3,7 +3,7 @@ "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", "location": "local", "api-version": "2015-11-01", - "newSubscription": { + "subscriptionDefinition": { "properties": { "displayName": "Test User-user1@contoso.com", "id": "", From 54db583e4c5b1bb6207c010a8fa9c39e356000bc Mon Sep 17 00:00:00 2001 From: Vishnu Priya Ananthu Sundaram Date: Mon, 6 Apr 2020 12:33:01 -0700 Subject: [PATCH 3/5] Address PR comments --- .../user-subscriptions/readme.azsautogen.md | 93 ------------------- .../user-subscriptions/readme.md | 25 +++++ 2 files changed, 25 insertions(+), 93 deletions(-) delete mode 100644 specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md diff --git a/specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md b/specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md deleted file mode 100644 index 22b296c0fa47..000000000000 --- a/specification/azsadmin/resource-manager/user-subscriptions/readme.azsautogen.md +++ /dev/null @@ -1,93 +0,0 @@ -# Subscriptions Admin - -> see https://aka.ms/autorest - -This is the AutoRest configuration file for Subscriptions Admin. - ---- -## Getting Started -To build the SDK for Subscriptions Admin, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: - -> `autorest` - -To see additional help and options, run: - -> `autorest --help` ---- - -## Configuration - -### Basic Information -These are the global settings for the Subscriptions API. - -``` yaml -title: SubscriptionClient -description: Subscription Management Client -openapi-type: arm -tag: package-2015-11-01 -``` - -## Suppression -``` yaml -directive: - - suppress: XmsResourceInPutResponse - reason: Subscription is not modelled as ARM resource in azure for legacy reasons. In Azure stack as well, Subscription is not modelled as ARM resource for azure consistency - where: - - $.paths["/subscriptions/{subscriptionId}"].put - - - suppress: R3023 - reason: No operations endpoint as not ARM resource provider. - - - suppress: SubscriptionIdParameterInOperations - reason: Subscription is the main resource in the API spec and it should not be masked in global parameters. - where: - - $.paths["/subscriptions/{subscriptionId}"].get.parameters[0] - - $.paths["/subscriptions/{subscriptionId}"].put.parameters[0] - - $.paths["/subscriptions/{subscriptionId}"].delete.parameters[0] - - - suppress: BodyTopLevelProperties - reason: Subscription is not modelled as ARM resource in azure for legacy reasons. In Azure stack as well, Subscription is not modelled as ARM resource for azure consistency. - where: - - $.definitions.Subscription.properties - - - suppress: RequiredPropertiesMissingInResourceModel - reason: Subscription is not modelled as ARM resource in azure for legacy reasons. In Azure stack as well, Subscription is not modelled as ARM resource for azure consistency. - where: - - $.definitions.Subscription - -``` - ---- -# Code Generation - -## C# - -``` yaml $(csharp) -csharp: - azure-arm: true - license-header: MICROSOFT_MIT_NO_VERSION - namespace: Microsoft.AzureStack.Management.Subscription - payload-flattening-threshold: 1 - output-folder: $(csharp-sdks-folder)/Generated - clear-output-folder: true -``` - - -``` yaml -# include the azure profile definitions from the standard location -require: $(this-folder)/../../../../profiles/readme.md - -# all the input files across all versions -input-file: - - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json - - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Offer.json - -``` - -If there are files that should not be in the `all-api-versions` set, -uncomment the `exclude-file` section below and add the file paths. - -``` yaml $(tag) == 'all-api-versions' -#exclude-file: -# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json -``` diff --git a/specification/azsadmin/resource-manager/user-subscriptions/readme.md b/specification/azsadmin/resource-manager/user-subscriptions/readme.md index 864cf4abba65..7eff63e9c33d 100644 --- a/specification/azsadmin/resource-manager/user-subscriptions/readme.md +++ b/specification/azsadmin/resource-manager/user-subscriptions/readme.md @@ -82,6 +82,31 @@ csharp: clear-output-folder: true ``` +## Multi-API/Profile support for AutoRest v3 generators + +AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files. + +This block is updated by an automatic script. Edits may be lost! + +``` yaml +# include the azure profile definitions from the standard location +require: $(this-folder)/../../../../profiles/readme.md + +# all the input files across all versions +input-file: + - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Subscriptions.json + - $(this-folder)/Microsoft.Subscriptions/preview/2015-11-01/Offer.json + +``` + +If there are files that should not be in the `all-api-versions` set, +uncomment the `exclude-file` section below and add the file paths. + +``` yaml $(tag) == 'all-api-versions' +#exclude-file: +# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json +``` + ## Python These settings apply only when `--python` is specified on the command line. From c4fb7e0cf0122ab11295b38e6307dbb7ca37de77 Mon Sep 17 00:00:00 2001 From: Vishnu Priya Ananthu Sundaram Date: Tue, 11 Aug 2020 12:46:34 -0700 Subject: [PATCH 4/5] Fix model validation error --- .../preview/2015-11-01/examples/Subscriptions/Create.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json index 828142ac96c0..050a1b036f13 100644 --- a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json +++ b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json @@ -4,14 +4,12 @@ "location": "local", "api-version": "2015-11-01", "subscriptionDefinition": { - "properties": { "displayName": "Test User-user1@contoso.com", "id": "", "offerId": "/delegatedProviders/default/offers/TestOffer-0892f99c-8d1c-48d1-a2b3-128a931afc09", "state": "Enabled", "subscriptionId": "a7aeb2dd-1b1d-458c-a3dc-09070c2ece5e", "tenantId": "" - } } }, "responses": { From 64c1f5d25828431b5975efd349957a7a2ced6150 Mon Sep 17 00:00:00 2001 From: Vishnu Priya Ananthu Sundaram Date: Tue, 11 Aug 2020 12:58:07 -0700 Subject: [PATCH 5/5] Fix prettier issue --- .../2015-11-01/examples/Subscriptions/Create.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json index 050a1b036f13..3851dcb6eb2f 100644 --- a/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json +++ b/specification/azsadmin/resource-manager/user-subscriptions/Microsoft.Subscriptions/preview/2015-11-01/examples/Subscriptions/Create.json @@ -4,12 +4,12 @@ "location": "local", "api-version": "2015-11-01", "subscriptionDefinition": { - "displayName": "Test User-user1@contoso.com", - "id": "", - "offerId": "/delegatedProviders/default/offers/TestOffer-0892f99c-8d1c-48d1-a2b3-128a931afc09", - "state": "Enabled", - "subscriptionId": "a7aeb2dd-1b1d-458c-a3dc-09070c2ece5e", - "tenantId": "" + "displayName": "Test User-user1@contoso.com", + "id": "", + "offerId": "/delegatedProviders/default/offers/TestOffer-0892f99c-8d1c-48d1-a2b3-128a931afc09", + "state": "Enabled", + "subscriptionId": "a7aeb2dd-1b1d-458c-a3dc-09070c2ece5e", + "tenantId": "" } }, "responses": {