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
2 changes: 0 additions & 2 deletions src/DataProtection/DataProtection.Autorest/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ generated
internal
exports
tools
custom/*.psm1
custom/autogen-model-cmdlets
test/*-TestResults.xml
license.txt
/*.ps1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - DataProtection")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.7.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.7.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("2.8.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("2.8.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
91 changes: 77 additions & 14 deletions src/DataProtection/DataProtection.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,41 @@ 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: ebdacd9571bc8a5faad5b8d418c70c3b6b7c2965
commit: 18609d68cf243ee3ce35d7c005ff3c7dd2cd9477
require:
- $(this-folder)/../../readme.azure.noprofile.md
input-file:
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/DataProtection/stable/2025-02-01/dataprotection.json
- $(repo)/specification/dataprotection/resource-manager/Microsoft.DataProtection/DataProtection/stable/2025-09-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:
"@autorest/powershell": "3.x"

directive:
- from: swagger-document
where: $.paths..parameters[?(@.name=='backupInstanceName')]
transform: $["description"] = "The name of the backup instance."
- from: swagger-document
where: $.paths..parameters[?(@.name=='vaultName')]
transform: $["description"] = "The name of the backup vault."
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}"].put
transform: delete $["x-ms-long-running-operation-options"];
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}"].put
transform: delete $["x-ms-long-running-operation-options"];
- from: swagger-document
where: $.definitions.ResourceDeletionInfo.properties
transform: >
$["deleteActivityID"] = $["deleteActivityId"];
delete $["deleteActivityId"];
- 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: $.definitions.BackupVault
transform: >
delete $.required;
- where:
parameter-name: XmsAuthorizationAuxiliary
set:
Expand Down Expand Up @@ -168,6 +189,16 @@ directive:
subject: ResourceGuardMapping
parameter-name: LastUpdatedTime|Description|ResourceGuardOperationDetail
hide: true
- where:
verb: Get
subject: DeletedBackupVault
variant: ^GetViaIdentity$
hide: true
- where:
verb: Get
subject: DeletedBackupVault
set:
subject: SoftDeletedBackupVault
- where:
verb: Get
subject: DeletedBackupInstance
Expand Down Expand Up @@ -269,6 +300,25 @@ directive:
verb: New
subject: BackupVault
hide: true
- where:
verb: New
subject: BackupVault
parameter-name: Parameter
set:
parameter-name: Parameter
clear-alias: true
- where:
verb: New
subject: BackupVault
variant: ^Create$
parameter-name: Parameter
required: false
- where:
verb: New
subject: BackupVault
variant: ^CreateExpanded$
parameter-name: StorageSetting
required: false
- where:
verb: Update
subject: BackupVault
Expand Down Expand Up @@ -304,6 +354,18 @@ directive:
subject: ResourceGuardMapping$
set:
verb: Set
- where:
verb: Get
subject: SoftDeletedBackupInstance
parameter-name: BackupInstanceName
set:
parameter-description: The name of the deleted backup instance
- where:
verb: Undo
subject: BackupInstanceDeletion
parameter-name: BackupInstanceName
set:
parameter-description: The name of the deleted backup instance
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges"].post
transform: $["description"] = "Finds the valid recovery point in time ranges for the restore."
Expand All @@ -322,35 +384,35 @@ directive:
- where:
verb: Test
subject: BackupInstance
variant: ^Validate2$|^ValidateExpanded2$|^ValidateViaIdentity2$|^ValidateViaIdentityExpanded2$
variant: ^Validate1$|^ValidateExpanded1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
set:
subject: BackupInstanceRestore
- where:
verb: Test
subject: BackupInstance
variant: ^Validate$|^ValidateExpanded$|^ValidateViaIdentity$|^ValidateViaIdentityExpanded$
variant: ^Validate2$|^ValidateExpanded2$|^ValidateViaIdentity2$|^ValidateViaIdentityExpanded2$
set:
subject: BackupInstanceReadiness
- where:
verb: Test
subject: BackupInstance
variant: ^Validate1$|^ValidateExpanded1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
variant: ^Validate$|^ValidateExpanded$|^ValidateViaIdentity$|^ValidateViaIdentityExpanded$
set:
subject: BackupInstanceUpdate
- where:
verb: Test
subject: BackupInstanceUpdate
variant: ^Validate1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
variant: ^Validate$|^ValidateViaIdentity$|^ValidateViaIdentityExpanded$
hide: true
- where:
verb: Test
subject: BackupInstanceReadiness
variant: ^Validate$|^ValidateViaIdentity$|^ValidateViaIdentityExpanded$
variant: ^Validate2$|^ValidateViaIdentity2$|^ValidateViaIdentityExpanded2$
hide: true
- where:
verb: Test
subject: BackupInstanceRestore
variant: ^Validate2$|^ValidateExpanded2$|^ValidateViaIdentity2$|^ValidateViaIdentityExpanded2$
variant: ^Validate1$|^ValidateExpanded1$|^ValidateViaIdentity1$|^ValidateViaIdentityExpanded1$
hide: true
- where:
verb: Test
Expand Down Expand Up @@ -452,9 +514,11 @@ directive:
- CrossRegionRestoreDetails
- CrossRegionRestoreRequestObject
- DeletionInfo
- EncryptionSettings
- InnerError
- ItemLevelRestoreTargetInfo
- PolicyParameters
- ResourceDeletionInfo
- RestoreFilesTargetInfo
- RestoreTargetInfo
- RestoreTargetInfoBase
Expand All @@ -464,22 +528,21 @@ directive:
- UserFacingError
- ValidateRestoreRequestObject
- ValidateCrossRegionRestoreRequestObject
- EncryptionSettings
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.IBaseBackupPolicy Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IBaseBackupPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IBaseBackupPolicy Property');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.ITriggerContext Trigger');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.ITriggerContext Trigger', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.ITriggerContext Trigger');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.IBackupParameters BackupParameter');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IBackupParameters BackupParameter', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IBackupParameters BackupParameter');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.IAzureBackupRecoveryPoint Property');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IAzureBackupRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.IAzureBackupRecoveryPoint Property');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.INamespacedNameResource ResourceModifierReference', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250201.INamespacedNameResource ResourceModifierReference');
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.INamespacedNameResource ResourceModifierReference', 'public Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.INamespacedNameResource ResourceModifierReference');
```

## Alternate settings
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "backupVaults/backupInstances/recoveryPoints",
"apiVersion": "2025-02-01",
"apiVersion": "2025-09-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": "2025-02-01",
"apiVersion": "2025-09-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": "2025-02-01",
"apiVersion": "2025-09-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": "2025-02-01",
"apiVersion": "2025-09-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": "2025-02-01",
"apiVersion": "2025-09-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": "2025-02-01",
"apiVersion": "2025-09-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": "2025-02-01",
"apiVersion": "2025-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"resourceType": "locations/deletedVaults",
"apiVersion": "2025-09-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection"
},
"commands": [
{
"name": "Get-AzDataProtectionSoftDeletedBackupVault",
"description": "Gets a deleted backup vault",
"path": "/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/deletedVaults/{deletedVaultName}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.dataprotection/get-azdataprotectionsoftdeletedbackupvault"
},
"parameterSets": [
{
"parameters": [
"-DeletedVaultName <String>",
"-Location <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Gets a deleted backup vault",
"parameters": [
{
"name": "-DeletedVaultName",
"value": "[Path.deletedVaultName]"
},
{
"name": "-Location",
"value": "[Path.location]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"resourceType": "locations/operationStatus",
"apiVersion": "2025-02-01",
"apiVersion": "2025-09-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": "2025-02-01",
"apiVersion": "2025-09-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.Api20250201.BackupInstanceResource]::FromJsonString($jsonStringResponse)
$backupInstances += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.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.Api20250201.BackupVaultResource]::FromJsonString($jsonStringResponse)
$backupVaults += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.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.Api20250201.AzureBackupJobResource]::FromJsonString($jsonStringResponse)
$backupJobs += [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20250901.AzureBackupJobResource]::FromJsonString($jsonStringResponse)
}
return $backupJobs
}
Expand Down
Loading
Loading