diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/examples/CosmosDBServicesList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/examples/CosmosDBServicesList.json new file mode 100644 index 000000000000..b7935d2299e4 --- /dev/null +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/examples/CosmosDBServicesList.json @@ -0,0 +1,37 @@ +{ + "parameters": { + "accountName": "ddb1", + "resourceGroupName": "rg1", + "api-version": "2021-04-01-preview", + "subscriptionId": "subid" + }, + "responses": { + "200": { + "body": { + "value": [ + { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services", + "name": "SqlDedicatedGateway", + "type": "Microsoft.DocumentDB/databaseAccounts/services", + "properties": { + "status": "Running", + "creationTime": "2021-01-25T12:56:05.4622517Z", + "instanceSize": "Cosmos.D4s", + "instanceCount": 1, + "serviceType": "SqlDedicatedGateway", + "SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/", + "locations": [ + { + "name": "SqlDedicatedGateway-westus2", + "location": "West US 2", + "status": "Running", + "SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/" + } + ] + } + } + ] + } + } + } +} diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/services.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/services.json index bbb62eea26ad..26e483f03cb1 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/services.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/services.json @@ -34,6 +34,48 @@ } }, "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services": { + "get": { + "x-ms-examples": { + "CosmosDBServicesList": { + "$ref": "./examples/CosmosDBServicesList.json" + } + }, + "operationId": "Service_List", + "description": "Gets the status of service.", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/accountNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "The ServiceResource.", + "schema": { + "$ref": "#/definitions/ServiceResourceListResult" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": ".../../cosmos-db.json#/definitions/CloudError" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}": { "put": { "tags": [ @@ -86,6 +128,12 @@ }, "202": { "description": "The job will complete asynchronously." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": ".../../cosmos-db.json#/definitions/CloudError" + } } } }, @@ -127,6 +175,12 @@ "schema": { "$ref": "#/definitions/ServiceResource" } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": ".../../cosmos-db.json#/definitions/CloudError" + } } } }, @@ -172,6 +226,12 @@ }, "200": { "description": "The response for service deletion." + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": ".../../cosmos-db.json#/definitions/CloudError" + } } } } @@ -203,7 +263,9 @@ }, "instanceCount": { "description": "Instance count for the service.", - "type": "integer" + "type": "integer", + "minimum": 1, + "format": "int32" }, "serviceType": { "$ref": "#/definitions/ServiceType" @@ -230,7 +292,9 @@ }, "instanceCount": { "description": "Instance count for the service.", - "type": "integer" + "type": "integer", + "minimum": 0, + "format": "int32" }, "serviceType": { "$ref": "#/definitions/ServiceType" @@ -262,6 +326,19 @@ } } }, + "ServiceResourceListResult": { + "properties": { + "value": { + "readOnly": true, + "type": "array", + "items": { + "$ref": "#/definitions/ServiceResource" + }, + "description": "List of SQL databases and their properties." + } + }, + "description": "The List operation response, that contains the SQL databases and their properties." + }, "DataTransferServiceResource": { "description": "Describes the service response property.", "type": "object",