Skip to content

Commit

Permalink
BRP prune backup store API (Azure#11479)
Browse files Browse the repository at this point in the history
* Add backup external store pruning to the API spec

* Fix CI
  • Loading branch information
poetw authored and giromm2ms committed Dec 20, 2020
1 parent 3e6e61a commit 0955f06
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@
"schema": {
"$ref": "#/definitions/OperationList"
}
},
"default": {
"description": "Error response."
}
},
"x-ms-pageable": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,55 @@
}
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Backup.Admin/backupLocations/{location}/pruneExternalStore": {
"post": {
"x-ms-examples": {
"Prune the external backup store": {
"$ref": "./examples/BackupLocations/Prune.json"
}
},
"x-ms-long-running-operation": true,
"x-ms-long-running-operation-options": {
"final-state-via": "location"
},
"description": "Prune the external backup store.",
"tags": [
"BackupLocations"
],
"operationId": "BackupLocations_PruneExternalStore",
"parameters": [
{
"$ref": "Backup.json#/parameters/SubscriptionIdParameter"
},
{
"$ref": "Backup.json#/parameters/ResourceGroupParameter"
},
{
"$ref": "#/parameters/BackupLocationParameter"
},
{
"$ref": "#/parameters/PruneBackupStoreOptionParameter"
},
{
"$ref": "Backup.json#/parameters/ApiVersionParameter"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/PruneList"
}
},
"202": {
"description": "ACCEPTED"
},
"default": {
"description": "Error response."
}
}
}
}
},
"definitions": {
Expand Down Expand Up @@ -288,6 +337,52 @@
"type": "string"
}
}
},
"PruneBackupStoreOperationType": {
"description": "Prune backup store operation type.",
"type": "string",
"enum": [
"Default",
"DryRun"
],
"x-ms-enum": {
"name": "PruneBackupStoreOperationType",
"modelAsString": false
}
},
"PruneBackupStoreOperationOptionModel": {
"type": "object",
"description": "Prune backup store operation model.",
"properties": {
"operationType": {
"description": "Operation type.",
"$ref": "#/definitions/PruneBackupStoreOperationType"
}
}
},
"PruneModel": {
"description": "Properties for a prune list.",
"properties": {
"pathsToDelete": {
"description": "Garbage file list.",
"type": "array",
"items": {
"type": "string"
},
"x-ms-client-flatten": true
}
}
},
"PruneList": {
"type": "object",
"description": "List of files to delete.",
"properties": {
"properties": {
"description": "Holds information for a backup.",
"$ref": "#/definitions/PruneModel",
"x-ms-client-flatten": true
}
}
}
},
"parameters": {
Expand All @@ -308,6 +403,16 @@
"$ref": "#/definitions/BackupLocation"
},
"x-ms-parameter-location": "method"
},
"PruneBackupStoreOptionParameter": {
"name": "option",
"in": "body",
"description": "Prune operation option.",
"required": false,
"schema": {
"$ref": "#/definitions/PruneBackupStoreOperationOptionModel"
},
"x-ms-parameter-location": "method"
}
},
"securityDefinitions": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"parameters": {
"subscriptionId": "8742f75d-84ae-4f1b-b22e-0e63dde0d6f4",
"resourceGroupName": "System.redmond",
"location": "redmond",
"api-version": "2018-09-01",
"OperationType": "DryRun"
},
"responses": {
"200": {
"body": {
"properties": {
"pathsToDelete": [
"masbackup/progressivebackup/1.2011.0.23/BackupEncryptionCert.cer",
"masbackup/progressivebackup/1.2011.0.23/BackupEncryptionCert.pfx"
]
}
}
},
"202": {}
}
}

0 comments on commit 0955f06

Please sign in to comment.