Skip to content

Commit

Permalink
[arm-batch] Add CheckNameAvailability operation to 2017-05-01 Swagger…
Browse files Browse the repository at this point in the history
… (management plane) for Azure Batch (Azure#1432)

* Add Azure Batch Resource Manager CheckNameAvailability operation

* Adding 204 response to BatchAccountDelete example
  • Loading branch information
kiwidev authored and vishrutshah committed Jul 20, 2017
1 parent 8da6f40 commit 1183158
Show file tree
Hide file tree
Showing 4 changed files with 139 additions and 2 deletions.
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": {
"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
}
}
}
}

0 comments on commit 1183158

Please sign in to comment.