Skip to content

Commit c1eb75b

Browse files
authored
BRP prune backup store API (#11479)
* Add backup external store pruning to the API spec * Fix CI
1 parent 323a977 commit c1eb75b

File tree

3 files changed

+130
-0
lines changed

3 files changed

+130
-0
lines changed

specification/azsadmin/resource-manager/backup/Microsoft.Backup.Admin/preview/2018-09-01/Backup.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
"schema": {
4040
"$ref": "#/definitions/OperationList"
4141
}
42+
},
43+
"default": {
44+
"description": "Error response."
4245
}
4346
},
4447
"x-ms-pageable": {

specification/azsadmin/resource-manager/backup/Microsoft.Backup.Admin/preview/2018-09-01/BackupLocations.json

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,55 @@
186186
}
187187
}
188188
}
189+
},
190+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Backup.Admin/backupLocations/{location}/pruneExternalStore": {
191+
"post": {
192+
"x-ms-examples": {
193+
"Prune the external backup store": {
194+
"$ref": "./examples/BackupLocations/Prune.json"
195+
}
196+
},
197+
"x-ms-long-running-operation": true,
198+
"x-ms-long-running-operation-options": {
199+
"final-state-via": "location"
200+
},
201+
"description": "Prune the external backup store.",
202+
"tags": [
203+
"BackupLocations"
204+
],
205+
"operationId": "BackupLocations_PruneExternalStore",
206+
"parameters": [
207+
{
208+
"$ref": "Backup.json#/parameters/SubscriptionIdParameter"
209+
},
210+
{
211+
"$ref": "Backup.json#/parameters/ResourceGroupParameter"
212+
},
213+
{
214+
"$ref": "#/parameters/BackupLocationParameter"
215+
},
216+
{
217+
"$ref": "#/parameters/PruneBackupStoreOptionParameter"
218+
},
219+
{
220+
"$ref": "Backup.json#/parameters/ApiVersionParameter"
221+
}
222+
],
223+
"responses": {
224+
"200": {
225+
"description": "OK",
226+
"schema": {
227+
"$ref": "#/definitions/PruneList"
228+
}
229+
},
230+
"202": {
231+
"description": "ACCEPTED"
232+
},
233+
"default": {
234+
"description": "Error response."
235+
}
236+
}
237+
}
189238
}
190239
},
191240
"definitions": {
@@ -288,6 +337,52 @@
288337
"type": "string"
289338
}
290339
}
340+
},
341+
"PruneBackupStoreOperationType": {
342+
"description": "Prune backup store operation type.",
343+
"type": "string",
344+
"enum": [
345+
"Default",
346+
"DryRun"
347+
],
348+
"x-ms-enum": {
349+
"name": "PruneBackupStoreOperationType",
350+
"modelAsString": false
351+
}
352+
},
353+
"PruneBackupStoreOperationOptionModel": {
354+
"type": "object",
355+
"description": "Prune backup store operation model.",
356+
"properties": {
357+
"operationType": {
358+
"description": "Operation type.",
359+
"$ref": "#/definitions/PruneBackupStoreOperationType"
360+
}
361+
}
362+
},
363+
"PruneModel": {
364+
"description": "Properties for a prune list.",
365+
"properties": {
366+
"pathsToDelete": {
367+
"description": "Garbage file list.",
368+
"type": "array",
369+
"items": {
370+
"type": "string"
371+
},
372+
"x-ms-client-flatten": true
373+
}
374+
}
375+
},
376+
"PruneList": {
377+
"type": "object",
378+
"description": "List of files to delete.",
379+
"properties": {
380+
"properties": {
381+
"description": "Holds information for a backup.",
382+
"$ref": "#/definitions/PruneModel",
383+
"x-ms-client-flatten": true
384+
}
385+
}
291386
}
292387
},
293388
"parameters": {
@@ -308,6 +403,16 @@
308403
"$ref": "#/definitions/BackupLocation"
309404
},
310405
"x-ms-parameter-location": "method"
406+
},
407+
"PruneBackupStoreOptionParameter": {
408+
"name": "option",
409+
"in": "body",
410+
"description": "Prune operation option.",
411+
"required": false,
412+
"schema": {
413+
"$ref": "#/definitions/PruneBackupStoreOperationOptionModel"
414+
},
415+
"x-ms-parameter-location": "method"
311416
}
312417
},
313418
"securityDefinitions": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"parameters": {
3+
"subscriptionId": "8742f75d-84ae-4f1b-b22e-0e63dde0d6f4",
4+
"resourceGroupName": "System.redmond",
5+
"location": "redmond",
6+
"api-version": "2018-09-01",
7+
"OperationType": "DryRun"
8+
},
9+
"responses": {
10+
"200": {
11+
"body": {
12+
"properties": {
13+
"pathsToDelete": [
14+
"masbackup/progressivebackup/1.2011.0.23/BackupEncryptionCert.cer",
15+
"masbackup/progressivebackup/1.2011.0.23/BackupEncryptionCert.pfx"
16+
]
17+
}
18+
}
19+
},
20+
"202": {}
21+
}
22+
}

0 commit comments

Comments
 (0)