Skip to content

Commit 4251d26

Browse files
authored
Merge pull request Azure#11111 from ninweninwe/network-january
update disconnect vpn/p2svpn gateway vpn connections
2 parents 6c50d44 + 831ad1f commit 4251d26

File tree

4 files changed

+54
-12
lines changed

4 files changed

+54
-12
lines changed

src/Network/Network/Cortex/P2SVpnGateway/DisconnectAzureP2SVpnGatewayVpnConnection.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ public class DisconnectAzureP2SVpnGatewayVpnConnectionCommand : P2SVpnGatewayBas
4949

5050
[Parameter(
5151
ParameterSetName = CortexParameterSetNames.ByP2SVpnGatewayResourceId,
52-
Mandatory = false,
52+
Mandatory = true,
5353
ValueFromPipelineByPropertyName = true,
5454
HelpMessage = "The Azure resource ID of the P2SVpnGateway to be modified.")]
5555
[ValidateNotNullOrEmpty]
56+
[ResourceIdCompleter("Microsoft.Network/p2sVpnGateways")]
5657
public string ResourceId { get; set; }
5758

5859
[Alias("P2SVpnGateway")]
5960
[Parameter(
6061
ParameterSetName = CortexParameterSetNames.ByP2SVpnGatewayObject,
61-
Mandatory = false,
62+
Mandatory = true,
6263
ValueFromPipeline = true,
6364
HelpMessage = "The P2S vpn gateway object")]
6465
[ValidateNotNullOrEmpty]
@@ -69,6 +70,14 @@ public class DisconnectAzureP2SVpnGatewayVpnConnectionCommand : P2SVpnGatewayBas
6970
HelpMessage = "P2S Vpn gateway gateway Vpn connection Id, which is returned by getting P2S Vpn gateway detailed connection health")]
7071
[ValidateNotNullOrEmpty]
7172
public string[] VpnConnectionId { get; set; }
73+
74+
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
75+
public SwitchParameter AsJob { get; set; }
76+
77+
[Parameter(
78+
Mandatory = false,
79+
HelpMessage = "Returns an object representing the item on which this operation is being performed.")]
80+
public SwitchParameter PassThru { get; set; }
7281

7382
public override void Execute()
7483
{

src/Network/Network/VirtualNetworkGateway/DisconnectAzureVirtualNetworkGatewayVpnConnection.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ public class DisconnectVirtualNetworkGatewayVpnConnectionCommand : VirtualNetwor
2424

2525
[Alias("VirtualNetworkGatewayId")]
2626
[Parameter(
27-
Mandatory = false,
27+
Mandatory = true,
2828
ValueFromPipelineByPropertyName = true,
2929
ParameterSetName = ParameterSetNames.ByResourceId,
3030
HelpMessage = "The resource id of the virtual network gateway Id")]
31+
[ResourceIdCompleter("Microsoft.Network/virtualNetworkGateways")]
32+
[ValidateNotNullOrEmpty]
3133
public string ResourceId { get; set; }
3234

3335
[Alias("VirtualNetworkGateway")]
@@ -36,6 +38,7 @@ public class DisconnectVirtualNetworkGatewayVpnConnectionCommand : VirtualNetwor
3638
ValueFromPipeline = true,
3739
ParameterSetName = ParameterSetNames.ByFactoryObject,
3840
HelpMessage = "The virtual network gateway object")]
41+
[ValidateNotNullOrEmpty]
3942
public PSVirtualNetworkGateway InputObject { get; set; }
4043

4144
[Parameter(
@@ -56,6 +59,11 @@ public class DisconnectVirtualNetworkGatewayVpnConnectionCommand : VirtualNetwor
5659
[Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")]
5760
public SwitchParameter AsJob { get; set; }
5861

62+
[Parameter(
63+
Mandatory = false,
64+
HelpMessage = "Returns an object representing the item on which this operation is being performed.")]
65+
public SwitchParameter PassThru { get; set; }
66+
5967
public override void Execute()
6068
{
6169
if (ParameterSetName.Equals(ParameterSetNames.ByFactoryObject, StringComparison.OrdinalIgnoreCase))

src/Network/Network/help/Disconnect-AzP2sVpnGatewayVpnConnection.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ P2SConnectionConfigurations : [
7171
The p2s vpn gateway object to be modified
7272

7373
```yaml
74-
Type: PSP2SVpnGateway
74+
Type: Microsoft.Azure.Commands.Network.Models.PSP2SVpnGateway
7575
Parameter Sets: ByP2SVpnGatewayObject
7676
Aliases: P2SVpnGateway
7777

@@ -127,6 +127,21 @@ Accept pipeline input: False
127127
Accept wildcard characters: False
128128
```
129129
130+
### -ResourceId
131+
P2s Virtual network gateway resource Id
132+
133+
```yaml
134+
Type: System.String
135+
Parameter Sets: ByP2SVpnGatewayResourceId
136+
Aliases: ResourceId
137+
138+
Required: True
139+
Position: Named
140+
Default value: None
141+
Accept pipeline input: True (ByPropertyName)
142+
Accept wildcard characters: False
143+
```
144+
130145
### CommonParameters
131146
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
132147
@@ -136,7 +151,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
136151
137152
## OUTPUTS
138153
139-
### Microsoft.Azure.Commands.Network.Models.PSP2SVpnConnectionHealth
154+
### Microsoft.Azure.Commands.Network.Models.PSP2SVpnGateway
140155
141156
## NOTES
142157

src/Network/Network/help/Disconnect-AzVirtualNetworkGatewayVpnConnection.md

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@ schema: 2.0.0
1111
Disconnect given connected vpn client connections with a given virtual network gateway.
1212

1313
## SYNTAX
14-
14+
### ByVpnGatewayName (Default)
1515
```
1616
Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceName <String> -ResourceGroupName <String> -InputObject <PSVirtualNetworkGateway> -ResourceId <ResourceId> -VpnConnectionId <VpnConnectionIds> [-AsJob] [<CommonParameters>]
1717
```
1818

19+
### ByVpnGatewayObject
20+
```
21+
Disconnect-AzVirtualNetworkGatewayVpnConnection -InputObject <PSP2SVpnGateway> -VpnConnectionId <VpnConnectionId> [<CommonParameters>]
22+
```
23+
24+
### ByVpnGatewayResourceId
25+
```
26+
Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceId <String> -VpnConnectionId <VpnConnectionId> [<CommonParameters>]
27+
```
28+
1929
## DESCRIPTION
2030
The **Disconnect-AzVirtualNetworkGatewayVpnConnection** cmdlet enables you to disconnect given connected vpn client connection.
2131

@@ -34,7 +44,7 @@ Virtual network gateway resource group's name
3444

3545
```yaml
3646
Type: System.String
37-
Parameter Sets: (All)
47+
Parameter Sets: ByVpnGatewayName
3848
Aliases:
3949

4050
Required: True
@@ -49,7 +59,7 @@ Virtual network gateway name
4959
5060
```yaml
5161
Type: System.String
52-
Parameter Sets: (All)
62+
Parameter Sets: ByVpnGatewayName
5363
Aliases: VirtualNetworkGatewayName
5464

5565
Required: True
@@ -64,10 +74,10 @@ Virtual network gateway resource Id
6474
6575
```yaml
6676
Type: System.String
67-
Parameter Sets: (All)
77+
Parameter Sets: ByVpnGatewayResourceId
6878
Aliases: ResourceId
6979

70-
Required: False
80+
Required: True
7181
Position: Named
7282
Default value: None
7383
Accept pipeline input: True (ByPropertyName)
@@ -94,7 +104,7 @@ Virtual network gateway object
94104
95105
```yaml
96106
Type: Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway
97-
Parameter Sets: (All)
107+
Parameter Sets: ByVpnGatewayObject
98108
Aliases: VirtualNetworkGateway
99109

100110
Required: False
@@ -128,7 +138,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
128138
129139
## OUTPUTS
130140
131-
### Microsoft.Azure.Commands.Network.Models.PSGatewayRoute
141+
### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway
132142
133143
## NOTES
134144

0 commit comments

Comments
 (0)