Skip to content

Commit bd96069

Browse files
xunsun-commitsFredericHeem
authored andcommitted
Fix S360 items for FSPG swagger (Azure#18870)
* Changed FSPG RestartParameter.failoverMode from string to enum for API 2021-06-01, 2021-06-01-preview, and 2021-06-15-privatepreview * Change enum first letter to lower case * Change to upper case * Fix S360 bugs for swagger FSPG 2020-02-14-preview, 2021-06-01-preview and 2021-06-01 APIs * Fix S360 item by adding default value to backupRetentionDays and maintenanceWindow * Fix s360 bugs * Undo supportedIops change, will change in RP side * Fix NameAvailability and ConfigurationProperties s360 bugs * Fix s360 bug for CloudError * Undo CloudError fix * Fix string default value * Remove server.tags because TrackedResource already has tags * Add missing properties for VirtualNetworkSubnetUsageResult * Add supportedHAMode for CapabilityProperties * Add supportedHAMode into example * Copy Databases.json from 2021-06-01 to 2021-06-01-preview * Change Databases.json to version 2021-06-01-preview
1 parent d54b441 commit bd96069

File tree

9 files changed

+463
-1
lines changed

9 files changed

+463
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,316 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "PostgreSQLServerManagementClient",
5+
"description": "The Microsoft Azure management API provides create, read, update, and delete functionality for Azure PostgreSQL resources including servers, databases, firewall rules, VNET rules, security alert policies, log files and configurations with new business model.",
6+
"version": "2021-06-01-preview"
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"security": [
19+
{
20+
"azure_auth": [
21+
"user_impersonation"
22+
]
23+
}
24+
],
25+
"securityDefinitions": {
26+
"azure_auth": {
27+
"type": "oauth2",
28+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
29+
"flow": "implicit",
30+
"description": "Azure Active Directory OAuth2 Flow",
31+
"scopes": {
32+
"user_impersonation": "impersonate your user account"
33+
}
34+
}
35+
},
36+
"paths": {
37+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases/{databaseName}": {
38+
"put": {
39+
"tags": [
40+
"Databases"
41+
],
42+
"operationId": "Databases_Create",
43+
"x-ms-examples": {
44+
"Create a database": {
45+
"$ref": "./examples/DatabaseCreate.json"
46+
}
47+
},
48+
"description": "Creates a new database or updates an existing database.",
49+
"parameters": [
50+
{
51+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
52+
},
53+
{
54+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
55+
},
56+
{
57+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
58+
},
59+
{
60+
"$ref": "#/parameters/ServerNameParameter"
61+
},
62+
{
63+
"$ref": "#/parameters/DatabaseNameParameter"
64+
},
65+
{
66+
"name": "parameters",
67+
"in": "body",
68+
"required": true,
69+
"schema": {
70+
"$ref": "#/definitions/Database"
71+
},
72+
"description": "The required parameters for creating or updating a database."
73+
}
74+
],
75+
"responses": {
76+
"200": {
77+
"description": "OK",
78+
"schema": {
79+
"$ref": "#/definitions/Database"
80+
}
81+
},
82+
"201": {
83+
"description": "Created",
84+
"schema": {
85+
"$ref": "#/definitions/Database"
86+
}
87+
},
88+
"202": {
89+
"description": "Accepted"
90+
},
91+
"default": {
92+
"description": "Error response describing why the operation failed.",
93+
"schema": {
94+
"$ref": "#/definitions/CloudError"
95+
}
96+
}
97+
},
98+
"x-ms-long-running-operation": true
99+
},
100+
"delete": {
101+
"tags": [
102+
"Databases"
103+
],
104+
"operationId": "Databases_Delete",
105+
"x-ms-examples": {
106+
"Delete a database": {
107+
"$ref": "./examples/DatabaseDelete.json"
108+
}
109+
},
110+
"description": "Deletes a database.",
111+
"parameters": [
112+
{
113+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
114+
},
115+
{
116+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
117+
},
118+
{
119+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
120+
},
121+
{
122+
"$ref": "#/parameters/ServerNameParameter"
123+
},
124+
{
125+
"$ref": "#/parameters/DatabaseNameParameter"
126+
}
127+
],
128+
"responses": {
129+
"200": {
130+
"description": "OK"
131+
},
132+
"202": {
133+
"description": "Accepted"
134+
},
135+
"204": {
136+
"description": "NoContent"
137+
},
138+
"default": {
139+
"description": "Error response describing why the operation failed.",
140+
"schema": {
141+
"$ref": "#/definitions/CloudError"
142+
}
143+
}
144+
},
145+
"x-ms-long-running-operation": true
146+
},
147+
"get": {
148+
"tags": [
149+
"Databases"
150+
],
151+
"operationId": "Databases_Get",
152+
"x-ms-examples": {
153+
"Get a database": {
154+
"$ref": "./examples/DatabaseGet.json"
155+
}
156+
},
157+
"description": "Gets information about a database.",
158+
"parameters": [
159+
{
160+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
161+
},
162+
{
163+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
164+
},
165+
{
166+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
167+
},
168+
{
169+
"$ref": "#/parameters/ServerNameParameter"
170+
},
171+
{
172+
"$ref": "#/parameters/DatabaseNameParameter"
173+
}
174+
],
175+
"responses": {
176+
"200": {
177+
"description": "OK",
178+
"schema": {
179+
"$ref": "#/definitions/Database"
180+
}
181+
},
182+
"default": {
183+
"description": "Error response describing why the operation failed.",
184+
"schema": {
185+
"$ref": "#/definitions/CloudError"
186+
}
187+
}
188+
}
189+
}
190+
},
191+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforPostgreSQL/flexibleServers/{serverName}/databases": {
192+
"get": {
193+
"tags": [
194+
"Databases"
195+
],
196+
"operationId": "Databases_ListByServer",
197+
"x-ms-examples": {
198+
"List databases in a server": {
199+
"$ref": "./examples/DatabasesListByServer.json"
200+
}
201+
},
202+
"description": "List all the databases in a given server.",
203+
"parameters": [
204+
{
205+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ApiVersionParameter"
206+
},
207+
{
208+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/SubscriptionIdParameter"
209+
},
210+
{
211+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/parameters/ResourceGroupNameParameter"
212+
},
213+
{
214+
"$ref": "#/parameters/ServerNameParameter"
215+
}
216+
],
217+
"responses": {
218+
"200": {
219+
"description": "OK",
220+
"schema": {
221+
"$ref": "#/definitions/DatabaseListResult"
222+
}
223+
},
224+
"default": {
225+
"description": "Error response describing why the operation failed.",
226+
"schema": {
227+
"$ref": "#/definitions/CloudError"
228+
}
229+
}
230+
},
231+
"x-ms-pageable": {
232+
"nextLinkName": "nextLink"
233+
}
234+
}
235+
}
236+
},
237+
"definitions": {
238+
"DatabaseProperties": {
239+
"properties": {
240+
"charset": {
241+
"type": "string",
242+
"description": "The charset of the database."
243+
},
244+
"collation": {
245+
"type": "string",
246+
"description": "The collation of the database."
247+
}
248+
},
249+
"description": "The properties of a database."
250+
},
251+
"Database": {
252+
"properties": {
253+
"properties": {
254+
"$ref": "#/definitions/DatabaseProperties",
255+
"x-ms-client-flatten": true,
256+
"description": "The properties of a database."
257+
},
258+
"systemData": {
259+
"$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData",
260+
"readOnly": true,
261+
"description": "The system metadata relating to this resource."
262+
}
263+
},
264+
"allOf": [
265+
{
266+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ProxyResource"
267+
}
268+
],
269+
"description": "Represents a Database."
270+
},
271+
"DatabaseListResult": {
272+
"type": "object",
273+
"properties": {
274+
"value": {
275+
"type": "array",
276+
"items": {
277+
"$ref": "#/definitions/Database"
278+
},
279+
"description": "The list of databases housed in a server"
280+
},
281+
"nextLink": {
282+
"description": "The link used to get the next page of databases.",
283+
"type": "string"
284+
}
285+
},
286+
"description": "A List of databases."
287+
},
288+
"CloudError": {
289+
"x-ms-external": true,
290+
"properties": {
291+
"error": {
292+
"$ref": "../../../../../common-types/resource-management/v1/types.json#/definitions/ErrorResponse"
293+
}
294+
},
295+
"description": "An error response from the Batch service."
296+
}
297+
},
298+
"parameters": {
299+
"ServerNameParameter": {
300+
"name": "serverName",
301+
"in": "path",
302+
"description": "The name of the server.",
303+
"required": true,
304+
"type": "string",
305+
"x-ms-parameter-location": "method"
306+
},
307+
"DatabaseNameParameter": {
308+
"name": "databaseName",
309+
"in": "path",
310+
"required": true,
311+
"type": "string",
312+
"description": "The name of the database.",
313+
"x-ms-parameter-location": "method"
314+
}
315+
}
316+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"parameters": {
3+
"databaseName": "db1",
4+
"serverName": "testserver",
5+
"resourceGroupName": "TestGroup",
6+
"api-version": "2021-06-01-preview",
7+
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff",
8+
"parameters": {
9+
"properties": {
10+
"charset": "utf8",
11+
"collation": "en_US.utf8"
12+
}
13+
}
14+
},
15+
"responses": {
16+
"201": {
17+
"body": {
18+
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1",
19+
"name": "db1",
20+
"type": "Microsoft.DBforPostgreSQL/flexibleServers/databases",
21+
"properties": {
22+
"charset": "utf8",
23+
"collation": "en_US.utf8"
24+
}
25+
}
26+
},
27+
"200": {
28+
"body": {
29+
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1",
30+
"name": "db1",
31+
"type": "Microsoft.DBforPostgreSQL/flexibleServers/databases",
32+
"properties": {
33+
"charset": "utf8",
34+
"collation": "en_US.utf8"
35+
}
36+
}
37+
},
38+
"202": {}
39+
}
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"parameters": {
3+
"databaseName": "db1",
4+
"serverName": "testserver",
5+
"resourceGroupName": "TestGroup",
6+
"api-version": "2021-06-01-preview",
7+
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
8+
},
9+
"responses": {
10+
"200": {},
11+
"202": {},
12+
"204": {}
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"parameters": {
3+
"databaseName": "db1",
4+
"serverName": "testserver",
5+
"resourceGroupName": "TestGroup",
6+
"api-version": "2021-06-01-preview",
7+
"subscriptionId": "ffffffff-ffff-ffff-ffff-ffffffffffff"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"id": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/TestGroup/providers/Microsoft.DBforPostgreSQL/flexibleServers/testserver/databases/db1",
13+
"name": "db1",
14+
"type": "Microsoft.DBforPostgreSQL/flexibleServers/databases",
15+
"properties": {
16+
"charset": "utf8",
17+
"collation": "en_US.utf8"
18+
}
19+
}
20+
}
21+
}
22+
}

0 commit comments

Comments
 (0)