|
15 | 15 | "network vnet peering update",
|
16 | 16 | )
|
17 | 17 | class Update(AAZCommand):
|
18 |
| - """Update a peering. |
| 18 | + """Update a peering in the specified virtual network. |
19 | 19 |
|
20 | 20 | :example: Change forwarded traffic configuration of a virtual network peering.
|
21 | 21 | az network vnet peering update -g MyResourceGroup -n MyVnet1ToMyVnet2 --vnet-name MyVnet1 --set allowForwardedTraffic=true
|
@@ -71,6 +71,66 @@ def _build_arguments_schema(cls, *args, **kwargs):
|
71 | 71 | required=True,
|
72 | 72 | id_part="child_name_1",
|
73 | 73 | )
|
| 74 | + _args_schema.sync_remote = AAZStrArg( |
| 75 | + options=["--sync-remote"], |
| 76 | + help="Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated.", |
| 77 | + enum={"true": "true"}, |
| 78 | + ) |
| 79 | + _args_schema.allow_forwarded_traffic = AAZBoolArg( |
| 80 | + options=["--allow-forwarded-traffic"], |
| 81 | + help="Allows forwarded traffic from the local VNet to the remote VNet.", |
| 82 | + nullable=True, |
| 83 | + ) |
| 84 | + _args_schema.allow_gateway_transit = AAZBoolArg( |
| 85 | + options=["--allow-gateway-transit"], |
| 86 | + help="Allows gateway link to be used in the remote VNet.", |
| 87 | + nullable=True, |
| 88 | + ) |
| 89 | + _args_schema.allow_vnet_access = AAZBoolArg( |
| 90 | + options=["--allow-vnet-access"], |
| 91 | + help="Allows access from the local VNet to the remote VNet.", |
| 92 | + nullable=True, |
| 93 | + ) |
| 94 | + _args_schema.enable_only_ipv6 = AAZBoolArg( |
| 95 | + options=["--enable-only-ipv6"], |
| 96 | + help="Whether only Ipv6 address space is peered for subnet peering.", |
| 97 | + nullable=True, |
| 98 | + ) |
| 99 | + _args_schema.local_subnet_names = AAZListArg( |
| 100 | + options=["--local-subnet-names"], |
| 101 | + help="List of local subnet names that are subnet peered with remote virtual network.", |
| 102 | + nullable=True, |
| 103 | + ) |
| 104 | + _args_schema.peer_complete_vnets = AAZBoolArg( |
| 105 | + options=["--peer-complete-vnets"], |
| 106 | + help="Whether complete virtual network address space is peered.", |
| 107 | + nullable=True, |
| 108 | + ) |
| 109 | + _args_schema.remote_subnet_names = AAZListArg( |
| 110 | + options=["--remote-subnet-names"], |
| 111 | + help="List of remote subnet names from remote virtual network that are subnet peered.", |
| 112 | + nullable=True, |
| 113 | + ) |
| 114 | + _args_schema.remote_vnet = AAZStrArg( |
| 115 | + options=["--remote-vnet"], |
| 116 | + help="Name or ID of the remote VNet.", |
| 117 | + nullable=True, |
| 118 | + ) |
| 119 | + _args_schema.use_remote_gateways = AAZBoolArg( |
| 120 | + options=["--use-remote-gateways"], |
| 121 | + help="Allows VNet to use the remote VNet's gateway. Remote VNet gateway must have --allow-gateway-transit enabled for remote peering. Only 1 peering can have this flag enabled. Cannot be set if the VNet already has a gateway.", |
| 122 | + nullable=True, |
| 123 | + ) |
| 124 | + |
| 125 | + local_subnet_names = cls._args_schema.local_subnet_names |
| 126 | + local_subnet_names.Element = AAZStrArg( |
| 127 | + nullable=True, |
| 128 | + ) |
| 129 | + |
| 130 | + remote_subnet_names = cls._args_schema.remote_subnet_names |
| 131 | + remote_subnet_names.Element = AAZStrArg( |
| 132 | + nullable=True, |
| 133 | + ) |
74 | 134 |
|
75 | 135 | # define Arg Group "Properties"
|
76 | 136 |
|
@@ -287,6 +347,9 @@ def url_parameters(self):
|
287 | 347 | @property
|
288 | 348 | def query_parameters(self):
|
289 | 349 | parameters = {
|
| 350 | + **self.serialize_query_param( |
| 351 | + "syncRemoteAddressSpace", self.ctx.args.sync_remote, |
| 352 | + ), |
290 | 353 | **self.serialize_query_param(
|
291 | 354 | "api-version", "2023-11-01",
|
292 | 355 | required=True,
|
@@ -351,7 +414,27 @@ def _update_instance(self, instance):
|
351 | 414 |
|
352 | 415 | properties = _builder.get(".properties")
|
353 | 416 | if properties is not None:
|
| 417 | + properties.set_prop("allowForwardedTraffic", AAZBoolType, ".allow_forwarded_traffic") |
| 418 | + properties.set_prop("allowGatewayTransit", AAZBoolType, ".allow_gateway_transit") |
| 419 | + properties.set_prop("allowVirtualNetworkAccess", AAZBoolType, ".allow_vnet_access") |
| 420 | + properties.set_prop("enableOnlyIPv6Peering", AAZBoolType, ".enable_only_ipv6") |
| 421 | + properties.set_prop("localSubnetNames", AAZListType, ".local_subnet_names") |
| 422 | + properties.set_prop("peerCompleteVnets", AAZBoolType, ".peer_complete_vnets") |
| 423 | + properties.set_prop("remoteSubnetNames", AAZListType, ".remote_subnet_names") |
354 | 424 | properties.set_prop("remoteVirtualNetwork", AAZObjectType)
|
| 425 | + properties.set_prop("useRemoteGateways", AAZBoolType, ".use_remote_gateways") |
| 426 | + |
| 427 | + local_subnet_names = _builder.get(".properties.localSubnetNames") |
| 428 | + if local_subnet_names is not None: |
| 429 | + local_subnet_names.set_elements(AAZStrType, ".") |
| 430 | + |
| 431 | + remote_subnet_names = _builder.get(".properties.remoteSubnetNames") |
| 432 | + if remote_subnet_names is not None: |
| 433 | + remote_subnet_names.set_elements(AAZStrType, ".") |
| 434 | + |
| 435 | + remote_virtual_network = _builder.get(".properties.remoteVirtualNetwork") |
| 436 | + if remote_virtual_network is not None: |
| 437 | + remote_virtual_network.set_prop("id", AAZStrType, ".remote_vnet") |
355 | 438 |
|
356 | 439 | return _instance_value
|
357 | 440 |
|
|
0 commit comments