Skip to content

Commit a291f74

Browse files
EugenioPenaNoriZC
andauthored
NoHealthyBackendsBehavior (#25322)
* NoHealthyBackendsBehavior Added the changes necessary for the NoHealthyBackendsBehavior property inside of probe. * Updated changelog * Update LoadBalancerTests.ps1 * Update ChangeLog.md --------- Co-authored-by: NoriZC <[email protected]>
1 parent 36d6759 commit a291f74

8 files changed

+95
-6
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Added NoHealthyBackendsBehavior to PSProbe, and updated corresponding cmdlets.
23+
- `New-AzLoadBalancerProbeConfig`
24+
- `Add-AzLoadBalancerProbeConfig`
25+
- `Set-AzLoadBalancerProbeConfig`
2226
* Updated Network.Management SDK to consume newer Swagger version
2327
* Updated cmdlet to add 'Premium' as a valid value for 'Sku' parameter and 'enableSessionRecording' feature for Bastion resources
2428
- `New-AzBastion`

src/Network/Network/Generated/Models/PSProbe.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public partial class PSProbe : PSChildResource
5353
public string RequestPath { get; set; }
5454
[JsonProperty(Order = 1)]
5555
[Ps1Xml(Target = ViewControl.Table)]
56+
public string NoHealthyBackendsBehavior { get; set; }
57+
[JsonProperty(Order = 1)]
58+
[Ps1Xml(Target = ViewControl.Table)]
5659
public string ProvisioningState { get; set; }
5760
[JsonProperty(Order = 1)]
5861
public List<PSResourceId> LoadBalancingRules { get; set; }

src/Network/Network/LoadBalancer/Probe/AddAzureRmLoadBalancerProbeConfigCommand.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,16 @@ public partial class AddAzureRmLoadBalancerProbeConfigCommand : NetworkBaseCmdle
8282
ValueFromPipelineByPropertyName = true)]
8383
public string RequestPath { get; set; }
8484

85+
[Parameter(
86+
Mandatory = false,
87+
HelpMessage = "Determines how new connections are handled by the load balancer when all backend instances are probed down.",
88+
ValueFromPipelineByPropertyName = true)]
89+
[PSArgumentCompleter(
90+
"AllProbedDown",
91+
"AllProbedUp"
92+
)]
93+
public string NoHealthyBackendsBehavior { get; set; }
94+
8595

8696
public override void Execute()
8797
{
@@ -107,6 +117,7 @@ public override void Execute()
107117
vProbes.NumberOfProbes = this.ProbeCount;
108118
vProbes.ProbeThreshold = this.ProbeThreshold;
109119
vProbes.RequestPath = this.RequestPath;
120+
vProbes.NoHealthyBackendsBehavior = this.NoHealthyBackendsBehavior;
110121
vProbes.Name = this.Name;
111122
var generatedId = string.Format(
112123
"/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/loadBalancers/{2}/{3}/{4}",

src/Network/Network/LoadBalancer/Probe/NewAzureRmLoadBalancerProbeConfigCommand.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ public partial class NewAzureRmLoadBalancerProbeConfigCommand : NetworkBaseCmdle
7575
ValueFromPipelineByPropertyName = true)]
7676
public string RequestPath { get; set; }
7777

78+
[Parameter(
79+
Mandatory = false,
80+
HelpMessage = "Determines how new connections are handled by the load balancer when all backend instances are probed down.",
81+
ValueFromPipelineByPropertyName = true)]
82+
[PSArgumentCompleter(
83+
"AllProbedDown",
84+
"AllProbedUp"
85+
)]
86+
public string NoHealthyBackendsBehavior { get; set; }
7887

7988
public override void Execute()
8089
{
@@ -86,6 +95,7 @@ public override void Execute()
8695
vProbes.NumberOfProbes = this.ProbeCount;
8796
vProbes.ProbeThreshold = this.ProbeThreshold;
8897
vProbes.RequestPath = this.RequestPath;
98+
vProbes.NoHealthyBackendsBehavior = this.NoHealthyBackendsBehavior;
8999
vProbes.Name = this.Name;
90100
var generatedId = string.Format(
91101
"/subscriptions/{0}/resourceGroups/{1}/providers/Microsoft.Network/loadBalancers/{2}/{3}/{4}",

src/Network/Network/LoadBalancer/Probe/SetAzureRmLoadBalancerProbeConfigCommand.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ public partial class SetAzureRmLoadBalancerProbeConfigCommand : NetworkBaseCmdle
8282
ValueFromPipelineByPropertyName = true)]
8383
public string RequestPath { get; set; }
8484

85+
[Parameter(
86+
Mandatory = false,
87+
HelpMessage = "Determines how new connections are handled by the load balancer when all backend instances are probed down.",
88+
ValueFromPipelineByPropertyName = true)]
89+
[PSArgumentCompleter(
90+
"AllProbedDown",
91+
"AllProbedUp"
92+
)]
93+
public string NoHealthyBackendsBehavior { get; set; }
8594

8695
public override void Execute()
8796
{
@@ -101,6 +110,7 @@ public override void Execute()
101110
vProbes.NumberOfProbes = this.ProbeCount;
102111
vProbes.ProbeThreshold = this.ProbeThreshold;
103112
vProbes.RequestPath = this.RequestPath;
113+
vProbes.NoHealthyBackendsBehavior = this.NoHealthyBackendsBehavior;
104114
vProbes.Name = this.Name;
105115
this.LoadBalancer.Probes[vProbesIndex] = vProbes;
106116
WriteObject(this.LoadBalancer, true);

src/Network/Network/help/Add-AzLoadBalancerProbeConfig.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Adds a probe configuration to a load balancer.
1515

1616
```
1717
Add-AzLoadBalancerProbeConfig -LoadBalancer <PSLoadBalancer> -Name <String> [-Protocol <String>] -Port <Int32>
18-
-IntervalInSeconds <Int32> -ProbeCount <Int32> [-ProbeThreshold <Int32>] [-RequestPath <String>]
18+
-IntervalInSeconds <Int32> -ProbeCount <Int32> [-ProbeThreshold <Int32>] [-RequestPath <String>] [-NoHealthyBackendsBehavior <String>]
1919
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2020
```
2121

@@ -26,7 +26,7 @@ The **Add-AzLoadBalancerProbeConfig** cmdlet adds a probe configuration to an Az
2626

2727
### Example 1: Add a probe configuration to a load balancer
2828
```powershell
29-
Get-AzLoadBalancer -Name "myLb" -ResourceGroupName "myRg" | Add-AzLoadBalancerProbeConfig -Name "probeName" -RequestPath healthcheck2.aspx -Protocol http -Port 81 -IntervalInSeconds 16 -ProbeCount 3 -ProbeThreshold 3 | Set-AzLoadBalancer
29+
Get-AzLoadBalancer -Name "myLb" -ResourceGroupName "myRg" | Add-AzLoadBalancerProbeConfig -Name "probeName" -RequestPath healthcheck2.aspx -Protocol http -Port 81 -IntervalInSeconds 16 -ProbeCount 3 -ProbeThreshold 3 -NoHealthyBackendsBehavior "AllProbedUp" | Set-AzLoadBalancer
3030
```
3131

3232
This command gets the load balancer named myLb, adds the specified probe configuration to it, and then uses the **Set-AzLoadBalancer** cmdlet to update the load balancer.
@@ -170,6 +170,23 @@ Accept pipeline input: True (ByPropertyName)
170170
Accept wildcard characters: False
171171
```
172172
173+
### -NoHealthyBackendsBehavior
174+
Determines how new connections are handled by the load balancer when all backend instances are probed down.
175+
The acceptable values for this parameter are: AllProbedDown or AllProbedUp.
176+
177+
```yaml
178+
Type: System.String
179+
Parameter Sets: (All)
180+
Aliases:
181+
Accepted values: AllProbedDown, AllProbedUp
182+
183+
Required: False
184+
Position: Named
185+
Default value: AllProbedDown
186+
Accept pipeline input: True (ByPropertyName)
187+
Accept wildcard characters: False
188+
```
189+
173190
### -Confirm
174191
Prompts you for confirmation before running the cmdlet.
175192

src/Network/Network/help/New-AzLoadBalancerProbeConfig.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Creates a probe configuration for a load balancer.
1515

1616
```
1717
New-AzLoadBalancerProbeConfig -Name <String> [-Protocol <String>] -Port <Int32> -IntervalInSeconds <Int32>
18-
-ProbeCount <Int32> [-ProbeThreshold <Int32>] [-RequestPath <String>]
18+
-ProbeCount <Int32> [-ProbeThreshold <Int32>] [-RequestPath <String>] [-NoHealthyBackendsBehavior <String>]
1919
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2020
```
2121

@@ -26,7 +26,7 @@ The **New-AzLoadBalancerProbeConfig** cmdlet creates a probe configuration for a
2626

2727
### Example 1: Create a probe configuration
2828
```powershell
29-
New-AzLoadBalancerProbeConfig -Name "MyProbe" -Protocol "http" -Port 80 -IntervalInSeconds 15 -ProbeCount 15 -ProbeThreshold 15
29+
New-AzLoadBalancerProbeConfig -Name "MyProbe" -Protocol "http" -Port 80 -IntervalInSeconds 15 -ProbeCount 15 -ProbeThreshold 15 -NoHealthyBackendsBehavior "AllProbedUp"
3030
```
3131

3232
This command creates a probe configuration named MyProbe using the HTTP protocol.
@@ -166,6 +166,23 @@ Accept pipeline input: True (ByPropertyName)
166166
Accept wildcard characters: False
167167
```
168168
169+
### -NoHealthyBackendsBehavior
170+
Determines how new connections are handled by the load balancer when all backend instances are probed down.
171+
The acceptable values for this parameter are: AllProbedDown or AllProbedUp.
172+
173+
```yaml
174+
Type: System.String
175+
Parameter Sets: (All)
176+
Aliases:
177+
Accepted values: AllProbedDown, AllProbedUp
178+
179+
Required: False
180+
Position: Named
181+
Default value: AllProbedDown
182+
Accept pipeline input: True (ByPropertyName)
183+
Accept wildcard characters: False
184+
```
185+
169186
### -Confirm
170187
Prompts you for confirmation before running the cmdlet.
171188

src/Network/Network/help/Set-AzLoadBalancerProbeConfig.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Updates a probe configuration for a load balancer.
1515

1616
```
1717
Set-AzLoadBalancerProbeConfig -LoadBalancer <PSLoadBalancer> -Name <String> [-Protocol <String>] -Port <Int32>
18-
-IntervalInSeconds <Int32> -ProbeCount <Int32> [-ProbeThreshold <Int32>] [-RequestPath <String>]
18+
-IntervalInSeconds <Int32> -ProbeCount <Int32> [-ProbeThreshold <Int32>] [-RequestPath <String>] [-NoHealthyBackendsBehavior <String>]
1919
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2020
```
2121

@@ -28,7 +28,7 @@ The **Set-AzLoadBalancerProbeConfig** cmdlet updates a probe configuration for a
2828
```powershell
2929
$slb = Get-AzLoadBalancer -Name "MyLoadBalancer" -ResourceGroupName "MyResourceGroup"
3030
$slb | Add-AzLoadBalancerProbeConfig -Name "NewProbe" -Protocol "http" -Port 80 -IntervalInSeconds 15 -ProbeCount 2 -ProbeThreshold 2 -RequestPath "healthcheck.aspx"
31-
$slb | Set-AzLoadBalancerProbeConfig -Name "NewProbe" -Port 80 -IntervalInSeconds 15 -ProbeCount 2
31+
$slb | Set-AzLoadBalancerProbeConfig -Name "NewProbe" -Port 80 -IntervalInSeconds 15 -ProbeCount 2 -NoHealthyBackendsBehavior "AllProbedUp"
3232
```
3333

3434
The first command gets the loadbalancer named MyLoadBalancer, and then stores it in the $slb variable.
@@ -186,6 +186,23 @@ Accept pipeline input: True (ByPropertyName)
186186
Accept wildcard characters: False
187187
```
188188
189+
### -NoHealthyBackendsBehavior
190+
Determines how new connections are handled by the load balancer when all backend instances are probed down.
191+
The acceptable values for this parameter are: AllProbedDown or AllProbedUp.
192+
193+
```yaml
194+
Type: System.String
195+
Parameter Sets: (All)
196+
Aliases:
197+
Accepted values: AllProbedDown, AllProbedUp
198+
199+
Required: False
200+
Position: Named
201+
Default value: AllProbedDown
202+
Accept pipeline input: True (ByPropertyName)
203+
Accept wildcard characters: False
204+
```
205+
189206
### -Confirm
190207
Prompts you for confirmation before running the cmdlet.
191208

0 commit comments

Comments
 (0)