Skip to content

Commit f0858c3

Browse files
gitlwhWeiheng Liwyunchi-ms
authored
Add new parameter ASN, Geo, ExpressrouteAdvertise to New-AzCustomIpPrefix command (#19532)
Add new parameter ASN, Geo, ExpressrouteAdvertise to New-AzCustomIpPrefix command Co-authored-by: Weiheng Li <[email protected]> Co-authored-by: Yunchi Wang <[email protected]>
1 parent b7c7d51 commit f0858c3

File tree

6 files changed

+126
-11
lines changed

6 files changed

+126
-11
lines changed

src/Network/Network/BYOIP/CustomIpPrefix/NewAzureCustomIpPrefixCommand.cs

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,28 @@ public class NewAzureCustomIpPrefixCommand : CustomIpPrefixBaseCmdlet
5757
[ValidateNotNullOrEmpty]
5858
public string Cidr { get; set; }
5959

60+
[Parameter(
61+
Mandatory = false,
62+
ValueFromPipelineByPropertyName = true,
63+
HelpMessage = "The customIpPrefix ASN code.")]
64+
public string Asn { get; set; }
65+
66+
[Parameter(
67+
Mandatory = false,
68+
ValueFromPipelineByPropertyName = true,
69+
HelpMessage = "The customIpPrefix GEO code.")]
70+
[ValidateSet(
71+
MNM.Geo.AFRI,
72+
MNM.Geo.APAC,
73+
MNM.Geo.AQ,
74+
MNM.Geo.EURO,
75+
MNM.Geo.LATAM,
76+
MNM.Geo.ME,
77+
MNM.Geo.NAM,
78+
MNM.Geo.OCEANIA,
79+
IgnoreCase = true)]
80+
public string Geo { get; set; }
81+
6082
[Parameter(
6183
Mandatory = false,
6284
HelpMessage = "Signed message for WAN validation.",
@@ -69,6 +91,12 @@ public class NewAzureCustomIpPrefixCommand : CustomIpPrefixBaseCmdlet
6991
ValueFromPipelineByPropertyName = true)]
7092
public string AuthorizationMessage { get; set; }
7193

94+
[Parameter(
95+
Mandatory = false,
96+
HelpMessage = "Using expressRoute advertise.",
97+
ValueFromPipelineByPropertyName = true)]
98+
public SwitchParameter ExpressRouteAdvertise { get; set; }
99+
72100
[Parameter(
73101
Mandatory = false,
74102
HelpMessage = "Parent CustomIpPrefix for /64 IPv6 CustomIpPrefix",
@@ -118,7 +146,10 @@ private PSCustomIpPrefix CreateCustomIpPrefix()
118146
Zones = this.Zone?.ToList(),
119147
SignedMessage = this.SignedMessage,
120148
AuthorizationMessage = this.AuthorizationMessage,
121-
CustomIpPrefixParent = this.CustomIpPrefixParent
149+
CustomIpPrefixParent = this.CustomIpPrefixParent,
150+
Geo = this.Geo,
151+
Asn = this.Asn,
152+
ExpressRouteAdvertise = this.ExpressRouteAdvertise
122153
};
123154

124155
var sdkModel = NetworkResourceManagerProfile.Mapper.Map<MNM.CustomIpPrefix>(psModel);

src/Network/Network/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
* Updated commandlets to support specifying an ASN on VPN Gateway
3030
- `NewAzureRmVpnGatewayCommand.cs`
3131
- `UpdateAzureRmVpnGatewayCommand.cs`
32+
* Updated commandlet to support new parameters: asn, geo, expressrouteadvertise.
33+
- `Update-AzCustomIpPrefix
3234
* Updated cmdlets to enable verification on client certificate revocation by using a new property VerifyClientRevocation in ApplicationGatewayClientAuthConfiguration
3335
- `New-AzApplicationGatewayClientAuthConfiguration`
3436
- `Set-AzApplicationGatewayClientAuthConfiguration`

src/Network/Network/Models/BYOIP/PSCustomIpPrefix.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ public class PSCustomIpPrefix : PSTopLevelResource
2121
{
2222
public string Cidr { get; set; }
2323

24+
public string Geo { get; set; }
25+
26+
public string Asn { get; set; }
27+
2428
public string CommissionedState { get; set; }
2529

2630
public List<PSResourceId> PublicIpPrefixes { get; set; }
@@ -37,7 +41,9 @@ public class PSCustomIpPrefix : PSTopLevelResource
3741

3842
public List<PSResourceId> ChildCustomIpPrefixes { get; set; }
3943

40-
public bool NoInternetAdvertise { get; set; }
44+
public bool? NoInternetAdvertise { get; set; }
45+
46+
public bool? ExpressRouteAdvertise { get; set; }
4147

4248
[JsonIgnore]
4349
public string PublicIpPrefixesText

src/Network/Network/Network.format.ps1xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1654,6 +1654,22 @@
16541654
<Label>Cidr</Label>
16551655
<PropertyName>Cidr</PropertyName>
16561656
</ListItem>
1657+
<ListItem>
1658+
<Label>Asn</Label>
1659+
<PropertyName>Asn</PropertyName>
1660+
</ListItem>
1661+
<ListItem>
1662+
<Label>Geo</Label>
1663+
<PropertyName>Geo</PropertyName>
1664+
</ListItem>
1665+
<ListItem>
1666+
<Label>ExpressrouteAdvertise</Label>
1667+
<PropertyName>ExpressrouteAdvertise</PropertyName>
1668+
</ListItem>
1669+
<ListItem>
1670+
<Label>NoInternetAdvertise</Label>
1671+
<PropertyName>NoInternetAdvertise</PropertyName>
1672+
</ListItem>
16571673
<ListItem>
16581674
<Label>CommissionedState</Label>
16591675
<PropertyName>CommissionedState</PropertyName>

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

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ Creates a CustomIpPrefix resource
1313
## SYNTAX
1414

1515
```
16-
New-AzCustomIpPrefix -Name <String> -ResourceGroupName <String> -Location <String> -Cidr <String>
17-
[-Zone <String[]>] [-Tag <Hashtable>] [-SignedMessage <String>] [-AuthorizationMessage <String>]
16+
New-AzCustomIpPrefix -Name <String> -ResourceGroupName <String> -Location <String> -Cidr <String> [-Geo <String>]
17+
[-Asn <String>] [-ExpressRouteAdvertise] [-Zone <String[]>] [-Tag <Hashtable>] [-SignedMessage <String>] [-AuthorizationMessage <String>]
1818
[-CustomIpPrefixParent <CustomIpPrefix>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
1919
[<CommonParameters>]
2020
```
@@ -63,6 +63,51 @@ Accept pipeline input: True (ByPropertyName)
6363
Accept wildcard characters: False
6464
```
6565
66+
### -Geo
67+
The CustomIpPrefix Geo code.
68+
69+
```yaml
70+
Type: String
71+
Parameter Sets: (All)
72+
Aliases:
73+
74+
Required: False
75+
Position: Named
76+
Default value: None
77+
Accept pipeline input: True (ByPropertyName)
78+
Accept wildcard characters: False
79+
```
80+
81+
### -Asn
82+
The CustomIpPrefix Geo code.
83+
84+
```yaml
85+
Type: String
86+
Parameter Sets: (All)
87+
Aliases:
88+
89+
Required: False
90+
Position: Named
91+
Default value: None
92+
Accept pipeline input: True (ByPropertyName)
93+
Accept wildcard characters: False
94+
```
95+
96+
### -ExpressRouteAdvertise
97+
Need to use ExpressRoute to advertise the CustomIpPrefix
98+
99+
```yaml
100+
Type: SwitchParameter
101+
Parameter Sets: (All)
102+
Aliases:
103+
104+
Required: False
105+
Position: Named
106+
Default value: None
107+
Accept pipeline input: False
108+
Accept wildcard characters: False
109+
```
110+
66111
### -DefaultProfile
67112
The credentials, account, tenant, and subscription used for communication with Azure.
68113

src/Network/Network/help/Update-AzCustomIpPrefix.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ Updates a CustomIpPrefix
1414

1515
### UpdateByNameParameterSet
1616
```
17-
Update-AzCustomIpPrefix -Name <String> -ResourceGroupName <String> [-Commission] [-Decomission] [-Provision] [-Deprovision] [-Cidr <String>]
17+
Update-AzCustomIpPrefix -Name <String> -ResourceGroupName <String> [-Commission] [-Decomission] [-Provision] [-Deprovision] [-NoInternetAdvertise] [-Cidr <String>]
1818
[-Tag <Hashtable>] [-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm]
1919
[<CommonParameters>]
2020
```
2121

2222
### UpdateByInputObjectParameterSet
2323
```
24-
Update-AzCustomIpPrefix -InputObject <PSCustomIpPrefix> [-Commission] [-Decomission] [-Provision] [-Deprovision] [-Cidr <String>] [-Tag <Hashtable>]
24+
Update-AzCustomIpPrefix -InputObject <PSCustomIpPrefix> [-Commission] [-Decomission] [-Provision] [-Deprovision] [-NoInternetAdvertise] [-Cidr <String>] [-Tag <Hashtable>]
2525
[-AsJob] [-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
2626
```
2727

2828
### UpdateByResourceIdParameterSet
2929
```
30-
Update-AzCustomIpPrefix -ResourceId <String> [-Commission] [-Decomission] [-Provision] [-Deprovision] [-Cidr <String>] [-Tag <Hashtable>] [-AsJob]
30+
Update-AzCustomIpPrefix -ResourceId <String> [-Commission] [-Decomission] [-Provision] [-Deprovision] [-NoInternetAdvertise] [-Cidr <String>] [-Tag <Hashtable>] [-AsJob]
3131
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
3232
```
3333

@@ -96,7 +96,7 @@ Accept wildcard characters: False
9696
```
9797
9898
### -Commission
99-
Run cmdlet in the background
99+
Commission the CustomIpPrefix resource
100100
101101
```yaml
102102
Type: SwitchParameter
@@ -111,7 +111,7 @@ Accept wildcard characters: False
111111
```
112112
113113
### -Decomission
114-
Run cmdlet in the background
114+
Decommission the CustomIpPrefix resource
115115
116116
```yaml
117117
Type: SwitchParameter
@@ -126,7 +126,7 @@ Accept wildcard characters: False
126126
```
127127
128128
### -Provision
129-
Run cmdlet in the background
129+
Provision the CustomIpPrefix resource
130130
131131
```yaml
132132
Type: SwitchParameter
@@ -141,7 +141,22 @@ Accept wildcard characters: False
141141
```
142142
143143
### -Deprovision
144-
Run cmdlet in the background
144+
Deprovision the CustomIpPrefix resource
145+
146+
```yaml
147+
Type: SwitchParameter
148+
Parameter Sets: (All)
149+
Aliases:
150+
151+
Required: False
152+
Position: Named
153+
Default value: None
154+
Accept pipeline input: False
155+
Accept wildcard characters: False
156+
```
157+
158+
### -NoInternetAdvertise
159+
Commission the CustomIpPrefix resource with no internet advertise
145160
146161
```yaml
147162
Type: SwitchParameter

0 commit comments

Comments
 (0)