Skip to content
Open
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
14 changes: 7 additions & 7 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: b88b86f58a98ee1569ae6e7cba6f84061e15166b
commit: b53afea5edbeb0572a35b1ab34ca3f122cdbd70b
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2025-01-01/dataprotection.json
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2025-07-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 @@ -467,19 +467,19 @@ directive:
- EncryptionSettings
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBaseBackupPolicy Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IBaseBackupPolicy Property');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.ITriggerContext Trigger');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.ITriggerContext Trigger');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBackupParameters BackupParameter');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IBackupParameters BackupParameter');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IAzureBackupRecoveryPoint Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IAzureBackupRecoveryPoint Property');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.INamespacedNameResource ResourceModifierReference', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.INamespacedNameResource ResourceModifierReference');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.INamespacedNameResource ResourceModifierReference', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.INamespacedNameResource ResourceModifierReference');
```

## Alternate settings
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.Api202501.BackupInstanceResource]::FromJsonString($jsonStringResponse)
$backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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.Api202501.BackupVaultResource]::FromJsonString($jsonStringResponse)
$backupVaults += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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.Api202501.AzureBackupJobResource]::FromJsonString($jsonStringResponse)
$backupJobs += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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.Api202501.IResourceGuardResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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.Api202501.IResourceGuardResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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
@@ -1,5 +1,5 @@
function Initialize-AzDataProtectionBackupInstance {
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBackupInstanceResource')]
[OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IBackupInstanceResource')]
[CmdletBinding(PositionalBinding=$false)]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('Initializes Backup instance Request object for configuring backup')]

Expand Down Expand Up @@ -39,9 +39,9 @@
[Parameter(Mandatory=$false, HelpMessage='Friendly name for backup instance')]
[System.String]
${FriendlyName},
[Parameter(Mandatory=$false, HelpMessage='Backup configuration for backup. Use this parameter to configure protection for AzureKubernetesService,AzureBlob.')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IBackupDatasourceParameters]

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

[Parameter(Mandatory=$false, HelpMessage='Use system assigned identity')]
Expand All @@ -57,7 +57,7 @@
process {

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

if($manifest.snapshotRGPermissions.Length -eq 0 -and $SnapshotResourceGroupId -ne "")
Expand Down Expand Up @@ -113,7 +113,7 @@
throw "UserAssignedIdentityArmId cannot be provided without UseSystemAssignedIdentity and UseSystemAssignedIdentity must be false when UserAssignedIdentityArmId is provided."
}

$backupInstance.IdentityDetail = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.IdentityDetails]::new()
$backupInstance.IdentityDetail = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IdentityDetails]::new()
$backupInstance.IdentityDetail.UseSystemAssignedIdentity = $UseSystemAssignedIdentity

if ($hasUserAssignedIdentityArmId) {
Expand All @@ -131,9 +131,9 @@
$errormsg = "Please input SecretStoreType"
throw $errormsg
}
$backupInstance.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.SecretStoreBasedAuthCredentials]::new()
$backupInstance.DatasourceAuthCredentials = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.SecretStoreBasedAuthCredentials]::new()
$backupInstance.DatasourceAuthCredentials.ObjectType = "SecretStoreBasedAuthCredentials"
$backupInstance.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.SecretStoreResource]::new()
$backupInstance.DatasourceAuthCredentials.SecretStoreResource = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.SecretStoreResource]::new()
$backupInstance.DatasourceAuthCredentials.SecretStoreResource.SecretStoreType = $SecretStoreType
$backupInstance.DatasourceAuthCredentials.SecretStoreResource.Uri = $SecretStoreURI
}
Expand All @@ -143,7 +143,7 @@
}
}

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

if($PSBoundParameters.ContainsKey("DatasourceId"))
Expand All @@ -161,7 +161,7 @@

if($manifest.addDataStoreParametersList -eq $true)
{
$operationalParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.AzureOperationalStoreParameters]::new()
$operationalParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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 @@ -7,7 +7,7 @@ function New-AzDataProtectionBackupConfigurationClientObject{
param(
[Parameter(Mandatory, HelpMessage='Datasource Type')]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Support.DatasourceTypes]
[ValidateSet('AzureKubernetesService', 'AzureBlob')]
[ValidateSet('AzureKubernetesService', 'AzureBlob', 'AzureDataLakeStorage')]
${DatasourceType},

[Parameter(Mandatory=$false, HelpMessage='List of resource types to be excluded from backup')]
Expand Down 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.Api202501.NamespacedNameResource[]]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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.Api202501.KubernetesClusterBackupDatasourceParameters]::new()
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.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.Api202501.BlobBackupDatasourceParameters]::new()
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.BlobBackupDatasourceParameters]::new()
$dataSourceParam.ObjectType = "BlobBackupDatasourceParameters"

if($VaultedBackupContainer -ne $null){
Expand Down Expand Up @@ -134,6 +134,44 @@ function New-AzDataProtectionBackupConfigurationClientObject{
throw $message
}
}
elseif($DatasourceType.ToString() -eq "AzureDataLakeStorage"){
$dataSourceParam = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.AdlsBlobBackupDatasourceParameters]::new()
$dataSourceParam.ObjectType = "AdlsBlobBackupDatasourceParameters"

if($VaultedBackupContainer -ne $null){

# exclude containers which start with $ except $web, $root
$unsupportedContainers = $VaultedBackupContainer | Where-Object { $_ -like '$*' -and $_ -ne "`$root" -and $_ -ne "`$web"}
if($unsupportedContainers.Count -gt 0){
$message = "Following containers are not allowed for configure protection with AzureDataLakeStorage - $unsupportedContainers. Please remove them and proceed."
throw $message
}

$dataSourceParam.ContainersList = $VaultedBackupContainer
}
elseif($IncludeAllContainer){
if($StorageAccountName -eq $null -or $StorageAccountResourceGroupName -eq $null){
$message = "Please input StorageAccountName and StorageAccountResourceGroupName parameters for fetching all vaulted containers."
throw $message
}

CheckStorageModuleDependency
$storageAccount = Get-AzStorageAccount -ResourceGroupName $StorageAccountResourceGroupName -Name $StorageAccountName
$containers = Get-AzStorageContainer -Context $storageAccount.Context

# exclude containers which start with $ except $web, $root
$allContainers = $containers.Name | Where-Object { -not($_ -like '$*' -and $_ -ne "`$root" -and $_ -ne "`$web")}
$dataSourceParam.ContainersList = $allContainers
}
elseif($ExcludedResourceType -ne $null -or $IncludedResourceType -ne $null -or $ExcludedNamespace -ne $null -or $IncludedNamespace -ne $null -or $LabelSelector -ne $null -or $SnapshotVolume -ne $null -or $IncludeClusterScopeResource -ne $null){
$message = "Invalid parameters ExcludedResourceType, IncludedResourceType, ExcludedNamespace, IncludedNamespace, LabelSelector, SnapshotVolume, IncludeClusterScopeResource for given DatasourceType."
throw $message
}
else {
$message = "Please input VaultedBackupContainer or IncludeAllContainer parameters for given workload type."
throw $message
}
}

$dataSourceParam
}
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.Api202501.IBackupInstanceResource]
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.IBackupInstanceResource]
${BackupInstance},

[Parameter(Mandatory=$false, HelpMessage='Resource tags')]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function Stop-AzDataProtectionBackupInstanceProtection
{
$parameterSetName = $PsCmdlet.ParameterSetName
if($parameterSetName -eq "StopViaIdentity"){
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.StopProtectionRequest]::new()
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.StopProtectionRequest]::new()

$hasResourceGuardOperationRequest = $PSBoundParameters.Remove("ResourceGuardOperationRequest")
if($hasResourceGuardOperationRequest){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function Suspend-AzDataProtectionBackupInstanceBackup
{
$parameterSetName = $PsCmdlet.ParameterSetName
if($parameterSetName -eq "SuspendViaIdentity"){
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api202501.SuspendBackupRequest]::new()
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250701.SuspendBackupRequest]::new()

$hasResourceGuardOperationRequest = $PSBoundParameters.Remove("ResourceGuardOperationRequest")
if($hasResourceGuardOperationRequest){
Expand Down
Loading
Loading