|
1 | 1 | function Initialize-AzDataProtectionRestoreRequest
|
2 | 2 | {
|
3 |
| - [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.IAzureBackupRestoreRequest')] |
| 3 | + [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.IAzureBackupRestoreRequest')] |
4 | 4 | [CmdletBinding(PositionalBinding=$false)]
|
5 | 5 | [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Initializes Restore Request object for triggering restore on a protected backup instance.')]
|
6 | 6 |
|
|
71 | 71 |
|
72 | 72 | [Parameter(ParameterSetName="OriginalLocationFullRecovery", Mandatory, HelpMessage='Backup Instance object to trigger original localtion restore.')]
|
73 | 73 | [Parameter(ParameterSetName="OriginalLocationILR", Mandatory, HelpMessage='Backup Instance object to trigger original localtion restore.')]
|
74 |
| - [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.BackupInstanceResource] |
| 74 | + [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.BackupInstanceResource] |
75 | 75 | ${BackupInstance},
|
76 | 76 |
|
77 | 77 | [Parameter(ParameterSetName="AlternateLocationFullRecovery", Mandatory, HelpMessage='Target resource Id to which backup data will be restored.')]
|
|
132 | 132 | Write-Debug -Message $RecoveryPoint
|
133 | 133 |
|
134 | 134 | if($PSBoundParameters.ContainsKey("RehydrationPriority")){
|
135 |
| - $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.AzureBackupRestoreWithRehydrationRequest]::new() |
| 135 | + $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.AzureBackupRestoreWithRehydrationRequest]::new() |
136 | 136 | $restoreRequest.ObjectType = "AzureBackupRestoreWithRehydrationRequest"
|
137 | 137 | $restoreRequest.RehydrationPriority = $RehydrationPriority
|
138 | 138 | if($PSBoundParameters.ContainsKey("RehydrationDuration")){
|
|
143 | 143 | }
|
144 | 144 | }
|
145 | 145 | else{
|
146 |
| - $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.AzureBackupRecoveryPointBasedRestoreRequest]::new() |
| 146 | + $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.AzureBackupRecoveryPointBasedRestoreRequest]::new() |
147 | 147 | $restoreRequest.ObjectType = "AzureBackupRecoveryPointBasedRestoreRequest"
|
148 | 148 | }
|
149 | 149 | $restoreRequest.RecoveryPointId = $RecoveryPoint
|
|
153 | 153 | {
|
154 | 154 | $utcTime = $PointInTime.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.0000000Z")
|
155 | 155 | Write-Debug -Message $utcTime
|
156 |
| - $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.AzureBackupRecoveryTimeBasedRestoreRequest]::new() |
| 156 | + $restoreRequest = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.AzureBackupRecoveryTimeBasedRestoreRequest]::new() |
157 | 157 | $restoreRequest.ObjectType = "AzureBackupRecoveryTimeBasedRestoreRequest"
|
158 | 158 | $restoreRequest.RecoveryPointTime = $utcTime
|
159 | 159 | $restoreMode = "PointInTimeBased"
|
|
170 | 170 |
|
171 | 171 | if($RestoreType -eq "RestoreAsFiles")
|
172 | 172 | {
|
173 |
| - $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.RestoreFilesTargetInfo]::new() |
| 173 | + $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.RestoreFilesTargetInfo]::new() |
174 | 174 | $restoreRequest.RestoreTargetInfo.ObjectType = "RestoreFilesTargetInfo"
|
175 | 175 |
|
176 | 176 | if(!($PSBoundParameters.ContainsKey("FileNamePrefix")) -or !($PSBoundParameters.ContainsKey("TargetContainerURI")) ){
|
|
185 | 185 | elseif(!($ItemLevelRecovery))
|
186 | 186 | {
|
187 | 187 | # RestoreTargetInfo for OLR ALR Full recovery
|
188 |
| - $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.RestoreTargetInfo]::new() |
| 188 | + $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.RestoreTargetInfo]::new() |
189 | 189 | $restoreRequest.RestoreTargetInfo.ObjectType = "restoreTargetInfo"
|
190 | 190 | }
|
191 | 191 | else
|
192 | 192 | {
|
193 | 193 | # ILR: ItemLevelRestoreTargetInfo
|
194 |
| - $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.ItemLevelRestoreTargetInfo]::new() |
| 194 | + $restoreRequest.RestoreTargetInfo = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.ItemLevelRestoreTargetInfo]::new() |
195 | 195 | $restoreRequest.RestoreTargetInfo.ObjectType = "itemLevelRestoreTargetInfo"
|
196 | 196 |
|
197 | 197 | $restoreCriteriaList = @()
|
198 | 198 |
|
199 | 199 | if($ContainersList.length -gt 0){
|
200 | 200 | for($i = 0; $i -lt $ContainersList.length; $i++){
|
201 | 201 |
|
202 |
| - $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.RangeBasedItemLevelRestoreCriteria]::new() |
| 202 | + $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.RangeBasedItemLevelRestoreCriteria]::new() |
203 | 203 |
|
204 | 204 | $restoreCriteria.ObjectType = "RangeBasedItemLevelRestoreCriteria"
|
205 | 205 | $restoreCriteria.MinMatchingValue = $ContainersList[$i]
|
|
218 | 218 |
|
219 | 219 | for($i = 0; $i -lt $FromPrefixPattern.length; $i++){
|
220 | 220 |
|
221 |
| - $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.RangeBasedItemLevelRestoreCriteria]::new() |
| 221 | + $restoreCriteria = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.RangeBasedItemLevelRestoreCriteria]::new() |
222 | 222 |
|
223 | 223 | $restoreCriteria.ObjectType = "RangeBasedItemLevelRestoreCriteria"
|
224 | 224 | $restoreCriteria.MinMatchingValue = $FromPrefixPattern[$i]
|
|
280 | 280 | $errormsg = "Please input SecretStoreType"
|
281 | 281 | throw $errormsg
|
282 | 282 | }
|
283 |
| - $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.SecretStoreBasedAuthCredentials]::new() |
| 283 | + $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.SecretStoreBasedAuthCredentials]::new() |
284 | 284 | $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.ObjectType = "SecretStoreBasedAuthCredentials"
|
285 |
| - $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20220501.SecretStoreResource]::new() |
| 285 | + $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20221201.SecretStoreResource]::new() |
286 | 286 | $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource.SecretStoreType = $SecretStoreType
|
287 | 287 | $restoreRequest.RestoreTargetInfo.DatasourceAuthCredentials.SecretStoreResource.Uri = $SecretStoreURI
|
288 | 288 | }
|
|
0 commit comments