Skip to content

Commit 156fea4

Browse files
committed
fixed CI issues
1 parent f6cb922 commit 156fea4

12 files changed

+451
-502
lines changed

src/DataProtection/DataProtection.Autorest/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ directive:
245245
- where:
246246
verb: Stop
247247
subject: ^BackupInstanceProtection$
248-
variant: StopExpanded$
249-
hide: true
248+
variant: StopExpanded$|StopViaIdentity$
249+
hide: true
250250
- where:
251251
verb: Suspend
252252
subject: ^BackupInstanceBackup$
@@ -255,7 +255,7 @@ directive:
255255
- where:
256256
verb: Suspend
257257
subject: ^BackupInstanceBackup$
258-
variant: SuspendExpanded$
258+
variant: SuspendExpanded$|SuspendViaIdentity$
259259
hide: true
260260
- where:
261261
verb: Get

src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Platform/BackupInstance/Stop-AzDataProtectionBackupInstanceProtection.ps1

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,28 @@ function Stop-AzDataProtectionBackupInstanceProtection
66
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
77
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('This operation will stop protection of a backup instance and data will be held forever')]
88

9-
param(
10-
# Stop, StopExpanded
11-
[Parameter(Mandatory=$false, HelpMessage='Subscription Id of the backup vault')]
9+
param(
10+
[Parameter(ParameterSetName="Stop", Mandatory=$false, HelpMessage='Subscription Id of the backup vault')]
1211
[System.String]
1312
${SubscriptionId},
1413

15-
[Parameter(Mandatory, HelpMessage='The name of the resource group where the backup vault is present')]
14+
[Parameter(ParameterSetName="Stop", Mandatory, HelpMessage='The name of the resource group where the backup vault is present')]
1615
[System.String]
1716
${ResourceGroupName},
1817

19-
[Parameter(Mandatory, HelpMessage='The name of the backup instance')]
18+
[Parameter(ParameterSetName="Stop", Mandatory, HelpMessage='The name of the backup instance')]
2019
[System.String]
2120
${BackupInstanceName},
2221

23-
[Parameter(Mandatory, HelpMessage='The name of the backup vault')]
22+
[Parameter(ParameterSetName="Stop", Mandatory, HelpMessage='The name of the backup vault')]
2423
[System.String]
2524
${VaultName},
2625

27-
#[Parameter(ParameterSetName="Stop", Mandatory, HelpMessage='Restore request object to be initialized using Initialize-AzDataProtectionRestoreRequest cmdlet', #ValueFromPipeline=$true)]
28-
#[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IStopProtectionRequest]
29-
#${Parameter},
26+
[Parameter(ParameterSetName="StopViaIdentity", Mandatory, HelpMessage='Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.', ValueFromPipeline=$true)]
27+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
28+
${InputObject},
3029

31-
[Parameter(ParameterSetName="Stop", Mandatory=$false, HelpMessage='Resource guard operation request in the format similar to <ResourceGuard-ARMID>/dppDisableStopProtectionRequests/default. Use this parameter when the operation is MUA protected.')]
30+
[Parameter(Mandatory=$false, HelpMessage='Resource guard operation request in the format similar to <ResourceGuard-ARMID>/dppDisableStopProtectionRequests/default. Use this parameter when the operation is MUA protected.')]
3231
[System.String[]]
3332
${ResourceGuardOperationRequest},
3433

@@ -93,12 +92,24 @@ function Stop-AzDataProtectionBackupInstanceProtection
9392

9493
process
9594
{
95+
$parameterSetName = $PsCmdlet.ParameterSetName
96+
if($parameterSetName -eq "StopViaIdentity"){
97+
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.StopProtectionRequest]::new()
98+
99+
$hasResourceGuardOperationRequest = $PSBoundParameters.Remove("ResourceGuardOperationRequest")
100+
if($hasResourceGuardOperationRequest){
101+
$Parameter.ResourceGuardOperationRequest = $ResourceGuardOperationRequest
102+
}
103+
104+
$null = $PSBoundParameters.Add("Parameter", $Parameter)
105+
}
106+
96107
if($PSBoundParameters.ContainsKey("Token"))
97108
{
98109
$null = $PSBoundParameters.Remove("Token")
99110
$null = $PSBoundParameters.Add("Token", "Bearer $Token")
100-
}
101-
111+
}
112+
102113
Az.DataProtection.Internal\Stop-AzDataProtectionBackupInstanceProtection @PSBoundParameters
103114
}
104115
}

src/DataProtection/DataProtection.Autorest/custom/Cmdlets/Platform/BackupInstance/Suspend-AzDataProtectionBackupInstanceBackup.ps1

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,30 +6,28 @@ function Suspend-AzDataProtectionBackupInstanceBackup
66
[CmdletBinding(PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
77
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('This operation will stop backup for a backup instance and retains the backup data as per the policy except latest Recovery point, which will be retained forever')]
88

9-
param(
10-
# Stop, StopExpanded
11-
[Parameter(Mandatory=$false, HelpMessage='Subscription Id of the backup vault')]
9+
param(
10+
[Parameter(ParameterSetName="Suspend", Mandatory=$false, HelpMessage='Subscription Id of the backup vault')]
1211
[System.String]
1312
${SubscriptionId},
1413

15-
[Parameter(Mandatory, HelpMessage='The name of the resource group where the backup vault is present')]
14+
[Parameter(ParameterSetName="Suspend", Mandatory, HelpMessage='The name of the resource group where the backup vault is present')]
1615
[System.String]
1716
${ResourceGroupName},
1817

19-
[Parameter(Mandatory, HelpMessage='The name of the backup instance')]
18+
[Parameter(ParameterSetName="Suspend", Mandatory, HelpMessage='The name of the backup instance')]
2019
[System.String]
2120
${BackupInstanceName},
2221

23-
[Parameter(Mandatory, HelpMessage='The name of the backup vault')]
22+
[Parameter(ParameterSetName="Suspend", Mandatory, HelpMessage='The name of the backup vault')]
2423
[System.String]
2524
${VaultName},
2625

27-
# TODO: remove from here and StopProtection
28-
#[Parameter(ParameterSetName="Stop", Mandatory, HelpMessage='Restore request object to be initialized using Initialize-AzDataProtectionRestoreRequest cmdlet', #ValueFromPipeline=$true)]
29-
#[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ISuspendBackupRequest]
30-
#${Parameter},
26+
[Parameter(ParameterSetName="SuspendViaIdentity", Mandatory, HelpMessage='Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.', ValueFromPipeline=$true)]
27+
[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity]
28+
${InputObject},
3129

32-
[Parameter(ParameterSetName="Suspend", Mandatory=$false, HelpMessage='Resource guard operation request in the format similar to <ResourceGuard-ARMID>/dppDisableSuspendBackupsRequests/default. Use this parameter when the operation is MUA protected.')]
30+
[Parameter(Mandatory=$false, HelpMessage='Resource guard operation request in the format similar to <ResourceGuard-ARMID>/dppDisableSuspendBackupsRequests/default. Use this parameter when the operation is MUA protected.')]
3331
[System.String[]]
3432
${ResourceGuardOperationRequest},
3533

@@ -94,6 +92,18 @@ function Suspend-AzDataProtectionBackupInstanceBackup
9492

9593
process
9694
{
95+
$parameterSetName = $PsCmdlet.ParameterSetName
96+
if($parameterSetName -eq "SuspendViaIdentity"){
97+
$Parameter = [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.SuspendBackupRequest]::new()
98+
99+
$hasResourceGuardOperationRequest = $PSBoundParameters.Remove("ResourceGuardOperationRequest")
100+
if($hasResourceGuardOperationRequest){
101+
$Parameter.ResourceGuardOperationRequest = $ResourceGuardOperationRequest
102+
}
103+
104+
$null = $PSBoundParameters.Add("Parameter", $Parameter)
105+
}
106+
97107
if($PSBoundParameters.ContainsKey("Token"))
98108
{
99109
$null = $PSBoundParameters.Remove("Token")

src/DataProtection/DataProtection.Autorest/docs/Az.DataProtection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Triggers restore for a BackupInstance
138138
This operation will stop protection of a backup instance and data will be held forever
139139

140140
### [Suspend-AzDataProtectionBackupInstanceBackup](Suspend-AzDataProtectionBackupInstanceBackup.md)
141-
This operation will stop backup for a backup instance and retains the backup data as per the policy (except latest Recovery point, which will be retained forever)
141+
This operation will stop backup for a backup instance and retains the backup data as per the policy except latest Recovery point, which will be retained forever
142142

143143
### [Sync-AzDataProtectionBackupInstance](Sync-AzDataProtectionBackupInstance.md)
144144
Sync backup instance again in case of failure\r\nThis action will retry last failed operation and will bring backup instance to valid state

src/DataProtection/DataProtection.Autorest/docs/Stop-AzDataProtectionBackupInstanceProtection.md

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,44 +15,29 @@ This operation will stop protection of a backup instance and data will be held f
1515
### Stop (Default)
1616
```
1717
Stop-AzDataProtectionBackupInstanceProtection -BackupInstanceName <String> -ResourceGroupName <String>
18-
-VaultName <String> [-Token <String>] [-AsJob] [-DefaultProfile <PSObject>] [-NoWait] [-PassThru]
19-
[-ResourceGuardOperationRequest <String[]>] [-SubscriptionId <String>] [-Confirm] [-WhatIf]
18+
-VaultName <String> [-AsJob] [-DefaultProfile <PSObject>] [-NoWait] [-PassThru]
19+
[-ResourceGuardOperationRequest <String[]>] [-SubscriptionId <String>] [-Token <String>] [-Confirm] [-WhatIf]
2020
[<CommonParameters>]
2121
```
2222

2323
### StopViaIdentity
2424
```
25-
Stop-AzDataProtectionBackupInstanceProtection -InputObject <IDataProtectionIdentity>
26-
-Parameter <IStopProtectionRequest> [-Token <String>] [-AsJob] [-DefaultProfile <PSObject>] [-NoWait]
27-
[-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
25+
Stop-AzDataProtectionBackupInstanceProtection -InputObject <IDataProtectionIdentity> [-AsJob]
26+
[-DefaultProfile <PSObject>] [-NoWait] [-PassThru] [-ResourceGuardOperationRequest <String[]>]
27+
[-Token <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
2828
```
2929

3030
## DESCRIPTION
3131
This operation will stop protection of a backup instance and data will be held forever
3232

3333
## EXAMPLES
3434

35-
### Example 1: {{ Add title here }}
35+
### Example 1: Stop protection for a backup instance
3636
```powershell
37-
{{ Add code here }}
37+
Stop-AzDataProtectionBackupInstanceProtection -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
3838
```
3939

40-
```output
41-
{{ Add output here }}
42-
```
43-
44-
{{ Add description here }}
45-
46-
### Example 2: {{ Add title here }}
47-
```powershell
48-
{{ Add code here }}
49-
```
50-
51-
```output
52-
{{ Add output here }}
53-
```
54-
55-
{{ Add description here }}
40+
The above command can be used to stop protection of a backup instance
5641

5742
## PARAMETERS
5843

@@ -87,8 +72,7 @@ Accept wildcard characters: False
8772
```
8873
8974
### -DefaultProfile
90-
The DefaultProfile parameter is not functional.
91-
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
75+
9276
9377
```yaml
9478
Type: System.Management.Automation.PSObject
@@ -133,22 +117,6 @@ Accept pipeline input: False
133117
Accept wildcard characters: False
134118
```
135119
136-
### -Parameter
137-
Request body of Stop protection when MUA is Enabled
138-
To construct, see NOTES section for PARAMETER properties and create a hash table.
139-
140-
```yaml
141-
Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IStopProtectionRequest
142-
Parameter Sets: StopViaIdentity
143-
Aliases:
144-
145-
Required: True
146-
Position: Named
147-
Default value: None
148-
Accept pipeline input: True (ByValue)
149-
Accept wildcard characters: False
150-
```
151-
152120
### -PassThru
153121
Returns true when the command succeeds
154122
@@ -185,7 +153,7 @@ Use this parameter when the operation is MUA protected.
185153
186154
```yaml
187155
Type: System.String[]
188-
Parameter Sets: Stop
156+
Parameter Sets: (All)
189157
Aliases:
190158

191159
Required: False
@@ -277,8 +245,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
277245
278246
## INPUTS
279247
280-
### Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IStopProtectionRequest
281-
282248
### Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
283249
284250
## OUTPUTS

src/DataProtection/DataProtection.Autorest/docs/Suspend-AzDataProtectionBackupInstanceBackup.md

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,36 @@ schema: 2.0.0
88
# Suspend-AzDataProtectionBackupInstanceBackup
99

1010
## SYNOPSIS
11-
This operation will stop backup for a backup instance and retains the backup data as per the policy (except latest Recovery point, which will be retained forever)
11+
This operation will stop backup for a backup instance and retains the backup data as per the policy except latest Recovery point, which will be retained forever
1212

1313
## SYNTAX
1414

1515
### Suspend (Default)
1616
```
1717
Suspend-AzDataProtectionBackupInstanceBackup -BackupInstanceName <String> -ResourceGroupName <String>
18-
-VaultName <String> [-Token <String>] [-AsJob] [-DefaultProfile <PSObject>] [-NoWait] [-PassThru]
19-
[-ResourceGuardOperationRequest <String[]>] [-SubscriptionId <String>] [-Confirm] [-WhatIf]
18+
-VaultName <String> [-AsJob] [-DefaultProfile <PSObject>] [-NoWait] [-PassThru]
19+
[-ResourceGuardOperationRequest <String[]>] [-SubscriptionId <String>] [-Token <String>] [-Confirm] [-WhatIf]
2020
[<CommonParameters>]
2121
```
2222

2323
### SuspendViaIdentity
2424
```
25-
Suspend-AzDataProtectionBackupInstanceBackup -InputObject <IDataProtectionIdentity>
26-
-Parameter <ISuspendBackupRequest> [-Token <String>] [-AsJob] [-DefaultProfile <PSObject>] [-NoWait]
27-
[-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
25+
Suspend-AzDataProtectionBackupInstanceBackup -InputObject <IDataProtectionIdentity> [-AsJob]
26+
[-DefaultProfile <PSObject>] [-NoWait] [-PassThru] [-ResourceGuardOperationRequest <String[]>]
27+
[-Token <String>] [-Confirm] [-WhatIf] [<CommonParameters>]
2828
```
2929

3030
## DESCRIPTION
31-
This operation will stop backup for a backup instance and retains the backup data as per the policy (except latest Recovery point, which will be retained forever)
31+
This operation will stop backup for a backup instance and retains the backup data as per the policy except latest Recovery point, which will be retained forever
3232

3333
## EXAMPLES
3434

35-
### Example 1: {{ Add title here }}
35+
### Example 1: Suspend backups for a backup instance
3636
```powershell
37-
{{ Add code here }}
37+
Suspend-AzDataProtectionBackupInstanceBackup -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
3838
```
3939

40-
```output
41-
{{ Add output here }}
42-
```
43-
44-
{{ Add description here }}
45-
46-
### Example 2: {{ Add title here }}
47-
```powershell
48-
{{ Add code here }}
49-
```
50-
51-
```output
52-
{{ Add output here }}
53-
```
54-
55-
{{ Add description here }}
40+
The above command can be used to stop backups of a backup instance, this will move the backup instance to a suspended state.
5641

5742
## PARAMETERS
5843

@@ -87,8 +72,7 @@ Accept wildcard characters: False
8772
```
8873
8974
### -DefaultProfile
90-
The DefaultProfile parameter is not functional.
91-
Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.
75+
9276
9377
```yaml
9478
Type: System.Management.Automation.PSObject
@@ -133,22 +117,6 @@ Accept pipeline input: False
133117
Accept wildcard characters: False
134118
```
135119
136-
### -Parameter
137-
Request body of Suspend backup when MUA is Enabled
138-
To construct, see NOTES section for PARAMETER properties and create a hash table.
139-
140-
```yaml
141-
Type: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ISuspendBackupRequest
142-
Parameter Sets: SuspendViaIdentity
143-
Aliases:
144-
145-
Required: True
146-
Position: Named
147-
Default value: None
148-
Accept pipeline input: True (ByValue)
149-
Accept wildcard characters: False
150-
```
151-
152120
### -PassThru
153121
Returns true when the command succeeds
154122
@@ -185,7 +153,7 @@ Use this parameter when the operation is MUA protected.
185153
186154
```yaml
187155
Type: System.String[]
188-
Parameter Sets: Suspend
156+
Parameter Sets: (All)
189157
Aliases:
190158

191159
Required: False
@@ -277,8 +245,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
277245
278246
## INPUTS
279247
280-
### Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.ISuspendBackupRequest
281-
282248
### Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IDataProtectionIdentity
283249
284250
## OUTPUTS
Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1-
### Example 1: {{ Add title here }}
1+
### Example 1: Stop protection for a backup instance
22
```powershell
3-
{{ Add code here }}
3+
Stop-AzDataProtectionBackupInstanceProtection -ResourceGroupName "rgName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx" -VaultName "vaultName" -BackupInstanceName $backupInstance.BackupInstanceName
44
```
55

6-
```output
7-
{{ Add output here }}
8-
```
9-
10-
{{ Add description here }}
11-
12-
### Example 2: {{ Add title here }}
13-
```powershell
14-
{{ Add code here }}
15-
```
16-
17-
```output
18-
{{ Add output here }}
19-
```
20-
21-
{{ Add description here }}
22-
6+
The above command can be used to stop protection of a backup instance

0 commit comments

Comments
 (0)