Skip to content

Commit 39d88f8

Browse files
authored
{Network} az network vnet-gateway: Add parameters --allow-remote-vnet-traffic and --allow-vwan-traffic (#28446)
1 parent 053e961 commit 39d88f8

11 files changed

Lines changed: 2005 additions & 20 deletions

File tree

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/gateway/_create.py

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Create(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2022-01-01",
25+
"version": "2023-09-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways/{}", "2022-01-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways/{}", "2023-09-01"],
2828
]
2929
}
3030

@@ -59,6 +59,10 @@ def _build_arguments_schema(cls, *args, **kwargs):
5959
resource_group_arg="resource_group",
6060
),
6161
)
62+
_args_schema.allow_non_vwan_traffic = AAZBoolArg(
63+
options=["--allow-non-vwan-traffic"],
64+
help="Configures this gateway to accept traffic from non Virtual WAN networks.",
65+
)
6266
_args_schema.virtual_hub = AAZStrArg(
6367
options=["--virtual-hub"],
6468
help="Name or ID of the virtual hub to associate with the gateway.",
@@ -190,7 +194,7 @@ def url_parameters(self):
190194
def query_parameters(self):
191195
parameters = {
192196
**self.serialize_query_param(
193-
"api-version", "2022-01-01",
197+
"api-version", "2023-09-01",
194198
required=True,
195199
),
196200
}
@@ -221,6 +225,7 @@ def content(self):
221225

222226
properties = _builder.get(".properties")
223227
if properties is not None:
228+
properties.set_prop("allowNonVirtualWanTraffic", AAZBoolType, ".allow_non_vwan_traffic")
224229
properties.set_prop("autoScaleConfiguration", AAZObjectType)
225230
properties.set_prop("virtualHub", AAZObjectType, ".", typ_kwargs={"flags": {"required": True}})
226231

@@ -278,6 +283,9 @@ def _build_schema_on_200_201(cls):
278283
)
279284

280285
properties = cls._schema_on_200_201.properties
286+
properties.allow_non_virtual_wan_traffic = AAZBoolType(
287+
serialized_name="allowNonVirtualWanTraffic",
288+
)
281289
properties.auto_scale_configuration = AAZObjectType(
282290
serialized_name="autoScaleConfiguration",
283291
)
@@ -319,6 +327,9 @@ def _build_schema_on_200_201(cls):
319327
properties.enable_internet_security = AAZBoolType(
320328
serialized_name="enableInternetSecurity",
321329
)
330+
properties.enable_private_link_fast_path = AAZBoolType(
331+
serialized_name="enablePrivateLinkFastPath",
332+
)
322333
properties.express_route_circuit_peering = AAZObjectType(
323334
serialized_name="expressRouteCircuitPeering",
324335
flags={"required": True},
@@ -345,6 +356,14 @@ def _build_schema_on_200_201(cls):
345356
serialized_name="associatedRouteTable",
346357
)
347358
_CreateHelper._build_schema_sub_resource_read(routing_configuration.associated_route_table)
359+
routing_configuration.inbound_route_map = AAZObjectType(
360+
serialized_name="inboundRouteMap",
361+
)
362+
_CreateHelper._build_schema_sub_resource_read(routing_configuration.inbound_route_map)
363+
routing_configuration.outbound_route_map = AAZObjectType(
364+
serialized_name="outboundRouteMap",
365+
)
366+
_CreateHelper._build_schema_sub_resource_read(routing_configuration.outbound_route_map)
348367
routing_configuration.propagated_route_tables = AAZObjectType(
349368
serialized_name="propagatedRouteTables",
350369
)
@@ -371,6 +390,9 @@ def _build_schema_on_200_201(cls):
371390
vnet_routes.static_routes = AAZListType(
372391
serialized_name="staticRoutes",
373392
)
393+
vnet_routes.static_routes_config = AAZObjectType(
394+
serialized_name="staticRoutesConfig",
395+
)
374396

375397
bgp_connections = cls._schema_on_200_201.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.bgp_connections
376398
bgp_connections.Element = AAZObjectType()
@@ -391,6 +413,15 @@ def _build_schema_on_200_201(cls):
391413
address_prefixes = cls._schema_on_200_201.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes.Element.address_prefixes
392414
address_prefixes.Element = AAZStrType()
393415

416+
static_routes_config = cls._schema_on_200_201.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes_config
417+
static_routes_config.propagate_static_routes = AAZBoolType(
418+
serialized_name="propagateStaticRoutes",
419+
flags={"read_only": True},
420+
)
421+
static_routes_config.vnet_local_route_override_criteria = AAZStrType(
422+
serialized_name="vnetLocalRouteOverrideCriteria",
423+
)
424+
394425
virtual_hub = cls._schema_on_200_201.properties.virtual_hub
395426
virtual_hub.id = AAZStrType()
396427

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/gateway/_delete.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Delete(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2022-01-01",
25+
"version": "2023-09-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways/{}", "2022-01-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways/{}", "2023-09-01"],
2828
]
2929
}
3030

@@ -142,7 +142,7 @@ def url_parameters(self):
142142
def query_parameters(self):
143143
parameters = {
144144
**self.serialize_query_param(
145-
"api-version", "2022-01-01",
145+
"api-version", "2023-09-01",
146146
required=True,
147147
),
148148
}

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/gateway/_list.py

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ class List(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2022-01-01",
25+
"version": "2023-09-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/expressroutegateways", "2022-01-01"],
28-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways", "2022-01-01"],
27+
["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/expressroutegateways", "2023-09-01"],
28+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways", "2023-09-01"],
2929
]
3030
}
3131

@@ -114,7 +114,7 @@ def url_parameters(self):
114114
def query_parameters(self):
115115
parameters = {
116116
**self.serialize_query_param(
117-
"api-version", "2022-01-01",
117+
"api-version", "2023-09-01",
118118
required=True,
119119
),
120120
}
@@ -170,6 +170,9 @@ def _build_schema_on_200(cls):
170170
)
171171

172172
properties = cls._schema_on_200.value.Element.properties
173+
properties.allow_non_virtual_wan_traffic = AAZBoolType(
174+
serialized_name="allowNonVirtualWanTraffic",
175+
)
173176
properties.auto_scale_configuration = AAZObjectType(
174177
serialized_name="autoScaleConfiguration",
175178
)
@@ -211,6 +214,9 @@ def _build_schema_on_200(cls):
211214
properties.enable_internet_security = AAZBoolType(
212215
serialized_name="enableInternetSecurity",
213216
)
217+
properties.enable_private_link_fast_path = AAZBoolType(
218+
serialized_name="enablePrivateLinkFastPath",
219+
)
214220
properties.express_route_circuit_peering = AAZObjectType(
215221
serialized_name="expressRouteCircuitPeering",
216222
flags={"required": True},
@@ -237,6 +243,14 @@ def _build_schema_on_200(cls):
237243
serialized_name="associatedRouteTable",
238244
)
239245
_ListHelper._build_schema_sub_resource_read(routing_configuration.associated_route_table)
246+
routing_configuration.inbound_route_map = AAZObjectType(
247+
serialized_name="inboundRouteMap",
248+
)
249+
_ListHelper._build_schema_sub_resource_read(routing_configuration.inbound_route_map)
250+
routing_configuration.outbound_route_map = AAZObjectType(
251+
serialized_name="outboundRouteMap",
252+
)
253+
_ListHelper._build_schema_sub_resource_read(routing_configuration.outbound_route_map)
240254
routing_configuration.propagated_route_tables = AAZObjectType(
241255
serialized_name="propagatedRouteTables",
242256
)
@@ -263,6 +277,9 @@ def _build_schema_on_200(cls):
263277
vnet_routes.static_routes = AAZListType(
264278
serialized_name="staticRoutes",
265279
)
280+
vnet_routes.static_routes_config = AAZObjectType(
281+
serialized_name="staticRoutesConfig",
282+
)
266283

267284
bgp_connections = cls._schema_on_200.value.Element.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.bgp_connections
268285
bgp_connections.Element = AAZObjectType()
@@ -283,6 +300,15 @@ def _build_schema_on_200(cls):
283300
address_prefixes = cls._schema_on_200.value.Element.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes.Element.address_prefixes
284301
address_prefixes.Element = AAZStrType()
285302

303+
static_routes_config = cls._schema_on_200.value.Element.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes_config
304+
static_routes_config.propagate_static_routes = AAZBoolType(
305+
serialized_name="propagateStaticRoutes",
306+
flags={"read_only": True},
307+
)
308+
static_routes_config.vnet_local_route_override_criteria = AAZStrType(
309+
serialized_name="vnetLocalRouteOverrideCriteria",
310+
)
311+
286312
virtual_hub = cls._schema_on_200.value.Element.properties.virtual_hub
287313
virtual_hub.id = AAZStrType()
288314

@@ -331,7 +357,7 @@ def url_parameters(self):
331357
def query_parameters(self):
332358
parameters = {
333359
**self.serialize_query_param(
334-
"api-version", "2022-01-01",
360+
"api-version", "2023-09-01",
335361
required=True,
336362
),
337363
}
@@ -387,6 +413,9 @@ def _build_schema_on_200(cls):
387413
)
388414

389415
properties = cls._schema_on_200.value.Element.properties
416+
properties.allow_non_virtual_wan_traffic = AAZBoolType(
417+
serialized_name="allowNonVirtualWanTraffic",
418+
)
390419
properties.auto_scale_configuration = AAZObjectType(
391420
serialized_name="autoScaleConfiguration",
392421
)
@@ -428,6 +457,9 @@ def _build_schema_on_200(cls):
428457
properties.enable_internet_security = AAZBoolType(
429458
serialized_name="enableInternetSecurity",
430459
)
460+
properties.enable_private_link_fast_path = AAZBoolType(
461+
serialized_name="enablePrivateLinkFastPath",
462+
)
431463
properties.express_route_circuit_peering = AAZObjectType(
432464
serialized_name="expressRouteCircuitPeering",
433465
flags={"required": True},
@@ -454,6 +486,14 @@ def _build_schema_on_200(cls):
454486
serialized_name="associatedRouteTable",
455487
)
456488
_ListHelper._build_schema_sub_resource_read(routing_configuration.associated_route_table)
489+
routing_configuration.inbound_route_map = AAZObjectType(
490+
serialized_name="inboundRouteMap",
491+
)
492+
_ListHelper._build_schema_sub_resource_read(routing_configuration.inbound_route_map)
493+
routing_configuration.outbound_route_map = AAZObjectType(
494+
serialized_name="outboundRouteMap",
495+
)
496+
_ListHelper._build_schema_sub_resource_read(routing_configuration.outbound_route_map)
457497
routing_configuration.propagated_route_tables = AAZObjectType(
458498
serialized_name="propagatedRouteTables",
459499
)
@@ -480,6 +520,9 @@ def _build_schema_on_200(cls):
480520
vnet_routes.static_routes = AAZListType(
481521
serialized_name="staticRoutes",
482522
)
523+
vnet_routes.static_routes_config = AAZObjectType(
524+
serialized_name="staticRoutesConfig",
525+
)
483526

484527
bgp_connections = cls._schema_on_200.value.Element.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.bgp_connections
485528
bgp_connections.Element = AAZObjectType()
@@ -500,6 +543,15 @@ def _build_schema_on_200(cls):
500543
address_prefixes = cls._schema_on_200.value.Element.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes.Element.address_prefixes
501544
address_prefixes.Element = AAZStrType()
502545

546+
static_routes_config = cls._schema_on_200.value.Element.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes_config
547+
static_routes_config.propagate_static_routes = AAZBoolType(
548+
serialized_name="propagateStaticRoutes",
549+
flags={"read_only": True},
550+
)
551+
static_routes_config.vnet_local_route_override_criteria = AAZStrType(
552+
serialized_name="vnetLocalRouteOverrideCriteria",
553+
)
554+
503555
virtual_hub = cls._schema_on_200.value.Element.properties.virtual_hub
504556
virtual_hub.id = AAZStrType()
505557

src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/gateway/_show.py

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class Show(AAZCommand):
2222
"""
2323

2424
_aaz_info = {
25-
"version": "2022-01-01",
25+
"version": "2023-09-01",
2626
"resources": [
27-
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways/{}", "2022-01-01"],
27+
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutegateways/{}", "2023-09-01"],
2828
]
2929
}
3030

@@ -120,7 +120,7 @@ def url_parameters(self):
120120
def query_parameters(self):
121121
parameters = {
122122
**self.serialize_query_param(
123-
"api-version", "2022-01-01",
123+
"api-version", "2023-09-01",
124124
required=True,
125125
),
126126
}
@@ -170,6 +170,9 @@ def _build_schema_on_200(cls):
170170
)
171171

172172
properties = cls._schema_on_200.properties
173+
properties.allow_non_virtual_wan_traffic = AAZBoolType(
174+
serialized_name="allowNonVirtualWanTraffic",
175+
)
173176
properties.auto_scale_configuration = AAZObjectType(
174177
serialized_name="autoScaleConfiguration",
175178
)
@@ -211,6 +214,9 @@ def _build_schema_on_200(cls):
211214
properties.enable_internet_security = AAZBoolType(
212215
serialized_name="enableInternetSecurity",
213216
)
217+
properties.enable_private_link_fast_path = AAZBoolType(
218+
serialized_name="enablePrivateLinkFastPath",
219+
)
214220
properties.express_route_circuit_peering = AAZObjectType(
215221
serialized_name="expressRouteCircuitPeering",
216222
flags={"required": True},
@@ -237,6 +243,14 @@ def _build_schema_on_200(cls):
237243
serialized_name="associatedRouteTable",
238244
)
239245
_ShowHelper._build_schema_sub_resource_read(routing_configuration.associated_route_table)
246+
routing_configuration.inbound_route_map = AAZObjectType(
247+
serialized_name="inboundRouteMap",
248+
)
249+
_ShowHelper._build_schema_sub_resource_read(routing_configuration.inbound_route_map)
250+
routing_configuration.outbound_route_map = AAZObjectType(
251+
serialized_name="outboundRouteMap",
252+
)
253+
_ShowHelper._build_schema_sub_resource_read(routing_configuration.outbound_route_map)
240254
routing_configuration.propagated_route_tables = AAZObjectType(
241255
serialized_name="propagatedRouteTables",
242256
)
@@ -263,6 +277,9 @@ def _build_schema_on_200(cls):
263277
vnet_routes.static_routes = AAZListType(
264278
serialized_name="staticRoutes",
265279
)
280+
vnet_routes.static_routes_config = AAZObjectType(
281+
serialized_name="staticRoutesConfig",
282+
)
266283

267284
bgp_connections = cls._schema_on_200.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.bgp_connections
268285
bgp_connections.Element = AAZObjectType()
@@ -283,6 +300,15 @@ def _build_schema_on_200(cls):
283300
address_prefixes = cls._schema_on_200.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes.Element.address_prefixes
284301
address_prefixes.Element = AAZStrType()
285302

303+
static_routes_config = cls._schema_on_200.properties.express_route_connections.Element.properties.routing_configuration.vnet_routes.static_routes_config
304+
static_routes_config.propagate_static_routes = AAZBoolType(
305+
serialized_name="propagateStaticRoutes",
306+
flags={"read_only": True},
307+
)
308+
static_routes_config.vnet_local_route_override_criteria = AAZStrType(
309+
serialized_name="vnetLocalRouteOverrideCriteria",
310+
)
311+
286312
virtual_hub = cls._schema_on_200.properties.virtual_hub
287313
virtual_hub.id = AAZStrType()
288314

0 commit comments

Comments
 (0)