Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CheckNameAvailability operation to 2017-05-01 Swagger (management plane) for Azure Batch #1432

Merged
merged 2 commits into from
Jul 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,54 @@
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Batch/locations/{locationName}/checkNameAvailability": {
"post": {
"operationId": "Location_CheckNameAvailability",
"description": "Checks whether the Batch account name is available in the specified region.",
"x-ms-examples": {
"LocationCheckNameAvailability_Available": { "$ref": "./examples/LocationCheckNameAvailability_Available.json" },
"LocationCheckNameAvailability_AlreadyExists": { "$ref": "./examples/LocationCheckNameAvailability_AlreadyExists.json" }
},
"parameters": [
{
"name": "locationName",
"in": "path",
"required": true,
"type": "string",
"description": "The desired region for the name check."
},
{
"$ref": "#/parameters/ApiVersionParameter"
},
{
"$ref": "#/parameters/SubscriptionIdParameter"
},
{
"name": "parameters",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/CheckNameAvailabilityParameters"
},
"description": "Properties needed to check the availability of a name."
}
],
"responses": {
"200": {
"description": "Success. Returns details about whether a Batch account name is available.",
"schema": {
"$ref": "#/definitions/CheckNameAvailabilityResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -1496,6 +1544,56 @@
"title": "The URL to get the next set of operation list results if there are any."
}
}
},
"CheckNameAvailabilityParameters": {
"properties": {
"name": {
"type": "string",
"description": "The name to check for availability"
},
"type": {
"type": "string",
"enum": [ "Microsoft.Batch/batchAccounts" ],
"x-ms-enum": {
"name": "Type",
"modelAsString": false
},
"description": "The resource type. Must be set to Microsoft.Batch/batchAccounts"
}
},
"required": [
"name",
"type"
],
"description": "Parameters for a check name availability request."
},
"CheckNameAvailabilityResult": {
"properties": {
"nameAvailable": {
"readOnly": true,
"type": "boolean",
"description": "Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or invalid and cannot be used."
},
"reason": {
"readOnly": true,
"type": "string",
"enum": [
"Invalid",
"AlreadyExists"
],
"x-ms-enum": {
"name": "NameAvailabilityReason",
"modelAsString": false
},
"description": "Gets the reason that a Batch account name could not be used. The Reason element is only returned if NameAvailable is false."
},
"message": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readOnly: true here as well ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

"readOnly": true,
"type": "string",
"description": "Gets an error message explaining the Reason value in more detail."
}
},
"description": "The CheckNameAvailability operation response."
}
},
"parameters": {
Expand Down Expand Up @@ -1534,4 +1632,4 @@
"x-ms-parameter-location": "method"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
},
"responses": {
"200": {},
"202": {}
"202": {},
"204": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"api-version": "2017-05-01",
"subscriptionId": "subid",
"locationName": "japaneast",
"parameters": {
"name": "existingaccountname",
"type": "Microsoft.Batch/batchAccounts"
}
},
"responses": {
"200": {
"body": {
"nameAvailable": false,
"reason": "AlreadyExists",
"message": "An account named 'existingaccountname' is already in use."
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"parameters": {
"api-version": "2017-05-01",
"subscriptionId": "subid",
"locationName": "japaneast",
"parameters": {
"name": "newaccountname",
"type": "Microsoft.Batch/batchAccounts"
}
},
"responses": {
"200": {
"body": {
"nameAvailable": true
}
}
}
}