Skip to content

Commit

Permalink
Merge pull request Azure#285 from zubairabid/users/zubair/softdelete
Browse files Browse the repository at this point in the history
[dataprotection] Full support for Soft Delete in V2
  • Loading branch information
kairu-ms authored Aug 17, 2023
2 parents 4776a0c + 8862990 commit 4d534f6
Show file tree
Hide file tree
Showing 25 changed files with 780 additions and 31 deletions.
3 changes: 2 additions & 1 deletion Commands/dataprotection/backup-instance/_adhoc-backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ Trigger adhoc backup.

#### examples

- Trigger Adhoc Backup
- Fetch Backup Policy details for rule name and Trigger Adhoc Backup
```bash
dataprotection backup-policy show -g "000pikumar" --vault-name "PratikPrivatePreviewVault1" -n "backupPolicy"
dataprotection backup-instance adhoc-backup --name "testInstance1" --rule-name "BackupWeekly" --retention-tag-override "yearly" --resource-group "000pikumar" --vault-name "PratikPrivatePreviewVault1"
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ Validate whether adhoc backup will be successful or not
### [2023-05-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5kYXRhcHJvdGVjdGlvbi9iYWNrdXB2YXVsdHMve30vdmFsaWRhdGVmb3JiYWNrdXA=/2023-05-01.xml) **Experimental**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/validateforbackup 2023-05-01 -->

#### examples

- Validate Backup
```bash
dataprotection backup-instance validate-for-backup -g sample_rg --vault-name sample_backupvault --backup-instance backup_instance.json
```
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,10 @@ Validates if Restore can be triggered for a DataSource
### [2023-05-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5kYXRhcHJvdGVjdGlvbi9iYWNrdXB2YXVsdHMve30vYmFja3VwaW5zdGFuY2VzL3t9L3ZhbGlkYXRlcmVzdG9yZQ==/2023-05-01.xml) **Experimental**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/backupinstances/{}/validaterestore 2023-05-01 -->

#### examples

- Validate Restore
```bash
dataprotection backup-instance validate-for-restore-g sample_rg --vault-name sample_backupvault --backup-instance-name sample_biname-fd53a211-3f3e-4c7e-ba45-81050e27c0be --restore-request-object restorerequestobject.json
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _dataprotection backup-instance deleted-backup-instance list_

List deleted backup instances belonging to a backup vault

## Versions

### [2023-05-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5kYXRhcHJvdGVjdGlvbi9iYWNrdXB2YXVsdHMve30vZGVsZXRlZGJhY2t1cGluc3RhbmNlcw==/2023-05-01.xml) **Experimental**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/deletedbackupinstances 2023-05-01 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _dataprotection backup-instance deleted-backup-instance show_

Get a deleted backup instance with name in a backup vault

## Versions

### [2023-05-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5kYXRhcHJvdGVjdGlvbi9iYWNrdXB2YXVsdHMve30vZGVsZXRlZGJhY2t1cGluc3RhbmNlcy97fQ==/2023-05-01.xml) **Experimental**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/deletedbackupinstances/{} 2023-05-01 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# [Command] _dataprotection backup-instance deleted-backup-instance undelete_

Undelete soft-deleted backup instances.

## Versions

### [2023-05-01](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcmVzb3VyY2Vncm91cHMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5kYXRhcHJvdGVjdGlvbi9iYWNrdXB2YXVsdHMve30vZGVsZXRlZGJhY2t1cGluc3RhbmNlcy97fS91bmRlbGV0ZQ==/2023-05-01.xml) **Experimental**

<!-- mgmt-plane /subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/deletedbackupinstances/{}/undelete 2023-05-01 -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# [Group] _dataprotection backup-instance deleted-backup-instance_

Perform operations on soft-deleted backup instances.

## Commands

- [list](/Commands/dataprotection/backup-instance/deleted-backup-instance/_list.md)
: List deleted backup instances belonging to a backup vault

- [show](/Commands/dataprotection/backup-instance/deleted-backup-instance/_show.md)
: Get a deleted backup instance with name in a backup vault

- [undelete](/Commands/dataprotection/backup-instance/deleted-backup-instance/_undelete.md)
: Undelete soft-deleted backup instances.
5 changes: 4 additions & 1 deletion Commands/dataprotection/backup-instance/readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# [Group] _dataprotection backup-instance_

Manage backup instance with dataprotection
Manage backup instance with dataprotection.

## Subgroups

- [deleted-backup-instance](/Commands/dataprotection/backup-instance/deleted-backup-instance/readme.md)
: Perform operations on soft-deleted backup instances.

- [restore](/Commands/dataprotection/backup-instance/restore/readme.md)
: Restore backed up instances from recovery points in a backup vault

Expand Down
4 changes: 2 additions & 2 deletions Commands/dataprotection/readme.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# [Group] _dataprotection_

Manage dataprotection
Manage dataprotection.

## Subgroups

- [backup-instance](/Commands/dataprotection/backup-instance/readme.md)
: Manage backup instance with dataprotection
: Manage backup instance with dataprotection.

- [backup-policy](/Commands/dataprotection/backup-policy/readme.md)
: Manage backup policy with dataprotection.
Expand Down
2 changes: 1 addition & 1 deletion Commands/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
: Manage databricks workspaces.

- [dataprotection](/Commands/dataprotection/readme.md)
: Manage dataprotection
: Manage dataprotection.

- [devcenter](/Commands/devcenter/readme.md)
: Manage resources with devcenter.
Expand Down
107 changes: 104 additions & 3 deletions Commands/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -5623,6 +5623,90 @@
"commandGroups": {
"backup-instance": {
"commandGroups": {
"deleted-backup-instance": {
"commands": {
"list": {
"help": {
"short": "List deleted backup instances belonging to a backup vault"
},
"names": [
"dataprotection",
"backup-instance",
"deleted-backup-instance",
"list"
],
"versions": [
{
"name": "2023-05-01",
"resources": [
{
"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/deletedbackupinstances",
"plane": "mgmt-plane",
"version": "2023-05-01"
}
],
"stage": "Experimental"
}
]
},
"show": {
"help": {
"short": "Get a deleted backup instance with name in a backup vault"
},
"names": [
"dataprotection",
"backup-instance",
"deleted-backup-instance",
"show"
],
"versions": [
{
"name": "2023-05-01",
"resources": [
{
"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/deletedbackupinstances/{}",
"plane": "mgmt-plane",
"version": "2023-05-01"
}
],
"stage": "Experimental"
}
]
},
"undelete": {
"help": {
"short": "Undelete soft-deleted backup instances."
},
"names": [
"dataprotection",
"backup-instance",
"deleted-backup-instance",
"undelete"
],
"versions": [
{
"name": "2023-05-01",
"resources": [
{
"id": "/subscriptions/{}/resourcegroups/{}/providers/microsoft.dataprotection/backupvaults/{}/deletedbackupinstances/{}/undelete",
"plane": "mgmt-plane",
"version": "2023-05-01"
}
],
"stage": "Experimental"
}
]
}
},
"help": {
"short": "Perform operations on soft-deleted backup instances."
},
"names": [
"dataprotection",
"backup-instance",
"deleted-backup-instance"
]
},
"restore": {
"commands": {
"trigger": {
Expand Down Expand Up @@ -5713,9 +5797,10 @@
"examples": [
{
"commands": [
"dataprotection backup-policy show -g \"000pikumar\" --vault-name \"PratikPrivatePreviewVault1\" -n \"backupPolicy\"",
"dataprotection backup-instance adhoc-backup --name \"testInstance1\" --rule-name \"BackupWeekly\" --retention-tag-override \"yearly\" --resource-group \"000pikumar\" --vault-name \"PratikPrivatePreviewVault1\""
],
"name": "Trigger Adhoc Backup"
"name": "Fetch Backup Policy details for rule name and Trigger Adhoc Backup"
}
],
"name": "2023-05-01",
Expand Down Expand Up @@ -6144,6 +6229,14 @@
"stage": "Experimental"
},
{
"examples": [
{
"commands": [
"dataprotection backup-instance validate-for-backup -g sample_rg --vault-name sample_backupvault --backup-instance backup_instance.json"
],
"name": "Validate Backup"
}
],
"name": "2023-05-01",
"resources": [
{
Expand Down Expand Up @@ -6186,6 +6279,14 @@
"stage": "Experimental"
},
{
"examples": [
{
"commands": [
"dataprotection backup-instance validate-for-restore-g sample_rg --vault-name sample_backupvault --backup-instance-name sample_biname-fd53a211-3f3e-4c7e-ba45-81050e27c0be --restore-request-object restorerequestobject.json"
],
"name": "Validate Restore"
}
],
"name": "2023-05-01",
"resources": [
{
Expand All @@ -6200,7 +6301,7 @@
}
},
"help": {
"short": "Manage backup instance with dataprotection"
"short": "Manage backup instance with dataprotection."
},
"names": [
"dataprotection",
Expand Down Expand Up @@ -7445,7 +7546,7 @@
}
},
"help": {
"short": "Manage dataprotection"
"short": "Manage dataprotection."
},
"names": [
"dataprotection"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,8 @@
</arg>
</argGroup>
<argGroup name="FeatureSettings">
<arg type="object" var="$parameters.properties.featureSettings.crossRegionRestoreSettings" options="cross-region-restore-settings" group="FeatureSettings">
<arg type="object" var="$parameters.properties.featureSettings.crossRegionRestoreSettings" options="cross-region-restore-settings" hide="True" group="FeatureSettings">
<help short="-"/>
<arg type="string" var="$parameters.properties.featureSettings.crossRegionRestoreSettings.state" options="state">
<help short="CrossRegionRestore state"/>
<enum>
Expand All @@ -274,7 +275,7 @@
<arg type="string" var="$parameters.identity.type" options="type" group="Identity">
<help short="The identityType which can be either SystemAssigned or None"/>
</arg>
<arg type="object" var="$parameters.identity.userAssignedIdentities" options="user-assigned-identities" group="Identity">
<arg type="object" var="$parameters.identity.userAssignedIdentities" options="user-assigned-identities" hide="True" group="Identity">
<help short="Gets or sets the user assigned identities."/>
<additionalProp>
<item type="object">
Expand Down Expand Up @@ -342,9 +343,11 @@
<argGroup name="SoftDeleteSettings">
<arg type="float64" var="$parameters.properties.securitySettings.softDeleteSettings.retentionDurationInDays" options="retention-duration-in-days soft-delete-retention" group="SoftDeleteSettings">
<help short="Soft delete retention duration"/>
<default value="14.0"/>
</arg>
<arg type="string" var="$parameters.properties.securitySettings.softDeleteSettings.state" options="soft-delete-state" group="SoftDeleteSettings">
<help short="State of soft delete"/>
<default value="&quot;On&quot;"/>
<enum>
<item name="AlwaysOn" value="&quot;AlwaysOn&quot;"/>
<item name="Off" value="&quot;Off&quot;"/>
Expand Down Expand Up @@ -645,7 +648,8 @@
</arg>
</argGroup>
<argGroup name="FeatureSettings">
<arg nullable="True" type="object" var="$parameters.properties.featureSettings.crossRegionRestoreSettings" options="cross-region-restore-settings" group="FeatureSettings">
<arg nullable="True" type="object" var="$parameters.properties.featureSettings.crossRegionRestoreSettings" options="cross-region-restore-settings" hide="True" group="FeatureSettings">
<help short="."/>
<arg nullable="True" type="string" var="$parameters.properties.featureSettings.crossRegionRestoreSettings.state" options="state">
<help short="CrossRegionRestore state"/>
<enum>
Expand All @@ -667,7 +671,7 @@
<arg nullable="True" type="string" var="$parameters.identity.type" options="type" group="Identity">
<help short="The identityType which can be either SystemAssigned or None"/>
</arg>
<arg nullable="True" type="object" var="$parameters.identity.userAssignedIdentities" options="user-assigned-identities" group="Identity">
<arg nullable="True" type="object" var="$parameters.identity.userAssignedIdentities" options="user-assigned-identities" hide="True" group="Identity">
<help short="Gets or sets the user assigned identities."/>
<additionalProp>
<item nullable="True" type="object">
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -321,15 +321,15 @@
</arg>
</argGroup>
<argGroup name="Parameters">
<arg type="object" var="$parameters.tags" options="tags" group="Parameters">
<arg type="object" var="$parameters.tags" options="tags" hide="True" group="Parameters">
<help short="Proxy Resource tags."/>
<additionalProp>
<item type="string"/>
</additionalProp>
</arg>
</argGroup>
<argGroup name="Properties">
<arg type="object" var="$parameters.properties.dataSourceInfo" options="data-source-info" group="Properties">
<arg type="object" var="$parameters.properties.dataSourceInfo" options="data-source-info" hide="True" group="Properties">
<help short="Gets or sets the data source information."/>
<arg type="string" var="$parameters.properties.dataSourceInfo.datasourceType" options="datasource-type">
<help short="DatasourceType of the resource."/>
Expand Down Expand Up @@ -359,7 +359,7 @@
<help short="Uri of the resource."/>
</arg>
</arg>
<arg type="object" var="$parameters.properties.dataSourceSetInfo" options="data-source-set-info" group="Properties">
<arg type="object" var="$parameters.properties.dataSourceSetInfo" options="data-source-set-info" hide="True" group="Properties">
<help short="Gets or sets the data source set information."/>
<arg type="string" var="$parameters.properties.dataSourceSetInfo.datasourceType" options="datasource-type">
<help short="DatasourceType of the resource."/>
Expand All @@ -386,7 +386,7 @@
<help short="Uri of the resource."/>
</arg>
</arg>
<arg type="object" var="$parameters.properties.datasourceAuthCredentials" options="datasource-auth-credentials" group="Properties">
<arg type="object" var="$parameters.properties.datasourceAuthCredentials" options="datasource-auth-credentials" hide="True" group="Properties">
<help short="Credentials to use to authenticate with data source provider."/>
<arg type="object" var="$parameters.properties.datasourceAuthCredentials.SecretStoreBasedAuthCredentials" options="secret-store-based-auth-credentials">
<arg type="object" var="$parameters.properties.datasourceAuthCredentials.SecretStoreBasedAuthCredentials.secretStoreResource" options="secret-store-resource">
Expand All @@ -407,10 +407,10 @@
</arg>
</arg>
</arg>
<arg type="string" var="$parameters.properties.friendlyName" options="friendly-name" group="Properties">
<arg type="string" var="$parameters.properties.friendlyName" options="friendly-name" hide="True" group="Properties">
<help short="Gets or sets the Backup Instance friendly name."/>
</arg>
<arg type="object" var="$parameters.properties.identityDetails" options="identity-details" group="Properties">
<arg type="object" var="$parameters.properties.identityDetails" options="identity-details" hide="True" group="Properties">
<help short="Contains information of the Identity Details for the BI. If it is null, default will be considered as System Assigned."/>
<arg type="boolean" var="$parameters.properties.identityDetails.useSystemAssignedIdentity" options="use-system-assigned-identity">
<help short="Specifies if the BI is protected by System Identity."/>
Expand All @@ -419,8 +419,10 @@
<help short="ARM URL for User Assigned Identity."/>
</arg>
</arg>
<arg type="string" var="$parameters.properties.objectType" options="object-type" group="Properties"/>
<arg type="object" var="$parameters.properties.policyInfo" options="policy-info" group="Properties">
<arg type="string" var="$parameters.properties.objectType" options="object-type" hide="True" group="Properties">
<help short="-"/>
</arg>
<arg type="object" var="$parameters.properties.policyInfo" options="policy-info" hide="True" group="Properties">
<help short="Gets or sets the policy information."/>
<arg type="string" var="$parameters.properties.policyInfo.policyId" options="policy-id" required="True"/>
<arg type="object" var="$parameters.properties.policyInfo.policyParameters" options="policy-parameters">
Expand Down Expand Up @@ -495,7 +497,7 @@
</arg>
</arg>
</arg>
<arg type="string" var="$parameters.properties.validationType" options="validation-type" group="Properties">
<arg type="string" var="$parameters.properties.validationType" options="validation-type" hide="True" group="Properties">
<help short="Specifies the type of validation. In case of DeepValidation, all validations from /validateForBackup API will run again."/>
<enum>
<item name="DeepValidation" value="&quot;DeepValidation&quot;"/>
Expand Down

Large diffs are not rendered by default.

Loading

0 comments on commit 4d534f6

Please sign in to comment.