Skip to content

Added Configure protection commands #24791

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

Draft
wants to merge 2 commits into
base: generation-RecoveryServices-preview
Choose a base branch
from
Draft
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.RecoveryServices.private.dll'
FormatsToProcess = './Az.RecoveryServices.format.ps1xml'
FunctionsToExport = 'Edit-AzRecoveryServicesBackupRetentionPolicyClientObject', 'Edit-AzRecoveryServicesBackupSchedulePolicyClientObject', 'Get-AzRecoveryServicesBackupContainer', 'Get-AzRecoveryServicesBackupItem', 'Get-AzRecoveryServicesBackupProtectableItem', 'Get-AzRecoveryServicesBackupProtectionPolicy', 'Get-AzRecoveryServicesPolicyTemplate', 'New-AzRecoveryServicesBackupProtectionPolicy', 'Register-AzRecoveryServicesBackupContainer', 'Remove-AzRecoveryServicesBackupProtectionPolicy', '*'
FunctionsToExport = 'Edit-AzRecoveryServicesBackupRetentionPolicyClientObject', 'Edit-AzRecoveryServicesBackupSchedulePolicyClientObject', 'Enable-AzRecoveryServicesBackupProtection', 'Get-AzRecoveryServicesBackupContainer', 'Get-AzRecoveryServicesBackupItem', 'Get-AzRecoveryServicesBackupOperationResult', 'Get-AzRecoveryServicesBackupOperationStatuses', 'Get-AzRecoveryServicesBackupProtectableItem', 'Get-AzRecoveryServicesBackupProtectionPolicy', 'Get-AzRecoveryServicesBackupStatus', 'Get-AzRecoveryServicesOperationStatus', 'Get-AzRecoveryServicesPolicyTemplate', 'Get-AzRecoveryServicesProtectionContainerOperationResult', 'Get-AzRecoveryServicesProtectionContainerRefreshOperationResult', 'Get-AzRecoveryServicesProtectionPolicyOperationResult', 'Get-AzRecoveryServicesProtectionPolicyOperationStatuses', 'Invoke-AzRecoveryServicesInquireProtectionContainer', 'New-AzRecoveryServicesBackupProtectionPolicy', 'Register-AzRecoveryServicesBackupContainer', 'Remove-AzRecoveryServicesBackupProtectionPolicy', 'Unregister-AzRecoveryServicesBackupContainer', '*'
AliasesToExport = 'Set-AzRecoveryServicesBackupprotectionPolicy', '*'
PrivateData = @{
PSData = @{
Expand Down
26 changes: 18 additions & 8 deletions src/RecoveryServices/RecoveryServices.Backup.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ title: RecoveryServices
use-extension:
"@autorest/powershell": "3.x"

inlining-threshold: 0
directive:
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}"].put
Expand All @@ -55,9 +56,15 @@ directive:
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers"].post
transform: $["x-ms-long-running-operation"] = true
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire"].post
transform: $["x-ms-long-running-operation"] = true
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}"].put
transform: $["x-ms-long-running-operation"] = true
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}"].delete
transform: $["x-ms-long-running-operation"] = true
- where:
verb: New
subject: ProtectionPolicy
Expand Down Expand Up @@ -88,7 +95,7 @@ directive:
set:
subject: BackupPolicy
- where:
subject: Job|BackupEngine|OperationResult|OperationStatuses|EncryptionConfig|StorageConfigsNonCrr|VaultConfig|BackupStatus|BackupUsageSummary|JobDetail|PrivateEndpointConnection|RecoveryPoint|RecommendedForMove|ResourceGuardProxy|SecurityPiN|ItemLevelRecoveryConnection|Restore|Cancellation|ValidateOperation|ResourceGuardProxyDelete|Prepare|FeatureSupport|WorkloadItem|DeletedProtectionContainer|InquireProtectionContainer|PrivateEndpointOperationStatus|^ProtectionIntent
subject: Job|BackupEngine|EncryptionConfig|StorageConfigsNonCrr|VaultConfig|BackupUsageSummary|JobDetail|PrivateEndpointConnection|RecoveryPoint|RecommendedForMove|ResourceGuardProxy|SecurityPiN|ItemLevelRecoveryConnection|Restore|Cancellation|ValidateOperation|ResourceGuardProxyDelete|Prepare|FeatureSupport|WorkloadItem|DeletedProtectionContainer|PrivateEndpointOperationStatus|^ProtectionIntent
remove: true
- where:
verb: Start
Expand All @@ -97,7 +104,7 @@ directive:
verb: Set
subject: BackupPolicy
remove: true
- where:
- where:
verb: Get
subject: BackupPolicy
hide: true
Expand All @@ -109,16 +116,16 @@ directive:
- where:
subject: BackupProtectableItem
hide: true
- where:
verb: Unregister
subject: ProtectionContainer
remove: true
- where:
verb: New|Remove|Set
verb: Remove|Set
subject: ProtectedItem
remove: true
- where:
subject: ProtectedItem|ProtectionIntent|OperationStatus|ProtectionContainer|ProtectableContainer
subject: ProtectedItem|ProtectionIntent|ProtectableContainer
hide: true
- where:
verb: Get|Update|^Register$|Unregister
subject: .*ProtectionContainer$
hide: true
- no-inline:
- DailyRetentionSchedule
Expand Down Expand Up @@ -159,4 +166,7 @@ directive:
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IRecoveryPoint Property', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IRecoveryPoint Property');
- from: source-file-csharp
where: $
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IOperationStatusExtendedInfo Property', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IOperationStatusExtendedInfo Property');
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"resourceType": "locations",
"apiVersion": "2023-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices"
},
"commands": [
{
"name": "Get-AzRecoveryServicesBackupStatus",
"description": "Get the container backup status",
"path": "/Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices/get-azrecoveryservicesbackupstatus"
},
"parameterSets": [
{
"parameters": [
"-AzureRegion <String>",
"[-SubscriptionId <String[]>]"
]
}
]
},
"examples": [
{
"description": "Get the container backup status",
"parameters": [
{
"name": "-AzureRegion",
"value": "[Path.azureRegion]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"resourceType": "vaults/backupFabrics/operationResults",
"apiVersion": "2023-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices"
},
"commands": [
{
"name": "Get-AzRecoveryServicesProtectionContainerRefreshOperationResult",
"description": "Provides the result of the refresh operation triggered by the BeginRefresh operation.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices/get-azrecoveryservicesprotectioncontainerrefreshoperationresult"
},
"parameterSets": [
{
"parameters": [
"-FabricName <String>",
"-OperationId <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]",
"-VaultName <String>"
]
}
]
},
"examples": [
{
"description": "Provides the result of the refresh operation triggered by the BeginRefresh operation.",
"parameters": [
{
"name": "-FabricName",
"value": "[Path.fabricName]"
},
{
"name": "-OperationId",
"value": "[Path.operationId]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
},
{
"name": "-VaultName",
"value": "[Path.vaultName]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"resourceType": "vaults/backupFabrics/protectionContainers/operationResults",
"apiVersion": "2023-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices"
},
"commands": [
{
"name": "Get-AzRecoveryServicesProtectionContainerOperationResult",
"description": "Fetches the result of any operation on the container.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices/get-azrecoveryservicesprotectioncontaineroperationresult"
},
"parameterSets": [
{
"parameters": [
"-ContainerName <String>",
"-FabricName <String>",
"-OperationId <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]",
"-VaultName <String>"
]
}
]
},
"examples": [
{
"description": "Fetches the result of any operation on the container.",
"parameters": [
{
"name": "-ContainerName",
"value": "[Path.containerName]"
},
{
"name": "-FabricName",
"value": "[Path.fabricName]"
},
{
"name": "-OperationId",
"value": "[Path.operationId]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
},
{
"name": "-VaultName",
"value": "[Path.vaultName]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"resourceType": "vaults/backupOperationResults",
"apiVersion": "2023-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices"
},
"commands": [
{
"name": "Get-AzRecoveryServicesBackupOperationResult",
"description": "Provides the status of the delete operations such as deleting backed up item.\nOnce the operation has started, the\\r\\nstatus code in the response would be Accepted.\nIt will continue to be in this state till it reaches completion.\nOn\\r\\nsuccessful completion, the status code will be OK.\nThis method expects OperationID as an argument.\nOperationID is\\r\\npart of the Location header of the operation response.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices/get-azrecoveryservicesbackupoperationresult"
},
"parameterSets": [
{
"parameters": [
"-OperationId <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]",
"-VaultName <String>"
]
}
]
},
"examples": [
{
"description": "Provides the status of the delete operations such as deleting backed up item. Once the operation has started, the\\r\\nstatus code in the response would be Accepted. It will continue to be in this state till it reaches completion. On\\r\\nsuccessful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is\\r\\npart of the Location header of the operation response.",
"parameters": [
{
"name": "-OperationId",
"value": "[Path.operationId]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
},
{
"name": "-VaultName",
"value": "[Path.vaultName]"
}
]
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"resourceType": "vaults/backupOperations",
"apiVersion": "2023-02-01",
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices"
},
"commands": [
{
"name": "Get-AzRecoveryServicesBackupOperationStatuses",
"description": "Fetches the status of an operation such as triggering a backup, restore.\nThe status can be in progress, completed\\r\\nor failed.\nYou can refer to the OperationStatus enum for all the possible states of an operation.\nSome operations\\r\\ncreate jobs.\nThis method returns the list of jobs when the operation is complete.",
"path": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}",
"help": {
"learnMore": {
"url": "https://learn.microsoft.com/powershell/module/az.recoveryservices/get-azrecoveryservicesbackupoperationstatuses"
},
"parameterSets": [
{
"parameters": [
"-OperationId <String>",
"-ResourceGroupName <String>",
"[-SubscriptionId <String[]>]",
"-VaultName <String>"
]
}
]
},
"examples": [
{
"description": "Fetches the status of an operation such as triggering a backup, restore. The status can be in progress, completed\\r\\nor failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some operations\\r\\ncreate jobs. This method returns the list of jobs when the operation is complete.",
"parameters": [
{
"name": "-OperationId",
"value": "[Path.operationId]"
},
{
"name": "-ResourceGroupName",
"value": "[Path.resourceGroupName]"
},
{
"name": "-SubscriptionId",
"value": "[Path.subscriptionId]"
},
{
"name": "-VaultName",
"value": "[Path.vaultName]"
}
]
}
]
}
]
}
Loading
Loading