Skip to content

Commit

Permalink
Updated AfdEndpoint and CheckNameAvailability API with additional pro… (
Browse files Browse the repository at this point in the history
Azure#17518)

* 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
  • Loading branch information
zhuofudeng authored and FredericHeem committed Mar 7, 2022
1 parent 5c3632c commit cbacb71
Show file tree
Hide file tree
Showing 6 changed files with 149 additions and 6 deletions.
1 change: 1 addition & 0 deletions custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ ADSIs
ADTO
adultscore
afd
afdx
affinitized
AFRINIC
agentpool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -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 <endpointname>.azureedge.net.",
"type": "object",
Expand Down Expand Up @@ -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"
}
}
},
Expand Down Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"tags": {},
"location": "CentralUs",
"properties": {
"enabledState": "Enabled"
"enabledState": "Enabled",
"autoGeneratedDomainNameLabelScope": "TenantReuse"
}
}
},
Expand All @@ -25,7 +26,8 @@
"hostName": "endpoint1.azureedge.net",
"enabledState": "Enabled",
"provisioningState": "Succeeded",
"deploymentStatus": "NotStarted"
"deploymentStatus": "NotStarted",
"autoGeneratedDomainNameLabelScope": "TenantReuse"
}
}
},
Expand All @@ -40,7 +42,8 @@
"hostName": "endpoint1.azureedge.net",
"enabledState": "Enabled",
"provisioningState": "Creating",
"deploymentStatus": "NotStarted"
"deploymentStatus": "NotStarted",
"autoGeneratedDomainNameLabelScope": "TenantReuse"
}
}
},
Expand All @@ -55,7 +58,8 @@
"hostName": "endpoint1.azureedge.net",
"enabledState": "Enabled",
"provisioningState": "Creating",
"deploymentStatus": "NotStarted"
"deploymentStatus": "NotStarted",
"autoGeneratedDomainNameLabelScope": "TenantReuse"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"hostName": "endpoint1.azureedge.net",
"enabledState": "Enabled",
"provisioningState": "Succeeded",
"deploymentStatus": "Succeeded"
"deploymentStatus": "Succeeded",
"autoGeneratedDomainNameLabelScope": "TenantReuse"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"hostName": "endpoint1.azureedge.net",
"enabledState": "Enabled",
"provisioningState": "Succeeded",
"deploymentStatus": "Succeeded"
"deploymentStatus": "Succeeded",
"autoGeneratedDomainNameLabelScope": "TenantReuse"
}
}
]
Expand Down
Original file line number Diff line number Diff line change
@@ -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": ""
}
}
}
}

0 comments on commit cbacb71

Please sign in to comment.