From cbacb71cd56bb1f2d576244ef05f4793737ab304 Mon Sep 17 00:00:00 2001 From: Zhuofu Deng Date: Tue, 8 Feb 2022 17:29:06 -0800 Subject: [PATCH] =?UTF-8?q?Updated=20AfdEndpoint=20and=20CheckNameAvailabi?= =?UTF-8?q?lity=20API=20with=20additional=20pro=E2=80=A6=20(#17518)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updated AfdEndpoint and CheckNameAvailability API with additional property AutoGeneratedDomainNameLabelScope Update afdx.json * Added AutoGeneratedDomainNameLabelScope property into CheckNameAvailabilityInput instead of checkHostNameAvailabilityInput * Update cdn.json Updated the property name and its description. * Update d property name in examples. * Fix the reference error and a typo * Fix the reference error in CDN API * test * Updated property name to camelCase style * Updated the property name to camel case style. * Added new checkNameAvailability API for afdx * Updated the parameter references in new API * Added input and output type separate from CDN one for new checkNameAvailability API * Updated the input and out reference path for new API * Added AfdResourceType for new API * Updated the definition name of input and output for new API * Updated input name in example. * Include the required property type in the example. * Rename the new API to CheckEndpointNameAvailability --- custom-words.txt | 1 + .../Microsoft.Cdn/stable/2021-06-01/afdx.json | 114 ++++++++++++++++++ .../examples/AFDEndpoints_Create.json | 12 +- .../2021-06-01/examples/AFDEndpoints_Get.json | 3 +- .../examples/AFDEndpoints_ListByProfile.json | 3 +- .../CheckEndpointNameAvailability.json | 22 ++++ 6 files changed, 149 insertions(+), 6 deletions(-) create mode 100644 specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CheckEndpointNameAvailability.json diff --git a/custom-words.txt b/custom-words.txt index cb018c3bb277..c363d7aa6654 100644 --- a/custom-words.txt +++ b/custom-words.txt @@ -43,6 +43,7 @@ ADSIs ADTO adultscore afd +afdx affinitized AFRINIC agentpool diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/afdx.json b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/afdx.json index 92e5b0e0643d..c0ddfef75a78 100644 --- a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/afdx.json +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/afdx.json @@ -34,6 +34,54 @@ } }, "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/checkEndpointNameAvailability": { + "post": { + "tags": [ + "CheckEndpointNameAvailability" + ], + "description": "Check the availability of a resource name. This is needed for resources where name is globally unique, such as a afdx endpoint.", + "operationId": "CheckEndpointNameAvailability", + "x-ms-examples": { + "CheckEndpointNameAvailability": { + "$ref": "./examples/CheckEndpointNameAvailability.json" + } + }, + "parameters": [ + { + "name": "checkEndpointNameAvailabilityInput", + "in": "body", + "description": "Input to check.", + "required": true, + "schema": { + "$ref": "#/definitions/CheckEndpointNameAvailabilityInput" + } + }, + { + "$ref": "#/parameters/subscriptionIdParameter" + }, + { + "$ref": "#/parameters/resourceGroupNameParameter" + }, + { + "$ref": "#/parameters/apiVersionParameter" + } + ], + "responses": { + "200": { + "description": "OK. The request has succeeded.", + "schema": { + "$ref": "#/definitions/CheckEndpointNameAvailabilityOutput" + } + }, + "default": { + "description": "CDN error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/AfdErrorResponse" + } + } + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/usages": { "post": { "tags": [ @@ -4348,6 +4396,20 @@ } } }, + "AutoGeneratedDomainNameLabelScope": { + "description": "Indicates the endpoint name reuse scope. The default value is TenantReuse.", + "enum": [ + "TenantReuse", + "SubscriptionReuse", + "ResourceGroupReuse", + "NoReuse" + ], + "type": "string", + "x-ms-enum": { + "name": "AutoGeneratedDomainNameLabelScope", + "modelAsString": true + } + }, "AFDEndpoint": { "description": "CDN endpoint is the entity within a CDN profile containing configuration information such as origin, protocol, content caching and delivery behavior. The AzureFrontDoor endpoint uses the URL format .azureedge.net.", "type": "object", @@ -4378,6 +4440,10 @@ "description": "The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net", "type": "string", "readOnly": true + }, + "autoGeneratedDomainNameLabelScope": { + "description": "Indicates the endpoint name reuse scope. The default value is TenantReuse.", + "$ref": "#/definitions/AutoGeneratedDomainNameLabelScope" } } }, @@ -5289,6 +5355,54 @@ } } }, + "CheckEndpointNameAvailabilityInput": { + "description": "Input of CheckNameAvailability API.", + "type": "object", + "required": [ + "name", + "type" + ], + "properties": { + "name": { + "description": "The resource name to validate.", + "type": "string" + }, + "type": { + "description": "The type of the resource whose name is to be validated.", + "$ref": "./cdn.json#/definitions/ResourceType" + }, + "autoGeneratedDomainNameLabelScope": { + "description": "Indicates the endpoint name reuse scope. The default value is TenantReuse.", + "$ref": "#/definitions/AutoGeneratedDomainNameLabelScope" + } + } + }, + "CheckEndpointNameAvailabilityOutput": { + "description": "Output of check name availability API.", + "type": "object", + "properties": { + "nameAvailable": { + "description": "Indicates whether the name is available.", + "readOnly": true, + "type": "boolean" + }, + "availableHostname": { + "description": "Returns the available hostname generated based on the AutoGeneratedDomainNameLabelScope when the name is available, otherwise it returns empty string", + "readOnly": true, + "type": "string" + }, + "reason": { + "description": "The reason why the name is not available.", + "readOnly": true, + "type": "string" + }, + "message": { + "description": "The detailed error message describing why the name is not available.", + "readOnly": true, + "type": "string" + } + } + }, "CheckHostNameAvailabilityInput": { "description": "Input of CheckHostNameAvailability API.", "type": "object", diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Create.json b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Create.json index 90752bc39076..762f8feee71f 100644 --- a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Create.json +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Create.json @@ -9,7 +9,8 @@ "tags": {}, "location": "CentralUs", "properties": { - "enabledState": "Enabled" + "enabledState": "Enabled", + "autoGeneratedDomainNameLabelScope": "TenantReuse" } } }, @@ -25,7 +26,8 @@ "hostName": "endpoint1.azureedge.net", "enabledState": "Enabled", "provisioningState": "Succeeded", - "deploymentStatus": "NotStarted" + "deploymentStatus": "NotStarted", + "autoGeneratedDomainNameLabelScope": "TenantReuse" } } }, @@ -40,7 +42,8 @@ "hostName": "endpoint1.azureedge.net", "enabledState": "Enabled", "provisioningState": "Creating", - "deploymentStatus": "NotStarted" + "deploymentStatus": "NotStarted", + "autoGeneratedDomainNameLabelScope": "TenantReuse" } } }, @@ -55,7 +58,8 @@ "hostName": "endpoint1.azureedge.net", "enabledState": "Enabled", "provisioningState": "Creating", - "deploymentStatus": "NotStarted" + "deploymentStatus": "NotStarted", + "autoGeneratedDomainNameLabelScope": "TenantReuse" } } } diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Get.json b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Get.json index 41ca4afad024..4baf2d289149 100644 --- a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Get.json +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_Get.json @@ -18,7 +18,8 @@ "hostName": "endpoint1.azureedge.net", "enabledState": "Enabled", "provisioningState": "Succeeded", - "deploymentStatus": "Succeeded" + "deploymentStatus": "Succeeded", + "autoGeneratedDomainNameLabelScope": "TenantReuse" } } } diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_ListByProfile.json b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_ListByProfile.json index 3237c166b64e..499a8a189e5d 100644 --- a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_ListByProfile.json +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/AFDEndpoints_ListByProfile.json @@ -19,7 +19,8 @@ "hostName": "endpoint1.azureedge.net", "enabledState": "Enabled", "provisioningState": "Succeeded", - "deploymentStatus": "Succeeded" + "deploymentStatus": "Succeeded", + "autoGeneratedDomainNameLabelScope": "TenantReuse" } } ] diff --git a/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CheckEndpointNameAvailability.json b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CheckEndpointNameAvailability.json new file mode 100644 index 000000000000..da354d8043b7 --- /dev/null +++ b/specification/cdn/resource-manager/Microsoft.Cdn/stable/2021-06-01/examples/CheckEndpointNameAvailability.json @@ -0,0 +1,22 @@ +{ + "parameters": { + "api-version": "2021-06-01", + "subscriptionId": "subid", + "resourceGroupName": "myResourceGroup", + "checkEndpointNameAvailabilityInput": { + "name": "sampleName", + "type": "Microsoft.Cdn/Profiles/AfdEndpoints", + "autoGeneratedDomainNameLabelScope": "TenantReuse" + } + }, + "responses": { + "200": { + "body": { + "nameAvailable": false, + "reason": "Name is already in use", + "message": "Name not available", + "availableHostname": "" + } + } + } +}