Skip to content

Commit 6dc2904

Browse files
LingyunSubganapa
authored andcommitted
Parameter change in Add-AzsScaleUnitNode + CI bugfixing
1 parent 561a6fa commit 6dc2904

File tree

6 files changed

+1350
-11
lines changed

6 files changed

+1350
-11
lines changed
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
<#
2+
.Synopsis
3+
Scales out a scale unit.
4+
.Description
5+
Scales out a scale unit.
6+
.Example
7+
To view examples, please use the -Online parameter with Get-Help or navigate to: https://docs.microsoft.com/en-us/powershell/module/azs.fabric.admin/add-azsscaleunitnode
8+
.Inputs
9+
Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Models.IFabricAdminIdentity
10+
.Outputs
11+
System.Boolean
12+
.Notes
13+
COMPLEX PARAMETER PROPERTIES
14+
To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.
15+
16+
INPUTOBJECT <IFabricAdminIdentity>: Identity Parameter
17+
[Drive <String>]: Name of the storage drive.
18+
[EdgeGateway <String>]: Name of the edge gateway.
19+
[EdgeGatewayPool <String>]: Name of the edge gateway pool.
20+
[FabricLocation <String>]: Fabric location.
21+
[FileShare <String>]: Fabric file share name.
22+
[IPPool <String>]: IP pool name.
23+
[Id <String>]: Resource identity path
24+
[InfraRole <String>]: Infrastructure role name.
25+
[InfraRoleInstance <String>]: Name of an infrastructure role instance.
26+
[Location <String>]: Location of the resource.
27+
[LogicalNetwork <String>]: Name of the logical network.
28+
[LogicalSubnet <String>]: Name of the logical subnet.
29+
[MacAddressPool <String>]: Name of the MAC address pool.
30+
[Operation <String>]: Operation identifier.
31+
[ResourceGroupName <String>]: Name of the resource group.
32+
[ScaleUnit <String>]: Name of the scale units.
33+
[ScaleUnitNode <String>]: Name of the scale unit node.
34+
[SlbMuxInstance <String>]: Name of a SLB MUX instance.
35+
[StorageSubSystem <String>]: Name of the storage system.
36+
[SubscriptionId <String>]: Subscription credentials that uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
37+
[Volume <String>]: Name of the storage volume.
38+
[BmciPv4Address <String>]: BMC address of the physical machine.
39+
[ComputerName <String>]: Computer name of the physical machine.
40+
.Link
41+
https://docs.microsoft.com/en-us/powershell/module/azs.fabric.admin/add-azsscaleunitnode
42+
#>
43+
function Add-AzsScaleUnitNode {
44+
[OutputType([System.Boolean])]
45+
[CmdletBinding(DefaultParameterSetName='ScaleExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
46+
param(
47+
[Parameter(ParameterSetName='Scale')]
48+
[Parameter(ParameterSetName='ScaleExpanded')]
49+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
50+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='(Get-AzLocation)[0].Location')]
51+
[System.String]
52+
# Location of the resource.
53+
${Location},
54+
55+
[Parameter(ParameterSetName='Scale')]
56+
[Parameter(ParameterSetName='ScaleExpanded')]
57+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
58+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='-join("System.",(Get-AzLocation)[0].Location)')]
59+
[System.String]
60+
# Name of the resource group.
61+
${ResourceGroupName},
62+
63+
[Parameter(ParameterSetName='Scale', Mandatory)]
64+
[Parameter(ParameterSetName='ScaleExpanded', Mandatory)]
65+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
66+
[System.String]
67+
# Name of the scale units.
68+
${ScaleUnit},
69+
70+
[Parameter(ParameterSetName='Scale')]
71+
[Parameter(ParameterSetName='ScaleExpanded')]
72+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
73+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')]
74+
[System.String]
75+
# Subscription credentials that uniquely identify Microsoft Azure subscription.
76+
# The subscription ID forms part of the URI for every service call.
77+
${SubscriptionId},
78+
79+
[Parameter(ParameterSetName='ScaleViaIdentity', Mandatory, ValueFromPipeline)]
80+
[Parameter(ParameterSetName='ScaleViaIdentityExpanded', Mandatory, ValueFromPipeline)]
81+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
82+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Models.IFabricAdminIdentity]
83+
# Identity Parameter
84+
# To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
85+
${InputObject},
86+
87+
[Parameter(ParameterSetName='ScaleExpanded')]
88+
[Parameter(ParameterSetName='ScaleViaIdentityExpanded')]
89+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Body')]
90+
[System.Management.Automation.SwitchParameter]
91+
# Flag indicates if the operation should wait for storage to converge before returning.
92+
${AwaitStorageConvergence},
93+
94+
[Parameter(ParameterSetName='BmciPv4Address', Mandatory)]
95+
[Parameter(ParameterSetName='ScaleExpanded', Mandatory)]
96+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
97+
[System.String]
98+
# BMC address of the physical machine.
99+
${BmciPv4Address},
100+
101+
[Parameter(ParameterSetName='ComputerName ', Mandatory)]
102+
[Parameter(ParameterSetName='ScaleExpanded', Mandatory)]
103+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Path')]
104+
[System.String]
105+
# Computer name of the physical machine.
106+
${ComputerName},
107+
108+
[Parameter()]
109+
[Alias('AzureRMContext', 'AzureCredential')]
110+
[ValidateNotNull()]
111+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Azure')]
112+
[System.Management.Automation.PSObject]
113+
# The credentials, account, tenant, and subscription used for communication with Azure.
114+
${DefaultProfile},
115+
116+
[Parameter()]
117+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
118+
[System.Management.Automation.SwitchParameter]
119+
# Run the command as a job
120+
${AsJob},
121+
122+
[Parameter(DontShow)]
123+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
124+
[System.Management.Automation.SwitchParameter]
125+
# Wait for .NET debugger to attach
126+
${Break},
127+
128+
[Parameter(DontShow)]
129+
[ValidateNotNull()]
130+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
131+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.SendAsyncStep[]]
132+
# SendAsync Pipeline Steps to be appended to the front of the pipeline
133+
${HttpPipelineAppend},
134+
135+
[Parameter(DontShow)]
136+
[ValidateNotNull()]
137+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
138+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Runtime.SendAsyncStep[]]
139+
# SendAsync Pipeline Steps to be prepended to the front of the pipeline
140+
${HttpPipelinePrepend},
141+
142+
[Parameter()]
143+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
144+
[System.Management.Automation.SwitchParameter]
145+
# Run the command asynchronously
146+
${NoWait},
147+
148+
[Parameter()]
149+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
150+
[System.Management.Automation.SwitchParameter]
151+
# Returns true when the command succeeds
152+
${PassThru},
153+
154+
[Parameter(DontShow)]
155+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
156+
[System.Uri]
157+
# The URI for the proxy server to use
158+
${Proxy},
159+
160+
[Parameter(DontShow)]
161+
[ValidateNotNull()]
162+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
163+
[System.Management.Automation.PSCredential]
164+
# Credentials for a proxy server to use for the remote call
165+
${ProxyCredential},
166+
167+
[Parameter(DontShow)]
168+
[Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Category('Runtime')]
169+
[System.Management.Automation.SwitchParameter]
170+
# Use the default credentials for the proxy
171+
${ProxyUseDefaultCredentials}
172+
)
173+
174+
process {
175+
176+
$NewNode = New-Object -TypeName Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Models.Api20160501.ScaleOutScaleUnitParameters
177+
$NewNode.BmciPv4Address = ${BmciPv4Address}
178+
$NewNode.ComputerName = ${ComputerName}
179+
$PSBoundParameters['NodeList'] = $NewNode
180+
181+
if ($PSBoundParameters.ContainsKey(('BmciPv4Address'))){
182+
$null = $PSBoundParameters.Remove('BmciPv4Address')
183+
}
184+
185+
if ($PSBoundParameters.ContainsKey(('ComputerName'))){
186+
$null = $PSBoundParameters.Remove('ComputerName')
187+
}
188+
189+
Azs.Fabric.Admin.internal\Add-AzsScaleUnitNode @PSBoundParameters
190+
}
191+
}

src/Azs.Fabric.Admin/docs/Add-AzsScaleUnitNode.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Scales out a scale unit.
1515
### ScaleExpanded (Default)
1616
```
1717
Add-AzsScaleUnitNode -ScaleUnit <String> [-Location <String>] [-ResourceGroupName <String>]
18-
[-SubscriptionId <String>] [-AwaitStorageConvergence] [-NodeList <IScaleOutScaleUnitParameters[]>]
18+
[-SubscriptionId <String>] [-AwaitStorageConvergence] [-BmciPv4Address <String>] [-ComputerName <String>]
1919
[-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
2020
```
2121

@@ -36,7 +36,7 @@ Add-AzsScaleUnitNode -InputObject <IFabricAdminIdentity>
3636
### ScaleViaIdentityExpanded
3737
```
3838
Add-AzsScaleUnitNode -InputObject <IFabricAdminIdentity> [-AwaitStorageConvergence]
39-
[-NodeList <IScaleOutScaleUnitParameters[]>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru]
39+
[-BmciPv4Address <String>] [-ComputerName <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru]
4040
[-Confirm] [-WhatIf] [<CommonParameters>]
4141
```
4242

@@ -47,7 +47,7 @@ Scales out a scale unit.
4747

4848
### Example 1: Add-AzsScaleUnitNode
4949
```powershell
50-
PS C:\> Add-AzsScaleUnitNode -NodeList $Nodes -ScaleUnit $ScaleUnitName
50+
PS C:\> Add-AzsScaleUnitNode -BmciPv4Address $BmciPv4Address -ComputerName $ComputerName -ScaleUnit $ScaleUnitName
5151
5252
Adds a list of nodes to the scale unit.
5353
```
@@ -137,9 +137,11 @@ Accept wildcard characters: False
137137
Dynamic: False
138138
```
139139
140-
### -NodeList
141-
List of nodes in the scale unit.
142-
To construct, see NOTES section for NODELIST properties and create a hash table.
140+
### -BmciPv4Address
141+
BMC address of the physical machine.
142+
143+
### -ComputerName
144+
Computer name of the physical machine.
143145
144146
```yaml
145147
Type: Microsoft.Azure.PowerShell.Cmdlets.FabricAdmin.Models.Api20160501.IScaleOutScaleUnitParameters[]

src/Azs.Fabric.Admin/examples/Add-AzsScaleUnitNode.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Example 1: Add-AzsScaleUnitNode
22
```powershell
3-
PS C:\> Add-AzsScaleUnitNode -NodeList $Nodes -ScaleUnit $ScaleUnitName
3+
PS C:\> Add-AzsScaleUnitNode -BmciPv4Address $BmciPv4Address -ComputerName $ComputerName -ScaleUnit $ScaleUnitName
44
55
Adds a list of nodes to the scale unit.
66
```

src/Azs.Fabric.Admin/readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,11 @@ directive:
385385
verb: Add
386386
subject: ScaleUnitNode
387387

388+
- where:
389+
verb: Add
390+
subject: ScaleUnitNode
391+
hide: true
392+
388393
# [ScaleUnitNode]Rename Start-AzsScaleUnitNodeMaintenanceMode to Disable-AzsScaleUnitNode
389394
- where:
390395
verb: Start

src/Azs.Fabric.Admin/test/ScaleUnitNode.Tests.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ if (-Not (Test-Path -Path $loadEnvPath)) {
33
$loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1'
44
}
55
. ($loadEnvPath)
6-
$TestRecordingFile = Join-Path $PSScriptRoot 'Repair-AzsScaleUnitNode.Recording.json'
6+
$TestRecordingFile = Join-Path $PSScriptRoot 'ScaleUnitNodeTest.Recording.json'
77
$currentPath = $PSScriptRoot
88
while(-not $mockingPath) {
99
$mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File
1010
$currentPath = Split-Path -Path $currentPath -Parent
1111
}
1212
. ($mockingPath | Select-Object -First 1).FullName
1313

14-
Describe 'Repair-AzsScaleUnitNode' {
14+
Describe 'ScaleUnitNodeTest' {
1515
. $PSScriptRoot\Common.ps1
1616

1717
BeforeEach {
@@ -187,9 +187,8 @@ Describe 'Repair-AzsScaleUnitNode' {
187187
It "TestAddScaleUnitNode" -Skip:$('TestAddScaleUnitNode' -in $global:SkippedTests) {
188188
$global:TestName = "TestAddScaleUnitNode"
189189

190-
$NewNode = New-AzsScaleUnitNodeObject -ComputerName "ASRR1N22R19U29" -BMCIPv4Address "100.83.64.17"
191190
{
192-
Add-AzsScaleUnitNode -NodeList $NewNode -ScaleUnit "s-cluster" -Location 'east'
191+
Add-AzsScaleUnitNode -BmciPv4Address "100.71.11.155" -ComputerName "ASRR1N31R12U25" -ScaleUnit "s-cluster"
193192
} | Should not throw
194193

195194
}

0 commit comments

Comments
 (0)