Skip to content

Commit 54a1d17

Browse files
committed
Generated backup cmdlets
1 parent f89390b commit 54a1d17

File tree

241 files changed

+24298
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

241 files changed

+24298
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
bin
2+
obj
3+
.vs
4+
generated
5+
internal
6+
exports
7+
tools
8+
custom/*.psm1
9+
custom/autogen-model-cmdlets
10+
test/*-TestResults.xml
11+
/*.ps1
12+
/*.ps1xml
13+
/*.psm1
14+
/*.snk
15+
/*.csproj
16+
/*.nuspec
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@{
2+
GUID = '37eaf44e-78f7-4a5a-82d1-f6350681704b'
3+
RootModule = './Az.RecoveryServices.psm1'
4+
ModuleVersion = '0.1.0'
5+
CompatiblePSEditions = 'Core', 'Desktop'
6+
Author = 'Microsoft Corporation'
7+
CompanyName = 'Microsoft Corporation'
8+
Copyright = 'Microsoft Corporation. All rights reserved.'
9+
Description = 'Microsoft Azure PowerShell: RecoveryServices cmdlets'
10+
PowerShellVersion = '5.1'
11+
DotNetFrameworkVersion = '4.7.2'
12+
RequiredAssemblies = './bin/Az.RecoveryServices.private.dll'
13+
FormatsToProcess = './Az.RecoveryServices.format.ps1xml'
14+
FunctionsToExport = 'Export-AzRecoveryServicesJob', 'Get-AzRecoveryServicesBackupEngine', 'Get-AzRecoveryServicesBackupJob', 'Get-AzRecoveryServicesBackupOperationResult', 'Get-AzRecoveryServicesBackupOperationStatuses', 'Get-AzRecoveryServicesBackupPolicy', 'Get-AzRecoveryServicesBackupProtectableItem', 'Get-AzRecoveryServicesBackupProtectedItem', 'Get-AzRecoveryServicesBackupProtectionContainer', 'Get-AzRecoveryServicesBackupProtectionIntent', 'Get-AzRecoveryServicesBackupResourceEncryptionConfig', 'Get-AzRecoveryServicesBackupResourceStorageConfigsNonCrr', 'Get-AzRecoveryServicesBackupResourceVaultConfig', 'Get-AzRecoveryServicesBackupStatus', 'Get-AzRecoveryServicesBackupUsageSummary', 'Get-AzRecoveryServicesBackupWorkloadItem', 'Get-AzRecoveryServicesBmsPrepareDataMoveOperationResult', 'Get-AzRecoveryServicesDeletedProtectionContainer', 'Get-AzRecoveryServicesExportJobsOperationResult', 'Get-AzRecoveryServicesJobDetail', 'Get-AzRecoveryServicesJobOperationResult', 'Get-AzRecoveryServicesOperationStatus', 'Get-AzRecoveryServicesPrivateEndpointConnection', 'Get-AzRecoveryServicesPrivateEndpointOperationStatus', 'Get-AzRecoveryServicesProtectableContainer', 'Get-AzRecoveryServicesProtectedItem', 'Get-AzRecoveryServicesProtectedItemOperationResult', 'Get-AzRecoveryServicesProtectedItemOperationStatuses', 'Get-AzRecoveryServicesProtectionContainer', 'Get-AzRecoveryServicesProtectionContainerOperationResult', 'Get-AzRecoveryServicesProtectionContainerRefreshOperationResult', 'Get-AzRecoveryServicesProtectionIntent', 'Get-AzRecoveryServicesProtectionPolicy', 'Get-AzRecoveryServicesProtectionPolicyOperationResult', 'Get-AzRecoveryServicesProtectionPolicyOperationStatuses', 'Get-AzRecoveryServicesRecoveryPoint', 'Get-AzRecoveryServicesRecoveryPointsRecommendedForMove', 'Get-AzRecoveryServicesResourceGuardProxy', 'Get-AzRecoveryServicesSecurityPiN', 'Get-AzRecoveryServicesValidateOperationResult', 'Get-AzRecoveryServicesValidateOperationStatuses', 'Invoke-AzRecoveryServicesInquireProtectionContainer', 'Invoke-AzRecoveryServicesPrepare', 'Move-AzRecoveryServicesRecoveryPoint', 'New-AzRecoveryServicesItemLevelRecoveryConnection', 'New-AzRecoveryServicesProtectedItem', 'New-AzRecoveryServicesProtectionIntent', 'New-AzRecoveryServicesProtectionPolicy', 'Register-AzRecoveryServicesProtectionContainer', 'Remove-AzRecoveryServicesPrivateEndpointConnection', 'Remove-AzRecoveryServicesProtectedItem', 'Remove-AzRecoveryServicesProtectionIntent', 'Remove-AzRecoveryServicesProtectionPolicy', 'Remove-AzRecoveryServicesResourceGuardProxy', 'Revoke-AzRecoveryServicesItemLevelRecoveryConnection', 'Set-AzRecoveryServicesBackupResourceEncryptionConfig', 'Set-AzRecoveryServicesBackupResourceStorageConfigsNonCrr', 'Set-AzRecoveryServicesBackupResourceVaultConfig', 'Set-AzRecoveryServicesPrivateEndpointConnection', 'Set-AzRecoveryServicesProtectedItem', 'Set-AzRecoveryServicesProtectionIntent', 'Set-AzRecoveryServicesProtectionPolicy', 'Set-AzRecoveryServicesResourceGuardProxy', 'Start-AzRecoveryServices', 'Start-AzRecoveryServicesBackup', 'Start-AzRecoveryServicesJobCancellation', 'Start-AzRecoveryServicesRestore', 'Start-AzRecoveryServicesValidateOperation', 'Test-AzRecoveryServicesFeatureSupport', 'Test-AzRecoveryServicesProtectionIntent', 'Unlock-AzRecoveryServicesResourceGuardProxyDelete', 'Unregister-AzRecoveryServicesProtectionContainer', 'Update-AzRecoveryServicesBackupResourceStorageConfigsNonCrr', 'Update-AzRecoveryServicesBackupResourceVaultConfig', 'Update-AzRecoveryServicesProtectionContainer', '*'
15+
AliasesToExport = '*'
16+
PrivateData = @{
17+
PSData = @{
18+
Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'RecoveryServices'
19+
LicenseUri = 'https://aka.ms/azps-license'
20+
ProjectUri = 'https://github.com/Azure/azure-powershell'
21+
ReleaseNotes = ''
22+
}
23+
}
24+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.5.33530.505
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Az.RecoveryServices", "Az.RecoveryServices.csproj", "{3C36EEDB-664E-4165-8680-D40C4010D9D9}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{3C36EEDB-664E-4165-8680-D40C4010D9D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{3C36EEDB-664E-4165-8680-D40C4010D9D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{3C36EEDB-664E-4165-8680-D40C4010D9D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{3C36EEDB-664E-4165-8680-D40C4010D9D9}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {E67A86E5-D2A8-4374-B8CD-1D2A107A4A41}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
<!-- region Generated -->
2+
# Az.RecoveryServices
3+
This directory contains the PowerShell module for the RecoveryServices service.
4+
5+
---
6+
## Status
7+
[![Az.RecoveryServices](https://img.shields.io/powershellgallery/v/Az.RecoveryServices.svg?style=flat-square&label=Az.RecoveryServices "Az.RecoveryServices")](https://www.powershellgallery.com/packages/Az.RecoveryServices/)
8+
9+
## Info
10+
- Modifiable: yes
11+
- Generated: all
12+
- Committed: yes
13+
- Packaged: yes
14+
15+
---
16+
## Detail
17+
This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension.
18+
19+
## Module Requirements
20+
- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater
21+
22+
## Authentication
23+
AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent.
24+
25+
## Development
26+
For information on how to develop for `Az.RecoveryServices`, see [how-to.md](how-to.md).
27+
<!-- endregion -->
28+
29+
# My API
30+
31+
This file contains the configuration for generating My API from the OpenAPI specification.
32+
33+
> see https://aka.ms/autorest
34+
35+
``` yaml
36+
# it's the same options as command line options, just drop the double-dash!
37+
branch: c94569d116a82ee11a94c5dfb190650dd675a1bf
38+
require:
39+
- $(this-folder)/../readme.azure.noprofile.md
40+
input-file:
41+
- $(repo)/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/bms.json
42+
title: RecoveryServices
43+
directive:
44+
- no-inline:
45+
- DailyRetentionSchedule
46+
- HourlySchedule
47+
- MonthlyRetentionSchedule
48+
- Settings
49+
- WeeklyRetentionSchedule
50+
- YearlyRetentionSchedule
51+
- from: source-file-csharp
52+
where: $
53+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IProtectionPolicy Property', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IProtectionPolicy Property');
54+
- from: source-file-csharp
55+
where: $
56+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IRetentionPolicy RetentionPolicy', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.IRetentionPolicy RetentionPolicy');
57+
- from: source-file-csharp
58+
where: $
59+
transform: $ = $.replace('internal Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.ISchedulePolicy SchedulePolicy', 'public Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.Models.Api20230201.ISchedulePolicy SchedulePolicy');
60+
```
61+
62+
## Alternate settings
63+
64+
This section is only activated if the `--make-it-rain` switch is added to the command line
65+
66+
``` yaml $(make-it-rain)
67+
namespace: MyCompany.Special.Rest
68+
```
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Custom
2+
This directory contains custom implementation for non-generated cmdlets for the `Az.RecoveryServices` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `..\exports` folder. The only generated file into this folder is the `Az.RecoveryServices.custom.psm1`. This file should not be modified.
3+
4+
## Info
5+
- Modifiable: yes
6+
- Generated: partial
7+
- Committed: yes
8+
- Packaged: yes
9+
10+
## Details
11+
For `Az.RecoveryServices` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*.
12+
13+
For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.RecoveryServices.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder.
14+
15+
For script cmdlets, these are loaded via the `Az.RecoveryServices.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build.
16+
17+
## Purpose
18+
This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `..\exports` folder.
19+
20+
## Usage
21+
The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `..\exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters:
22+
- Break
23+
- DefaultProfile
24+
- HttpPipelineAppend
25+
- HttpPipelinePrepend
26+
- Proxy
27+
- ProxyCredential
28+
- ProxyUseDefaultCredentials
29+
30+
These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.RecoveryServices`. For C#, follow the usage seen in the `ProcessRecordAsync` method.
31+
32+
### Attributes
33+
For processing the cmdlets, we've created some additional attributes:
34+
- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.DescriptionAttribute`
35+
- Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://learn.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts.
36+
- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.DoNotExportAttribute`
37+
- Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.RecoveryServices`.
38+
- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.InternalExportAttribute`
39+
- Used in C# cmdlets to route exported cmdlets to the `..\internal`, which are *not exposed* by `Az.RecoveryServices`. For more information, see [README.md](..\internal/README.md) in the `..\internal` folder.
40+
- `Microsoft.Azure.PowerShell.Cmdlets.RecoveryServices.ProfileAttribute`
41+
- Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules.

0 commit comments

Comments
 (0)