From bfa386fbc15406b76eeb919d429750ee1bcf30be Mon Sep 17 00:00:00 2001 From: Jian Hui Date: Fri, 30 Oct 2026 12:01:22 +0800 Subject: [PATCH 1/2] [Network] `az network express-route`: Add MultiCloud circuit support Copilot-Session: 3079c979-fd58-4641-9fc2-5422cf111af9 --- .../latest/network/express_route/_create.py | 196 ++- .../latest/network/express_route/_delete.py | 6 +- .../aaz/latest/network/express_route/_list.py | 161 ++- .../aaz/latest/network/express_route/_show.py | 90 +- .../latest/network/express_route/_update.py | 1198 +++++++++++------ .../aaz/latest/network/express_route/_wait.py | 88 +- ..._connection_inbound_outbound_routemap.yaml | 4 +- .../test_network_express_route.yaml | 26 +- ...st_network_express_route_global_reach.yaml | 8 +- ...ork_express_route_global_reach_config.yaml | 8 +- ...st_network_express_route_ipv6_peering.yaml | 4 +- ...t_network_express_route_ipv6_peering2.yaml | 4 +- ...network_express_route_peer_connection.yaml | 8 +- .../tests/latest/test_network_commands.py | 44 + .../tests/latest/test_network_unit_tests.py | 128 ++ 15 files changed, 1402 insertions(+), 571 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_create.py index 18c8349b02d..e55c9bd6903 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_create.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_create.py @@ -19,12 +19,18 @@ class Create(AAZCommand): :example: Create an ExpressRoute circuit. az network express-route create --bandwidth 200 -n MyCircuit --peering-location "SiliconValley" -g MyResourceGroup --provider "Equinix" -l "West US" --sku-family MeteredData --sku-tier Standard + + :example: Create an ExpressRoute MultiCloud circuit using a partner cloud account ID. + az network express-route create --bandwidth 200 -n MyCircuit --peering-location uswest2 -g MyResourceGroup --provider AWS -l eastus2 --sku-family MeteredData --sku-tier MultiCloud --partner-account-id 123456789 + + :example: Create an ExpressRoute MultiCloud circuit using an activation key from the partner cloud provider. + az network express-route create --bandwidth 200 -n MyCircuit --peering-location uswest2 -g MyResourceGroup --provider AWS -l eastus2 --sku-family MeteredData --sku-tier MultiCloud --activation-key MyActivationKey """ _aaz_info = { - "version": "2022-01-01", + "version": "2025-09-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2022-01-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2025-09-01"], ] } @@ -60,7 +66,7 @@ def _build_arguments_schema(cls, *args, **kwargs): ), ) _args_schema.allow_classic_operations = AAZBoolArg( - options=["--allow-classic-operations"], + options=["--allow-classic-ops", "--allow-classic-operations"], help="Allow classic operations. Allowed values: false, true.", ) _args_schema.bandwidth_in_gbps = AAZFloatArg( @@ -97,7 +103,7 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--sku-tier"], help="SKU Tier of ExpressRoute circuit. Allowed values: Basic, Local, Premium, Standard. Default: Standard.", default="Standard", - enum={"Basic": "Basic", "Local": "Local", "Premium": "Premium", "Standard": "Standard"}, + enum={"Basic": "Basic", "Local": "Local", "MultiCloud": "MultiCloud", "Premium": "Premium", "Standard": "Standard"}, ) _args_schema.tags = AAZDictArg( options=["--tags"], @@ -111,6 +117,23 @@ def _build_arguments_schema(cls, *args, **kwargs): # define Arg Group "Properties" + _args_schema = cls._args_schema + _args_schema.activation_key = AAZStrArg( + options=["--activation-key"], + arg_group="Properties", + help="Activation Key from partner cloud provider.", + ) + _args_schema.enable_direct_port_rate_limit = AAZBoolArg( + options=["--enable-port-rate-limit", "--enable-direct-port-rate-limit"], + arg_group="Properties", + help="Flag denoting rate-limiting status of the ExpressRoute direct-port circuit.", + ) + _args_schema.partner_account_id = AAZStrArg( + options=["--partner-account-id"], + arg_group="Properties", + help="Account ID of customer account on partner cloud provider.", + ) + # define Arg Group "ServiceProviderProperties" _args_schema = cls._args_schema @@ -121,12 +144,31 @@ def _build_arguments_schema(cls, *args, **kwargs): ) return cls._args_schema + _args_common_sub_resource_create = None + + @classmethod + def _build_args_common_sub_resource_create(cls, _schema): + if cls._args_common_sub_resource_create is not None: + _schema.id = cls._args_common_sub_resource_create.id + return + + cls._args_common_sub_resource_create = AAZObjectArg() + + common_sub_resource_create = cls._args_common_sub_resource_create + common_sub_resource_create.id = AAZStrArg( + options=["id"], + help="Resource ID.", + ) + + _schema.id = cls._args_common_sub_resource_create.id + _args_express_route_circuit_peering_config_create = None @classmethod def _build_args_express_route_circuit_peering_config_create(cls, _schema): if cls._args_express_route_circuit_peering_config_create is not None: _schema.advertised_communities = cls._args_express_route_circuit_peering_config_create.advertised_communities + _schema.advertised_public_prefix_info = cls._args_express_route_circuit_peering_config_create.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._args_express_route_circuit_peering_config_create.advertised_public_prefixes _schema.customer_asn = cls._args_express_route_circuit_peering_config_create.customer_asn _schema.legacy_mode = cls._args_express_route_circuit_peering_config_create.legacy_mode @@ -140,6 +182,10 @@ def _build_args_express_route_circuit_peering_config_create(cls, _schema): options=["advertised-communities"], help="The communities of bgp peering. Specified for microsoft peering.", ) + express_route_circuit_peering_config_create.advertised_public_prefix_info = AAZListArg( + options=["advertised-public-prefix-info"], + help="List of Prefix information required to perform validation.", + ) express_route_circuit_peering_config_create.advertised_public_prefixes = AAZListArg( options=["advertised-public-prefixes"], help="The reference to AdvertisedPublicPrefixes.", @@ -160,33 +206,33 @@ def _build_args_express_route_circuit_peering_config_create(cls, _schema): advertised_communities = cls._args_express_route_circuit_peering_config_create.advertised_communities advertised_communities.Element = AAZStrArg() + advertised_public_prefix_info = cls._args_express_route_circuit_peering_config_create.advertised_public_prefix_info + advertised_public_prefix_info.Element = AAZObjectArg() + + _element = cls._args_express_route_circuit_peering_config_create.advertised_public_prefix_info.Element + _element.prefix = AAZStrArg( + options=["prefix"], + help="Advertised Public Prefix.", + ) + _element.signature = AAZStrArg( + options=["signature"], + help="Signed string generated by encrypting validationId with a private key.", + ) + _element.validation_id = AAZStrArg( + options=["validation-id"], + help="Validation string that contains circuit peering info.", + ) + advertised_public_prefixes = cls._args_express_route_circuit_peering_config_create.advertised_public_prefixes advertised_public_prefixes.Element = AAZStrArg() _schema.advertised_communities = cls._args_express_route_circuit_peering_config_create.advertised_communities + _schema.advertised_public_prefix_info = cls._args_express_route_circuit_peering_config_create.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._args_express_route_circuit_peering_config_create.advertised_public_prefixes _schema.customer_asn = cls._args_express_route_circuit_peering_config_create.customer_asn _schema.legacy_mode = cls._args_express_route_circuit_peering_config_create.legacy_mode _schema.routing_registry_name = cls._args_express_route_circuit_peering_config_create.routing_registry_name - _args_sub_resource_create = None - - @classmethod - def _build_args_sub_resource_create(cls, _schema): - if cls._args_sub_resource_create is not None: - _schema.id = cls._args_sub_resource_create.id - return - - cls._args_sub_resource_create = AAZObjectArg() - - sub_resource_create = cls._args_sub_resource_create - sub_resource_create.id = AAZStrArg( - options=["id"], - help="Resource ID.", - ) - - _schema.id = cls._args_sub_resource_create.id - def _execute_operations(self): self.pre_operations() yield self.ExpressRouteCircuitsCreateOrUpdate(ctx=self.ctx)() @@ -268,7 +314,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } @@ -300,10 +346,13 @@ def content(self): properties = _builder.get(".properties") if properties is not None: + properties.set_prop("activationKey", AAZStrType, ".activation_key") properties.set_prop("allowClassicOperations", AAZBoolType, ".allow_classic_operations") properties.set_prop("bandwidthInGbps", AAZFloatType, ".bandwidth_in_gbps") + properties.set_prop("enableDirectPortRateLimit", AAZBoolType, ".enable_direct_port_rate_limit") properties.set_prop("expressRoutePort", AAZObjectType) properties.set_prop("globalReachEnabled", AAZBoolType, ".allow_global_reach") + properties.set_prop("partnerAccountId", AAZStrType, ".partner_account_id") properties.set_prop("serviceProviderProperties", AAZObjectType) express_route_port = _builder.get(".properties.expressRoutePort") @@ -364,12 +413,19 @@ def _build_schema_on_200_201(cls): ) properties = cls._schema_on_200_201.properties + properties.activation_key = AAZStrType( + serialized_name="activationKey", + ) properties.allow_classic_operations = AAZBoolType( serialized_name="allowClassicOperations", ) properties.authorization_key = AAZStrType( serialized_name="authorizationKey", ) + properties.authorization_status = AAZStrType( + serialized_name="authorizationStatus", + flags={"read_only": True}, + ) properties.authorizations = AAZListType() properties.bandwidth_in_gbps = AAZFloatType( serialized_name="bandwidthInGbps", @@ -377,21 +433,31 @@ def _build_schema_on_200_201(cls): properties.circuit_provisioning_state = AAZStrType( serialized_name="circuitProvisioningState", ) + properties.enable_direct_port_rate_limit = AAZBoolType( + serialized_name="enableDirectPortRateLimit", + ) properties.express_route_port = AAZObjectType( serialized_name="expressRoutePort", ) - _CreateHelper._build_schema_sub_resource_read(properties.express_route_port) + _CreateHelper._build_schema_common_sub_resource_read(properties.express_route_port) properties.gateway_manager_etag = AAZStrType( serialized_name="gatewayManagerEtag", ) properties.global_reach_enabled = AAZBoolType( serialized_name="globalReachEnabled", ) + properties.partner_account_id = AAZStrType( + serialized_name="partnerAccountId", + ) properties.peerings = AAZListType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) + properties.resiliency_level = AAZStrType( + serialized_name="resiliencyLevel", + flags={"read_only": True}, + ) properties.service_key = AAZStrType( serialized_name="serviceKey", ) @@ -431,6 +497,10 @@ def _build_schema_on_200_201(cls): properties.authorization_use_status = AAZStrType( serialized_name="authorizationUseStatus", ) + properties.connection_resource_uri = AAZStrType( + serialized_name="connectionResourceUri", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -497,7 +567,7 @@ def _build_schema_on_200_201(cls): properties.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _CreateHelper._build_schema_sub_resource_read(properties.route_filter) + _CreateHelper._build_schema_common_sub_resource_read(properties.route_filter) properties.secondary_azure_port = AAZStrType( serialized_name="secondaryAzurePort", ) @@ -543,14 +613,14 @@ def _build_schema_on_200_201(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _CreateHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _CreateHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.ipv6_circuit_connection_config = AAZObjectType( serialized_name="ipv6CircuitConnectionConfig", ) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _CreateHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _CreateHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -581,7 +651,7 @@ def _build_schema_on_200_201(cls): ipv6_peering_config.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _CreateHelper._build_schema_sub_resource_read(ipv6_peering_config.route_filter) + _CreateHelper._build_schema_common_sub_resource_read(ipv6_peering_config.route_filter) ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( serialized_name="secondaryPeerAddressPrefix", ) @@ -620,11 +690,11 @@ def _build_schema_on_200_201(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _CreateHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _CreateHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _CreateHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _CreateHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -669,11 +739,18 @@ def _build_schema_on_200_201(cls): class _CreateHelper: """Helper class for Create""" + @classmethod + def _build_schema_common_sub_resource_create(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") + @classmethod def _build_schema_express_route_circuit_peering_config_create(cls, _builder): if _builder is None: return _builder.set_prop("advertisedCommunities", AAZListType, ".advertised_communities") + _builder.set_prop("advertisedPublicPrefixInfo", AAZListType, ".advertised_public_prefix_info") _builder.set_prop("advertisedPublicPrefixes", AAZListType, ".advertised_public_prefixes") _builder.set_prop("customerASN", AAZIntType, ".customer_asn") _builder.set_prop("legacyMode", AAZIntType, ".legacy_mode") @@ -683,15 +760,34 @@ def _build_schema_express_route_circuit_peering_config_create(cls, _builder): if advertised_communities is not None: advertised_communities.set_elements(AAZStrType, ".") + advertised_public_prefix_info = _builder.get(".advertisedPublicPrefixInfo") + if advertised_public_prefix_info is not None: + advertised_public_prefix_info.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".advertisedPublicPrefixInfo[]") + if _elements is not None: + _elements.set_prop("prefix", AAZStrType, ".prefix") + _elements.set_prop("signature", AAZStrType, ".signature") + _elements.set_prop("validationId", AAZStrType, ".validation_id") + advertised_public_prefixes = _builder.get(".advertisedPublicPrefixes") if advertised_public_prefixes is not None: advertised_public_prefixes.set_elements(AAZStrType, ".") + _schema_common_sub_resource_read = None + @classmethod - def _build_schema_sub_resource_create(cls, _builder): - if _builder is None: + def _build_schema_common_sub_resource_read(cls, _schema): + if cls._schema_common_sub_resource_read is not None: + _schema.id = cls._schema_common_sub_resource_read.id return - _builder.set_prop("id", AAZStrType, ".id") + + cls._schema_common_sub_resource_read = _schema_common_sub_resource_read = AAZObjectType() + + common_sub_resource_read = _schema_common_sub_resource_read + common_sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_common_sub_resource_read.id _schema_express_route_circuit_peering_config_read = None @@ -699,6 +795,7 @@ def _build_schema_sub_resource_create(cls, _builder): def _build_schema_express_route_circuit_peering_config_read(cls, _schema): if cls._schema_express_route_circuit_peering_config_read is not None: _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn @@ -712,6 +809,9 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): express_route_circuit_peering_config_read.advertised_communities = AAZListType( serialized_name="advertisedCommunities", ) + express_route_circuit_peering_config_read.advertised_public_prefix_info = AAZListType( + serialized_name="advertisedPublicPrefixInfo", + ) express_route_circuit_peering_config_read.advertised_public_prefixes = AAZListType( serialized_name="advertisedPublicPrefixes", ) @@ -732,30 +832,30 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): advertised_communities = _schema_express_route_circuit_peering_config_read.advertised_communities advertised_communities.Element = AAZStrType() + advertised_public_prefix_info = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info + advertised_public_prefix_info.Element = AAZObjectType() + + _element = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info.Element + _element.prefix = AAZStrType() + _element.signature = AAZStrType() + _element.validation_id = AAZStrType( + serialized_name="validationId", + ) + _element.validation_state = AAZStrType( + serialized_name="validationState", + flags={"read_only": True}, + ) + advertised_public_prefixes = _schema_express_route_circuit_peering_config_read.advertised_public_prefixes advertised_public_prefixes.Element = AAZStrType() _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn _schema.legacy_mode = cls._schema_express_route_circuit_peering_config_read.legacy_mode _schema.routing_registry_name = cls._schema_express_route_circuit_peering_config_read.routing_registry_name - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - __all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_delete.py index 009faac45b6..609e2a50062 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_delete.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_delete.py @@ -25,9 +25,9 @@ class Delete(AAZCommand): """ _aaz_info = { - "version": "2022-01-01", + "version": "2025-09-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2022-01-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2025-09-01"], ] } @@ -145,7 +145,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_list.py index fae8b4208c2..880eb73a484 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_list.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_list.py @@ -22,10 +22,10 @@ class List(AAZCommand): """ _aaz_info = { - "version": "2022-01-01", + "version": "2025-09-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/expressroutecircuits", "2022-01-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits", "2022-01-01"], + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/expressroutecircuits", "2025-09-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits", "2025-09-01"], ] } @@ -51,12 +51,12 @@ def _build_arguments_schema(cls, *args, **kwargs): def _execute_operations(self): self.pre_operations() - condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) - condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True + condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id) if condition_0: - self.ExpressRouteCircuitsList(ctx=self.ctx)() - if condition_1: self.ExpressRouteCircuitsListAll(ctx=self.ctx)() + if condition_1: + self.ExpressRouteCircuitsList(ctx=self.ctx)() self.post_operations() @register_callback @@ -72,7 +72,7 @@ def _output(self, *args, **kwargs): next_link = self.deserialize_output(self.ctx.vars.instance.next_link) return result, next_link - class ExpressRouteCircuitsList(AAZHttpOperation): + class ExpressRouteCircuitsListAll(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -86,7 +86,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits", **self.url_parameters ) @@ -101,10 +101,6 @@ def error_format(self): @property def url_parameters(self): parameters = { - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, @@ -116,7 +112,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } @@ -152,7 +148,9 @@ def _build_schema_on_200(cls): _schema_on_200.next_link = AAZStrType( serialized_name="nextLink", ) - _schema_on_200.value = AAZListType() + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) value = cls._schema_on_200.value value.Element = AAZObjectType() @@ -176,12 +174,19 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.value.Element.properties + properties.activation_key = AAZStrType( + serialized_name="activationKey", + ) properties.allow_classic_operations = AAZBoolType( serialized_name="allowClassicOperations", ) properties.authorization_key = AAZStrType( serialized_name="authorizationKey", ) + properties.authorization_status = AAZStrType( + serialized_name="authorizationStatus", + flags={"read_only": True}, + ) properties.authorizations = AAZListType() properties.bandwidth_in_gbps = AAZFloatType( serialized_name="bandwidthInGbps", @@ -189,21 +194,31 @@ def _build_schema_on_200(cls): properties.circuit_provisioning_state = AAZStrType( serialized_name="circuitProvisioningState", ) + properties.enable_direct_port_rate_limit = AAZBoolType( + serialized_name="enableDirectPortRateLimit", + ) properties.express_route_port = AAZObjectType( serialized_name="expressRoutePort", ) - _ListHelper._build_schema_sub_resource_read(properties.express_route_port) + _ListHelper._build_schema_common_sub_resource_read(properties.express_route_port) properties.gateway_manager_etag = AAZStrType( serialized_name="gatewayManagerEtag", ) properties.global_reach_enabled = AAZBoolType( serialized_name="globalReachEnabled", ) + properties.partner_account_id = AAZStrType( + serialized_name="partnerAccountId", + ) properties.peerings = AAZListType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) + properties.resiliency_level = AAZStrType( + serialized_name="resiliencyLevel", + flags={"read_only": True}, + ) properties.service_key = AAZStrType( serialized_name="serviceKey", ) @@ -243,6 +258,10 @@ def _build_schema_on_200(cls): properties.authorization_use_status = AAZStrType( serialized_name="authorizationUseStatus", ) + properties.connection_resource_uri = AAZStrType( + serialized_name="connectionResourceUri", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -309,7 +328,7 @@ def _build_schema_on_200(cls): properties.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _ListHelper._build_schema_sub_resource_read(properties.route_filter) + _ListHelper._build_schema_common_sub_resource_read(properties.route_filter) properties.secondary_azure_port = AAZStrType( serialized_name="secondaryAzurePort", ) @@ -355,14 +374,14 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.ipv6_circuit_connection_config = AAZObjectType( serialized_name="ipv6CircuitConnectionConfig", ) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -393,7 +412,7 @@ def _build_schema_on_200(cls): ipv6_peering_config.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _ListHelper._build_schema_sub_resource_read(ipv6_peering_config.route_filter) + _ListHelper._build_schema_common_sub_resource_read(ipv6_peering_config.route_filter) ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( serialized_name="secondaryPeerAddressPrefix", ) @@ -432,11 +451,11 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -477,7 +496,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 - class ExpressRouteCircuitsListAll(AAZHttpOperation): + class ExpressRouteCircuitsList(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -491,7 +510,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits", **self.url_parameters ) @@ -506,6 +525,10 @@ def error_format(self): @property def url_parameters(self): parameters = { + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), **self.serialize_url_param( "subscriptionId", self.ctx.subscription_id, required=True, @@ -517,7 +540,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } @@ -553,7 +576,9 @@ def _build_schema_on_200(cls): _schema_on_200.next_link = AAZStrType( serialized_name="nextLink", ) - _schema_on_200.value = AAZListType() + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) value = cls._schema_on_200.value value.Element = AAZObjectType() @@ -577,12 +602,19 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.value.Element.properties + properties.activation_key = AAZStrType( + serialized_name="activationKey", + ) properties.allow_classic_operations = AAZBoolType( serialized_name="allowClassicOperations", ) properties.authorization_key = AAZStrType( serialized_name="authorizationKey", ) + properties.authorization_status = AAZStrType( + serialized_name="authorizationStatus", + flags={"read_only": True}, + ) properties.authorizations = AAZListType() properties.bandwidth_in_gbps = AAZFloatType( serialized_name="bandwidthInGbps", @@ -590,21 +622,31 @@ def _build_schema_on_200(cls): properties.circuit_provisioning_state = AAZStrType( serialized_name="circuitProvisioningState", ) + properties.enable_direct_port_rate_limit = AAZBoolType( + serialized_name="enableDirectPortRateLimit", + ) properties.express_route_port = AAZObjectType( serialized_name="expressRoutePort", ) - _ListHelper._build_schema_sub_resource_read(properties.express_route_port) + _ListHelper._build_schema_common_sub_resource_read(properties.express_route_port) properties.gateway_manager_etag = AAZStrType( serialized_name="gatewayManagerEtag", ) properties.global_reach_enabled = AAZBoolType( serialized_name="globalReachEnabled", ) + properties.partner_account_id = AAZStrType( + serialized_name="partnerAccountId", + ) properties.peerings = AAZListType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) + properties.resiliency_level = AAZStrType( + serialized_name="resiliencyLevel", + flags={"read_only": True}, + ) properties.service_key = AAZStrType( serialized_name="serviceKey", ) @@ -644,6 +686,10 @@ def _build_schema_on_200(cls): properties.authorization_use_status = AAZStrType( serialized_name="authorizationUseStatus", ) + properties.connection_resource_uri = AAZStrType( + serialized_name="connectionResourceUri", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -710,7 +756,7 @@ def _build_schema_on_200(cls): properties.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _ListHelper._build_schema_sub_resource_read(properties.route_filter) + _ListHelper._build_schema_common_sub_resource_read(properties.route_filter) properties.secondary_azure_port = AAZStrType( serialized_name="secondaryAzurePort", ) @@ -756,14 +802,14 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.ipv6_circuit_connection_config = AAZObjectType( serialized_name="ipv6CircuitConnectionConfig", ) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -794,7 +840,7 @@ def _build_schema_on_200(cls): ipv6_peering_config.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _ListHelper._build_schema_sub_resource_read(ipv6_peering_config.route_filter) + _ListHelper._build_schema_common_sub_resource_read(ipv6_peering_config.route_filter) ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( serialized_name="secondaryPeerAddressPrefix", ) @@ -833,11 +879,11 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _ListHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _ListHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -882,12 +928,28 @@ def _build_schema_on_200(cls): class _ListHelper: """Helper class for List""" + _schema_common_sub_resource_read = None + + @classmethod + def _build_schema_common_sub_resource_read(cls, _schema): + if cls._schema_common_sub_resource_read is not None: + _schema.id = cls._schema_common_sub_resource_read.id + return + + cls._schema_common_sub_resource_read = _schema_common_sub_resource_read = AAZObjectType() + + common_sub_resource_read = _schema_common_sub_resource_read + common_sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_common_sub_resource_read.id + _schema_express_route_circuit_peering_config_read = None @classmethod def _build_schema_express_route_circuit_peering_config_read(cls, _schema): if cls._schema_express_route_circuit_peering_config_read is not None: _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn @@ -901,6 +963,9 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): express_route_circuit_peering_config_read.advertised_communities = AAZListType( serialized_name="advertisedCommunities", ) + express_route_circuit_peering_config_read.advertised_public_prefix_info = AAZListType( + serialized_name="advertisedPublicPrefixInfo", + ) express_route_circuit_peering_config_read.advertised_public_prefixes = AAZListType( serialized_name="advertisedPublicPrefixes", ) @@ -921,30 +986,30 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): advertised_communities = _schema_express_route_circuit_peering_config_read.advertised_communities advertised_communities.Element = AAZStrType() + advertised_public_prefix_info = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info + advertised_public_prefix_info.Element = AAZObjectType() + + _element = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info.Element + _element.prefix = AAZStrType() + _element.signature = AAZStrType() + _element.validation_id = AAZStrType( + serialized_name="validationId", + ) + _element.validation_state = AAZStrType( + serialized_name="validationState", + flags={"read_only": True}, + ) + advertised_public_prefixes = _schema_express_route_circuit_peering_config_read.advertised_public_prefixes advertised_public_prefixes.Element = AAZStrType() _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn _schema.legacy_mode = cls._schema_express_route_circuit_peering_config_read.legacy_mode _schema.routing_registry_name = cls._schema_express_route_circuit_peering_config_read.routing_registry_name - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - __all__ = ["List"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_show.py index 112f7e16bac..0b820ea53d5 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_show.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_show.py @@ -22,9 +22,9 @@ class Show(AAZCommand): """ _aaz_info = { - "version": "2022-01-01", + "version": "2025-09-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2022-01-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2025-09-01"], ] } @@ -120,7 +120,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } @@ -171,12 +171,19 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.properties + properties.activation_key = AAZStrType( + serialized_name="activationKey", + ) properties.allow_classic_operations = AAZBoolType( serialized_name="allowClassicOperations", ) properties.authorization_key = AAZStrType( serialized_name="authorizationKey", ) + properties.authorization_status = AAZStrType( + serialized_name="authorizationStatus", + flags={"read_only": True}, + ) properties.authorizations = AAZListType() properties.bandwidth_in_gbps = AAZFloatType( serialized_name="bandwidthInGbps", @@ -184,21 +191,31 @@ def _build_schema_on_200(cls): properties.circuit_provisioning_state = AAZStrType( serialized_name="circuitProvisioningState", ) + properties.enable_direct_port_rate_limit = AAZBoolType( + serialized_name="enableDirectPortRateLimit", + ) properties.express_route_port = AAZObjectType( serialized_name="expressRoutePort", ) - _ShowHelper._build_schema_sub_resource_read(properties.express_route_port) + _ShowHelper._build_schema_common_sub_resource_read(properties.express_route_port) properties.gateway_manager_etag = AAZStrType( serialized_name="gatewayManagerEtag", ) properties.global_reach_enabled = AAZBoolType( serialized_name="globalReachEnabled", ) + properties.partner_account_id = AAZStrType( + serialized_name="partnerAccountId", + ) properties.peerings = AAZListType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) + properties.resiliency_level = AAZStrType( + serialized_name="resiliencyLevel", + flags={"read_only": True}, + ) properties.service_key = AAZStrType( serialized_name="serviceKey", ) @@ -238,6 +255,10 @@ def _build_schema_on_200(cls): properties.authorization_use_status = AAZStrType( serialized_name="authorizationUseStatus", ) + properties.connection_resource_uri = AAZStrType( + serialized_name="connectionResourceUri", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -304,7 +325,7 @@ def _build_schema_on_200(cls): properties.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _ShowHelper._build_schema_sub_resource_read(properties.route_filter) + _ShowHelper._build_schema_common_sub_resource_read(properties.route_filter) properties.secondary_azure_port = AAZStrType( serialized_name="secondaryAzurePort", ) @@ -350,14 +371,14 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _ShowHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _ShowHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.ipv6_circuit_connection_config = AAZObjectType( serialized_name="ipv6CircuitConnectionConfig", ) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _ShowHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _ShowHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -388,7 +409,7 @@ def _build_schema_on_200(cls): ipv6_peering_config.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _ShowHelper._build_schema_sub_resource_read(ipv6_peering_config.route_filter) + _ShowHelper._build_schema_common_sub_resource_read(ipv6_peering_config.route_filter) ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( serialized_name="secondaryPeerAddressPrefix", ) @@ -427,11 +448,11 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _ShowHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _ShowHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _ShowHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _ShowHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -476,12 +497,28 @@ def _build_schema_on_200(cls): class _ShowHelper: """Helper class for Show""" + _schema_common_sub_resource_read = None + + @classmethod + def _build_schema_common_sub_resource_read(cls, _schema): + if cls._schema_common_sub_resource_read is not None: + _schema.id = cls._schema_common_sub_resource_read.id + return + + cls._schema_common_sub_resource_read = _schema_common_sub_resource_read = AAZObjectType() + + common_sub_resource_read = _schema_common_sub_resource_read + common_sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_common_sub_resource_read.id + _schema_express_route_circuit_peering_config_read = None @classmethod def _build_schema_express_route_circuit_peering_config_read(cls, _schema): if cls._schema_express_route_circuit_peering_config_read is not None: _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn @@ -495,6 +532,9 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): express_route_circuit_peering_config_read.advertised_communities = AAZListType( serialized_name="advertisedCommunities", ) + express_route_circuit_peering_config_read.advertised_public_prefix_info = AAZListType( + serialized_name="advertisedPublicPrefixInfo", + ) express_route_circuit_peering_config_read.advertised_public_prefixes = AAZListType( serialized_name="advertisedPublicPrefixes", ) @@ -515,30 +555,30 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): advertised_communities = _schema_express_route_circuit_peering_config_read.advertised_communities advertised_communities.Element = AAZStrType() + advertised_public_prefix_info = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info + advertised_public_prefix_info.Element = AAZObjectType() + + _element = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info.Element + _element.prefix = AAZStrType() + _element.signature = AAZStrType() + _element.validation_id = AAZStrType( + serialized_name="validationId", + ) + _element.validation_state = AAZStrType( + serialized_name="validationState", + flags={"read_only": True}, + ) + advertised_public_prefixes = _schema_express_route_circuit_peering_config_read.advertised_public_prefixes advertised_public_prefixes.Element = AAZStrType() _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn _schema.legacy_mode = cls._schema_express_route_circuit_peering_config_read.legacy_mode _schema.routing_registry_name = cls._schema_express_route_circuit_peering_config_read.routing_registry_name - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - __all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_update.py index 9aaac92f493..fee3b232b60 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_update.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_update.py @@ -22,9 +22,9 @@ class Update(AAZCommand): """ _aaz_info = { - "version": "2022-01-01", + "version": "2025-09-01", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2022-01-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2025-09-01"], ] } @@ -57,8 +57,8 @@ def _build_arguments_schema(cls, *args, **kwargs): required=True, ) _args_schema.allow_classic_operations = AAZBoolArg( - options=["--allow-classic-operations"], - help="Allow classic operations.", + options=["--allow-classic-ops", "--allow-classic-operations"], + help="Allow classic operations. Allowed values: false, true.", nullable=True, ) _args_schema.bandwidth_in_gbps = AAZFloatArg( @@ -101,7 +101,7 @@ def _build_arguments_schema(cls, *args, **kwargs): options=["--sku-tier"], help="SKU Tier of ExpressRoute circuit. Allowed values: Basic, Local, Premium, Standard.", nullable=True, - enum={"Basic": "Basic", "Local": "Local", "Premium": "Premium", "Standard": "Standard"}, + enum={"Basic": "Basic", "Local": "Local", "MultiCloud": "MultiCloud", "Premium": "Premium", "Standard": "Standard"}, ) _args_schema.tags = AAZDictArg( options=["--tags"], @@ -118,6 +118,26 @@ def _build_arguments_schema(cls, *args, **kwargs): # define Arg Group "Properties" + _args_schema = cls._args_schema + _args_schema.activation_key = AAZStrArg( + options=["--activation-key"], + arg_group="Properties", + help="Activation Key from partner cloud provider.", + nullable=True, + ) + _args_schema.enable_direct_port_rate_limit = AAZBoolArg( + options=["--enable-port-rate-limit", "--enable-direct-port-rate-limit"], + arg_group="Properties", + help="Flag denoting rate-limiting status of the ExpressRoute direct-port circuit.", + nullable=True, + ) + _args_schema.partner_account_id = AAZStrArg( + options=["--partner-account-id"], + arg_group="Properties", + help="Account ID of customer account on partner cloud provider.", + nullable=True, + ) + # define Arg Group "ServiceProviderProperties" _args_schema = cls._args_schema @@ -129,12 +149,34 @@ def _build_arguments_schema(cls, *args, **kwargs): ) return cls._args_schema + _args_common_sub_resource_update = None + + @classmethod + def _build_args_common_sub_resource_update(cls, _schema): + if cls._args_common_sub_resource_update is not None: + _schema.id = cls._args_common_sub_resource_update.id + return + + cls._args_common_sub_resource_update = AAZObjectArg( + nullable=True, + ) + + common_sub_resource_update = cls._args_common_sub_resource_update + common_sub_resource_update.id = AAZStrArg( + options=["id"], + help="Resource ID.", + nullable=True, + ) + + _schema.id = cls._args_common_sub_resource_update.id + _args_express_route_circuit_peering_config_update = None @classmethod def _build_args_express_route_circuit_peering_config_update(cls, _schema): if cls._args_express_route_circuit_peering_config_update is not None: _schema.advertised_communities = cls._args_express_route_circuit_peering_config_update.advertised_communities + _schema.advertised_public_prefix_info = cls._args_express_route_circuit_peering_config_update.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._args_express_route_circuit_peering_config_update.advertised_public_prefixes _schema.customer_asn = cls._args_express_route_circuit_peering_config_update.customer_asn _schema.legacy_mode = cls._args_express_route_circuit_peering_config_update.legacy_mode @@ -151,6 +193,11 @@ def _build_args_express_route_circuit_peering_config_update(cls, _schema): help="The communities of bgp peering. Specified for microsoft peering.", nullable=True, ) + express_route_circuit_peering_config_update.advertised_public_prefix_info = AAZListArg( + options=["advertised-public-prefix-info"], + help="List of Prefix information required to perform validation.", + nullable=True, + ) express_route_circuit_peering_config_update.advertised_public_prefixes = AAZListArg( options=["advertised-public-prefixes"], help="The reference to AdvertisedPublicPrefixes.", @@ -177,38 +224,40 @@ def _build_args_express_route_circuit_peering_config_update(cls, _schema): nullable=True, ) + advertised_public_prefix_info = cls._args_express_route_circuit_peering_config_update.advertised_public_prefix_info + advertised_public_prefix_info.Element = AAZObjectArg( + nullable=True, + ) + + _element = cls._args_express_route_circuit_peering_config_update.advertised_public_prefix_info.Element + _element.prefix = AAZStrArg( + options=["prefix"], + help="Advertised Public Prefix.", + nullable=True, + ) + _element.signature = AAZStrArg( + options=["signature"], + help="Signed string generated by encrypting validationId with a private key.", + nullable=True, + ) + _element.validation_id = AAZStrArg( + options=["validation-id"], + help="Validation string that contains circuit peering info.", + nullable=True, + ) + advertised_public_prefixes = cls._args_express_route_circuit_peering_config_update.advertised_public_prefixes advertised_public_prefixes.Element = AAZStrArg( nullable=True, ) _schema.advertised_communities = cls._args_express_route_circuit_peering_config_update.advertised_communities + _schema.advertised_public_prefix_info = cls._args_express_route_circuit_peering_config_update.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._args_express_route_circuit_peering_config_update.advertised_public_prefixes _schema.customer_asn = cls._args_express_route_circuit_peering_config_update.customer_asn _schema.legacy_mode = cls._args_express_route_circuit_peering_config_update.legacy_mode _schema.routing_registry_name = cls._args_express_route_circuit_peering_config_update.routing_registry_name - _args_sub_resource_update = None - - @classmethod - def _build_args_sub_resource_update(cls, _schema): - if cls._args_sub_resource_update is not None: - _schema.id = cls._args_sub_resource_update.id - return - - cls._args_sub_resource_update = AAZObjectArg( - nullable=True, - ) - - sub_resource_update = cls._args_sub_resource_update - sub_resource_update.id = AAZStrArg( - options=["id"], - help="Resource ID.", - nullable=True, - ) - - _schema.id = cls._args_sub_resource_update.id - def _execute_operations(self): self.pre_operations() self.ExpressRouteCircuitsGet(ctx=self.ctx)() @@ -287,7 +336,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } @@ -318,7 +367,345 @@ def _build_schema_on_200(cls): return cls._schema_on_200 cls._schema_on_200 = AAZObjectType() - _UpdateHelper._build_schema_express_route_circuit_read(cls._schema_on_200) + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.id = AAZStrType() + _schema_on_200.location = AAZStrType() + _schema_on_200.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.sku = AAZObjectType() + _schema_on_200.tags = AAZDictType() + _schema_on_200.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties + properties.activation_key = AAZStrType( + serialized_name="activationKey", + ) + properties.allow_classic_operations = AAZBoolType( + serialized_name="allowClassicOperations", + ) + properties.authorization_key = AAZStrType( + serialized_name="authorizationKey", + ) + properties.authorization_status = AAZStrType( + serialized_name="authorizationStatus", + flags={"read_only": True}, + ) + properties.authorizations = AAZListType() + properties.bandwidth_in_gbps = AAZFloatType( + serialized_name="bandwidthInGbps", + ) + properties.circuit_provisioning_state = AAZStrType( + serialized_name="circuitProvisioningState", + ) + properties.enable_direct_port_rate_limit = AAZBoolType( + serialized_name="enableDirectPortRateLimit", + ) + properties.express_route_port = AAZObjectType( + serialized_name="expressRoutePort", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.express_route_port) + properties.gateway_manager_etag = AAZStrType( + serialized_name="gatewayManagerEtag", + ) + properties.global_reach_enabled = AAZBoolType( + serialized_name="globalReachEnabled", + ) + properties.partner_account_id = AAZStrType( + serialized_name="partnerAccountId", + ) + properties.peerings = AAZListType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resiliency_level = AAZStrType( + serialized_name="resiliencyLevel", + flags={"read_only": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + ) + properties.service_provider_notes = AAZStrType( + serialized_name="serviceProviderNotes", + ) + properties.service_provider_properties = AAZObjectType( + serialized_name="serviceProviderProperties", + ) + properties.service_provider_provisioning_state = AAZStrType( + serialized_name="serviceProviderProvisioningState", + ) + properties.stag = AAZIntType( + flags={"read_only": True}, + ) + + authorizations = cls._schema_on_200.properties.authorizations + authorizations.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.authorizations.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties.authorizations.Element.properties + properties.authorization_key = AAZStrType( + serialized_name="authorizationKey", + ) + properties.authorization_use_status = AAZStrType( + serialized_name="authorizationUseStatus", + ) + properties.connection_resource_uri = AAZStrType( + serialized_name="connectionResourceUri", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + peerings = cls._schema_on_200.properties.peerings + peerings.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.peerings.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties.peerings.Element.properties + properties.azure_asn = AAZIntType( + serialized_name="azureASN", + ) + properties.connections = AAZListType() + properties.express_route_connection = AAZObjectType( + serialized_name="expressRouteConnection", + ) + properties.gateway_manager_etag = AAZStrType( + serialized_name="gatewayManagerEtag", + ) + properties.ipv6_peering_config = AAZObjectType( + serialized_name="ipv6PeeringConfig", + ) + properties.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + flags={"read_only": True}, + ) + properties.microsoft_peering_config = AAZObjectType( + serialized_name="microsoftPeeringConfig", + ) + _UpdateHelper._build_schema_express_route_circuit_peering_config_read(properties.microsoft_peering_config) + properties.peer_asn = AAZIntType( + serialized_name="peerASN", + ) + properties.peered_connections = AAZListType( + serialized_name="peeredConnections", + flags={"read_only": True}, + ) + properties.peering_type = AAZStrType( + serialized_name="peeringType", + ) + properties.primary_azure_port = AAZStrType( + serialized_name="primaryAzurePort", + ) + properties.primary_peer_address_prefix = AAZStrType( + serialized_name="primaryPeerAddressPrefix", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.route_filter = AAZObjectType( + serialized_name="routeFilter", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.route_filter) + properties.secondary_azure_port = AAZStrType( + serialized_name="secondaryAzurePort", + ) + properties.secondary_peer_address_prefix = AAZStrType( + serialized_name="secondaryPeerAddressPrefix", + ) + properties.shared_key = AAZStrType( + serialized_name="sharedKey", + ) + properties.state = AAZStrType() + properties.stats = AAZObjectType() + properties.vlan_id = AAZIntType( + serialized_name="vlanId", + ) + + connections = cls._schema_on_200.properties.peerings.Element.properties.connections + connections.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.peerings.Element.properties.connections.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties.peerings.Element.properties.connections.Element.properties + properties.address_prefix = AAZStrType( + serialized_name="addressPrefix", + ) + properties.authorization_key = AAZStrType( + serialized_name="authorizationKey", + ) + properties.circuit_connection_status = AAZStrType( + serialized_name="circuitConnectionStatus", + flags={"read_only": True}, + ) + properties.express_route_circuit_peering = AAZObjectType( + serialized_name="expressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) + properties.ipv6_circuit_connection_config = AAZObjectType( + serialized_name="ipv6CircuitConnectionConfig", + ) + properties.peer_express_route_circuit_peering = AAZObjectType( + serialized_name="peerExpressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + ipv6_circuit_connection_config = cls._schema_on_200.properties.peerings.Element.properties.connections.Element.properties.ipv6_circuit_connection_config + ipv6_circuit_connection_config.address_prefix = AAZStrType( + serialized_name="addressPrefix", + ) + ipv6_circuit_connection_config.circuit_connection_status = AAZStrType( + serialized_name="circuitConnectionStatus", + flags={"read_only": True}, + ) + + express_route_connection = cls._schema_on_200.properties.peerings.Element.properties.express_route_connection + express_route_connection.id = AAZStrType( + flags={"read_only": True}, + ) + + ipv6_peering_config = cls._schema_on_200.properties.peerings.Element.properties.ipv6_peering_config + ipv6_peering_config.microsoft_peering_config = AAZObjectType( + serialized_name="microsoftPeeringConfig", + ) + _UpdateHelper._build_schema_express_route_circuit_peering_config_read(ipv6_peering_config.microsoft_peering_config) + ipv6_peering_config.primary_peer_address_prefix = AAZStrType( + serialized_name="primaryPeerAddressPrefix", + ) + ipv6_peering_config.route_filter = AAZObjectType( + serialized_name="routeFilter", + ) + _UpdateHelper._build_schema_common_sub_resource_read(ipv6_peering_config.route_filter) + ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( + serialized_name="secondaryPeerAddressPrefix", + ) + ipv6_peering_config.state = AAZStrType() + + peered_connections = cls._schema_on_200.properties.peerings.Element.properties.peered_connections + peered_connections.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.peerings.Element.properties.peered_connections.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200.properties.peerings.Element.properties.peered_connections.Element.properties + properties.address_prefix = AAZStrType( + serialized_name="addressPrefix", + ) + properties.auth_resource_guid = AAZStrType( + serialized_name="authResourceGuid", + ) + properties.circuit_connection_status = AAZStrType( + serialized_name="circuitConnectionStatus", + flags={"read_only": True}, + ) + properties.connection_name = AAZStrType( + serialized_name="connectionName", + ) + properties.express_route_circuit_peering = AAZObjectType( + serialized_name="expressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) + properties.peer_express_route_circuit_peering = AAZObjectType( + serialized_name="peerExpressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + stats = cls._schema_on_200.properties.peerings.Element.properties.stats + stats.primarybytes_in = AAZIntType( + serialized_name="primarybytesIn", + ) + stats.primarybytes_out = AAZIntType( + serialized_name="primarybytesOut", + ) + stats.secondarybytes_in = AAZIntType( + serialized_name="secondarybytesIn", + ) + stats.secondarybytes_out = AAZIntType( + serialized_name="secondarybytesOut", + ) + + service_provider_properties = cls._schema_on_200.properties.service_provider_properties + service_provider_properties.bandwidth_in_mbps = AAZIntType( + serialized_name="bandwidthInMbps", + ) + service_provider_properties.peering_location = AAZStrType( + serialized_name="peeringLocation", + ) + service_provider_properties.service_provider_name = AAZStrType( + serialized_name="serviceProviderName", + ) + + sku = cls._schema_on_200.sku + sku.family = AAZStrType() + sku.name = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200.tags + tags.Element = AAZStrType() return cls._schema_on_200 @@ -386,7 +773,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } @@ -429,7 +816,345 @@ def _build_schema_on_200_201(cls): return cls._schema_on_200_201 cls._schema_on_200_201 = AAZObjectType() - _UpdateHelper._build_schema_express_route_circuit_read(cls._schema_on_200_201) + + _schema_on_200_201 = cls._schema_on_200_201 + _schema_on_200_201.etag = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.id = AAZStrType() + _schema_on_200_201.location = AAZStrType() + _schema_on_200_201.name = AAZStrType( + flags={"read_only": True}, + ) + _schema_on_200_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200_201.sku = AAZObjectType() + _schema_on_200_201.tags = AAZDictType() + _schema_on_200_201.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties + properties.activation_key = AAZStrType( + serialized_name="activationKey", + ) + properties.allow_classic_operations = AAZBoolType( + serialized_name="allowClassicOperations", + ) + properties.authorization_key = AAZStrType( + serialized_name="authorizationKey", + ) + properties.authorization_status = AAZStrType( + serialized_name="authorizationStatus", + flags={"read_only": True}, + ) + properties.authorizations = AAZListType() + properties.bandwidth_in_gbps = AAZFloatType( + serialized_name="bandwidthInGbps", + ) + properties.circuit_provisioning_state = AAZStrType( + serialized_name="circuitProvisioningState", + ) + properties.enable_direct_port_rate_limit = AAZBoolType( + serialized_name="enableDirectPortRateLimit", + ) + properties.express_route_port = AAZObjectType( + serialized_name="expressRoutePort", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.express_route_port) + properties.gateway_manager_etag = AAZStrType( + serialized_name="gatewayManagerEtag", + ) + properties.global_reach_enabled = AAZBoolType( + serialized_name="globalReachEnabled", + ) + properties.partner_account_id = AAZStrType( + serialized_name="partnerAccountId", + ) + properties.peerings = AAZListType() + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.resiliency_level = AAZStrType( + serialized_name="resiliencyLevel", + flags={"read_only": True}, + ) + properties.service_key = AAZStrType( + serialized_name="serviceKey", + ) + properties.service_provider_notes = AAZStrType( + serialized_name="serviceProviderNotes", + ) + properties.service_provider_properties = AAZObjectType( + serialized_name="serviceProviderProperties", + ) + properties.service_provider_provisioning_state = AAZStrType( + serialized_name="serviceProviderProvisioningState", + ) + properties.stag = AAZIntType( + flags={"read_only": True}, + ) + + authorizations = cls._schema_on_200_201.properties.authorizations + authorizations.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.authorizations.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties.authorizations.Element.properties + properties.authorization_key = AAZStrType( + serialized_name="authorizationKey", + ) + properties.authorization_use_status = AAZStrType( + serialized_name="authorizationUseStatus", + ) + properties.connection_resource_uri = AAZStrType( + serialized_name="connectionResourceUri", + flags={"read_only": True}, + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + peerings = cls._schema_on_200_201.properties.peerings + peerings.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.peerings.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties.peerings.Element.properties + properties.azure_asn = AAZIntType( + serialized_name="azureASN", + ) + properties.connections = AAZListType() + properties.express_route_connection = AAZObjectType( + serialized_name="expressRouteConnection", + ) + properties.gateway_manager_etag = AAZStrType( + serialized_name="gatewayManagerEtag", + ) + properties.ipv6_peering_config = AAZObjectType( + serialized_name="ipv6PeeringConfig", + ) + properties.last_modified_by = AAZStrType( + serialized_name="lastModifiedBy", + flags={"read_only": True}, + ) + properties.microsoft_peering_config = AAZObjectType( + serialized_name="microsoftPeeringConfig", + ) + _UpdateHelper._build_schema_express_route_circuit_peering_config_read(properties.microsoft_peering_config) + properties.peer_asn = AAZIntType( + serialized_name="peerASN", + ) + properties.peered_connections = AAZListType( + serialized_name="peeredConnections", + flags={"read_only": True}, + ) + properties.peering_type = AAZStrType( + serialized_name="peeringType", + ) + properties.primary_azure_port = AAZStrType( + serialized_name="primaryAzurePort", + ) + properties.primary_peer_address_prefix = AAZStrType( + serialized_name="primaryPeerAddressPrefix", + ) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + properties.route_filter = AAZObjectType( + serialized_name="routeFilter", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.route_filter) + properties.secondary_azure_port = AAZStrType( + serialized_name="secondaryAzurePort", + ) + properties.secondary_peer_address_prefix = AAZStrType( + serialized_name="secondaryPeerAddressPrefix", + ) + properties.shared_key = AAZStrType( + serialized_name="sharedKey", + ) + properties.state = AAZStrType() + properties.stats = AAZObjectType() + properties.vlan_id = AAZIntType( + serialized_name="vlanId", + ) + + connections = cls._schema_on_200_201.properties.peerings.Element.properties.connections + connections.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.peerings.Element.properties.connections.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties.peerings.Element.properties.connections.Element.properties + properties.address_prefix = AAZStrType( + serialized_name="addressPrefix", + ) + properties.authorization_key = AAZStrType( + serialized_name="authorizationKey", + ) + properties.circuit_connection_status = AAZStrType( + serialized_name="circuitConnectionStatus", + flags={"read_only": True}, + ) + properties.express_route_circuit_peering = AAZObjectType( + serialized_name="expressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) + properties.ipv6_circuit_connection_config = AAZObjectType( + serialized_name="ipv6CircuitConnectionConfig", + ) + properties.peer_express_route_circuit_peering = AAZObjectType( + serialized_name="peerExpressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + ipv6_circuit_connection_config = cls._schema_on_200_201.properties.peerings.Element.properties.connections.Element.properties.ipv6_circuit_connection_config + ipv6_circuit_connection_config.address_prefix = AAZStrType( + serialized_name="addressPrefix", + ) + ipv6_circuit_connection_config.circuit_connection_status = AAZStrType( + serialized_name="circuitConnectionStatus", + flags={"read_only": True}, + ) + + express_route_connection = cls._schema_on_200_201.properties.peerings.Element.properties.express_route_connection + express_route_connection.id = AAZStrType( + flags={"read_only": True}, + ) + + ipv6_peering_config = cls._schema_on_200_201.properties.peerings.Element.properties.ipv6_peering_config + ipv6_peering_config.microsoft_peering_config = AAZObjectType( + serialized_name="microsoftPeeringConfig", + ) + _UpdateHelper._build_schema_express_route_circuit_peering_config_read(ipv6_peering_config.microsoft_peering_config) + ipv6_peering_config.primary_peer_address_prefix = AAZStrType( + serialized_name="primaryPeerAddressPrefix", + ) + ipv6_peering_config.route_filter = AAZObjectType( + serialized_name="routeFilter", + ) + _UpdateHelper._build_schema_common_sub_resource_read(ipv6_peering_config.route_filter) + ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( + serialized_name="secondaryPeerAddressPrefix", + ) + ipv6_peering_config.state = AAZStrType() + + peered_connections = cls._schema_on_200_201.properties.peerings.Element.properties.peered_connections + peered_connections.Element = AAZObjectType() + + _element = cls._schema_on_200_201.properties.peerings.Element.properties.peered_connections.Element + _element.etag = AAZStrType( + flags={"read_only": True}, + ) + _element.id = AAZStrType() + _element.name = AAZStrType() + _element.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _element.type = AAZStrType( + flags={"read_only": True}, + ) + + properties = cls._schema_on_200_201.properties.peerings.Element.properties.peered_connections.Element.properties + properties.address_prefix = AAZStrType( + serialized_name="addressPrefix", + ) + properties.auth_resource_guid = AAZStrType( + serialized_name="authResourceGuid", + ) + properties.circuit_connection_status = AAZStrType( + serialized_name="circuitConnectionStatus", + flags={"read_only": True}, + ) + properties.connection_name = AAZStrType( + serialized_name="connectionName", + ) + properties.express_route_circuit_peering = AAZObjectType( + serialized_name="expressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) + properties.peer_express_route_circuit_peering = AAZObjectType( + serialized_name="peerExpressRouteCircuitPeering", + ) + _UpdateHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) + properties.provisioning_state = AAZStrType( + serialized_name="provisioningState", + flags={"read_only": True}, + ) + + stats = cls._schema_on_200_201.properties.peerings.Element.properties.stats + stats.primarybytes_in = AAZIntType( + serialized_name="primarybytesIn", + ) + stats.primarybytes_out = AAZIntType( + serialized_name="primarybytesOut", + ) + stats.secondarybytes_in = AAZIntType( + serialized_name="secondarybytesIn", + ) + stats.secondarybytes_out = AAZIntType( + serialized_name="secondarybytesOut", + ) + + service_provider_properties = cls._schema_on_200_201.properties.service_provider_properties + service_provider_properties.bandwidth_in_mbps = AAZIntType( + serialized_name="bandwidthInMbps", + ) + service_provider_properties.peering_location = AAZStrType( + serialized_name="peeringLocation", + ) + service_provider_properties.service_provider_name = AAZStrType( + serialized_name="serviceProviderName", + ) + + sku = cls._schema_on_200_201.sku + sku.family = AAZStrType() + sku.name = AAZStrType() + sku.tier = AAZStrType() + + tags = cls._schema_on_200_201.tags + tags.Element = AAZStrType() return cls._schema_on_200_201 @@ -450,10 +1175,13 @@ def _update_instance(self, instance): properties = _builder.get(".properties") if properties is not None: + properties.set_prop("activationKey", AAZStrType, ".activation_key") properties.set_prop("allowClassicOperations", AAZBoolType, ".allow_classic_operations") properties.set_prop("bandwidthInGbps", AAZFloatType, ".bandwidth_in_gbps") + properties.set_prop("enableDirectPortRateLimit", AAZBoolType, ".enable_direct_port_rate_limit") properties.set_prop("expressRoutePort", AAZObjectType) properties.set_prop("globalReachEnabled", AAZBoolType, ".allow_global_reach") + properties.set_prop("partnerAccountId", AAZStrType, ".partner_account_id") properties.set_prop("serviceProviderProperties", AAZObjectType) express_route_port = _builder.get(".properties.expressRoutePort") @@ -490,11 +1218,18 @@ def __call__(self, *args, **kwargs): class _UpdateHelper: """Helper class for Update""" + @classmethod + def _build_schema_common_sub_resource_update(cls, _builder): + if _builder is None: + return + _builder.set_prop("id", AAZStrType, ".id") + @classmethod def _build_schema_express_route_circuit_peering_config_update(cls, _builder): if _builder is None: return _builder.set_prop("advertisedCommunities", AAZListType, ".advertised_communities") + _builder.set_prop("advertisedPublicPrefixInfo", AAZListType, ".advertised_public_prefix_info") _builder.set_prop("advertisedPublicPrefixes", AAZListType, ".advertised_public_prefixes") _builder.set_prop("customerASN", AAZIntType, ".customer_asn") _builder.set_prop("legacyMode", AAZIntType, ".legacy_mode") @@ -504,15 +1239,34 @@ def _build_schema_express_route_circuit_peering_config_update(cls, _builder): if advertised_communities is not None: advertised_communities.set_elements(AAZStrType, ".") + advertised_public_prefix_info = _builder.get(".advertisedPublicPrefixInfo") + if advertised_public_prefix_info is not None: + advertised_public_prefix_info.set_elements(AAZObjectType, ".") + + _elements = _builder.get(".advertisedPublicPrefixInfo[]") + if _elements is not None: + _elements.set_prop("prefix", AAZStrType, ".prefix") + _elements.set_prop("signature", AAZStrType, ".signature") + _elements.set_prop("validationId", AAZStrType, ".validation_id") + advertised_public_prefixes = _builder.get(".advertisedPublicPrefixes") if advertised_public_prefixes is not None: advertised_public_prefixes.set_elements(AAZStrType, ".") + _schema_common_sub_resource_read = None + @classmethod - def _build_schema_sub_resource_update(cls, _builder): - if _builder is None: + def _build_schema_common_sub_resource_read(cls, _schema): + if cls._schema_common_sub_resource_read is not None: + _schema.id = cls._schema_common_sub_resource_read.id return - _builder.set_prop("id", AAZStrType, ".id") + + cls._schema_common_sub_resource_read = _schema_common_sub_resource_read = AAZObjectType() + + common_sub_resource_read = _schema_common_sub_resource_read + common_sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_common_sub_resource_read.id _schema_express_route_circuit_peering_config_read = None @@ -520,6 +1274,7 @@ def _build_schema_sub_resource_update(cls, _builder): def _build_schema_express_route_circuit_peering_config_read(cls, _schema): if cls._schema_express_route_circuit_peering_config_read is not None: _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn @@ -533,6 +1288,9 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): express_route_circuit_peering_config_read.advertised_communities = AAZListType( serialized_name="advertisedCommunities", ) + express_route_circuit_peering_config_read.advertised_public_prefix_info = AAZListType( + serialized_name="advertisedPublicPrefixInfo", + ) express_route_circuit_peering_config_read.advertised_public_prefixes = AAZListType( serialized_name="advertisedPublicPrefixes", ) @@ -553,374 +1311,30 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): advertised_communities = _schema_express_route_circuit_peering_config_read.advertised_communities advertised_communities.Element = AAZStrType() + advertised_public_prefix_info = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info + advertised_public_prefix_info.Element = AAZObjectType() + + _element = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info.Element + _element.prefix = AAZStrType() + _element.signature = AAZStrType() + _element.validation_id = AAZStrType( + serialized_name="validationId", + ) + _element.validation_state = AAZStrType( + serialized_name="validationState", + flags={"read_only": True}, + ) + advertised_public_prefixes = _schema_express_route_circuit_peering_config_read.advertised_public_prefixes advertised_public_prefixes.Element = AAZStrType() _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn _schema.legacy_mode = cls._schema_express_route_circuit_peering_config_read.legacy_mode _schema.routing_registry_name = cls._schema_express_route_circuit_peering_config_read.routing_registry_name - _schema_express_route_circuit_read = None - - @classmethod - def _build_schema_express_route_circuit_read(cls, _schema): - if cls._schema_express_route_circuit_read is not None: - _schema.etag = cls._schema_express_route_circuit_read.etag - _schema.id = cls._schema_express_route_circuit_read.id - _schema.location = cls._schema_express_route_circuit_read.location - _schema.name = cls._schema_express_route_circuit_read.name - _schema.properties = cls._schema_express_route_circuit_read.properties - _schema.sku = cls._schema_express_route_circuit_read.sku - _schema.tags = cls._schema_express_route_circuit_read.tags - _schema.type = cls._schema_express_route_circuit_read.type - return - - cls._schema_express_route_circuit_read = _schema_express_route_circuit_read = AAZObjectType() - - express_route_circuit_read = _schema_express_route_circuit_read - express_route_circuit_read.etag = AAZStrType( - flags={"read_only": True}, - ) - express_route_circuit_read.id = AAZStrType() - express_route_circuit_read.location = AAZStrType() - express_route_circuit_read.name = AAZStrType( - flags={"read_only": True}, - ) - express_route_circuit_read.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - express_route_circuit_read.sku = AAZObjectType() - express_route_circuit_read.tags = AAZDictType() - express_route_circuit_read.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_express_route_circuit_read.properties - properties.allow_classic_operations = AAZBoolType( - serialized_name="allowClassicOperations", - ) - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.authorizations = AAZListType() - properties.bandwidth_in_gbps = AAZFloatType( - serialized_name="bandwidthInGbps", - ) - properties.circuit_provisioning_state = AAZStrType( - serialized_name="circuitProvisioningState", - ) - properties.express_route_port = AAZObjectType( - serialized_name="expressRoutePort", - ) - cls._build_schema_sub_resource_read(properties.express_route_port) - properties.gateway_manager_etag = AAZStrType( - serialized_name="gatewayManagerEtag", - ) - properties.global_reach_enabled = AAZBoolType( - serialized_name="globalReachEnabled", - ) - properties.peerings = AAZListType() - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.service_key = AAZStrType( - serialized_name="serviceKey", - ) - properties.service_provider_notes = AAZStrType( - serialized_name="serviceProviderNotes", - ) - properties.service_provider_properties = AAZObjectType( - serialized_name="serviceProviderProperties", - ) - properties.service_provider_provisioning_state = AAZStrType( - serialized_name="serviceProviderProvisioningState", - ) - properties.stag = AAZIntType( - flags={"read_only": True}, - ) - - authorizations = _schema_express_route_circuit_read.properties.authorizations - authorizations.Element = AAZObjectType() - - _element = _schema_express_route_circuit_read.properties.authorizations.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_express_route_circuit_read.properties.authorizations.Element.properties - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.authorization_use_status = AAZStrType( - serialized_name="authorizationUseStatus", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - peerings = _schema_express_route_circuit_read.properties.peerings - peerings.Element = AAZObjectType() - - _element = _schema_express_route_circuit_read.properties.peerings.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_express_route_circuit_read.properties.peerings.Element.properties - properties.azure_asn = AAZIntType( - serialized_name="azureASN", - ) - properties.connections = AAZListType() - properties.express_route_connection = AAZObjectType( - serialized_name="expressRouteConnection", - ) - properties.gateway_manager_etag = AAZStrType( - serialized_name="gatewayManagerEtag", - ) - properties.ipv6_peering_config = AAZObjectType( - serialized_name="ipv6PeeringConfig", - ) - properties.last_modified_by = AAZStrType( - serialized_name="lastModifiedBy", - flags={"read_only": True}, - ) - properties.microsoft_peering_config = AAZObjectType( - serialized_name="microsoftPeeringConfig", - ) - cls._build_schema_express_route_circuit_peering_config_read(properties.microsoft_peering_config) - properties.peer_asn = AAZIntType( - serialized_name="peerASN", - ) - properties.peered_connections = AAZListType( - serialized_name="peeredConnections", - flags={"read_only": True}, - ) - properties.peering_type = AAZStrType( - serialized_name="peeringType", - ) - properties.primary_azure_port = AAZStrType( - serialized_name="primaryAzurePort", - ) - properties.primary_peer_address_prefix = AAZStrType( - serialized_name="primaryPeerAddressPrefix", - ) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - properties.route_filter = AAZObjectType( - serialized_name="routeFilter", - ) - cls._build_schema_sub_resource_read(properties.route_filter) - properties.secondary_azure_port = AAZStrType( - serialized_name="secondaryAzurePort", - ) - properties.secondary_peer_address_prefix = AAZStrType( - serialized_name="secondaryPeerAddressPrefix", - ) - properties.shared_key = AAZStrType( - serialized_name="sharedKey", - ) - properties.state = AAZStrType() - properties.stats = AAZObjectType() - properties.vlan_id = AAZIntType( - serialized_name="vlanId", - ) - - connections = _schema_express_route_circuit_read.properties.peerings.Element.properties.connections - connections.Element = AAZObjectType() - - _element = _schema_express_route_circuit_read.properties.peerings.Element.properties.connections.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_express_route_circuit_read.properties.peerings.Element.properties.connections.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.authorization_key = AAZStrType( - serialized_name="authorizationKey", - ) - properties.circuit_connection_status = AAZStrType( - serialized_name="circuitConnectionStatus", - flags={"read_only": True}, - ) - properties.express_route_circuit_peering = AAZObjectType( - serialized_name="expressRouteCircuitPeering", - ) - cls._build_schema_sub_resource_read(properties.express_route_circuit_peering) - properties.ipv6_circuit_connection_config = AAZObjectType( - serialized_name="ipv6CircuitConnectionConfig", - ) - properties.peer_express_route_circuit_peering = AAZObjectType( - serialized_name="peerExpressRouteCircuitPeering", - ) - cls._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - ipv6_circuit_connection_config = _schema_express_route_circuit_read.properties.peerings.Element.properties.connections.Element.properties.ipv6_circuit_connection_config - ipv6_circuit_connection_config.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - ipv6_circuit_connection_config.circuit_connection_status = AAZStrType( - serialized_name="circuitConnectionStatus", - flags={"read_only": True}, - ) - - express_route_connection = _schema_express_route_circuit_read.properties.peerings.Element.properties.express_route_connection - express_route_connection.id = AAZStrType( - flags={"read_only": True}, - ) - - ipv6_peering_config = _schema_express_route_circuit_read.properties.peerings.Element.properties.ipv6_peering_config - ipv6_peering_config.microsoft_peering_config = AAZObjectType( - serialized_name="microsoftPeeringConfig", - ) - cls._build_schema_express_route_circuit_peering_config_read(ipv6_peering_config.microsoft_peering_config) - ipv6_peering_config.primary_peer_address_prefix = AAZStrType( - serialized_name="primaryPeerAddressPrefix", - ) - ipv6_peering_config.route_filter = AAZObjectType( - serialized_name="routeFilter", - ) - cls._build_schema_sub_resource_read(ipv6_peering_config.route_filter) - ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( - serialized_name="secondaryPeerAddressPrefix", - ) - ipv6_peering_config.state = AAZStrType() - - peered_connections = _schema_express_route_circuit_read.properties.peerings.Element.properties.peered_connections - peered_connections.Element = AAZObjectType() - - _element = _schema_express_route_circuit_read.properties.peerings.Element.properties.peered_connections.Element - _element.etag = AAZStrType( - flags={"read_only": True}, - ) - _element.id = AAZStrType() - _element.name = AAZStrType() - _element.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _element.type = AAZStrType( - flags={"read_only": True}, - ) - - properties = _schema_express_route_circuit_read.properties.peerings.Element.properties.peered_connections.Element.properties - properties.address_prefix = AAZStrType( - serialized_name="addressPrefix", - ) - properties.auth_resource_guid = AAZStrType( - serialized_name="authResourceGuid", - ) - properties.circuit_connection_status = AAZStrType( - serialized_name="circuitConnectionStatus", - flags={"read_only": True}, - ) - properties.connection_name = AAZStrType( - serialized_name="connectionName", - ) - properties.express_route_circuit_peering = AAZObjectType( - serialized_name="expressRouteCircuitPeering", - ) - cls._build_schema_sub_resource_read(properties.express_route_circuit_peering) - properties.peer_express_route_circuit_peering = AAZObjectType( - serialized_name="peerExpressRouteCircuitPeering", - ) - cls._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) - properties.provisioning_state = AAZStrType( - serialized_name="provisioningState", - flags={"read_only": True}, - ) - - stats = _schema_express_route_circuit_read.properties.peerings.Element.properties.stats - stats.primarybytes_in = AAZIntType( - serialized_name="primarybytesIn", - ) - stats.primarybytes_out = AAZIntType( - serialized_name="primarybytesOut", - ) - stats.secondarybytes_in = AAZIntType( - serialized_name="secondarybytesIn", - ) - stats.secondarybytes_out = AAZIntType( - serialized_name="secondarybytesOut", - ) - - service_provider_properties = _schema_express_route_circuit_read.properties.service_provider_properties - service_provider_properties.bandwidth_in_mbps = AAZIntType( - serialized_name="bandwidthInMbps", - ) - service_provider_properties.peering_location = AAZStrType( - serialized_name="peeringLocation", - ) - service_provider_properties.service_provider_name = AAZStrType( - serialized_name="serviceProviderName", - ) - - sku = _schema_express_route_circuit_read.sku - sku.family = AAZStrType() - sku.name = AAZStrType() - sku.tier = AAZStrType() - - tags = _schema_express_route_circuit_read.tags - tags.Element = AAZStrType() - - _schema.etag = cls._schema_express_route_circuit_read.etag - _schema.id = cls._schema_express_route_circuit_read.id - _schema.location = cls._schema_express_route_circuit_read.location - _schema.name = cls._schema_express_route_circuit_read.name - _schema.properties = cls._schema_express_route_circuit_read.properties - _schema.sku = cls._schema_express_route_circuit_read.sku - _schema.tags = cls._schema_express_route_circuit_read.tags - _schema.type = cls._schema_express_route_circuit_read.type - - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - __all__ = ["Update"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_wait.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_wait.py index 456429a0c56..730ba8bd746 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_wait.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/express_route/_wait.py @@ -20,7 +20,7 @@ class Wait(AAZWaitCommand): _aaz_info = { "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2022-01-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/expressroutecircuits/{}", "2025-09-01"], ] } @@ -116,7 +116,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-01-01", + "api-version", "2025-09-01", required=True, ), } @@ -167,12 +167,19 @@ def _build_schema_on_200(cls): ) properties = cls._schema_on_200.properties + properties.activation_key = AAZStrType( + serialized_name="activationKey", + ) properties.allow_classic_operations = AAZBoolType( serialized_name="allowClassicOperations", ) properties.authorization_key = AAZStrType( serialized_name="authorizationKey", ) + properties.authorization_status = AAZStrType( + serialized_name="authorizationStatus", + flags={"read_only": True}, + ) properties.authorizations = AAZListType() properties.bandwidth_in_gbps = AAZFloatType( serialized_name="bandwidthInGbps", @@ -180,21 +187,31 @@ def _build_schema_on_200(cls): properties.circuit_provisioning_state = AAZStrType( serialized_name="circuitProvisioningState", ) + properties.enable_direct_port_rate_limit = AAZBoolType( + serialized_name="enableDirectPortRateLimit", + ) properties.express_route_port = AAZObjectType( serialized_name="expressRoutePort", ) - _WaitHelper._build_schema_sub_resource_read(properties.express_route_port) + _WaitHelper._build_schema_common_sub_resource_read(properties.express_route_port) properties.gateway_manager_etag = AAZStrType( serialized_name="gatewayManagerEtag", ) properties.global_reach_enabled = AAZBoolType( serialized_name="globalReachEnabled", ) + properties.partner_account_id = AAZStrType( + serialized_name="partnerAccountId", + ) properties.peerings = AAZListType() properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, ) + properties.resiliency_level = AAZStrType( + serialized_name="resiliencyLevel", + flags={"read_only": True}, + ) properties.service_key = AAZStrType( serialized_name="serviceKey", ) @@ -234,6 +251,10 @@ def _build_schema_on_200(cls): properties.authorization_use_status = AAZStrType( serialized_name="authorizationUseStatus", ) + properties.connection_resource_uri = AAZStrType( + serialized_name="connectionResourceUri", + flags={"read_only": True}, + ) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -300,7 +321,7 @@ def _build_schema_on_200(cls): properties.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _WaitHelper._build_schema_sub_resource_read(properties.route_filter) + _WaitHelper._build_schema_common_sub_resource_read(properties.route_filter) properties.secondary_azure_port = AAZStrType( serialized_name="secondaryAzurePort", ) @@ -346,14 +367,14 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _WaitHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _WaitHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.ipv6_circuit_connection_config = AAZObjectType( serialized_name="ipv6CircuitConnectionConfig", ) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _WaitHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _WaitHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -384,7 +405,7 @@ def _build_schema_on_200(cls): ipv6_peering_config.route_filter = AAZObjectType( serialized_name="routeFilter", ) - _WaitHelper._build_schema_sub_resource_read(ipv6_peering_config.route_filter) + _WaitHelper._build_schema_common_sub_resource_read(ipv6_peering_config.route_filter) ipv6_peering_config.secondary_peer_address_prefix = AAZStrType( serialized_name="secondaryPeerAddressPrefix", ) @@ -423,11 +444,11 @@ def _build_schema_on_200(cls): properties.express_route_circuit_peering = AAZObjectType( serialized_name="expressRouteCircuitPeering", ) - _WaitHelper._build_schema_sub_resource_read(properties.express_route_circuit_peering) + _WaitHelper._build_schema_common_sub_resource_read(properties.express_route_circuit_peering) properties.peer_express_route_circuit_peering = AAZObjectType( serialized_name="peerExpressRouteCircuitPeering", ) - _WaitHelper._build_schema_sub_resource_read(properties.peer_express_route_circuit_peering) + _WaitHelper._build_schema_common_sub_resource_read(properties.peer_express_route_circuit_peering) properties.provisioning_state = AAZStrType( serialized_name="provisioningState", flags={"read_only": True}, @@ -472,12 +493,28 @@ def _build_schema_on_200(cls): class _WaitHelper: """Helper class for Wait""" + _schema_common_sub_resource_read = None + + @classmethod + def _build_schema_common_sub_resource_read(cls, _schema): + if cls._schema_common_sub_resource_read is not None: + _schema.id = cls._schema_common_sub_resource_read.id + return + + cls._schema_common_sub_resource_read = _schema_common_sub_resource_read = AAZObjectType() + + common_sub_resource_read = _schema_common_sub_resource_read + common_sub_resource_read.id = AAZStrType() + + _schema.id = cls._schema_common_sub_resource_read.id + _schema_express_route_circuit_peering_config_read = None @classmethod def _build_schema_express_route_circuit_peering_config_read(cls, _schema): if cls._schema_express_route_circuit_peering_config_read is not None: _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn @@ -491,6 +528,9 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): express_route_circuit_peering_config_read.advertised_communities = AAZListType( serialized_name="advertisedCommunities", ) + express_route_circuit_peering_config_read.advertised_public_prefix_info = AAZListType( + serialized_name="advertisedPublicPrefixInfo", + ) express_route_circuit_peering_config_read.advertised_public_prefixes = AAZListType( serialized_name="advertisedPublicPrefixes", ) @@ -511,30 +551,30 @@ def _build_schema_express_route_circuit_peering_config_read(cls, _schema): advertised_communities = _schema_express_route_circuit_peering_config_read.advertised_communities advertised_communities.Element = AAZStrType() + advertised_public_prefix_info = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info + advertised_public_prefix_info.Element = AAZObjectType() + + _element = _schema_express_route_circuit_peering_config_read.advertised_public_prefix_info.Element + _element.prefix = AAZStrType() + _element.signature = AAZStrType() + _element.validation_id = AAZStrType( + serialized_name="validationId", + ) + _element.validation_state = AAZStrType( + serialized_name="validationState", + flags={"read_only": True}, + ) + advertised_public_prefixes = _schema_express_route_circuit_peering_config_read.advertised_public_prefixes advertised_public_prefixes.Element = AAZStrType() _schema.advertised_communities = cls._schema_express_route_circuit_peering_config_read.advertised_communities + _schema.advertised_public_prefix_info = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefix_info _schema.advertised_public_prefixes = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes _schema.advertised_public_prefixes_state = cls._schema_express_route_circuit_peering_config_read.advertised_public_prefixes_state _schema.customer_asn = cls._schema_express_route_circuit_peering_config_read.customer_asn _schema.legacy_mode = cls._schema_express_route_circuit_peering_config_read.legacy_mode _schema.routing_registry_name = cls._schema_express_route_circuit_peering_config_read.routing_registry_name - _schema_sub_resource_read = None - - @classmethod - def _build_schema_sub_resource_read(cls, _schema): - if cls._schema_sub_resource_read is not None: - _schema.id = cls._schema_sub_resource_read.id - return - - cls._schema_sub_resource_read = _schema_sub_resource_read = AAZObjectType() - - sub_resource_read = _schema_sub_resource_read - sub_resource_read.id = AAZStrType() - - _schema.id = cls._schema_sub_resource_read.id - __all__ = ["Wait"] diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_express_route_gateway_connection_inbound_outbound_routemap.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_express_route_gateway_connection_inbound_outbound_routemap.yaml index 516d2fc1629..97c32fb2b22 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_express_route_gateway_connection_inbound_outbound_routemap.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_express_route_gateway_connection_inbound_outbound_routemap.yaml @@ -1493,7 +1493,7 @@ interactions: User-Agent: - AZURECLI/2.45.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_gateway_connection_inbound_outbound_routemap000001/providers/Microsoft.Network/expressRouteCircuits/er000004?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_gateway_connection_inbound_outbound_routemap000001/providers/Microsoft.Network/expressRouteCircuits/er000004?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_gateway_connection_inbound_outbound_routemap000001/providers/Microsoft.Network/expressRouteCircuits/er000004\"\ @@ -1704,7 +1704,7 @@ interactions: User-Agent: - AZURECLI/2.45.0 (AAZ) azsdk-python-core/1.24.0 Python/3.10.9 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_gateway_connection_inbound_outbound_routemap000001/providers/Microsoft.Network/expressRouteCircuits/er000004?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_gateway_connection_inbound_outbound_routemap000001/providers/Microsoft.Network/expressRouteCircuits/er000004?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er000004\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_gateway_connection_inbound_outbound_routemap000001/providers/Microsoft.Network/expressRouteCircuits/er000004\"\ diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route.yaml index 8588098bf51..b54483ca605 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route.yaml @@ -1033,7 +1033,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1247,7 +1247,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1308,7 +1308,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/expressRouteCircuits?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/expressRouteCircuits?api-version=2025-09-01 response: body: string: '{"value":[{"name":"er3","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-cli-test-rg/providers/Microsoft.Network/expressRouteCircuits/er3","etag":"W/\"c85fd8b2-2944-4a56-817d-d398da3b98ea\"","type":"Microsoft.Network/expressRouteCircuits","location":"westus","properties":{"provisioningState":"Failed","resourceGuid":"3906963b-2830-47a2-a3f0-572f3359d04b","peerings":[{"name":"MicrosoftPeering","id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-cli-test-rg/providers/Microsoft.Network/expressRouteCircuits/er3/peerings/MicrosoftPeering","etag":"W/\"c85fd8b2-2944-4a56-817d-d398da3b98ea\"","properties":{"provisioningState":"Deleting","peeringType":"MicrosoftPeering","azureASN":12076,"peerASN":4,"primaryPeerAddressPrefix":"192.168.0.0/30","secondaryPeerAddressPrefix":"192.168.1.0/30","primaryAzurePort":"A51-TEST-06GMR-CIS-1-PRI-C","secondaryAzurePort":"A51-TEST-06GMR-CIS-2-SEC-C","state":"Enabled","vlanId":100,"gatewayManagerEtag":"17","lastModifiedBy":"Customer","microsoftPeeringConfig":{"advertisedPublicPrefixes":["192.168.0.0/30","192.168.1.0/30"],"advertisedPublicPrefixesState":"ValidationNeeded","customerASN":0,"legacyMode":0,"routingRegistryName":"NONE"},"connections":[],"peeredConnections":[]},"type":"Microsoft.Network/expressRouteCircuits/peerings"}],"authorizations":[],"serviceProviderProperties":{"serviceProviderName":"Microsoft @@ -1361,7 +1361,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits?api-version=2025-09-01 response: body: string: "{\r\n \"value\": [\r\n {\r\n \"name\": \"circuit1\",\r\n \"id\": @@ -1427,7 +1427,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1541,7 +1541,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1615,7 +1615,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1734,7 +1734,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1797,7 +1797,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1871,7 +1871,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -1990,7 +1990,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -3793,7 +3793,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: '' @@ -3945,7 +3945,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route000001/providers/Microsoft.Network/expressRouteCircuits?api-version=2025-09-01 response: body: string: "{\r\n \"value\": []\r\n}" diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach.yaml index d60e4fc8d2b..cb1de5ffc34 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach.yaml @@ -65,7 +65,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er1\",\r\n @@ -379,7 +379,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er1\",\r\n @@ -665,7 +665,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er2\",\r\n @@ -779,7 +779,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach000001/providers/Microsoft.Network/expressRouteCircuits/er2\",\r\n diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach_config.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach_config.yaml index c1e6a2331bd..378f9bc9d68 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach_config.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_global_reach_config.yaml @@ -65,7 +65,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er1\",\r\n @@ -267,7 +267,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er1\",\r\n @@ -548,7 +548,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er2\",\r\n @@ -662,7 +662,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_global_reach_config000001/providers/Microsoft.Network/expressRouteCircuits/er2\",\r\n diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering.yaml index 04f7bd8a255..36dc4a56a34 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering.yaml @@ -65,7 +65,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n @@ -379,7 +379,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering000001/providers/Microsoft.Network/expressRouteCircuits/circuit1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"circuit1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering000001/providers/Microsoft.Network/expressRouteCircuits/circuit1\",\r\n diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering2.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering2.yaml index 10392327cdd..b82e1266ccf 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering2.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_ipv6_peering2.yaml @@ -65,7 +65,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering2000001/providers/Microsoft.Network/expressRouteCircuits/test_circuit?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering2000001/providers/Microsoft.Network/expressRouteCircuits/test_circuit?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"test_circuit\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering2000001/providers/Microsoft.Network/expressRouteCircuits/test_circuit\",\r\n @@ -279,7 +279,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering2000001/providers/Microsoft.Network/expressRouteCircuits/test_circuit?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering2000001/providers/Microsoft.Network/expressRouteCircuits/test_circuit?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"test_circuit\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_ipv6_peering2000001/providers/Microsoft.Network/expressRouteCircuits/test_circuit\",\r\n diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_peer_connection.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_peer_connection.yaml index c081a973573..c80bf345111 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_peer_connection.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_express_route_peer_connection.yaml @@ -65,7 +65,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er1\",\r\n @@ -279,7 +279,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er1?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er1\",\r\n @@ -565,7 +565,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er2\",\r\n @@ -679,7 +679,7 @@ interactions: - AZURECLI/2.39.0 (PIP) azsdk-python-azure-mgmt-network/21.0.1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2022-01-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er2?api-version=2025-09-01 response: body: string: "{\r\n \"name\": \"er2\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_express_route_peer_connection000001/providers/Microsoft.Network/expressRouteCircuits/er2\",\r\n diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py index 43c2d48e238..05d386e8c56 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py @@ -4038,6 +4038,50 @@ def test_network_express_route(self, resource_group): with self.assertRaisesRegex(CLIError, 'Please provide a complete resource ID'): self.cmd('network express-route gateway connection show --ids /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myrg/providers/Microsoft.Network/expressRouteGateways/aaa') + @live_only() # live_only as MultiCloud circuits need a real partner cloud account, contact service team for one + @unittest.skipUnless( + os.environ.get('AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID') and + os.environ.get('AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY'), + 'Set AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID and AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY for live tests.') + @ResourceGroupPreparer(name_prefix='cli_test_express_route_multicloud', location='eastus2') + def test_network_express_route_multicloud(self, resource_group): + workflows = [ + ('account', '--partner-account-id', 'partnerAccountId', + os.environ['AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID']), + ('activation', '--activation-key', 'activationKey', + os.environ['AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY']), + ] + for workflow, parameter, field, value in workflows: + with self.subTest(workflow=workflow): + self.kwargs.update({ + 'rg': resource_group, + 'er': 'mccircuit-' + workflow, + 'parameter': parameter, + 'provisioning_value': value, + }) + checks = [ + self.check('sku.name', 'MultiCloud_MeteredData'), + self.check('sku.tier', 'MultiCloud'), + self.check('sku.family', 'MeteredData'), + self.check(field, '{provisioning_value}'), + self.check("contains(['Standard', 'High', 'Maximum'], resiliencyLevel)", True), + ] + self.cmd('network express-route create -g {rg} -n {er} --bandwidth 200 --provider AWS --peering-location uswest2 ' + '--sku-tier MultiCloud --sku-family MeteredData {parameter} "{provisioning_value}"', + checks=checks) + self.cmd('network express-route update -g {rg} -n {er} {parameter} "{provisioning_value}" ' + '--tags purpose=multicloud-cli-test', + checks=checks + [self.check('tags.purpose', 'multicloud-cli-test')]) + self.cmd('network express-route show -g {rg} -n {er}', checks=checks) + self.cmd('network express-route list -g {rg}', checks=[ + self.check('length(@)', 1), + self.check('[0].sku.name', 'MultiCloud_MeteredData'), + self.check('[0].' + field, '{provisioning_value}'), + self.check("contains(['Standard', 'High', 'Maximum'], [0].resiliencyLevel)", True), + ]) + self.cmd('network express-route delete -g {rg} -n {er}') + self.cmd('network express-route list -g {rg}', checks=self.is_empty()) + @unittest.skip('Test is wrong, please fix. rg not found') @ResourceGroupPreparer(name_prefix='cli_test_express_route') def test_network_express_route_connection_routing_configuration(self, resource_group): diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_unit_tests.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_unit_tests.py index 71c0b80966f..5850712eebd 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_unit_tests.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_unit_tests.py @@ -5,6 +5,7 @@ import unittest +from copy import deepcopy from unittest import mock from knack.util import CLIError @@ -90,6 +91,133 @@ def test_network_upsert(self): self.assertEqual(result[1].value, 'noodle') +class TestExpressRouteMultiCloud(unittest.TestCase): + def setUp(self): + self.resource = { + 'name': 'circuit', + 'location': 'eastus2', + 'sku': {'name': 'MultiCloud_MeteredData', 'tier': 'MultiCloud', 'family': 'MeteredData'}, + 'properties': { + 'partnerAccountId': 'original-account', + 'activationKey': 'original-key', + 'resiliencyLevel': 'Maximum', + 'serviceProviderProvisioningState': 'DeProvisioned', + 'serviceProviderProperties': { + 'serviceProviderName': 'AWS', 'peeringLocation': 'uswest2', 'bandwidthInMbps': 200, + }, + }, + } + + def _command(self, command_type, **arguments): + from azure.cli.core import AzCli + from azure.cli.core.aaz._command_ctx import AAZCommandCtx + + cli = mock.MagicMock(spec=AzCli) + cli.data = {} + cli.cloud = mock.MagicMock() + command = command_type(cli_ctx=cli) + command.ctx = AAZCommandCtx(cli, command.get_arguments_schema(), { + 'name': 'circuit', 'resource_group': 'rg', + 'subscription': '00000000-0000-0000-0000-000000000000', + **arguments, + }) + command.ctx.get_http_client = mock.Mock() + command.ctx.format_args() + return command + + def test_create_multicloud_provisioning(self): + from azure.cli.command_modules.network.custom import ExpressRouteCreate + + for argument, field in [('partner_account_id', 'partnerAccountId'), ('activation_key', 'activationKey')]: + with self.subTest(argument=argument): + command = self._command( + ExpressRouteCreate, location='eastus2', bandwidth=['200'], provider='AWS', + peering_location='uswest2', sku_tier='MultiCloud', sku_family='MeteredData', + **{argument: 'test-value+/='}) + command.pre_operations() + operation = command.ExpressRouteCircuitsCreateOrUpdate(command.ctx) + self.assertEqual(operation.query_parameters['api-version'], '2025-09-01') + self.assertEqual(operation.content, { + 'location': 'eastus2', + 'sku': self.resource['sku'], + 'properties': { + field: 'test-value+/=', + 'serviceProviderProperties': self.resource['properties']['serviceProviderProperties'], + }, + }) + + def test_update_multicloud_provisioning(self): + from azure.cli.command_modules.network.custom import ExpressRouteUpdate + + cases = [ + {'partner_account_id': 'updated-account'}, + {'activation_key': 'updated-key'}, + {'partner_account_id': ''}, + {'activation_key': ''}, + {'partner_account_id': None}, + {'activation_key': None}, + {'tags': {'purpose': 'test'}}, + {'sku_tier': 'MultiCloud', 'sku_family': 'MeteredData'}, + ] + for arguments in cases: + with self.subTest(arguments=arguments): + command = self._command(ExpressRouteUpdate, **arguments) + command.pre_operations() + command.ctx.set_var( + 'instance', deepcopy(self.resource), command.ExpressRouteCircuitsGet._build_schema_on_200) + command.InstanceUpdateByJson(command.ctx)() + command.post_instance_update(command.ctx.vars.instance) + operation = command.ExpressRouteCircuitsCreateOrUpdate(command.ctx) + body = operation.content + self.assertEqual(operation.query_parameters['api-version'], '2025-09-01') + self.assertEqual(body['sku'], self.resource['sku']) + for argument, field in [('partner_account_id', 'partnerAccountId'), ('activation_key', 'activationKey')]: + if argument in arguments and arguments[argument] is None: + self.assertNotIn(field, body['properties']) + else: + self.assertEqual( + body['properties'][field], arguments.get(argument, self.resource['properties'][field])) + self.assertEqual( + body['properties']['serviceProviderProperties'], + self.resource['properties']['serviceProviderProperties']) + self.assertNotIn('resiliencyLevel', body['properties']) + if 'tags' in arguments: + self.assertEqual(body['tags'], arguments['tags']) + + def test_multicloud_output_and_read_only_resiliency(self): + from azure.cli.core.aaz import AAZCommand + from azure.cli.command_modules.network.custom import ExpressRouteCreate, ExpressRouteUpdate + from azure.cli.command_modules.network.aaz.latest.network.express_route import List, Show, Wait + + operations = [ + (ExpressRouteCreate.ExpressRouteCircuitsCreateOrUpdate._build_schema_on_200_201, False), + (ExpressRouteUpdate.ExpressRouteCircuitsGet._build_schema_on_200, False), + (ExpressRouteUpdate.ExpressRouteCircuitsCreateOrUpdate._build_schema_on_200_201, False), + (Show.ExpressRouteCircuitsGet._build_schema_on_200, False), + (List.ExpressRouteCircuitsList._build_schema_on_200, True), + (List.ExpressRouteCircuitsListAll._build_schema_on_200, True), + (Wait.ExpressRouteCircuitsGet._build_schema_on_200, False), + ] + for schema_builder, is_list in operations: + for level in ['Standard', 'High', 'Maximum']: + with self.subTest(operation=schema_builder.__qualname__, resiliency=level): + resource = deepcopy(self.resource) + resource['properties']['resiliencyLevel'] = level + schema = schema_builder() + data = {'value': [resource]} if is_list else resource + value = schema._ValueCls(schema=schema, data=schema.process_data(data)) + output = AAZCommand.deserialize_output(value) + if is_list: + output = output['value'][0] + for field in ['partnerAccountId', 'activationKey', 'resiliencyLevel', + 'serviceProviderProvisioningState']: + self.assertEqual(output[field], resource['properties'][field]) + + for command_type in [ExpressRouteCreate, ExpressRouteUpdate]: + command = self._command(command_type, location='eastus2') + self.assertNotIn('resiliency_level', dict(command._cli_arguments_loader())) + + class TestVpnConnectionCertAuthNoSharedKey(unittest.TestCase): """Unit test to verify that --shared-key is not required when --auth-type Certificate is used.""" From 20f715b619f29208103b5ec85b7d2a5e8fe1e871 Mon Sep 17 00:00:00 2001 From: Jian Hui Date: Wed, 4 Nov 2026 09:49:12 +0800 Subject: [PATCH 2/2] {Network} `az network express-route`: Adjust MultiCloud live test for dev subscription Copilot-Session: e3d4e3bd-ea62-458e-bf2a-57e0043d9327 --- .../tests/latest/test_network_commands.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py index 05d386e8c56..22d4e90aa26 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py @@ -4040,18 +4040,20 @@ def test_network_express_route(self, resource_group): @live_only() # live_only as MultiCloud circuits need a real partner cloud account, contact service team for one @unittest.skipUnless( - os.environ.get('AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID') and + os.environ.get('AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID') or os.environ.get('AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY'), - 'Set AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID and AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY for live tests.') - @ResourceGroupPreparer(name_prefix='cli_test_express_route_multicloud', location='eastus2') + 'Set AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID and/or AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY for live tests.') + @ResourceGroupPreparer(name_prefix='cli_test_express_route_multicloud', location='westus2') def test_network_express_route_multicloud(self, resource_group): workflows = [ ('account', '--partner-account-id', 'partnerAccountId', - os.environ['AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID']), + os.environ.get('AZURE_TEST_EXPRESS_ROUTE_PARTNER_ACCOUNT_ID')), ('activation', '--activation-key', 'activationKey', - os.environ['AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY']), + os.environ.get('AZURE_TEST_EXPRESS_ROUTE_ACTIVATION_KEY')), ] for workflow, parameter, field, value in workflows: + if not value: + continue with self.subTest(workflow=workflow): self.kwargs.update({ 'rg': resource_group, @@ -4066,12 +4068,11 @@ def test_network_express_route_multicloud(self, resource_group): self.check(field, '{provisioning_value}'), self.check("contains(['Standard', 'High', 'Maximum'], resiliencyLevel)", True), ] - self.cmd('network express-route create -g {rg} -n {er} --bandwidth 200 --provider AWS --peering-location uswest2 ' + self.cmd('network express-route create -g {rg} -n {er} --bandwidth 1000 --provider aws --peering-location uswest2 ' '--sku-tier MultiCloud --sku-family MeteredData {parameter} "{provisioning_value}"', checks=checks) - self.cmd('network express-route update -g {rg} -n {er} {parameter} "{provisioning_value}" ' - '--tags purpose=multicloud-cli-test', - checks=checks + [self.check('tags.purpose', 'multicloud-cli-test')]) + # No update step: the service currently returns InternalServerError on any re-PUT of a + # MultiCloud circuit. Add `express-route update` here once the service supports it. self.cmd('network express-route show -g {rg} -n {er}', checks=checks) self.cmd('network express-route list -g {rg}', checks=[ self.check('length(@)', 1),