Skip to content

Commit f8eb88e

Browse files
authored
Merge pull request #12 from MehaKaushik/master
list operation+default error response+integer format
2 parents b9851f1 + 706ca85 commit f8eb88e

2 files changed

Lines changed: 116 additions & 2 deletions

File tree

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"parameters": {
3+
"accountName": "ddb1",
4+
"resourceGroupName": "rg1",
5+
"api-version": "2021-04-01-preview",
6+
"subscriptionId": "subid"
7+
},
8+
"responses": {
9+
"200": {
10+
"body": {
11+
"value": [
12+
{
13+
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1/services",
14+
"name": "SqlDedicatedGateway",
15+
"type": "Microsoft.DocumentDB/databaseAccounts/services",
16+
"properties": {
17+
"status": "Running",
18+
"creationTime": "2021-01-25T12:56:05.4622517Z",
19+
"instanceSize": "Cosmos.D4s",
20+
"instanceCount": 1,
21+
"serviceType": "SqlDedicatedGateway",
22+
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway.sqlx.cosmos.windows-int.net/",
23+
"locations": [
24+
{
25+
"name": "SqlDedicatedGateway-westus2",
26+
"location": "West US 2",
27+
"status": "Running",
28+
"SqlDedicatedGatewayEndpoint": "https://sqlDedicatedGateway-westus.sqlx.cosmos.windows-int.net/"
29+
}
30+
]
31+
}
32+
}
33+
]
34+
}
35+
}
36+
}
37+
}

specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2021-04-01-preview/services.json

Lines changed: 79 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,48 @@
3434
}
3535
},
3636
"paths": {
37+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services": {
38+
"get": {
39+
"x-ms-examples": {
40+
"CosmosDBServicesList": {
41+
"$ref": "./examples/CosmosDBServicesList.json"
42+
}
43+
},
44+
"operationId": "Service_List",
45+
"description": "Gets the status of service.",
46+
"parameters": [
47+
{
48+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
49+
},
50+
{
51+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
52+
},
53+
{
54+
"$ref": "#/parameters/accountNameParameter"
55+
},
56+
{
57+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
58+
}
59+
],
60+
"responses": {
61+
"200": {
62+
"description": "The ServiceResource.",
63+
"schema": {
64+
"$ref": "#/definitions/ServiceResourceListResult"
65+
}
66+
},
67+
"default": {
68+
"description": "Error response describing why the operation failed.",
69+
"schema": {
70+
"$ref": ".../../cosmos-db.json#/definitions/CloudError"
71+
}
72+
}
73+
},
74+
"x-ms-pageable": {
75+
"nextLinkName": null
76+
}
77+
}
78+
},
3779
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}": {
3880
"put": {
3981
"tags": [
@@ -86,6 +128,12 @@
86128
},
87129
"202": {
88130
"description": "The job will complete asynchronously."
131+
},
132+
"default": {
133+
"description": "Error response describing why the operation failed.",
134+
"schema": {
135+
"$ref": ".../../cosmos-db.json#/definitions/CloudError"
136+
}
89137
}
90138
}
91139
},
@@ -127,6 +175,12 @@
127175
"schema": {
128176
"$ref": "#/definitions/ServiceResource"
129177
}
178+
},
179+
"default": {
180+
"description": "Error response describing why the operation failed.",
181+
"schema": {
182+
"$ref": ".../../cosmos-db.json#/definitions/CloudError"
183+
}
130184
}
131185
}
132186
},
@@ -172,6 +226,12 @@
172226
},
173227
"200": {
174228
"description": "The response for service deletion."
229+
},
230+
"default": {
231+
"description": "Error response describing why the operation failed.",
232+
"schema": {
233+
"$ref": ".../../cosmos-db.json#/definitions/CloudError"
234+
}
175235
}
176236
}
177237
}
@@ -203,7 +263,9 @@
203263
},
204264
"instanceCount": {
205265
"description": "Instance count for the service.",
206-
"type": "integer"
266+
"type": "integer",
267+
"minimum": 1,
268+
"format": "int32"
207269
},
208270
"serviceType": {
209271
"$ref": "#/definitions/ServiceType"
@@ -230,7 +292,9 @@
230292
},
231293
"instanceCount": {
232294
"description": "Instance count for the service.",
233-
"type": "integer"
295+
"type": "integer",
296+
"minimum": 0,
297+
"format": "int32"
234298
},
235299
"serviceType": {
236300
"$ref": "#/definitions/ServiceType"
@@ -262,6 +326,19 @@
262326
}
263327
}
264328
},
329+
"ServiceResourceListResult": {
330+
"properties": {
331+
"value": {
332+
"readOnly": true,
333+
"type": "array",
334+
"items": {
335+
"$ref": "#/definitions/ServiceResource"
336+
},
337+
"description": "List of SQL databases and their properties."
338+
}
339+
},
340+
"description": "The List operation response, that contains the SQL databases and their properties."
341+
},
265342
"DataTransferServiceResource": {
266343
"description": "Describes the service response property.",
267344
"type": "object",

0 commit comments

Comments
 (0)