Skip to content

Commit

Permalink
cmk ps changes added
Browse files Browse the repository at this point in the history
CmkEncryption tests added

CmkEncryption added to only UpdateExpanded variant

Updated help text for Update-AzDataProtectionBackupVault cmdlet
  • Loading branch information
Kartik Mahajan (from Dev Box) authored and Karmah24 committed Apr 19, 2024
1 parent e42b628 commit 52a167e
Show file tree
Hide file tree
Showing 81 changed files with 1,086 additions and 174 deletions.
42 changes: 34 additions & 8 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: c77bbf822be2deaac1b690270c6cd03a52df0e37
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-03-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 Down Expand Up @@ -104,6 +104,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 +163,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 @@ -249,6 +253,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 +369,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 +421,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.Api20240301.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.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.Api20240301.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.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.Api20240301.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.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.Api20240301.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.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-03-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-03-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/backupJobs",
"apiVersion": "2023-12-01",
"apiVersion": "2024-03-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-03-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-03-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-03-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-03-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-03-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-03-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.Api20240301.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.Api20240301.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.Api20240301.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.Api20240301.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 @@ -2,7 +2,7 @@

function Update-AzDataProtectionResourceGuard
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IResourceGuardResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.IResourceGuardResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Updates a resource guard belonging to a resource group')]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


function Initialize-AzDataProtectionBackupInstance {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBackupInstanceResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.IBackupInstanceResource')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Initializes Backup instance Request object for configuring backup')]

Expand Down Expand Up @@ -44,14 +44,14 @@ function Initialize-AzDataProtectionBackupInstance {
${FriendlyName},

[Parameter(Mandatory=$false, HelpMessage='Backup configuration for backup. Use this parameter to configure protection for AzureKubernetesService,AzureBlob.')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBackupDatasourceParameters]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.IBackupDatasourceParameters]
${BackupConfiguration}
)

process {

$manifest = LoadManifest -DatasourceType $DatasourceType.ToString()
$backupInstance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.BackupInstance]::new()
$backupInstance = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.BackupInstance]::new()
$backupInstance.ObjectType = "BackupInstance"

if($manifest.snapshotRGPermissions.Length -eq 0 -and $SnapshotResourceGroupId -ne "")
Expand Down Expand Up @@ -109,9 +109,9 @@ function Initialize-AzDataProtectionBackupInstance {
$errormsg = "Please input SecretStoreType"
throw $errormsg
}
$backupInstance.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.SecretStoreBasedAuthCredentials]::new()
$backupInstance.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.SecretStoreBasedAuthCredentials]::new()
$backupInstance.DatasourceAuthCredentials.ObjectType = "SecretStoreBasedAuthCredentials"
$backupInstance.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.SecretStoreResource]::new()
$backupInstance.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.SecretStoreResource]::new()
$backupInstance.DatasourceAuthCredentials.SecretStoreResource.SecretStoreType = $SecretStoreType
$backupInstance.DatasourceAuthCredentials.SecretStoreResource.Uri = $SecretStoreURI
}
Expand All @@ -121,7 +121,7 @@ function Initialize-AzDataProtectionBackupInstance {
}
}

$backupInstanceResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.BackupInstanceResource]::new()
$backupInstanceResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.BackupInstanceResource]::new()
$backupInstanceResource.Property = $backupInstance

if($PSBoundParameters.ContainsKey("DatasourceId"))
Expand All @@ -139,7 +139,7 @@ function Initialize-AzDataProtectionBackupInstance {

if($manifest.addDataStoreParametersList -eq $true)
{
$operationalParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.AzureOperationalStoreParameters]::new()
$operationalParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.AzureOperationalStoreParameters]::new()
$operationalParam.DataStoreType = "OperationalStore"
$operationalParam.ObjectType = "AzureOperationalStoreParameters"
$operationalParam.ResourceGroupId = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function New-AzDataProtectionBackupConfigurationClientObject{
${IncludeClusterScopeResource},

[Parameter(Mandatory=$false, HelpMessage='Hook reference to be executed during backup.')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.NamespacedNameResource[]]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.NamespacedNameResource[]]
${BackupHookReference},

[Parameter(Mandatory=$false, HelpMessage='List of containers to be backed up inside the VaultStore. Use this parameter for DatasourceType AzureBlob.')]
Expand Down Expand Up @@ -71,7 +71,7 @@ function New-AzDataProtectionBackupConfigurationClientObject{
throw $message
}

$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.KubernetesClusterBackupDatasourceParameters]::new()
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.KubernetesClusterBackupDatasourceParameters]::new()
$dataSourceParam.ObjectType = "KubernetesClusterBackupDatasourceParameters"

$dataSourceParam.ExcludedResourceType = $ExcludedResourceType
Expand All @@ -97,7 +97,7 @@ function New-AzDataProtectionBackupConfigurationClientObject{
}

if($DatasourceType.ToString() -eq "AzureBlob"){
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.BlobBackupDatasourceParameters]::new()
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.BlobBackupDatasourceParameters]::new()
$dataSourceParam.ObjectType = "BlobBackupDatasourceParameters"

if($VaultedBackupContainer -ne $null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function New-AzDataProtectionBackupInstance {
${VaultName},

[Parameter(Mandatory, HelpMessage='Backup instance request object which will be used to configure backup')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBackupInstanceResource]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.IBackupInstanceResource]
${BackupInstance},

[Parameter(Mandatory=$false, HelpMessage='Resource tags')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

function Update-AzDataProtectionBackupInstanceAssociatedPolicy
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IBackupInstanceResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.IBackupInstanceResource')]
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Updates associated policy for a given backup instance')]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function Get-AzDataProtectionJob
{
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20231201.IAzureBackupJobResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240301.IAzureBackupJobResource')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Gets or lists jobs in a backup vault')]

Expand Down
Loading

0 comments on commit 52a167e

Please sign in to comment.