From b997c58a067df7a0db5dd1b9b2b2cf6173ba8e79 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Wed, 22 Apr 2020 14:43:39 -0700 Subject: [PATCH 01/17] Check Resource Name added to swagger --- .../examples/CheckResourceName.json | 20 ++++++ .../stable/2020-01-01/subscriptions.json | 64 +++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/examples/CheckResourceName.json diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/examples/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/examples/CheckResourceName.json new file mode 100644 index 000000000000..84ec179e05d9 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/examples/CheckResourceName.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "body": [ + { + "Name": "isxbox", + "Type": "ResourceProviderTestHost/TestResourceType" + } + ], + "api-version": "2020-01-01" + }, + "responses": { + "200": { + "body": { + "name": "isxbox", + "type": "ResourceProviderTestHost/TestResourceType", + "status": "Allowed" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index ee5d51274e47..b5f76cd1ebf3 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -182,6 +182,53 @@ "nextLinkName": "nextLink" } } + }, + "/providers/Microsoft.Resources/checkResourceName": { + "post": { + "tags": [ + "Tenants" + ], + "operationId": "checkResourceName", + "description": "Checks if the resource name is valid or not", + "summary": "Checks resource name validity", + "consumes": [ "application/json" ], + "parameters": [ + { + "in": "body", + "name": "", + "schema": { + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns status as allowed or not.", + "schema": { + "$ref": "#/definitions/CheckResourceNameResult" + } + } + }, + "x-ms-examples": { + "Check validity for a resource name.": { + "$ref": "./examples/CheckResourceName.json" + } + } + } } }, "definitions": { @@ -518,6 +565,23 @@ ], "description": "Tenant Ids information." }, + "CheckResourceNameResult": { + "properties": { + "name": { + "description": "Name of Resource", + "type": "string" + }, + "type": { + "description": "Type of Resource", + "type": "string" + }, + "status": { + "description": "Is ther resource name allowed or not", + "type": "string" + } + }, + "description": "Validity of Resource name for the given type" + }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", From 6a54977e61874804e732f1ade63fca8a8946c1ca Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Wed, 22 Apr 2020 15:26:01 -0700 Subject: [PATCH 02/17] spellcheck and prettier check fixed --- .../stable/2020-01-01/subscriptions.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index b5f76cd1ebf3..5c68dc0319e9 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -191,7 +191,9 @@ "operationId": "checkResourceName", "description": "Checks if the resource name is valid or not", "summary": "Checks resource name validity", - "consumes": [ "application/json" ], + "consumes": [ + "application/json" + ], "parameters": [ { "in": "body", @@ -576,7 +578,7 @@ "type": "string" }, "status": { - "description": "Is ther resource name allowed or not", + "description": "Is the resource name allowed or not", "type": "string" } }, From 32185d672b4a83d3d6b7b3f603569e816a0dbe96 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Fri, 15 May 2020 15:55:21 -0700 Subject: [PATCH 03/17] fixes --- .../stable/2020-01-01/subscriptions.json | 52 +++++++++++-------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index 5c68dc0319e9..e48569eed5af 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -189,29 +189,12 @@ "Tenants" ], "operationId": "checkResourceName", - "description": "Checks if the resource name is valid or not", + "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", "summary": "Checks resource name validity", - "consumes": [ - "application/json" - ], + "consumes": [ "application/json" ], "parameters": [ { - "in": "body", - "name": "", - "schema": { - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - } + "$ref": "#/parameters/CheckResourceNameParameter" }, { "$ref": "#/parameters/ApiVersionParameter" @@ -578,11 +561,14 @@ "type": "string" }, "status": { - "description": "Is the resource name allowed or not", - "type": "string" + "description": "Is the resource name Allowed or Reserved", + "type": "string", + "enum": [ + "Allowed", + "Reserved"] } }, - "description": "Validity of Resource name for the given type" + "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" }, "Operation": { "description": "Microsoft.Resources operation", @@ -641,6 +627,26 @@ "description": "The ID of the target subscription.", "x-ms-parameter-location": "method" }, + "CheckResourceNameParameter": { + "in": "body", + "name": "Resource Name Definition", + "schema": { + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + } + }, "ApiVersionParameter": { "name": "api-version", "in": "query", From 72ae4be31bfa06ed5afbb873a573c6aad443fccd Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Fri, 15 May 2020 16:49:32 -0700 Subject: [PATCH 04/17] prettier check and x-ms fixes --- .../stable/2020-01-01/subscriptions.json | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index e48569eed5af..f793e48e5a6e 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -191,7 +191,9 @@ "operationId": "checkResourceName", "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", "summary": "Checks resource name validity", - "consumes": [ "application/json" ], + "consumes": [ + "application/json" + ], "parameters": [ { "$ref": "#/parameters/CheckResourceNameParameter" @@ -564,8 +566,13 @@ "description": "Is the resource name Allowed or Reserved", "type": "string", "enum": [ - "Allowed", - "Reserved"] + "Allowed", + "Reserved" + ], + "x-ms-enum": { + "name": "ResourceNameStatus", + "modelAsString": true + } } }, "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" @@ -628,6 +635,7 @@ "x-ms-parameter-location": "method" }, "CheckResourceNameParameter": { + "description": "Resource object with values for resource name and resource type", "in": "body", "name": "Resource Name Definition", "schema": { @@ -645,7 +653,8 @@ "description": "The type of the resource" } } - } + }, + "x-ms-parameter-location": "method" }, "ApiVersionParameter": { "name": "api-version", From ca6bea7c90fb8d740a7ef35ba20152a4d30268e7 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Mon, 18 May 2020 10:13:15 -0700 Subject: [PATCH 05/17] added schema for resource name --- .../stable/2020-01-01/subscriptions.json | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index f793e48e5a6e..18bb42baf7fb 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -552,6 +552,22 @@ ], "description": "Tenant Ids information." }, + "ResourceName": { + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + }, "CheckResourceNameResult": { "properties": { "name": { @@ -639,20 +655,7 @@ "in": "body", "name": "Resource Name Definition", "schema": { - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "description": "Name of the resource", - "type": "string" - }, - "type": { - "type": "string", - "description": "The type of the resource" - } - } + "$ref": "#/definitions/ResourceName" }, "x-ms-parameter-location": "method" }, From fbbfff90f35b7d498831a05bad53c9bf53a783b4 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Mon, 18 May 2020 14:16:52 -0700 Subject: [PATCH 06/17] fixes --- .../stable/2020-01-01/subscriptions.json | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index 18bb42baf7fb..3589af0aa26a 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -553,20 +553,20 @@ "description": "Tenant Ids information." }, "ResourceName": { - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "description": "Name of the resource", - "type": "string" - }, - "type": { - "type": "string", - "description": "The type of the resource" + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } } - } }, "CheckResourceNameResult": { "properties": { @@ -656,7 +656,7 @@ "name": "Resource Name Definition", "schema": { "$ref": "#/definitions/ResourceName" - }, + }, "x-ms-parameter-location": "method" }, "ApiVersionParameter": { From 7437670fbec9893708a82be7ae56f5f6170a3aa8 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Thu, 21 May 2020 10:57:34 -0700 Subject: [PATCH 07/17] description added to resourcename --- .../stable/2020-01-01/subscriptions.json | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index 3589af0aa26a..e24e00b96f22 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -553,20 +553,21 @@ "description": "Tenant Ids information." }, "ResourceName": { - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "description": "Name of the resource", - "type": "string" - }, - "type": { - "type": "string", - "description": "The type of the resource" - } + "description": "Name and Type of the Resource", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" } + } }, "CheckResourceNameResult": { "properties": { @@ -656,7 +657,7 @@ "name": "Resource Name Definition", "schema": { "$ref": "#/definitions/ResourceName" - }, + }, "x-ms-parameter-location": "method" }, "ApiVersionParameter": { From 3be49448194b7a4ce0261805838e99ce9c22c914 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Tue, 26 May 2020 15:56:01 -0700 Subject: [PATCH 08/17] added changes to all api versions --- .../examples/CheckResourceName.json | 20 +++++ .../stable/2015-11-01/subscriptions.json | 85 +++++++++++++++++++ .../examples/CheckResourceName.json | 20 +++++ .../stable/2016-06-01/subscriptions.json | 85 +++++++++++++++++++ .../examples/CheckResourceName.json | 20 +++++ .../stable/2018-06-01/subscriptions.json | 85 +++++++++++++++++++ .../examples/CheckResourceName.json | 20 +++++ .../stable/2019-06-01/subscriptions.json | 85 +++++++++++++++++++ .../examples/CheckResourceName.json | 20 +++++ .../stable/2019-11-01/subscriptions.json | 85 +++++++++++++++++++ 10 files changed, 525 insertions(+) create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/examples/CheckResourceName.json create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/examples/CheckResourceName.json create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/examples/CheckResourceName.json create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/examples/CheckResourceName.json diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/examples/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/examples/CheckResourceName.json new file mode 100644 index 000000000000..77e33c4ba8f2 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/examples/CheckResourceName.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "body": [ + { + "Name": "isxbox", + "Type": "ResourceProviderTestHost/TestResourceType" + } + ], + "api-version": "2015-11-01" + }, + "responses": { + "200": { + "body": { + "name": "isxbox", + "type": "ResourceProviderTestHost/TestResourceType", + "status": "Allowed" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json index 32846f6b7326..5c1416319dd7 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json @@ -145,6 +145,40 @@ "nextLinkName": "nextLink" } } + }, + "/providers/Microsoft.Resources/checkResourceName": { + "post": { + "tags": [ + "Tenants" + ], + "operationId": "checkResourceName", + "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", + "summary": "Checks resource name validity", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/CheckResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns status as allowed or not.", + "schema": { + "$ref": "#/definitions/CheckResourceNameResult" + } + } + }, + "x-ms-examples": { + "Check validity for a resource name.": { + "$ref": "./examples/CheckResourceName.json" + } + } + } } }, "definitions": { @@ -277,9 +311,60 @@ "nextLink" ], "description": "Tenant Ids information." + }, + "ResourceName": { + "description": "Name and Type of the Resource", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + }, + "CheckResourceNameResult": { + "properties": { + "name": { + "description": "Name of Resource", + "type": "string" + }, + "type": { + "description": "Type of Resource", + "type": "string" + }, + "status": { + "description": "Is the resource name Allowed or Reserved", + "type": "string", + "enum": [ + "Allowed", + "Reserved" + ], + "x-ms-enum": { + "name": "ResourceNameStatus", + "modelAsString": true + } + } + }, + "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" } }, "parameters": { + "CheckResourceNameParameter": { + "description": "Resource object with values for resource name and resource type", + "in": "body", + "name": "Resource Name Definition", + "schema": { + "$ref": "#/definitions/ResourceName" + }, + "x-ms-parameter-location": "method" + }, "ApiVersionParameter": { "name": "api-version", "in": "query", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json new file mode 100644 index 000000000000..6ee63e4f2ea3 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "body": [ + { + "Name": "isxbox", + "Type": "ResourceProviderTestHost/TestResourceType" + } + ], + "api-version": "2016-06-01" + }, + "responses": { + "200": { + "body": { + "name": "isxbox", + "type": "ResourceProviderTestHost/TestResourceType", + "status": "Allowed" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json index 0ff278951ee7..1ede034bf8ee 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json @@ -162,6 +162,40 @@ "nextLinkName": "nextLink" } } + }, + "/providers/Microsoft.Resources/checkResourceName": { + "post": { + "tags": [ + "Tenants" + ], + "operationId": "checkResourceName", + "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", + "summary": "Checks resource name validity", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/CheckResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns status as allowed or not.", + "schema": { + "$ref": "#/definitions/CheckResourceNameResult" + } + } + }, + "x-ms-examples": { + "Check validity for a resource name.": { + "$ref": "./examples/CheckResourceName.json" + } + } + } } }, "definitions": { @@ -338,6 +372,48 @@ ], "description": "Tenant Ids information." }, + "ResourceName": { + "description": "Name and Type of the Resource", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + }, + "CheckResourceNameResult": { + "properties": { + "name": { + "description": "Name of Resource", + "type": "string" + }, + "type": { + "description": "Type of Resource", + "type": "string" + }, + "status": { + "description": "Is the resource name Allowed or Reserved", + "type": "string", + "enum": [ + "Allowed", + "Reserved" + ], + "x-ms-enum": { + "name": "ResourceNameStatus", + "modelAsString": true + } + } + }, + "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" + }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", @@ -395,6 +471,15 @@ "description": "The ID of the target subscription.", "x-ms-parameter-location": "method" }, + "CheckResourceNameParameter": { + "description": "Resource object with values for resource name and resource type", + "in": "body", + "name": "Resource Name Definition", + "schema": { + "$ref": "#/definitions/ResourceName" + }, + "x-ms-parameter-location": "method" + }, "ApiVersionParameter": { "name": "api-version", "in": "query", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/examples/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/examples/CheckResourceName.json new file mode 100644 index 000000000000..cd6b51d941f4 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/examples/CheckResourceName.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "body": [ + { + "Name": "isxbox", + "Type": "ResourceProviderTestHost/TestResourceType" + } + ], + "api-version": "2018-06-01" + }, + "responses": { + "200": { + "body": { + "name": "isxbox", + "type": "ResourceProviderTestHost/TestResourceType", + "status": "Allowed" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json index fe7335ec5a3f..d12848c84fb0 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json @@ -162,6 +162,40 @@ "nextLinkName": "nextLink" } } + }, + "/providers/Microsoft.Resources/checkResourceName": { + "post": { + "tags": [ + "Tenants" + ], + "operationId": "checkResourceName", + "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", + "summary": "Checks resource name validity", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/CheckResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns status as allowed or not.", + "schema": { + "$ref": "#/definitions/CheckResourceNameResult" + } + } + }, + "x-ms-examples": { + "Check validity for a resource name.": { + "$ref": "./examples/CheckResourceName.json" + } + } + } } }, "definitions": { @@ -367,6 +401,48 @@ ], "description": "Tenant Ids information." }, + "ResourceName": { + "description": "Name and Type of the Resource", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + }, + "CheckResourceNameResult": { + "properties": { + "name": { + "description": "Name of Resource", + "type": "string" + }, + "type": { + "description": "Type of Resource", + "type": "string" + }, + "status": { + "description": "Is the resource name Allowed or Reserved", + "type": "string", + "enum": [ + "Allowed", + "Reserved" + ], + "x-ms-enum": { + "name": "ResourceNameStatus", + "modelAsString": true + } + } + }, + "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" + }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", @@ -424,6 +500,15 @@ "description": "The ID of the target subscription.", "x-ms-parameter-location": "method" }, + "CheckResourceNameParameter": { + "description": "Resource object with values for resource name and resource type", + "in": "body", + "name": "Resource Name Definition", + "schema": { + "$ref": "#/definitions/ResourceName" + }, + "x-ms-parameter-location": "method" + }, "ApiVersionParameter": { "name": "api-version", "in": "query", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/examples/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/examples/CheckResourceName.json new file mode 100644 index 000000000000..72412b20f92a --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/examples/CheckResourceName.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "body": [ + { + "Name": "isxbox", + "Type": "ResourceProviderTestHost/TestResourceType" + } + ], + "api-version": "2019-06-01" + }, + "responses": { + "200": { + "body": { + "name": "isxbox", + "type": "ResourceProviderTestHost/TestResourceType", + "status": "Allowed" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json index c64abcc4164a..4d3f452d3140 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json @@ -172,6 +172,40 @@ "nextLinkName": "nextLink" } } + }, + "/providers/Microsoft.Resources/checkResourceName": { + "post": { + "tags": [ + "Tenants" + ], + "operationId": "checkResourceName", + "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", + "summary": "Checks resource name validity", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/CheckResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns status as allowed or not.", + "schema": { + "$ref": "#/definitions/CheckResourceNameResult" + } + } + }, + "x-ms-examples": { + "Check validity for a resource name.": { + "$ref": "./examples/CheckResourceName.json" + } + } + } } }, "definitions": { @@ -408,6 +442,48 @@ ], "description": "Tenant Ids information." }, + "ResourceName": { + "description": "Name and Type of the Resource", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + }, + "CheckResourceNameResult": { + "properties": { + "name": { + "description": "Name of Resource", + "type": "string" + }, + "type": { + "description": "Type of Resource", + "type": "string" + }, + "status": { + "description": "Is the resource name Allowed or Reserved", + "type": "string", + "enum": [ + "Allowed", + "Reserved" + ], + "x-ms-enum": { + "name": "ResourceNameStatus", + "modelAsString": true + } + } + }, + "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" + }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", @@ -465,6 +541,15 @@ "description": "The ID of the target subscription.", "x-ms-parameter-location": "method" }, + "CheckResourceNameParameter": { + "description": "Resource object with values for resource name and resource type", + "in": "body", + "name": "Resource Name Definition", + "schema": { + "$ref": "#/definitions/ResourceName" + }, + "x-ms-parameter-location": "method" + }, "ApiVersionParameter": { "name": "api-version", "in": "query", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/examples/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/examples/CheckResourceName.json new file mode 100644 index 000000000000..584176e6f6d6 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/examples/CheckResourceName.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "body": [ + { + "Name": "isxbox", + "Type": "ResourceProviderTestHost/TestResourceType" + } + ], + "api-version": "2019-11-01" + }, + "responses": { + "200": { + "body": { + "name": "isxbox", + "type": "ResourceProviderTestHost/TestResourceType", + "status": "Allowed" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json index a10bc931ed11..183bebd448fb 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json @@ -177,6 +177,40 @@ "nextLinkName": "nextLink" } } + }, + "/providers/Microsoft.Resources/checkResourceName": { + "post": { + "tags": [ + "Tenants" + ], + "operationId": "checkResourceName", + "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", + "summary": "Checks resource name validity", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/CheckResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns status as allowed or not.", + "schema": { + "$ref": "#/definitions/CheckResourceNameResult" + } + } + }, + "x-ms-examples": { + "Check validity for a resource name.": { + "$ref": "./examples/CheckResourceName.json" + } + } + } } }, "definitions": { @@ -498,6 +532,48 @@ ], "description": "Tenant Ids information." }, + "ResourceName": { + "description": "Name and Type of the Resource", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + }, + "CheckResourceNameResult": { + "properties": { + "name": { + "description": "Name of Resource", + "type": "string" + }, + "type": { + "description": "Type of Resource", + "type": "string" + }, + "status": { + "description": "Is the resource name Allowed or Reserved", + "type": "string", + "enum": [ + "Allowed", + "Reserved" + ], + "x-ms-enum": { + "name": "ResourceNameStatus", + "modelAsString": true + } + } + }, + "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" + }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", @@ -555,6 +631,15 @@ "description": "The ID of the target subscription.", "x-ms-parameter-location": "method" }, + "CheckResourceNameParameter": { + "description": "Resource object with values for resource name and resource type", + "in": "body", + "name": "Resource Name Definition", + "schema": { + "$ref": "#/definitions/ResourceName" + }, + "x-ms-parameter-location": "method" + }, "ApiVersionParameter": { "name": "api-version", "in": "query", From cbbdd6d14cf1099fa3cded08d8ecda923fe4c173 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Thu, 18 Jun 2020 16:18:04 -0700 Subject: [PATCH 09/17] default response added --- .../stable/2015-11-01/subscriptions.json | 25 +++++++++++++++++++ .../stable/2016-06-01/subscriptions.json | 25 +++++++++++++++++++ .../stable/2018-06-01/subscriptions.json | 25 +++++++++++++++++++ .../stable/2019-06-01/subscriptions.json | 25 +++++++++++++++++++ .../stable/2019-11-01/subscriptions.json | 25 +++++++++++++++++++ .../stable/2020-01-01/subscriptions.json | 25 +++++++++++++++++++ 6 files changed, 150 insertions(+) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json index 5c1416319dd7..a18fe09d961f 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json @@ -171,6 +171,12 @@ "schema": { "$ref": "#/definitions/CheckResourceNameResult" } + }, + "default": { + "description": "Error response saying resource name is invalid", + "schema": { + "$ref": "#/definitions/ErrorDefinition" + } } }, "x-ms-examples": { @@ -329,6 +335,25 @@ } } }, + "ErrorDefinition":{ + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Code of the error." + } + } + }, "CheckResourceNameResult": { "properties": { "name": { diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json index 1ede034bf8ee..3df4f322f732 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json @@ -188,6 +188,12 @@ "schema": { "$ref": "#/definitions/CheckResourceNameResult" } + }, + "default": { + "description": "Error response saying resource name is invalid", + "schema": { + "$ref": "#/definitions/ErrorDefinition" + } } }, "x-ms-examples": { @@ -389,6 +395,25 @@ } } }, + "ErrorDefinition":{ + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Code of the error." + } + } + }, "CheckResourceNameResult": { "properties": { "name": { diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json index d12848c84fb0..ddccd71220b4 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json @@ -188,6 +188,12 @@ "schema": { "$ref": "#/definitions/CheckResourceNameResult" } + }, + "default": { + "description": "Error response saying resource name is invalid", + "schema": { + "$ref": "#/definitions/ErrorDefinition" + } } }, "x-ms-examples": { @@ -418,6 +424,25 @@ } } }, + "ErrorDefinition":{ + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Code of the error." + } + } + }, "CheckResourceNameResult": { "properties": { "name": { diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json index 4d3f452d3140..56480d7cefd8 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json @@ -198,6 +198,12 @@ "schema": { "$ref": "#/definitions/CheckResourceNameResult" } + }, + "default": { + "description": "Error response saying resource name is invalid", + "schema": { + "$ref": "#/definitions/ErrorDefinition" + } } }, "x-ms-examples": { @@ -459,6 +465,25 @@ } } }, + "ErrorDefinition":{ + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Code of the error." + } + } + }, "CheckResourceNameResult": { "properties": { "name": { diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json index 183bebd448fb..1cf1227a1536 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json @@ -203,6 +203,12 @@ "schema": { "$ref": "#/definitions/CheckResourceNameResult" } + }, + "default": { + "description": "Error response saying resource name is invalid", + "schema": { + "$ref": "#/definitions/ErrorDefinition" + } } }, "x-ms-examples": { @@ -549,6 +555,25 @@ } } }, + "ErrorDefinition":{ + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Code of the error." + } + } + }, "CheckResourceNameResult": { "properties": { "name": { diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index e24e00b96f22..fbcc08bef870 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -208,6 +208,12 @@ "schema": { "$ref": "#/definitions/CheckResourceNameResult" } + }, + "default": { + "description": "Error response saying resource name is invalid", + "schema": { + "$ref": "#/definitions/ErrorDefinition" + } } }, "x-ms-examples": { @@ -594,6 +600,25 @@ }, "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" }, + "ErrorDefinition":{ + "type": "object", + "title": "Error", + "description": "Error description and code explaining why an operation failed.", + "required": [ + "message", + "code" + ], + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Code of the error." + } + } + }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", From 0697c03c76457bb457812c03ab5e253f38fbeef8 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Thu, 18 Jun 2020 17:01:48 -0700 Subject: [PATCH 10/17] prettier checl --- .../Microsoft.Resources/stable/2015-11-01/subscriptions.json | 2 +- .../Microsoft.Resources/stable/2016-06-01/subscriptions.json | 2 +- .../Microsoft.Resources/stable/2018-06-01/subscriptions.json | 2 +- .../Microsoft.Resources/stable/2019-06-01/subscriptions.json | 2 +- .../Microsoft.Resources/stable/2019-11-01/subscriptions.json | 2 +- .../Microsoft.Resources/stable/2020-01-01/subscriptions.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json index a18fe09d961f..9fee17a83d48 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json @@ -335,7 +335,7 @@ } } }, - "ErrorDefinition":{ + "ErrorDefinition": { "type": "object", "title": "Error", "description": "Error description and code explaining why an operation failed.", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json index 3df4f322f732..57f0715b07eb 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json @@ -395,7 +395,7 @@ } } }, - "ErrorDefinition":{ + "ErrorDefinition": { "type": "object", "title": "Error", "description": "Error description and code explaining why an operation failed.", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json index ddccd71220b4..df2210659de2 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json @@ -424,7 +424,7 @@ } } }, - "ErrorDefinition":{ + "ErrorDefinition": { "type": "object", "title": "Error", "description": "Error description and code explaining why an operation failed.", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json index 56480d7cefd8..387badf603c5 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json @@ -465,7 +465,7 @@ } } }, - "ErrorDefinition":{ + "ErrorDefinition": { "type": "object", "title": "Error", "description": "Error description and code explaining why an operation failed.", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json index 1cf1227a1536..7b0436a83b0e 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json @@ -555,7 +555,7 @@ } } }, - "ErrorDefinition":{ + "ErrorDefinition": { "type": "object", "title": "Error", "description": "Error description and code explaining why an operation failed.", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index fbcc08bef870..0b7251f5e889 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -600,7 +600,7 @@ }, "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" }, - "ErrorDefinition":{ + "ErrorDefinition": { "type": "object", "title": "Error", "description": "Error description and code explaining why an operation failed.", From 4d1f9917d11c936e0b17285f68d9289ec6051928 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Fri, 19 Jun 2020 12:42:13 -0700 Subject: [PATCH 11/17] default response changed --- .../stable/2015-11-01/subscriptions.json | 19 ++++++++++------- .../stable/2016-06-01/subscriptions.json | 21 +++++++++++-------- .../stable/2018-06-01/subscriptions.json | 19 ++++++++++------- .../stable/2019-06-01/subscriptions.json | 19 ++++++++++------- .../stable/2019-11-01/subscriptions.json | 19 ++++++++++------- .../stable/2020-01-01/subscriptions.json | 19 ++++++++++------- 6 files changed, 67 insertions(+), 49 deletions(-) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json index 9fee17a83d48..81e1db96161e 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2015-11-01/subscriptions.json @@ -175,7 +175,7 @@ "default": { "description": "Error response saying resource name is invalid", "schema": { - "$ref": "#/definitions/ErrorDefinition" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -335,14 +335,17 @@ } } }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, "ErrorDefinition": { - "type": "object", - "title": "Error", - "description": "Error description and code explaining why an operation failed.", - "required": [ - "message", - "code" - ], + "description": "Error description and code explaining why resource name is invalid.", "properties": { "message": { "type": "string", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json index 57f0715b07eb..54141c7d0469 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json @@ -190,9 +190,9 @@ } }, "default": { - "description": "Error response saying resource name is invalid", + "description": "Error response describing why resource name is invalid", "schema": { - "$ref": "#/definitions/ErrorDefinition" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -395,14 +395,17 @@ } } }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, "ErrorDefinition": { - "type": "object", - "title": "Error", - "description": "Error description and code explaining why an operation failed.", - "required": [ - "message", - "code" - ], + "description": "Error description and code explaining why resource name is invalid.", "properties": { "message": { "type": "string", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json index df2210659de2..99f212f95c48 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2018-06-01/subscriptions.json @@ -192,7 +192,7 @@ "default": { "description": "Error response saying resource name is invalid", "schema": { - "$ref": "#/definitions/ErrorDefinition" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -424,14 +424,17 @@ } } }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, "ErrorDefinition": { - "type": "object", - "title": "Error", - "description": "Error description and code explaining why an operation failed.", - "required": [ - "message", - "code" - ], + "description": "Error description and code explaining why resource name is invalid.", "properties": { "message": { "type": "string", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json index 387badf603c5..984bf3ead13f 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-06-01/subscriptions.json @@ -202,7 +202,7 @@ "default": { "description": "Error response saying resource name is invalid", "schema": { - "$ref": "#/definitions/ErrorDefinition" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -465,14 +465,17 @@ } } }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, "ErrorDefinition": { - "type": "object", - "title": "Error", - "description": "Error description and code explaining why an operation failed.", - "required": [ - "message", - "code" - ], + "description": "Error description and code explaining why resource name is invalid.", "properties": { "message": { "type": "string", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json index 7b0436a83b0e..ad98623bf852 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2019-11-01/subscriptions.json @@ -207,7 +207,7 @@ "default": { "description": "Error response saying resource name is invalid", "schema": { - "$ref": "#/definitions/ErrorDefinition" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -555,14 +555,17 @@ } } }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, "ErrorDefinition": { - "type": "object", - "title": "Error", - "description": "Error description and code explaining why an operation failed.", - "required": [ - "message", - "code" - ], + "description": "Error description and code explaining why resource name is invalid.", "properties": { "message": { "type": "string", diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json index 0b7251f5e889..b70ab71ed858 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2020-01-01/subscriptions.json @@ -212,7 +212,7 @@ "default": { "description": "Error response saying resource name is invalid", "schema": { - "$ref": "#/definitions/ErrorDefinition" + "$ref": "#/definitions/ErrorResponse" } } }, @@ -600,14 +600,17 @@ }, "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, "ErrorDefinition": { - "type": "object", - "title": "Error", - "description": "Error description and code explaining why an operation failed.", - "required": [ - "message", - "code" - ], + "description": "Error description and code explaining why resource name is invalid.", "properties": { "message": { "type": "string", From ad5ed348d7a1761ca89db921c1872f8e304ecc37 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Wed, 24 Jun 2020 09:53:24 -0700 Subject: [PATCH 12/17] removed 2016-06-01 api --- .../examples/CheckResourceName.json | 20 ---- .../stable/2016-06-01/subscriptions.json | 113 ------------------ 2 files changed, 133 deletions(-) delete mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json deleted file mode 100644 index 6ee63e4f2ea3..000000000000 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "parameters": { - "body": [ - { - "Name": "isxbox", - "Type": "ResourceProviderTestHost/TestResourceType" - } - ], - "api-version": "2016-06-01" - }, - "responses": { - "200": { - "body": { - "name": "isxbox", - "type": "ResourceProviderTestHost/TestResourceType", - "status": "Allowed" - } - } - } -} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json index 54141c7d0469..0ff278951ee7 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json @@ -162,46 +162,6 @@ "nextLinkName": "nextLink" } } - }, - "/providers/Microsoft.Resources/checkResourceName": { - "post": { - "tags": [ - "Tenants" - ], - "operationId": "checkResourceName", - "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", - "summary": "Checks resource name validity", - "consumes": [ - "application/json" - ], - "parameters": [ - { - "$ref": "#/parameters/CheckResourceNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "OK - Returns status as allowed or not.", - "schema": { - "$ref": "#/definitions/CheckResourceNameResult" - } - }, - "default": { - "description": "Error response describing why resource name is invalid", - "schema": { - "$ref": "#/definitions/ErrorResponse" - } - } - }, - "x-ms-examples": { - "Check validity for a resource name.": { - "$ref": "./examples/CheckResourceName.json" - } - } - } } }, "definitions": { @@ -378,70 +338,6 @@ ], "description": "Tenant Ids information." }, - "ResourceName": { - "description": "Name and Type of the Resource", - "required": [ - "name", - "type" - ], - "properties": { - "name": { - "description": "Name of the resource", - "type": "string" - }, - "type": { - "type": "string", - "description": "The type of the resource" - } - } - }, - "ErrorResponse": { - "description": "Error response.", - "properties": { - "error": { - "$ref": "#/definitions/ErrorDefinition", - "description": "The error details." - } - } - }, - "ErrorDefinition": { - "description": "Error description and code explaining why resource name is invalid.", - "properties": { - "message": { - "type": "string", - "description": "Description of the error." - }, - "code": { - "type": "string", - "description": "Code of the error." - } - } - }, - "CheckResourceNameResult": { - "properties": { - "name": { - "description": "Name of Resource", - "type": "string" - }, - "type": { - "description": "Type of Resource", - "type": "string" - }, - "status": { - "description": "Is the resource name Allowed or Reserved", - "type": "string", - "enum": [ - "Allowed", - "Reserved" - ], - "x-ms-enum": { - "name": "ResourceNameStatus", - "modelAsString": true - } - } - }, - "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" - }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", @@ -499,15 +395,6 @@ "description": "The ID of the target subscription.", "x-ms-parameter-location": "method" }, - "CheckResourceNameParameter": { - "description": "Resource object with values for resource name and resource type", - "in": "body", - "name": "Resource Name Definition", - "schema": { - "$ref": "#/definitions/ResourceName" - }, - "x-ms-parameter-location": "method" - }, "ApiVersionParameter": { "name": "api-version", "in": "query", From 16806d9b24905e48788936c8de0ae761d2e4a602 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Mon, 29 Jun 2020 23:30:46 -0700 Subject: [PATCH 13/17] override errors --- .../stable/2016-06-01/CheckResourceName.json | 20 ++++ .../stable/2016-06-01/subscriptions.json | 113 ++++++++++++++++++ .../resources/resource-manager/readme.md | 6 + 3 files changed, 139 insertions(+) create mode 100644 specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/CheckResourceName.json diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/CheckResourceName.json new file mode 100644 index 000000000000..6ee63e4f2ea3 --- /dev/null +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/CheckResourceName.json @@ -0,0 +1,20 @@ +{ + "parameters": { + "body": [ + { + "Name": "isxbox", + "Type": "ResourceProviderTestHost/TestResourceType" + } + ], + "api-version": "2016-06-01" + }, + "responses": { + "200": { + "body": { + "name": "isxbox", + "type": "ResourceProviderTestHost/TestResourceType", + "status": "Allowed" + } + } + } +} diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json index 0ff278951ee7..7aaee9160c89 100644 --- a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json +++ b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/subscriptions.json @@ -162,6 +162,46 @@ "nextLinkName": "nextLink" } } + }, + "/providers/Microsoft.Resources/checkResourceName": { + "post": { + "tags": [ + "Tenants" + ], + "operationId": "checkResourceName", + "description": "A resource name is valid if it is not a reserved word, does not contains a reserved word and does not start with a reserved word", + "summary": "Checks resource name validity", + "consumes": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/CheckResourceNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK - Returns status as allowed or not.", + "schema": { + "$ref": "#/definitions/CheckResourceNameResult" + } + }, + "default": { + "description": "Error response saying resource name is invalid", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Check validity for a resource name.": { + "$ref": "./examples/CheckResourceName.json" + } + } + } } }, "definitions": { @@ -338,6 +378,70 @@ ], "description": "Tenant Ids information." }, + "ResourceName": { + "description": "Name and Type of the Resource", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "Name of the resource", + "type": "string" + }, + "type": { + "type": "string", + "description": "The type of the resource" + } + } + }, + "CheckResourceNameResult": { + "properties": { + "name": { + "description": "Name of Resource", + "type": "string" + }, + "type": { + "description": "Type of Resource", + "type": "string" + }, + "status": { + "description": "Is the resource name Allowed or Reserved", + "type": "string", + "enum": [ + "Allowed", + "Reserved" + ], + "x-ms-enum": { + "name": "ResourceNameStatus", + "modelAsString": true + } + } + }, + "description": "Resource Name valid if not a reserved word, does not contain a reserved word and does not start with a reserved word" + }, + "ErrorResponse": { + "description": "Error response.", + "properties": { + "error": { + "$ref": "#/definitions/ErrorDefinition", + "description": "The error details." + } + } + }, + "ErrorDefinition": { + "description": "Error description and code explaining why resource name is invalid.", + "properties": { + "message": { + "type": "string", + "description": "Description of the error." + }, + "code": { + "type": "string", + "description": "Code of the error." + } + } + }, "Operation": { "description": "Microsoft.Resources operation", "type": "object", @@ -395,6 +499,15 @@ "description": "The ID of the target subscription.", "x-ms-parameter-location": "method" }, + "CheckResourceNameParameter": { + "description": "Resource object with values for resource name and resource type", + "in": "body", + "name": "Resource Name Definition", + "schema": { + "$ref": "#/definitions/ResourceName" + }, + "x-ms-parameter-location": "method" + }, "ApiVersionParameter": { "name": "api-version", "in": "query", diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index 32aea908a345..36e32ef43c54 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -616,6 +616,12 @@ input-file: - Microsoft.Authorization/stable/2016-12-01/policyAssignments.json - Microsoft.Resources/stable/2016-06-01/subscriptions.json - Microsoft.Resources/stable/2018-05-01/resources.json + +override-info: + title: PolicyClient + title: ResourceManagementClient + title: SubscriptionClient + title: ManagementLockClient ``` ## Multi-API/Profile support for AutoRest v3 generators From 3fdd3be5f0aaceea6e95b888fe20fac91b85c7f0 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Mon, 29 Jun 2020 23:39:36 -0700 Subject: [PATCH 14/17] file moved to examples --- .../stable/2016-06-01/{ => examples}/CheckResourceName.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/{ => examples}/CheckResourceName.json (100%) diff --git a/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/CheckResourceName.json b/specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json similarity index 100% rename from specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/CheckResourceName.json rename to specification/resources/resource-manager/Microsoft.Resources/stable/2016-06-01/examples/CheckResourceName.json From 777b40b30a7814db0cc038746c8e70964f3a733c Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Tue, 30 Jun 2020 19:40:41 -0700 Subject: [PATCH 15/17] single override --- specification/resources/resource-manager/readme.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index 36e32ef43c54..ff9e37515f1b 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -619,9 +619,6 @@ input-file: override-info: title: PolicyClient - title: ResourceManagementClient - title: SubscriptionClient - title: ManagementLockClient ``` ## Multi-API/Profile support for AutoRest v3 generators From 7df8056e4b575ef2b2cab8c8554bd6a32af8f993 Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Tue, 30 Jun 2020 19:53:39 -0700 Subject: [PATCH 16/17] reverting --- specification/resources/resource-manager/readme.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index ff9e37515f1b..32aea908a345 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -616,9 +616,6 @@ input-file: - Microsoft.Authorization/stable/2016-12-01/policyAssignments.json - Microsoft.Resources/stable/2016-06-01/subscriptions.json - Microsoft.Resources/stable/2018-05-01/resources.json - -override-info: - title: PolicyClient ``` ## Multi-API/Profile support for AutoRest v3 generators From 4f88bac3517e256c8377497490cfefb2a0d4c90b Mon Sep 17 00:00:00 2001 From: Shreyansh Nawlakha Date: Tue, 7 Jul 2020 19:03:08 -0700 Subject: [PATCH 17/17] override policyclient --- specification/resources/resource-manager/readme.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/specification/resources/resource-manager/readme.md b/specification/resources/resource-manager/readme.md index 32aea908a345..ff9e37515f1b 100644 --- a/specification/resources/resource-manager/readme.md +++ b/specification/resources/resource-manager/readme.md @@ -616,6 +616,9 @@ input-file: - Microsoft.Authorization/stable/2016-12-01/policyAssignments.json - Microsoft.Resources/stable/2016-06-01/subscriptions.json - Microsoft.Resources/stable/2018-05-01/resources.json + +override-info: + title: PolicyClient ``` ## Multi-API/Profile support for AutoRest v3 generators