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

Swagger Coverage/Completeness- for operation CheckNameAvailability #3663

Merged
merged 5 commits into from
Aug 17, 2018
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
@@ -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 @@
]
}
]
}
}