Skip to content

Commit b793671

Browse files
adealannatisch
authored andcommitted
Update BackupShortTermRetentionPolicies Swagger: Add ListByDatabase and update exceptions (#3207)
* Add BackupShortTermRetentionListResult and update exceptions * Use comnmon definition for ProxyResource * Add ListShortTermRetentionPoliciesByDatabase example
1 parent 3a5b541 commit b793671

File tree

2 files changed

+93
-3
lines changed

2 files changed

+93
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "00000000-1111-2222-3333-444444444444",
4+
"resourceGroupName": "Default-SQL-SouthEastAsia",
5+
"serverName": "testsvr",
6+
"databaseName": "testdb",
7+
"policyName": "default",
8+
"api-version": "2017-10-01-preview"
9+
},
10+
"responses": {
11+
"200": {
12+
"body": {
13+
"value": [
14+
{
15+
"id":"/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/testdb/backupShortTermRetentionPolicies/default",
16+
"name":"default",
17+
"type":"Microsoft.Sql/locations/servers/databases/backupShortTermRetentionPolicies",
18+
"properties": {
19+
"retentionDays":14
20+
}
21+
}
22+
]
23+
}
24+
}
25+
}
26+
}

specification/sql/resource-manager/Microsoft.Sql/preview/2017-10-01-preview/shortTermRetentionPolicies.json

Lines changed: 67 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
}
6363
},
6464
"default": {
65-
"description": "*** Error Responses: ***\n\n * 400 InvalidRestorableDroppedDatabaseDeletionDate - The restorable dropped database deletion date given is invalid\n\n * 400 InvalidRestorableDroppedDatabaseId - Invalid restorable dropped database identifier\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 ResourceNotFound - The requested resource was not found."
65+
"description": "*** Error Responses: ***\n\n * 400 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\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 ResourceNotFound - The requested resource was not found."
6666
}
6767
},
6868
"x-ms-examples": {
@@ -125,7 +125,7 @@
125125
}
126126
},
127127
"default": {
128-
"description": "*** Error Responses: ***\n\n * 400 InvalidRestorableDroppedDatabaseDeletionDate - The restorable dropped database deletion date given is invalid\n\n * 400 InvalidRestorableDroppedDatabaseId - Invalid restorable dropped database identifier\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 * 403 UpdateShortTermRetentionFeatureNotSupportedForEdition - This feature is not available for the selected database's edition {0}.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\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."
128+
"description": "*** Error Responses: ***\n\n * 400 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\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 UpdateShortTermRetentionFeatureNotSupportedForEdition - This feature is not available for the selected database's edition {0}.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\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."
129129
},
130130
"202": {
131131
"description": "Accepted"
@@ -192,7 +192,7 @@
192192
}
193193
},
194194
"default": {
195-
"description": "*** Error Responses: ***\n\n * 400 InvalidRestorableDroppedDatabaseDeletionDate - The restorable dropped database deletion date given is invalid\n\n * 400 InvalidRestorableDroppedDatabaseId - Invalid restorable dropped database identifier\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 * 403 UpdateShortTermRetentionFeatureNotSupportedForEdition - This feature is not available for the selected database's edition {0}.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\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."
195+
"description": "*** Error Responses: ***\n\n * 400 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\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 UpdateShortTermRetentionFeatureNotSupportedForEdition - This feature is not available for the selected database's edition {0}.\n\n * 404 SubscriptionDoesNotHaveServer - The requested server was not found\n\n * 404 ResourceNotFound - The requested resource was not found.\n\n * 404 CannotFindObject - Cannot find the object because it does not exist or you do not have permissions\n\n * 404 SourceDatabaseNotFound - The source database does not exist.\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."
196196
},
197197
"202": {
198198
"description": "Accepted"
@@ -205,6 +205,51 @@
205205
}
206206
}
207207
}
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": "#/parameters/ResourceGroupParameter"
219+
},
220+
{
221+
"$ref": "#/parameters/ServerNameParameter"
222+
},
223+
{
224+
"$ref": "#/parameters/DatabaseNameParameter"
225+
},
226+
{
227+
"$ref": "#/parameters/SubscriptionIdParameter"
228+
},
229+
{
230+
"$ref": "#/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 InvalidBackupRetentionDays - The retention days of {0} is not a valid configuration. Valid backup retention must be in 7-day increments (7, 14, 21, etc.)\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 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+
}
208253
}
209254
},
210255
"definitions": {
@@ -234,6 +279,25 @@
234279
"x-ms-client-flatten": true
235280
}
236281
}
282+
},
283+
"BackupShortTermRetentionPolicyListResult": {
284+
"description": "A list of short term retention policies.",
285+
"type": "object",
286+
"properties": {
287+
"value": {
288+
"description": "Array of results.",
289+
"type": "array",
290+
"items": {
291+
"$ref": "#/definitions/BackupShortTermRetentionPolicy"
292+
},
293+
"readOnly": true
294+
},
295+
"nextLink": {
296+
"description": "Link to retrieve next page of results.",
297+
"type": "string",
298+
"readOnly": true
299+
}
300+
}
237301
}
238302
},
239303
"parameters": {

0 commit comments

Comments
 (0)