Skip to content

Commit

Permalink
Add common types for CheckNameAvailability, OperationStatus and Locat…
Browse files Browse the repository at this point in the history
…ion (#12934)

* add operation param and response

* add operations field

* Add location param and CheckNameAvailability request and result
  • Loading branch information
aviaoh committed Mar 1, 2021
1 parent 8e222a3 commit 3b161e6
Showing 1 changed file with 106 additions and 0 deletions.
106 changes: 106 additions & 0 deletions specification/common-types/resource-management/v2/types.json
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,54 @@
}
}
},
"OperationStatusResult": {
"description": "The current status of an async operation.",
"type": "object",
"required": [
"status"
],
"properties": {
"id": {
"description": "Fully qualified ID for the async operation.",
"type": "string"
},
"name": {
"description": "Name of the async operation.",
"type": "string"
},
"status": {
"description": "Operation status.",
"type": "string"
},
"percentComplete": {
"description": "Percent of the operation that is complete.",
"type": "number",
"minimum": 0,
"maximum": 100
},
"startTime": {
"description": "The start time of the operation.",
"type": "string",
"format": "date-time"
},
"endTime": {
"description": "The end time of the operation.",
"type": "string",
"format": "date-time"
},
"operations": {
"description": "The operations list.",
"type": "array",
"items": {
"$ref": "#/definitions/OperationStatusResult"
}
},
"error": {
"description": "If present, details of the operation error.",
"$ref": "#/definitions/ErrorDetail"
}
}
},
"locationData": {
"description": "Metadata pertaining to the geographic location of the resource.",
"type": "object",
Expand Down Expand Up @@ -529,6 +577,46 @@
"type": "string"
}
}
},
"CheckNameAvailabilityRequest": {
"description": "The check availability request body.",
"type": "object",
"properties": {
"name": {
"description": "The name of the resource for which availability needs to be checked.",
"type": "string"
},
"type": {
"description": "The resource type.",
"type": "string"
}
}
},
"CheckNameAvailabilityResponse": {
"description": "The check availability result.",
"type": "object",
"properties": {
"nameAvailable": {
"description": "Indicates if the resource name is available.",
"type": "boolean"
},
"reason": {
"description": "The reason why the given name is not available.",
"type": "string",
"enum": [
"Invalid",
"AlreadyExists"
],
"x-ms-enum": {
"name": "CheckNameAvailabilityReason",
"modelAsString": true
}
},
"message": {
"description": "Detailed reason why the given name is available.",
"type": "string"
}
}
}
},
"parameters": {
Expand Down Expand Up @@ -558,6 +646,24 @@
"minLength": 1,
"maxLength": 90,
"x-ms-parameter-location": "method"
},
"OperationIdParameter": {
"name": "operationId",
"in": "path",
"required": true,
"type": "string",
"description": "The ID of an ongoing async operation.",
"minLength": 1,
"x-ms-parameter-location": "method"
},
"LocationParameter": {
"name": "location",
"in": "path",
"required": true,
"type": "string",
"description": "The name of Azure region.",
"minLength": 1,
"x-ms-parameter-location": "method"
}
}
}

0 comments on commit 3b161e6

Please sign in to comment.