File tree Expand file tree Collapse file tree 3 files changed +34
-1
lines changed
RecoveryServices.Backup.Models/AzureVmWorkloadModels
RecoveryServices.Backup.Providers/Providers Expand file tree Collapse file tree 3 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,13 @@ public AzureWorkloadSQLDatabaseProtectedItem(ProtectedItemResource protectedItem
82
82
ProtectionState =
83
83
EnumUtils . GetEnum < ItemProtectionState > ( protectedItem . ProtectionState . ToString ( ) ) ;
84
84
ProtectionStatus = EnumUtils . GetEnum < ItemProtectionStatus > ( protectedItem . ProtectionStatus ) ;
85
+ DateOfPurge = null ;
86
+ DeleteState = EnumUtils . GetEnum < ItemDeleteState > ( "NotDeleted" ) ;
87
+ if ( protectedItem . IsScheduledForDeferredDelete . HasValue )
88
+ {
89
+ DateOfPurge = protectedItem . DeferredDeleteTimeInUTC . Value . AddDays ( 14 ) ;
90
+ DeleteState = EnumUtils . GetEnum < ItemDeleteState > ( "ToBeDeleted" ) ;
91
+ }
85
92
}
86
93
}
87
94
Original file line number Diff line number Diff line change @@ -104,7 +104,32 @@ public RestAzureNS.AzureOperationResponse DisableProtectionWithDeleteData()
104
104
105
105
public RestAzureNS . AzureOperationResponse < ProtectedItemResource > UndeleteProtection ( )
106
106
{
107
- throw new Exception ( Resources . SoftdeleteNotImplementedException ) ;
107
+ string vaultName = ( string ) ProviderData [ VaultParams . VaultName ] ;
108
+ string resourceGroupName = ( string ) ProviderData [ VaultParams . ResourceGroupName ] ;
109
+ AzureWorkloadSQLDatabaseProtectedItem item = ( AzureWorkloadSQLDatabaseProtectedItem ) ProviderData [ ItemParams . Item ] ;
110
+
111
+ Dictionary < UriEnums , string > keyValueDict = HelperUtils . ParseUri ( item . Id ) ;
112
+ string containerUri = HelperUtils . GetContainerUri ( keyValueDict , item . Id ) ;
113
+ string protectedItemUri = HelperUtils . GetProtectedItemUri ( keyValueDict , item . Id ) ;
114
+
115
+ AzureVmWorkloadSQLDatabaseProtectedItem properties = new AzureVmWorkloadSQLDatabaseProtectedItem ( ) ;
116
+
117
+ properties . PolicyId = null ;
118
+ properties . ProtectionState = ProtectionState . ProtectionStopped ;
119
+ properties . SourceResourceId = item . SourceResourceId ;
120
+ properties . IsRehydrate = true ;
121
+
122
+ ProtectedItemResource serviceClientRequest = new ProtectedItemResource ( )
123
+ {
124
+ Properties = properties ,
125
+ } ;
126
+
127
+ return ServiceClientAdapter . CreateOrUpdateProtectedItem (
128
+ containerUri ,
129
+ protectedItemUri ,
130
+ serviceClientRequest ,
131
+ vaultName : vaultName ,
132
+ resourceGroupName : resourceGroupName ) ;
108
133
}
109
134
110
135
public RestAzureNS . AzureOperationResponse < ProtectedItemResource > EnableProtection ( )
Original file line number Diff line number Diff line change 18
18
- Additional information about change #1
19
19
-->
20
20
## Upcoming Release
21
+ * Enabled softdelete feature for SQL.
21
22
22
23
## Version 3.1.0
23
24
* Made help text and parameter set name changes to ` Restore-AzRecoveryServicesBackupItem ` cmdlet.
You can’t perform that action at this time.
0 commit comments