Skip to content

Commit

Permalink
Swagger Coverage/Completeness- for operation CheckNameAvailability (#…
Browse files Browse the repository at this point in the history
…3663)

* Update service.json

* CheckNameAvailability

* FIxed Parameter name

fixed couple of parameters name
  • Loading branch information
vivekkothakota authored and jhendrixMSFT committed Aug 17, 2018
1 parent c9d1315 commit 5ba2af3
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"api-version": "2018-02-02",
"subscriptionId": "subid",
"locationName": "eastus",
"parameters": {
"name": "existingprojectname",
"type": "Microsoft.Migrate/projects"
}
},
"responses": {
"200": {
"body": {
"nameAvailable": false,
"reason": "AlreadyExists",
"message": "The Migration project name 'existingprojectname' already exists for the given subscription. Please choose another name."
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"parameters": {
"api-version": "2018-02-02",
"subscriptionId": "subid",
"locationName": "eastus",
"parameters": {
"name": "newprojectname",
"type": "Microsoft.Migrate/projects"
}
},
"responses": {
"200": {
"body": {
"nameAvailable": true,
"reason": "Available",
"message": "The Migration project name 'newprojectname' is available for the given subscription"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1767,9 +1767,108 @@
}
},
"description": "An error response from the Azure Migrate service."
},
"CheckNameAvailabilityParameters": {
"properties": {
"name": {
"type": "string",
"description": "The name to check for availability"
},
"type": {
"type": "string",
"enum": [ "Microsoft.Migrate/projects" ],
"x-ms-enum": {
"name": "Type",
"modelAsString": false
},
"description": "The resource type. Must be set to Microsoft.Migrate/projects"
}
},
"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": [
"Available",
"Invalid",
"AlreadyExists"
],
"x-ms-enum": {
"name": "NameAvailabilityReason",
"modelAsString": false
},
"description": "Gets the reason that a project 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."
}
},
"paths": {
"/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/checkNameAvailability": {
"post": {
"operationId": "Location_CheckNameAvailability",
"description": "Checks whether the project 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/api-version"
},
{
"$ref": "#/parameters/subscriptionId"
},
{
"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 project name is available.",
"schema": {
"$ref": "#/definitions/CheckNameAvailabilityResult"
}
},
"default": {
"description": "Error response describing why the operation failed.",
"schema": {
"$ref": "#/definitions/CloudError"
}
}
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/locations/{locationName}/assessmentOptions": {
"get": {
"summary": "Get the assessment options.",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"swagger": "2.0",
"info": {
"version": "2018-01-10",
Expand Down Expand Up @@ -14994,4 +14994,4 @@
]
}
]
}
}

0 comments on commit 5ba2af3

Please sign in to comment.