Skip to content

Commit 9c9ccf7

Browse files
committed
add base for Microsoft.sql
1 parent 58aed99 commit 9c9ccf7

File tree

592 files changed

+68460
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

592 files changed

+68460
-0
lines changed
Lines changed: 345 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,345 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"version": "2021-02-01-preview",
5+
"title": "SqlManagementClient",
6+
"description": "The Azure SQL Database management API provides a RESTful set of web APIs that interact with Azure SQL Database services to manage your databases. The API enables users to create, retrieve, update, and delete databases, servers, and other entities."
7+
},
8+
"host": "management.azure.com",
9+
"schemes": [
10+
"https"
11+
],
12+
"consumes": [
13+
"application/json"
14+
],
15+
"produces": [
16+
"application/json"
17+
],
18+
"paths": {
19+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies/{policyName}": {
20+
"get": {
21+
"tags": [
22+
"BackupShortTermRetentionPolicies"
23+
],
24+
"description": "Gets a database's short term retention policy.",
25+
"operationId": "BackupShortTermRetentionPolicies_Get",
26+
"parameters": [
27+
{
28+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
29+
},
30+
{
31+
"$ref": "#/parameters/ServerNameParameter"
32+
},
33+
{
34+
"$ref": "#/parameters/DatabaseNameParameter"
35+
},
36+
{
37+
"name": "policyName",
38+
"in": "path",
39+
"description": "The policy name. Should always be \"default\".",
40+
"required": true,
41+
"type": "string",
42+
"enum": [
43+
"default"
44+
],
45+
"x-ms-enum": {
46+
"name": "ShortTermRetentionPolicyName",
47+
"modelAsString": true
48+
}
49+
},
50+
{
51+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
52+
},
53+
{
54+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
55+
}
56+
],
57+
"responses": {
58+
"200": {
59+
"description": "Successfully retrieved the policy.",
60+
"schema": {
61+
"$ref": "#/definitions/BackupShortTermRetentionPolicy"
62+
}
63+
},
64+
"default": {
65+
"description": "*** Error Responses: ***\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 ResourceNotFound - The requested resource was not found."
66+
}
67+
},
68+
"x-ms-examples": {
69+
"Get the short term retention policy for the database.": {
70+
"$ref": "./examples/GetShortTermRetentionPolicy.json"
71+
}
72+
}
73+
},
74+
"put": {
75+
"tags": [
76+
"BackupShortTermRetentionPolicies"
77+
],
78+
"description": "Updates a database's short term retention policy.",
79+
"operationId": "BackupShortTermRetentionPolicies_CreateOrUpdate",
80+
"parameters": [
81+
{
82+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
83+
},
84+
{
85+
"$ref": "#/parameters/ServerNameParameter"
86+
},
87+
{
88+
"$ref": "#/parameters/DatabaseNameParameter"
89+
},
90+
{
91+
"name": "policyName",
92+
"in": "path",
93+
"description": "The policy name. Should always be \"default\".",
94+
"required": true,
95+
"type": "string",
96+
"enum": [
97+
"default"
98+
],
99+
"x-ms-enum": {
100+
"name": "ShortTermRetentionPolicyName",
101+
"modelAsString": true
102+
}
103+
},
104+
{
105+
"name": "parameters",
106+
"in": "body",
107+
"description": "The short term retention policy info.",
108+
"required": true,
109+
"schema": {
110+
"$ref": "#/definitions/BackupShortTermRetentionPolicy"
111+
}
112+
},
113+
{
114+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
115+
},
116+
{
117+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
118+
}
119+
],
120+
"responses": {
121+
"200": {
122+
"description": "Successfully updated the policy.",
123+
"schema": {
124+
"$ref": "#/definitions/BackupShortTermRetentionPolicy"
125+
}
126+
},
127+
"default": {
128+
"description": "*** Error Responses: ***\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 InvalidBackupRetentionPeriod - The retention days of {0} is not a valid configuration. Valid backup retention in days must be between {1} and {2}\n\n * 400 InvalidDiffBackupIntervalHours - The differential backup interval hours of {0} is not a valid configuration. Valid differential backup interval must be {1} hours.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 409 ConflictingDatabaseOperation - There is already some operation on the database and the current operation should wait till it is done.\n\n * 409 ConflictingSystemOperationInProgress - A system maintenance operation is in progress on the database and further operations need to wait until it is completed.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout."
129+
},
130+
"202": {
131+
"description": "Accepted"
132+
}
133+
},
134+
"x-ms-long-running-operation": true,
135+
"x-ms-examples": {
136+
"Update the short term retention policy for the database.": {
137+
"$ref": "./examples/UpdateShortTermRetentionPolicy.json"
138+
}
139+
}
140+
},
141+
"patch": {
142+
"tags": [
143+
"BackupShortTermRetentionPolicies"
144+
],
145+
"description": "Updates a database's short term retention policy.",
146+
"operationId": "BackupShortTermRetentionPolicies_Update",
147+
"parameters": [
148+
{
149+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
150+
},
151+
{
152+
"$ref": "#/parameters/ServerNameParameter"
153+
},
154+
{
155+
"$ref": "#/parameters/DatabaseNameParameter"
156+
},
157+
{
158+
"name": "policyName",
159+
"in": "path",
160+
"description": "The policy name. Should always be \"default\".",
161+
"required": true,
162+
"type": "string",
163+
"enum": [
164+
"default"
165+
],
166+
"x-ms-enum": {
167+
"name": "ShortTermRetentionPolicyName",
168+
"modelAsString": true
169+
}
170+
},
171+
{
172+
"name": "parameters",
173+
"in": "body",
174+
"description": "The short term retention policy info.",
175+
"required": true,
176+
"schema": {
177+
"$ref": "#/definitions/BackupShortTermRetentionPolicy"
178+
}
179+
},
180+
{
181+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
182+
},
183+
{
184+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
185+
}
186+
],
187+
"responses": {
188+
"200": {
189+
"description": "Successfully updated the policy.",
190+
"schema": {
191+
"$ref": "#/definitions/BackupShortTermRetentionPolicy"
192+
}
193+
},
194+
"default": {
195+
"description": "*** Error Responses: ***\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 400 InvalidBackupRetentionPeriod - The retention days of {0} is not a valid configuration. Valid backup retention in days must be between {1} and {2}\n\n * 400 InvalidDiffBackupIntervalHours - The differential backup interval hours of {0} is not a valid configuration. Valid differential backup interval must be {1} hours.\n\n * 400 FeatureDisabledOnSelectedEdition - User attempted to use a feature which is disabled on current database edition.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 409 ConflictingDatabaseOperation - There is already some operation on the database and the current operation should wait till it is done.\n\n * 409 ConflictingSystemOperationInProgress - A system maintenance operation is in progress on the database and further operations need to wait until it is completed.\n\n * 429 SubscriptionTooManyCreateUpdateRequests - Requests beyond max requests that can be processed by available resources.\n\n * 429 SubscriptionTooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 503 TooManyRequests - Requests beyond max requests that can be processed by available resources.\n\n * 504 RequestTimeout - Service request exceeded the allowed timeout."
196+
},
197+
"202": {
198+
"description": "Accepted"
199+
}
200+
},
201+
"x-ms-long-running-operation": true,
202+
"x-ms-examples": {
203+
"Update the short term retention policy for the database.": {
204+
"$ref": "./examples/UpdateShortTermRetentionPolicy.json"
205+
}
206+
}
207+
}
208+
},
209+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupShortTermRetentionPolicies": {
210+
"get": {
211+
"tags": [
212+
"BackupShortTermRetentionPolicies"
213+
],
214+
"description": "Gets a database's short term retention policy.",
215+
"operationId": "BackupShortTermRetentionPolicies_ListByDatabase",
216+
"parameters": [
217+
{
218+
"$ref": "../../../common/v1/types.json#/parameters/ResourceGroupParameter"
219+
},
220+
{
221+
"$ref": "#/parameters/ServerNameParameter"
222+
},
223+
{
224+
"$ref": "#/parameters/DatabaseNameParameter"
225+
},
226+
{
227+
"$ref": "../../../common/v1/types.json#/parameters/SubscriptionIdParameter"
228+
},
229+
{
230+
"$ref": "../../../common/v1/types.json#/parameters/ApiVersionParameter"
231+
}
232+
],
233+
"responses": {
234+
"200": {
235+
"description": "Successfully retrieved the policy.",
236+
"schema": {
237+
"$ref": "#/definitions/BackupShortTermRetentionPolicyListResult"
238+
}
239+
},
240+
"default": {
241+
"description": "*** Error Responses: ***\n\n * 400 InvalidParameterValue - An invalid value was given to a parameter.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ServerNotInSubscriptionResourceGroup - Specified server does not exist in the specified resource group and subscription.\n\n * 404 ResourceNotFound - The requested resource was not found."
242+
}
243+
},
244+
"x-ms-pageable": {
245+
"nextLinkName": "nextLink"
246+
},
247+
"x-ms-examples": {
248+
"Get the short term retention policy for the database.": {
249+
"$ref": "./examples/ListShortTermRetentionPoliciesByDatabase.json"
250+
}
251+
}
252+
}
253+
}
254+
},
255+
"definitions": {
256+
"BackupShortTermRetentionPolicyProperties": {
257+
"description": "Properties of a short term retention policy",
258+
"type": "object",
259+
"properties": {
260+
"retentionDays": {
261+
"format": "int32",
262+
"description": "The backup retention period in days. This is how many days Point-in-Time Restore will be supported.",
263+
"type": "integer"
264+
},
265+
"diffBackupIntervalInHours": {
266+
"format": "int32",
267+
"description": "The differential backup interval in hours. This is how many interval hours between each differential backup will be supported. This is only applicable to live databases but not dropped databases.",
268+
"enum": [
269+
"12",
270+
"24"
271+
],
272+
"type": "integer",
273+
"x-ms-enum": {
274+
"name": "DiffBackupIntervalInHours",
275+
"modelAsString": true
276+
}
277+
}
278+
}
279+
},
280+
"BackupShortTermRetentionPolicy": {
281+
"description": "A short term retention policy.",
282+
"type": "object",
283+
"allOf": [
284+
{
285+
"$ref": "../../../common/v1/types.json#/definitions/ProxyResource"
286+
}
287+
],
288+
"properties": {
289+
"properties": {
290+
"$ref": "#/definitions/BackupShortTermRetentionPolicyProperties",
291+
"description": "Resource properties.",
292+
"x-ms-client-flatten": true
293+
}
294+
}
295+
},
296+
"BackupShortTermRetentionPolicyListResult": {
297+
"description": "A list of short term retention policies.",
298+
"type": "object",
299+
"properties": {
300+
"value": {
301+
"description": "Array of results.",
302+
"type": "array",
303+
"items": {
304+
"$ref": "#/definitions/BackupShortTermRetentionPolicy"
305+
},
306+
"readOnly": true
307+
},
308+
"nextLink": {
309+
"description": "Link to retrieve next page of results.",
310+
"type": "string",
311+
"readOnly": true
312+
}
313+
}
314+
}
315+
},
316+
"parameters": {
317+
"ServerNameParameter": {
318+
"name": "serverName",
319+
"in": "path",
320+
"description": "The name of the server.",
321+
"required": true,
322+
"type": "string",
323+
"x-ms-parameter-location": "method"
324+
},
325+
"DatabaseNameParameter": {
326+
"name": "databaseName",
327+
"in": "path",
328+
"description": "The name of the database.",
329+
"required": true,
330+
"type": "string",
331+
"x-ms-parameter-location": "method"
332+
}
333+
},
334+
"securityDefinitions": {
335+
"azure_auth": {
336+
"type": "oauth2",
337+
"description": "Azure Active Directory OAuth2 Flow",
338+
"flow": "implicit",
339+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
340+
"scopes": {
341+
"user_impersonation": "impersonate your user account"
342+
}
343+
}
344+
}
345+
}

0 commit comments

Comments
 (0)