Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Az.DataProtection] Adding CmkEnryption parameters to Get-AzDataProtectionBackupVault, New-AzDataProtectionBackupVault and Update-AzDataProtectionBackupVault cmdlets #24654

Merged
merged 6 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DotNetFrameworkVersion = '4.7.2'
RequiredAssemblies = './bin/Az.DataProtection.private.dll'
FormatsToProcess = './Az.DataProtection.format.ps1xml'
FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc', 'Edit-AzDataProtectionPolicyRetentionRuleClientObject', 'Edit-AzDataProtectionPolicyTagClientObject', 'Edit-AzDataProtectionPolicyTriggerClientObject', 'Find-AzDataProtectionRestorableTimeRange', 'Get-AzDataProtectionBackupInstance', 'Get-AzDataProtectionBackupPolicy', 'Get-AzDataProtectionBackupVault', 'Get-AzDataProtectionJob', 'Get-AzDataProtectionOperation', 'Get-AzDataProtectionOperationStatus', 'Get-AzDataProtectionPolicyTemplate', 'Get-AzDataProtectionRecoveryPoint', 'Get-AzDataProtectionResourceGuard', 'Get-AzDataProtectionResourceGuardMapping', 'Get-AzDataProtectionSoftDeletedBackupInstance', 'Initialize-AzDataProtectionBackupInstance', 'Initialize-AzDataProtectionRestoreRequest', 'New-AzDataProtectionBackupConfigurationClientObject', 'New-AzDataProtectionBackupInstance', 'New-AzDataProtectionBackupPolicy', 'New-AzDataProtectionBackupVault', 'New-AzDataProtectionBackupVaultStorageSettingObject', 'New-AzDataProtectionPolicyTagCriteriaClientObject', 'New-AzDataProtectionPolicyTriggerScheduleClientObject', 'New-AzDataProtectionResourceGuard', 'New-AzDataProtectionRestoreConfigurationClientObject', 'New-AzDataProtectionRetentionLifeCycleClientObject', 'Remove-AzDataProtectionBackupInstance', 'Remove-AzDataProtectionBackupPolicy', 'Remove-AzDataProtectionBackupVault', 'Remove-AzDataProtectionResourceGuard', 'Remove-AzDataProtectionResourceGuardMapping', 'Resume-AzDataProtectionBackupInstanceProtection', 'Search-AzDataProtectionBackupInstanceInAzGraph', 'Search-AzDataProtectionBackupVaultInAzGraph', 'Search-AzDataProtectionJobInAzGraph', 'Set-AzDataProtectionMSIPermission', 'Set-AzDataProtectionResourceGuardMapping', 'Start-AzDataProtectionBackupInstanceRestore', 'Stop-AzDataProtectionBackupInstanceProtection', 'Suspend-AzDataProtectionBackupInstanceBackup', 'Sync-AzDataProtectionBackupInstance', 'Test-AzDataProtectionBackupInstanceReadiness', 'Test-AzDataProtectionBackupInstanceRestore', 'Undo-AzDataProtectionBackupInstanceDeletion', 'Unlock-AzDataProtectionResourceGuardOperation', 'Update-AzDataProtectionBackupInstance', 'Update-AzDataProtectionBackupInstanceAssociatedPolicy', 'Update-AzDataProtectionBackupVault', 'Update-AzDataProtectionResourceGuard', '*'
FunctionsToExport = 'Backup-AzDataProtectionBackupInstanceAdhoc', 'Edit-AzDataProtectionPolicyRetentionRuleClientObject', 'Edit-AzDataProtectionPolicyTagClientObject', 'Edit-AzDataProtectionPolicyTriggerClientObject', 'Find-AzDataProtectionRestorableTimeRange', 'Get-AzDataProtectionBackupInstance', 'Get-AzDataProtectionBackupInstancesExtensionRouting', 'Get-AzDataProtectionBackupPolicy', 'Get-AzDataProtectionBackupVault', 'Get-AzDataProtectionJob', 'Get-AzDataProtectionOperation', 'Get-AzDataProtectionOperationStatus', 'Get-AzDataProtectionPolicyTemplate', 'Get-AzDataProtectionRecoveryPoint', 'Get-AzDataProtectionResourceGuard', 'Get-AzDataProtectionResourceGuardMapping', 'Get-AzDataProtectionSoftDeletedBackupInstance', 'Initialize-AzDataProtectionBackupInstance', 'Initialize-AzDataProtectionRestoreRequest', 'New-AzDataProtectionBackupConfigurationClientObject', 'New-AzDataProtectionBackupInstance', 'New-AzDataProtectionBackupPolicy', 'New-AzDataProtectionBackupVault', 'New-AzDataProtectionBackupVaultStorageSettingObject', 'New-AzDataProtectionPolicyTagCriteriaClientObject', 'New-AzDataProtectionPolicyTriggerScheduleClientObject', 'New-AzDataProtectionResourceGuard', 'New-AzDataProtectionRestoreConfigurationClientObject', 'New-AzDataProtectionRetentionLifeCycleClientObject', 'Remove-AzDataProtectionBackupInstance', 'Remove-AzDataProtectionBackupPolicy', 'Remove-AzDataProtectionBackupVault', 'Remove-AzDataProtectionResourceGuard', 'Remove-AzDataProtectionResourceGuardMapping', 'Resume-AzDataProtectionBackupInstanceProtection', 'Search-AzDataProtectionBackupInstanceInAzGraph', 'Search-AzDataProtectionBackupVaultInAzGraph', 'Search-AzDataProtectionJobInAzGraph', 'Set-AzDataProtectionMSIPermission', 'Set-AzDataProtectionResourceGuardMapping', 'Start-AzDataProtectionBackupInstanceRestore', 'Stop-AzDataProtectionBackupInstanceProtection', 'Suspend-AzDataProtectionBackupInstanceBackup', 'Sync-AzDataProtectionBackupInstance', 'Test-AzDataProtectionBackupInstanceReadiness', 'Test-AzDataProtectionBackupInstanceRestore', 'Undo-AzDataProtectionBackupInstanceDeletion', 'Unlock-AzDataProtectionResourceGuardOperation', 'Update-AzDataProtectionBackupInstance', 'Update-AzDataProtectionBackupInstanceAssociatedPolicy', 'Update-AzDataProtectionBackupVault', 'Update-AzDataProtectionResourceGuard', '*'
AliasesToExport = '*'
PrivateData = @{
PSData = @{
Expand Down
66 changes: 54 additions & 12 deletions src/DataProtection/DataProtection.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ This file contains the configuration for generating My API from the OpenAPI spec

``` yaml
# it's the same options as command line options, just drop the double-dash!
commit: 41d1c179dc166b7f16b7e40ef4f2a1d9c85b10cc
commit: 72f52bc8847a889488da885f40d6871a89e0470b
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-12-01/dataprotection.json
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2024-04-01/dataprotection.json
title: DataProtection
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
Expand All @@ -45,10 +45,6 @@ directive:
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}"].delete
transform: $["description"] = "Delete a backupInstances"
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete"]["post"]["parameters"]
transform: >
$.push({"name": "x-ms-authorization-auxiliary","in": "header","type": "string"})
- where:
parameter-name: XmsAuthorizationAuxiliary
set:
Expand Down Expand Up @@ -104,6 +100,10 @@ directive:
set:
parameter-name: SoftDeleteSetting
clear-alias: true
- where:
parameter-name: SecuritySettingEncryptionSetting
set:
parameter-name: EncryptionSetting
- where:
verb: Get
subject: BackupVaultResource.*
Expand Down Expand Up @@ -159,15 +159,15 @@ directive:
subject: ResourceGuardMapping
- where:
parameter-name: ResourceGuardProxyName
hide: true
hide: true
set:
default:
script: '"DppResourceGuardProxy"'
- where:
verb: New
subject: ResourceGuardMapping
parameter-name: LastUpdatedTime|Description|ResourceGuardOperationDetail
hide: true
hide: true
- where:
verb: Get
subject: DeletedBackupInstance
Expand Down Expand Up @@ -237,6 +237,26 @@ directive:
verb: Start
subject: .*Restore$
hide: true
- where:
verb: Stop
subject: ^BackupInstanceProtection$
variant: Stop$|StopViaIdentityExpanded$
remove: true
- where:
verb: Stop
subject: ^BackupInstanceProtection$
variant: StopExpanded$|StopViaIdentity$
hide: true
- where:
verb: Suspend
subject: ^BackupInstanceBackup$
variant: Suspend$|SuspendViaIdentityExpanded$
remove: true
- where:
verb: Suspend
subject: ^BackupInstanceBackup$
variant: SuspendExpanded$|SuspendViaIdentity$
hide: true
- where:
verb: Get
subject: OperationResultPatch
Expand All @@ -249,6 +269,11 @@ directive:
verb: New
subject: BackupVault
hide: true
- where:
verb: Update
subject: BackupVault
variant: ^UpdateExpanded$
hide: true
- where:
verb: Invoke
variant: ^Post$|^PostViaIdentity$|^PostViaIdentityExpanded$
Expand Down Expand Up @@ -360,6 +385,22 @@ directive:
property-name: SoftDeleteSettingState
set:
property-name: SoftDeleteState
- where:
property-name: SecuritySettingEncryptionSetting
set:
property-name: EncryptionSetting
- where:
property-name: InfrastructureEncryption
set:
property-name: CmkInfrastructureEncryption
- where:
property-name: KekIdentity
set:
property-name: CmkIdentity
- where:
property-name: KeyVaultProperty
set:
property-name: CmkKeyVaultProperty
- where:
subject: OperationStatus
parameter-name: Location
Expand Down Expand Up @@ -396,18 +437,19 @@ directive:
- UserFacingError
- ValidateRestoreRequestObject
- ValidateCrossRegionRestoreRequestObject
- EncryptionSettings
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBaseBackupPolicy Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBaseBackupPolicy Property');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.ITriggerContext Trigger');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ITriggerContext Trigger');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBackupParameters BackupParameter');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupParameters BackupParameter');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IAzureBackupRecoveryPoint Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IAzureBackupRecoveryPoint Property');
```

## Alternate settings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults/backupInstances/recoveryPoints",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults/backupInstances",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down Expand Up @@ -177,92 +177,6 @@
}
]
},
{
"name": "Stop-AzDataProtectionBackupInstanceProtection",
"description": "This operation will stop protection of a backup instance and data will be held forever",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/stopProtection",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection/stop-azdataprotectionbackupinstanceprotection"
},
"parameterSets": [
{
"parameters": [
"-BackupInstanceName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]",
"-VaultName <String>"
]
}
]
},
"examples": [
{
"description": "This operation will stop protection of a backup instance and data will be held forever",
"parameters": [
{
"name": "-BackupInstanceName",
"value": "[Path.backupInstanceName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
},
{
"name": "-VaultName",
"value": "[Path.vaultName]"
}
]
}
]
},
{
"name": "Suspend-AzDataProtectionBackupInstanceBackup",
"description": "This operation will stop backup for a backup instance and retains the backup data as per the policy (except latest Recovery point, which will be retained forever)",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/suspendBackups",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection/suspend-azdataprotectionbackupinstancebackup"
},
"parameterSets": [
{
"parameters": [
"-BackupInstanceName <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String>]",
"-VaultName <String>"
]
}
]
},
"examples": [
{
"description": "This operation will stop backup for a backup instance and retains the backup data as per the policy (except latest Recovery point, which will be retained forever)",
"parameters": [
{
"name": "-BackupInstanceName",
"value": "[Path.backupInstanceName]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
},
{
"name": "-VaultName",
"value": "[Path.vaultName]"
}
]
}
]
},
{
"name": "Test-AzDataProtectionBackupInstanceRestore",
"description": "Validates if Restore can be triggered for a DataSource",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults/backupJobs",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults/backupPolicies",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults/backupResourceGuardProxies",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults/deletedBackupInstances",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "locations/operationStatus",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "resourceGuards",
"apiVersion": "2023-12-01",
"apiVersion": "2024-04-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
foreach($argResponse in $argInstanceResponse)
{
$jsonStringResponse = $argResponse | ConvertTo-Json -Depth 100
$backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.BackupInstanceResource]::FromJsonString($jsonStringResponse)
$backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.BackupInstanceResource]::FromJsonString($jsonStringResponse)
}
return $backupInstances
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
foreach($argVault in $argAllVaults)
{
$jsonStringResponse = $argVault | ConvertTo-Json -Depth 100
$backupVaults += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.BackupVaultResource]::FromJsonString($jsonStringResponse)
$backupVaults += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.BackupVaultResource]::FromJsonString($jsonStringResponse)
}
return $backupVaults
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
foreach($jobresponse in $argJobResponse)
{
$jsonStringResponse = $jobresponse | ConvertTo-Json -Depth 100
$backupJobs += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.AzureBackupJobResource]::FromJsonString($jsonStringResponse)
$backupJobs += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.AzureBackupJobResource]::FromJsonString($jsonStringResponse)
}
return $backupJobs
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function New-AzDataProtectionResourceGuard
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IResourceGuardResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IResourceGuardResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Creates a resource guard under a resource group')]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ function Unlock-AzDataProtectionResourceGuardOperation
else {
$ResGuardProxy = Get-AzDataProtectionResourceGuardMapping -VaultName $VaultName -ResourceGroupName $ResourceGroupName
}

# TODO : Add new operations

$CriticalOperationsMap = @{ DisableMUA = "deleteResourceGuardProxyRequests"; DeleteBackupInstance = "deleteBackupInstanceRequests" }

# modify Critical operation exclusion list
Expand Down
Loading
Loading