From 6ae9ebdd0f924a238630e6a66ccd8fcdd81af8b9 Mon Sep 17 00:00:00 2001 From: Elad Perets Date: Thu, 23 Jul 2020 14:19:59 -0700 Subject: [PATCH 1/3] Update Microsoft.Resources swagger to include new alias contract (this is already exposed for some time now, but this part of the spec seems out-of-date). Also added the default API version and the API profile properties --- .../examples/GetNamedProviderAtTenant.json | 253 ++++++++++++++++++ .../stable/2020-06-01/resources.json | 114 ++++++++ 2 files changed, 367 insertions(+) create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/examples/GetNamedProviderAtTenant.json diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/examples/GetNamedProviderAtTenant.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/examples/GetNamedProviderAtTenant.json new file mode 100644 index 000000000000..0c2168e47790 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/examples/GetNamedProviderAtTenant.json @@ -0,0 +1,253 @@ +{ + "parameters": { + "$expand": "resourceTypes/aliases", + "resourceProviderNamespace": "Microsoft.Storage", + "api-version": "2020-06-01" + }, + "responses": { + "200": { + "body": { + "namespace": "Microsoft.Storage", + "resourceTypes": [ + { + "resourceType": "storageAccounts", + "locations": [ + "East US", + "East US 2", + "East US 2 (Stage)", + "West US", + "West Europe", + "East Asia", + "Southeast Asia", + "Japan East", + "Japan West", + "North Central US", + "South Central US", + "Central US", + "North Europe", + "Brazil South", + "Australia East", + "Australia Southeast", + "South India", + "Central India", + "West India", + "Canada East", + "Canada Central", + "West US 2", + "West Central US", + "UK South", + "UK West", + "Korea Central", + "Korea South", + "East US 2 EUAP", + "Central US EUAP", + "France Central", + "France South", + "Australia Central", + "Australia Central 2", + "South Africa West", + "South Africa North", + "UAE Central", + "UAE North", + "Switzerland North", + "Switzerland West", + "Germany West Central", + "Germany North", + "Norway East", + "Norway West", + "South Central US STG", + "Brazil Southeast" + ], + "apiVersions": [ + "2019-06-01", + "2019-04-01", + "2018-11-01", + "2018-07-01", + "2018-03-01-preview", + "2018-02-01", + "2017-10-01", + "2017-06-01", + "2016-12-01", + "2016-05-01", + "2016-01-01", + "2015-06-15", + "2015-05-01-preview" + ], + "defaultApiVersion": "2019-06-01", + "apiProfiles": [ + { + "profileVersion": "2019-03-01-hybrid", + "apiVersion": "2017-10-01" + }, + { + "profileVersion": "2017-03-09-profile", + "apiVersion": "2016-01-01" + }, + { + "profileVersion": "2018-03-01-hybrid", + "apiVersion": "2016-01-01" + }, + { + "profileVersion": "2018-06-01-profile", + "apiVersion": "2017-10-01" + } + ], + "aliases": [ + { + "name": "Microsoft.Storage/storageAccounts/accountType", + "paths": [ + { + "path": "properties.accountType", + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview" + ] + }, + { + "path": "sku.name", + "apiVersions": [ + "2018-11-01", + "2018-11-09", + "2018-07-01", + "2018-03-01-Preview", + "2018-02-01", + "2017-10-01", + "2017-06-01", + "2016-12-01", + "2016-05-01", + "2016-01-01" + ] + } + ], + "defaultPath": "sku.name" + }, + { + "name": "Microsoft.Storage/storageAccounts/sku.name", + "paths": [ + { + "path": "properties.accountType", + "apiVersions": [ + "2015-06-15", + "2015-05-01-preview" + ] + }, + { + "path": "sku.name", + "apiVersions": [ + "2018-11-01", + "2018-11-09", + "2018-07-01", + "2018-03-01-Preview", + "2018-02-01", + "2017-10-01", + "2017-06-01", + "2016-12-01", + "2016-05-01", + "2016-01-01" + ] + } + ], + "defaultPath": "sku.name" + }, + { + "name": "Microsoft.Storage/storageAccounts/accessTier", + "paths": [ + { + "path": "properties.accessTier", + "apiVersions": [ + "2018-11-01", + "2018-11-09", + "2018-07-01", + "2018-03-01-Preview", + "2018-02-01", + "2017-10-01", + "2017-06-01", + "2016-12-01", + "2016-05-01", + "2016-01-01", + "2015-06-15", + "2015-05-01-preview" + ] + } + ], + "defaultPath": "properties.accessTier" + }, + { + "name": "Microsoft.Storage/storageAccounts/enableBlobEncryption", + "paths": [ + { + "path": "properties.encryption.services.blob.enabled", + "apiVersions": [ + "2018-11-01", + "2018-11-09", + "2018-07-01", + "2018-03-01-Preview", + "2018-02-01", + "2017-10-01", + "2017-06-01", + "2016-12-01", + "2016-05-01", + "2016-01-01", + "2015-06-15", + "2015-05-01-preview" + ] + } + ], + "defaultPath": "properties.encryption.services.blob.enabled" + }, + { + "name": "Microsoft.Storage/storageAccounts/enableFileEncryption", + "paths": [ + { + "path": "properties.encryption.services.file.enabled", + "apiVersions": [ + "2018-11-01", + "2018-11-09", + "2018-07-01", + "2018-03-01-Preview", + "2018-02-01", + "2017-10-01", + "2017-06-01", + "2016-12-01", + "2016-05-01", + "2016-01-01", + "2015-06-15", + "2015-05-01-preview" + ] + } + ], + "defaultPath": "properties.encryption.services.file.enabled" + }, + { + "name": "Microsoft.Storage/storageAccounts/supportsHttpsTrafficOnly", + "paths": [ + { + "path": "properties.supportsHttpsTrafficOnly", + "apiVersions": [ + "2018-11-09", + "2018-03-01-Preview", + "2016-05-01", + "2016-01-01", + "2015-06-15", + "2015-05-01-preview" + ], + "metadata": { + "type": "NotSpecified", + "attributes": "None" + } + } + ], + "defaultPath": "properties.supportsHttpsTrafficOnly", + "defaultMetadata": { + "type": "Boolean", + "attributes": "Modifiable" + } + } + ], + "capabilities": "SupportsTags, SupportsLocation" + } + ] + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json index 46af7f8d08fc..2332c94473cc 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json @@ -2230,6 +2230,11 @@ "tags": [ "Providers" ], + "x-ms-examples": { + "Get a resource provider at tenant scope": { + "$ref": "./examples/GetNamedProviderAtTenant.json" + } + }, "operationId": "Providers_GetAtTenantScope", "description": "Gets the specified resource provider at the tenant level.", "parameters": [ @@ -4581,6 +4586,96 @@ }, "description": "An error response for a resource management request." }, + "ApiProfile" : { + "properties": { + "profileVersion": { + "type": "string", + "description": "The profile version." + }, + "apiVersion": { + "type": "string", + "description": "The API version." + } + } + }, + "AliasPathMetadata": { + "properties": { + "type": { + "type": "string", + "enum": [ + "NotSpecified", + "Any", + "String", + "Object", + "Array", + "Integer", + "Number", + "Boolean" + ], + "x-ms-enum": { + "name": "AliasPathTokenType", + "modelAsString": false, + "values": [ + { + "value": "NotSpecified", + "description": "The token type is not specified." + }, + { + "value": "Any", + "description": "The token type can be anything." + }, + { + "value": "String", + "description": "The token type is string." + }, + { + "value": "Object", + "description": "The token type is object." + }, + { + "value": "Array", + "description": "The token type is array." + }, + { + "value": "Integer", + "description": "The token type is integer." + }, + { + "value": "Number", + "description": "The token type is number." + }, + { + "value": "Boolean", + "description": "The token type is boolean." + } + ] + }, + "description": "The type of the token that the alias path is referring to." + }, + "attributes": { + "type": "string", + "enum": [ + "None", + "Modifiable" + ], + "x-ms-enum": { + "name": "AliasPathAttributes", + "modelAsString": false, + "values": [ + { + "value": "None", + "description": "The token that the alias path is referring to has no attributes." + }, + { + "value": "Modifiable", + "description": "The token that the alias path is referring to is modifiable by policies with 'modify' effect." + } + ] + }, + "description": "The attributes of the token that the alias path is referring to." + } + } + }, "AliasPath": { "properties": { "path": { @@ -4597,6 +4692,10 @@ "pattern": { "$ref": "#/definitions/AliasPattern", "description": "The pattern for an alias path." + }, + "metadata": { + "$ref": "#/definitions/AliasPathMetadata", + "description": "The metadata of the alias path. If missing, fall back to the default metadata of the alias." } }, "description": "The type of the paths for alias." @@ -4683,6 +4782,10 @@ "defaultPattern": { "$ref": "#/definitions/AliasPattern", "description": "The default pattern for an alias." + }, + "defaultMetadata": { + "$ref": "#/definitions/AliasPathMetadata", + "description": "The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata" } }, "description": "The alias type. " @@ -4714,6 +4817,17 @@ }, "description": "The API version." }, + "defaultApiVersion": { + "type": "string", + "description": "The default API version." + }, + "apiProfiles": { + "type": "array", + "items" : { + "$ref": "#/definitions/ApiProfile" + }, + "description": "The API profiles for the resource provider." + }, "capabilities": { "type": "string", "description": "The additional capabilities offered by this resource type." From b7e9226fde0cfbeff24458c90de4297c75e72ace Mon Sep 17 00:00:00 2001 From: Elad Perets Date: Thu, 23 Jul 2020 14:53:36 -0700 Subject: [PATCH 2/3] Fix prettier errors --- .../Microsoft.Resources/stable/2020-06-01/resources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json index 2332c94473cc..55a625b16497 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json @@ -4586,7 +4586,7 @@ }, "description": "An error response for a resource management request." }, - "ApiProfile" : { + "ApiProfile": { "properties": { "profileVersion": { "type": "string", @@ -4823,7 +4823,7 @@ }, "apiProfiles": { "type": "array", - "items" : { + "items": { "$ref": "#/definitions/ApiProfile" }, "description": "The API profiles for the resource provider." From 222c6820550f2d760710701b21c2ac8dc9f30e73 Mon Sep 17 00:00:00 2001 From: Elad Perets Date: Thu, 23 Jul 2020 15:37:55 -0700 Subject: [PATCH 3/3] Address PR comments --- .../stable/2020-06-01/resources.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json index 55a625b16497..96b7e2efcdaa 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-06-01/resources.json @@ -4590,10 +4590,12 @@ "properties": { "profileVersion": { "type": "string", + "readOnly": true, "description": "The profile version." }, "apiVersion": { "type": "string", + "readOnly": true, "description": "The API version." } } @@ -4602,6 +4604,7 @@ "properties": { "type": { "type": "string", + "readOnly": true, "enum": [ "NotSpecified", "Any", @@ -4614,7 +4617,7 @@ ], "x-ms-enum": { "name": "AliasPathTokenType", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "NotSpecified", @@ -4654,13 +4657,14 @@ }, "attributes": { "type": "string", + "readOnly": true, "enum": [ "None", "Modifiable" ], "x-ms-enum": { "name": "AliasPathAttributes", - "modelAsString": false, + "modelAsString": true, "values": [ { "value": "None", @@ -4694,6 +4698,7 @@ "description": "The pattern for an alias path." }, "metadata": { + "readOnly": true, "$ref": "#/definitions/AliasPathMetadata", "description": "The metadata of the alias path. If missing, fall back to the default metadata of the alias." } @@ -4784,6 +4789,7 @@ "description": "The default pattern for an alias." }, "defaultMetadata": { + "readOnly": true, "$ref": "#/definitions/AliasPathMetadata", "description": "The default alias path metadata. Applies to the default path and to any alias path that doesn't have metadata" } @@ -4819,10 +4825,12 @@ }, "defaultApiVersion": { "type": "string", + "readOnly": true, "description": "The default API version." }, "apiProfiles": { "type": "array", + "readOnly": true, "items": { "$ref": "#/definitions/ApiProfile" },