From f917749b8ac449757ef27025330e2183a6389814 Mon Sep 17 00:00:00 2001 From: Zunli Hu Date: Wed, 16 Mar 2022 09:51:30 +0800 Subject: [PATCH] Add API for checkNameAvailability in 2022-03-01 (#18204) * add API * update * fix * update * update --- .../2022-03-01/ManagedEnvironments.json | 59 +++++++++++++++++++ .../Certificates_CheckNameAvailability.json | 21 +++++++ .../ContainerApps_CheckNameAvailability.json | 21 +++++++ 3 files changed, 101 insertions(+) create mode 100644 specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json create mode 100644 specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json diff --git a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ManagedEnvironments.json b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ManagedEnvironments.json index b18bcf820626..f9e31c6672aa 100644 --- a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ManagedEnvironments.json +++ b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/ManagedEnvironments.json @@ -586,6 +586,65 @@ } } } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/managedEnvironments/{managedEnvironmentName}/checkNameAvailability": { + "post": { + "tags": [ + "ManagedEnvironments" + ], + "summary": "Checks the resource name availability.", + "description": "Checks if resource name is available.", + "operationId": "Namespaces_CheckNameAvailability", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "name": "managedEnvironmentName", + "in": "path", + "description": "Name of the Managed Environment.", + "required": true, + "type": "string" + }, + { + "name": "checkNameAvailabilityRequest", + "in": "body", + "description": "The check name availability request.", + "required": true, + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityRequest" + } + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/CheckNameAvailabilityResponse" + } + }, + "default": { + "description": "Error response.", + "schema": { + "$ref": "./CommonDefinitions.json#/definitions/DefaultErrorResponse" + } + } + }, + "x-ms-examples": { + "ContainerApps_CheckNameAvailability": { + "$ref": "./examples/ContainerApps_CheckNameAvailability.json" + }, + "Certificates_CheckNameAvailability": { + "$ref": "./examples/Certificates_CheckNameAvailability.json" + } + } + } } }, "definitions": { diff --git a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json new file mode 100644 index 000000000000..2788c6f66c02 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/Certificates_CheckNameAvailability.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "api-version": "2022-03-01", + "subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "resourceGroupName": "examplerg", + "managedEnvironmentName": "testcontainerenv", + "checkNameAvailabilityRequest": { + "name": "testcertificatename", + "type": "Microsoft.App/managedEnvironments/certificates" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true, + "reason": "None", + "message": "" + } + } + } +} diff --git a/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json new file mode 100644 index 000000000000..9ce9037bc6b3 --- /dev/null +++ b/specification/app/resource-manager/Microsoft.App/stable/2022-03-01/examples/ContainerApps_CheckNameAvailability.json @@ -0,0 +1,21 @@ +{ + "parameters": { + "api-version": "2022-03-01", + "subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345", + "resourceGroupName": "examplerg", + "managedEnvironmentName": "testcontainerenv", + "checkNameAvailabilityRequest": { + "name": "testcappname", + "type": "Microsoft.App/containerApps" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": true, + "reason": "None", + "message": "" + } + } + } +}