From 8afd612442547711ebc409b9d081aae3f905122b Mon Sep 17 00:00:00 2001 From: Ranjana Sinha Date: Fri, 5 Jun 2026 15:25:13 -0400 Subject: [PATCH 1/5] Update Traffic Manager CLI commands to 2024-04-01-preview API --- .../cli/command_modules/network/_params.py | 1 + .../traffic_manager/endpoint/_create.py | 6 +- .../traffic_manager/endpoint/_delete.py | 12 +- .../network/traffic_manager/endpoint/_show.py | 6 +- .../endpoint/_show_geographic_hierarchy.py | 6 +- .../traffic_manager/endpoint/_update.py | 8 +- .../traffic_manager/profile/__init__.py | 1 + .../traffic_manager/profile/_check_dns.py | 6 +- .../traffic_manager/profile/_check_dns_v2.py | 178 +++++++ .../traffic_manager/profile/_create.py | 18 +- .../traffic_manager/profile/_delete.py | 14 +- .../network/traffic_manager/profile/_list.py | 56 ++- .../network/traffic_manager/profile/_show.py | 11 +- .../traffic_manager/profile/_update.py | 21 +- .../profile/heat_map/__cmd_group.py | 23 + .../profile/heat_map/__init__.py | 12 + .../traffic_manager/profile/heat_map/_show.py | 256 ++++++++++ .../user_metrics_key/__cmd_group.py | 23 + .../user_metrics_key/__init__.py | 14 + .../user_metrics_key/_create.py | 151 ++++++ .../user_metrics_key/_delete.py | 146 ++++++ .../traffic_manager/user_metrics_key/_show.py | 151 ++++++ .../cli/command_modules/network/custom.py | 11 +- .../latest/recordings/test_dns_alias.yaml | 2 +- .../latest/recordings/test_dns_tmlink.yaml | 2 +- .../test_network_traffic_manager.yaml | 34 +- .../test_network_traffic_manager2.yaml | 6 +- ..._network_traffic_manager_always_serve.yaml | 8 +- ...t_network_traffic_manager_record_type.yaml | 201 ++++++++ ...rk_traffic_manager_record_type_update.yaml | 457 ++++++++++++++++++ ...etwork_traffic_manager_subnet_routing.yaml | 16 +- .../tests/latest/test_network_commands.py | 103 ++++ 32 files changed, 1857 insertions(+), 103 deletions(-) create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type.yaml create mode 100644 src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type_update.yaml diff --git a/src/azure-cli/azure/cli/command_modules/network/_params.py b/src/azure-cli/azure/cli/command_modules/network/_params.py index 28c58258c94..b9d65664721 100644 --- a/src/azure-cli/azure/cli/command_modules/network/_params.py +++ b/src/azure-cli/azure/cli/command_modules/network/_params.py @@ -641,6 +641,7 @@ def load_arguments(self, _): c.argument('unique_dns_name', help="Relative DNS name for the traffic manager profile. Resulting FQDN will be `.trafficmanager.net` and must be globally unique.") c.argument('max_return', help="Maximum number of endpoints to be returned for MultiValue routing type.", type=int) c.argument('ttl', help='DNS config time-to-live in seconds.', type=int) + c.argument('record_type', help='When record type is set, a traffic manager profile will allow only endpoints that match this type.', arg_type=get_enum_type(['A', 'AAAA', 'CNAME'])) with self.argument_context('network traffic-manager profile', arg_group='Monitor Configuration') as c: c.argument('monitor_path', help='Path to monitor. Use ""(\'""\' in PowerShell) for none.', options_list=['--path', c.deprecate(target='--monitor-path', redirect='--path', hide=True)]) diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_create.py index 78fdf682ecf..a0e0ed07291 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_create.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_create.py @@ -25,9 +25,9 @@ class Create(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2024-04-01-preview"], ] } @@ -252,7 +252,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_delete.py index 7f868a9530f..40eef352738 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_delete.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_delete.py @@ -25,16 +25,16 @@ class Delete(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2024-04-01-preview"], ] } def _handler(self, command_args): super()._handler(command_args) self._execute_operations() - return self._output() + return None _args_schema = None @@ -84,10 +84,6 @@ def pre_operations(self): def post_operations(self): pass - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - class EndpointsDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" @@ -146,7 +142,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show.py index faf950fe4cf..94ce5c568d7 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show.py @@ -22,9 +22,9 @@ class Show(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2024-04-01-preview"], ] } @@ -141,7 +141,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show_geographic_hierarchy.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show_geographic_hierarchy.py index 4fcf3795658..1f6714d022a 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show_geographic_hierarchy.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_show_geographic_hierarchy.py @@ -22,9 +22,9 @@ class ShowGeographicHierarchy(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/providers/microsoft.network/trafficmanagergeographichierarchies/default", "2022-04-01"], + ["mgmt-plane", "/providers/microsoft.network/trafficmanagergeographichierarchies/default", "2024-04-01-preview"], ] } @@ -80,7 +80,7 @@ def error_format(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_update.py index f30cca2707b..5fea929aa99 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_update.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/endpoint/_update.py @@ -32,9 +32,9 @@ class Update(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/{}/{}", "2024-04-01-preview"], ] } @@ -302,7 +302,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } @@ -393,7 +393,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py index d028234dbce..e9b58065516 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py @@ -10,6 +10,7 @@ from .__cmd_group import * from ._check_dns import * +from ._check_dns_v2 import * from ._create import * from ._delete import * from ._list import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns.py index d0dc66ef3cb..cee8d8024dc 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns.py @@ -22,9 +22,9 @@ class CheckDns(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/providers/microsoft.network/checktrafficmanagernameavailability", "2022-04-01"], + ["mgmt-plane", "/providers/microsoft.network/checktrafficmanagernameavailability", "2024-04-01-preview"], ] } @@ -104,7 +104,7 @@ def error_format(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py new file mode 100644 index 00000000000..afeb3563585 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py @@ -0,0 +1,178 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network traffic-manager profile check-dns-v2", +) +class CheckDnsV2(AAZCommand): + """Checks the availability of a Traffic Manager Relative DNS name. + """ + + _aaz_info = { + "version": "2024-04-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/checktrafficmanagernameavailabilityv2", "2024-04-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + # define Arg Group "Parameters" + + _args_schema = cls._args_schema + _args_schema.name = AAZStrArg( + options=["--name"], + arg_group="Parameters", + help="The name of the resource.", + ) + _args_schema.type = AAZStrArg( + options=["--type"], + arg_group="Parameters", + help="The type of the resource.", + ) + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.ProfilesCheckTrafficManagerNameAvailabilityV2(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class ProfilesCheckTrafficManagerNameAvailabilityV2(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkTrafficManagerNameAvailabilityV2", + **self.url_parameters + ) + + @property + def method(self): + return "POST" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-04-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Content-Type", "application/json", + ), + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + @property + def content(self): + _content_value, _builder = self.new_content_builder( + self.ctx.args, + typ=AAZObjectType, + typ_kwargs={"flags": {"required": True, "client_flatten": True}} + ) + _builder.set_prop("name", AAZStrType, ".name") + _builder.set_prop("type", AAZStrType, ".type") + + return self.serialize_content(_content_value) + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.message = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.name_available = AAZBoolType( + serialized_name="nameAvailable", + ) + _schema_on_200.reason = AAZStrType() + _schema_on_200.type = AAZStrType() + + return cls._schema_on_200 + + +class _CheckDnsV2Helper: + """Helper class for CheckDnsV2""" + + +__all__ = ["CheckDnsV2"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_create.py index 40a83d64cca..c776668b1bf 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_create.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_create.py @@ -15,7 +15,7 @@ "network traffic-manager profile create", ) class Create(AAZCommand): - """Create a traffic manager profile. + """Create a Traffic Manager profile. :example: Create a traffic manager profile with performance routing. az network traffic-manager profile create -g MyResourceGroup -n MyTmProfile --routing-method Performance --unique-dns-name mywebapp --ttl 30 --protocol HTTP --port 80 --path "/" @@ -25,9 +25,9 @@ class Create(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2024-04-01-preview"], ] } @@ -181,6 +181,12 @@ def _build_arguments_schema(cls, *args, **kwargs): default="Enabled", enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) + _args_schema.record_type = AAZStrArg( + options=["--record-type"], + arg_group="Properties", + help="When record type is set, a traffic manager profile will allow only endpoints that match this type.", + enum={"A": "A", "AAAA": "AAAA", "CNAME": "CNAME"}, + ) _args_schema.routing_method = AAZStrArg( options=["--routing-method"], arg_group="Properties", @@ -254,7 +260,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } @@ -290,6 +296,7 @@ def content(self): properties.set_prop("maxReturn", AAZIntType, ".max_return") properties.set_prop("monitorConfig", AAZObjectType) properties.set_prop("profileStatus", AAZStrType, ".status") + properties.set_prop("recordType", AAZStrType, ".record_type") properties.set_prop("trafficRoutingMethod", AAZStrType, ".routing_method") dns_config = _builder.get(".properties.dnsConfig") @@ -376,6 +383,9 @@ def _build_schema_on_200_201(cls): properties.profile_status = AAZStrType( serialized_name="profileStatus", ) + properties.record_type = AAZStrType( + serialized_name="recordType", + ) properties.traffic_routing_method = AAZStrType( serialized_name="trafficRoutingMethod", ) diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_delete.py index 3e28579e770..e9316145d96 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_delete.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_delete.py @@ -15,7 +15,7 @@ "network traffic-manager profile delete", ) class Delete(AAZCommand): - """Delete a traffic manager profile. + """Delete a Traffic Manager profile. :example: Delete a traffic manager profile. az network traffic-manager profile delete -g MyResourceGroup -n MyTmProfile @@ -25,16 +25,16 @@ class Delete(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2024-04-01-preview"], ] } def _handler(self, command_args): super()._handler(command_args) self._execute_operations() - return self._output() + return None _args_schema = None @@ -71,10 +71,6 @@ def pre_operations(self): def post_operations(self): pass - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - class ProfilesDelete(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" @@ -125,7 +121,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_list.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_list.py index e040c10c4bf..9fa8baae44a 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_list.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_list.py @@ -15,17 +15,17 @@ "network traffic-manager profile list", ) class List(AAZCommand): - """List traffic manager profiles. + """List all Traffic Manager profiles within a resource group. :example: List traffic manager profiles. az network traffic-manager profile list -g MyResourceGroup """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerprofiles", "2022-04-01"], - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerprofiles", "2024-04-01-preview"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles", "2024-04-01-preview"], ] } @@ -50,12 +50,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.ProfilesListByResourceGroup(ctx=self.ctx)() - if condition_1: self.ProfilesListBySubscription(ctx=self.ctx)() + if condition_1: + self.ProfilesListByResourceGroup(ctx=self.ctx)() self.post_operations() @register_callback @@ -70,7 +70,7 @@ def _output(self, *args, **kwargs): result = self.deserialize_output(self.ctx.vars.instance.value, client_flatten=True) return result - class ProfilesListByResourceGroup(AAZHttpOperation): + class ProfilesListBySubscription(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -84,7 +84,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles", + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles", **self.url_parameters ) @@ -99,10 +99,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, @@ -114,7 +110,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } @@ -147,7 +143,12 @@ def _build_schema_on_200(cls): cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) value = cls._schema_on_200.value value.Element = AAZObjectType() @@ -179,6 +180,9 @@ def _build_schema_on_200(cls): properties.profile_status = AAZStrType( serialized_name="profileStatus", ) + properties.record_type = AAZStrType( + serialized_name="recordType", + ) properties.traffic_routing_method = AAZStrType( serialized_name="trafficRoutingMethod", ) @@ -305,7 +309,7 @@ def _build_schema_on_200(cls): return cls._schema_on_200 - class ProfilesListBySubscription(AAZHttpOperation): + class ProfilesListByResourceGroup(AAZHttpOperation): CLIENT_TYPE = "MgmtClient" def __call__(self, *args, **kwargs): @@ -319,7 +323,7 @@ def __call__(self, *args, **kwargs): @property def url(self): return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficmanagerprofiles", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles", **self.url_parameters ) @@ -334,6 +338,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, @@ -345,7 +353,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } @@ -378,7 +386,12 @@ def _build_schema_on_200(cls): cls._schema_on_200 = AAZObjectType() _schema_on_200 = cls._schema_on_200 - _schema_on_200.value = AAZListType() + _schema_on_200.next_link = AAZStrType( + serialized_name="nextLink", + ) + _schema_on_200.value = AAZListType( + flags={"required": True}, + ) value = cls._schema_on_200.value value.Element = AAZObjectType() @@ -410,6 +423,9 @@ def _build_schema_on_200(cls): properties.profile_status = AAZStrType( serialized_name="profileStatus", ) + properties.record_type = AAZStrType( + serialized_name="recordType", + ) properties.traffic_routing_method = AAZStrType( serialized_name="trafficRoutingMethod", ) diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_show.py index 7ab5e82504f..815f80f36e7 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_show.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_show.py @@ -15,16 +15,16 @@ "network traffic-manager profile show", ) class Show(AAZCommand): - """Get the details of a traffic manager profile. + """Get a Traffic Manager profile. :example: Get the details of a traffic manager profile. az network traffic-manager profile show -g MyResourceGroup -n MyTmProfile """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2024-04-01-preview"], ] } @@ -120,7 +120,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } @@ -179,6 +179,9 @@ def _build_schema_on_200(cls): properties.profile_status = AAZStrType( serialized_name="profileStatus", ) + properties.record_type = AAZStrType( + serialized_name="recordType", + ) properties.traffic_routing_method = AAZStrType( serialized_name="trafficRoutingMethod", ) diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_update.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_update.py index 169c69363cd..2f381bb05e1 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_update.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_update.py @@ -15,7 +15,7 @@ "network traffic-manager profile update", ) class Update(AAZCommand): - """Update a traffic manager profile. + """Update a Traffic Manager profile. :example: Update a traffic manager profile to change the TTL to 300. az network traffic-manager profile update -g MyResourceGroup -n MyTmProfile --ttl 300 @@ -28,9 +28,9 @@ class Update(AAZCommand): """ _aaz_info = { - "version": "2022-04-01", + "version": "2024-04-01-preview", "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2022-04-01"], + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}", "2024-04-01-preview"], ] } @@ -192,6 +192,13 @@ def _build_arguments_schema(cls, *args, **kwargs): nullable=True, enum={"Disabled": "Disabled", "Enabled": "Enabled"}, ) + _args_schema.record_type = AAZStrArg( + options=["--record-type"], + arg_group="Properties", + help="When record type is set, a traffic manager profile will allow only endpoints that match this type.", + nullable=True, + enum={"A": "A", "AAAA": "AAAA", "CNAME": "CNAME"}, + ) _args_schema.routing_method = AAZStrArg( options=["--routing-method"], arg_group="Properties", @@ -279,7 +286,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } @@ -362,7 +369,7 @@ def url_parameters(self): def query_parameters(self): parameters = { **self.serialize_query_param( - "api-version", "2022-04-01", + "api-version", "2024-04-01-preview", required=True, ), } @@ -430,6 +437,7 @@ def _update_instance(self, instance): properties.set_prop("maxReturn", AAZIntType, ".max_return") properties.set_prop("monitorConfig", AAZObjectType) properties.set_prop("profileStatus", AAZStrType, ".status") + properties.set_prop("recordType", AAZStrType, ".record_type") properties.set_prop("trafficRoutingMethod", AAZStrType, ".routing_method") dns_config = _builder.get(".properties.dnsConfig") @@ -525,6 +533,9 @@ def _build_schema_profile_read(cls, _schema): properties.profile_status = AAZStrType( serialized_name="profileStatus", ) + properties.record_type = AAZStrType( + serialized_name="recordType", + ) properties.traffic_routing_method = AAZStrType( serialized_name="trafficRoutingMethod", ) diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py new file mode 100644 index 00000000000..9a774e694db --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "network traffic-manager profile heat-map", +) +class __CMDGroup(AAZCommandGroup): + """Manage Heat Map + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py new file mode 100644 index 00000000000..28d5f355813 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py @@ -0,0 +1,12 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._show import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py new file mode 100644 index 00000000000..f4458153a7e --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py @@ -0,0 +1,256 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network traffic-manager profile heat-map show", +) +class Show(AAZCommand): + """Get latest heatmap for Traffic Manager profile. + """ + + _aaz_info = { + "version": "2024-04-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/heatmaps/{}", "2024-04-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + + _args_schema = cls._args_schema + _args_schema.heat_map_type = AAZStrArg( + options=["-n", "--name", "--heat-map-type"], + help="The type of the heatmap.", + required=True, + id_part="child_name_1", + enum={"default": "default"}, + ) + _args_schema.profile_name = AAZStrArg( + options=["--profile-name"], + help="The name of the Traffic Manager profile.", + required=True, + id_part="name", + ) + _args_schema.resource_group = AAZResourceGroupNameArg( + required=True, + ) + _args_schema.bot_right = AAZListArg( + options=["--bot-right"], + help="The bottom right latitude,longitude pair of the rectangular viewport to query for.", + fmt=AAZListArgFormat( + max_length=2, + min_length=2, + ), + ) + _args_schema.top_left = AAZListArg( + options=["--top-left"], + help="The top left latitude,longitude pair of the rectangular viewport to query for.", + fmt=AAZListArgFormat( + max_length=2, + min_length=2, + ), + ) + + bot_right = cls._args_schema.bot_right + bot_right.Element = AAZFloatArg() + + top_left = cls._args_schema.top_left + top_left.Element = AAZFloatArg() + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.HeatMapGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class HeatMapGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/{heatMapType}", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "heatMapType", self.ctx.args.heat_map_type, + required=True, + ), + **self.serialize_url_param( + "profileName", self.ctx.args.profile_name, + required=True, + ), + **self.serialize_url_param( + "resourceGroupName", self.ctx.args.resource_group, + required=True, + ), + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "botRight", self.ctx.args.bot_right, + ), + **self.serialize_query_param( + "topLeft", self.ctx.args.top_left, + ), + **self.serialize_query_param( + "api-version", "2024-04-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.type = AAZStrType() + + properties = cls._schema_on_200.properties + properties.end_time = AAZStrType( + serialized_name="endTime", + ) + properties.endpoints = AAZListType() + properties.start_time = AAZStrType( + serialized_name="startTime", + ) + properties.traffic_flows = AAZListType( + serialized_name="trafficFlows", + ) + + endpoints = cls._schema_on_200.properties.endpoints + endpoints.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.endpoints.Element + _element.endpoint_id = AAZIntType( + serialized_name="endpointId", + ) + _element.resource_id = AAZStrType( + serialized_name="resourceId", + ) + + traffic_flows = cls._schema_on_200.properties.traffic_flows + traffic_flows.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.traffic_flows.Element + _element.latitude = AAZFloatType() + _element.longitude = AAZFloatType() + _element.query_experiences = AAZListType( + serialized_name="queryExperiences", + ) + _element.source_ip = AAZStrType( + serialized_name="sourceIp", + ) + + query_experiences = cls._schema_on_200.properties.traffic_flows.Element.query_experiences + query_experiences.Element = AAZObjectType() + + _element = cls._schema_on_200.properties.traffic_flows.Element.query_experiences.Element + _element.endpoint_id = AAZIntType( + serialized_name="endpointId", + flags={"required": True}, + ) + _element.latency = AAZFloatType() + _element.query_count = AAZIntType( + serialized_name="queryCount", + flags={"required": True}, + ) + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py new file mode 100644 index 00000000000..17d48c5390d --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py @@ -0,0 +1,23 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command_group( + "network traffic-manager user-metrics-key", +) +class __CMDGroup(AAZCommandGroup): + """Manage Traffic Manager User Metrics Key + """ + pass + + +__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py new file mode 100644 index 00000000000..45df27f97a0 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py @@ -0,0 +1,14 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from .__cmd_group import * +from ._create import * +from ._delete import * +from ._show import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py new file mode 100644 index 00000000000..3508608f58c --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py @@ -0,0 +1,151 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network traffic-manager user-metrics-key create", +) +class Create(AAZCommand): + """Create a subscription-level key used for Real User Metrics collection. + """ + + _aaz_info = { + "version": "2024-04-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerusermetricskeys/default", "2024-04-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TrafficManagerUserMetricsKeysCreateOrUpdate(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class TrafficManagerUserMetricsKeysCreateOrUpdate(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [201]: + return self.on_201(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", + **self.url_parameters + ) + + @property + def method(self): + return "PUT" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-04-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_201(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_201 + ) + + _schema_on_201 = None + + @classmethod + def _build_schema_on_201(cls): + if cls._schema_on_201 is not None: + return cls._schema_on_201 + + cls._schema_on_201 = AAZObjectType() + + _schema_on_201 = cls._schema_on_201 + _schema_on_201.id = AAZStrType() + _schema_on_201.name = AAZStrType() + _schema_on_201.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_201.type = AAZStrType() + + properties = cls._schema_on_201.properties + properties.key = AAZStrType() + + return cls._schema_on_201 + + +class _CreateHelper: + """Helper class for Create""" + + +__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py new file mode 100644 index 00000000000..67425f1f57b --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py @@ -0,0 +1,146 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network traffic-manager user-metrics-key delete", + confirmation="Are you sure you want to perform this operation?", +) +class Delete(AAZCommand): + """Delete a subscription-level key used for Real User Metrics collection. + """ + + _aaz_info = { + "version": "2024-04-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerusermetricskeys/default", "2024-04-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TrafficManagerUserMetricsKeysDelete(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class TrafficManagerUserMetricsKeysDelete(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", + **self.url_parameters + ) + + @property + def method(self): + return "DELETE" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-04-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.boolean = AAZBoolType( + flags={"read_only": True}, + ) + + return cls._schema_on_200 + + +class _DeleteHelper: + """Helper class for Delete""" + + +__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py new file mode 100644 index 00000000000..a2d52da583b --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py @@ -0,0 +1,151 @@ +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# +# Code generated by aaz-dev-tools +# -------------------------------------------------------------------------------------------- + +# pylint: skip-file +# flake8: noqa + +from azure.cli.core.aaz import * + + +@register_command( + "network traffic-manager user-metrics-key show", +) +class Show(AAZCommand): + """Get the subscription-level key used for Real User Metrics collection. + """ + + _aaz_info = { + "version": "2024-04-01-preview", + "resources": [ + ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerusermetricskeys/default", "2024-04-01-preview"], + ] + } + + def _handler(self, command_args): + super()._handler(command_args) + self._execute_operations() + return self._output() + + _args_schema = None + + @classmethod + def _build_arguments_schema(cls, *args, **kwargs): + if cls._args_schema is not None: + return cls._args_schema + cls._args_schema = super()._build_arguments_schema(*args, **kwargs) + + # define Arg Group "" + return cls._args_schema + + def _execute_operations(self): + self.pre_operations() + self.TrafficManagerUserMetricsKeysGet(ctx=self.ctx)() + self.post_operations() + + @register_callback + def pre_operations(self): + pass + + @register_callback + def post_operations(self): + pass + + def _output(self, *args, **kwargs): + result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) + return result + + class TrafficManagerUserMetricsKeysGet(AAZHttpOperation): + CLIENT_TYPE = "MgmtClient" + + def __call__(self, *args, **kwargs): + request = self.make_request() + session = self.client.send_request(request=request, stream=False, **kwargs) + if session.http_response.status_code in [200]: + return self.on_200(session) + + return self.on_error(session.http_response) + + @property + def url(self): + return self.client.format_url( + "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", + **self.url_parameters + ) + + @property + def method(self): + return "GET" + + @property + def error_format(self): + return "ODataV4Format" + + @property + def url_parameters(self): + parameters = { + **self.serialize_url_param( + "subscriptionId", self.ctx.subscription_id, + required=True, + ), + } + return parameters + + @property + def query_parameters(self): + parameters = { + **self.serialize_query_param( + "api-version", "2024-04-01-preview", + required=True, + ), + } + return parameters + + @property + def header_parameters(self): + parameters = { + **self.serialize_header_param( + "Accept", "application/json", + ), + } + return parameters + + def on_200(self, session): + data = self.deserialize_http_content(session) + self.ctx.set_var( + "instance", + data, + schema_builder=self._build_schema_on_200 + ) + + _schema_on_200 = None + + @classmethod + def _build_schema_on_200(cls): + if cls._schema_on_200 is not None: + return cls._schema_on_200 + + cls._schema_on_200 = AAZObjectType() + + _schema_on_200 = cls._schema_on_200 + _schema_on_200.id = AAZStrType() + _schema_on_200.name = AAZStrType() + _schema_on_200.properties = AAZObjectType( + flags={"client_flatten": True}, + ) + _schema_on_200.type = AAZStrType() + + properties = cls._schema_on_200.properties + properties.key = AAZStrType() + + return cls._schema_on_200 + + +class _ShowHelper: + """Helper class for Show""" + + +__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index 2813ad8cd04..cb169aeb2cc 100644 --- a/src/azure-cli/azure/cli/command_modules/network/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/custom.py @@ -5359,7 +5359,8 @@ def create_traffic_manager_profile(cmd, traffic_manager_profile_name, resource_g monitor_port=80, monitor_protocol="HTTP", profile_status="Enabled", ttl=30, tags=None, interval=None, timeout=None, max_failures=None, - monitor_custom_headers=None, status_code_ranges=None, max_return=None): + monitor_custom_headers=None, status_code_ranges=None, max_return=None, + record_type=None): from .aaz.latest.network.traffic_manager.profile import Create if monitor_path is None and monitor_protocol == 'HTTP': monitor_path = '/' @@ -5380,7 +5381,8 @@ def create_traffic_manager_profile(cmd, traffic_manager_profile_name, resource_g "port": monitor_port, "protocol": monitor_protocol, "timeout": timeout, - "max_failures": max_failures + "max_failures": max_failures, + "record_type": record_type } return Create(cli_ctx=cmd.cli_ctx)(command_args=args) @@ -5390,7 +5392,8 @@ def update_traffic_manager_profile(cmd, traffic_manager_profile_name, resource_g profile_status=None, routing_method=None, tags=None, monitor_protocol=None, monitor_port=None, monitor_path=None, ttl=None, timeout=None, interval=None, max_failures=None, - monitor_custom_headers=None, status_code_ranges=None, max_return=None): + monitor_custom_headers=None, status_code_ranges=None, max_return=None, + record_type=None): from .aaz.latest.network.traffic_manager.profile import Update args = { "name": traffic_manager_profile_name, @@ -5422,6 +5425,8 @@ def update_traffic_manager_profile(cmd, traffic_manager_profile_name, resource_g args["timeout"] = timeout if max_failures is not None: args["max_failures"] = max_failures + if record_type is not None: + args["record_type"] = record_type return Update(cli_ctx=cmd.cli_ctx)(command_args=args) diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_alias.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_alias.yaml index 14b4d72d371..84fda4ba633 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_alias.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_alias.yaml @@ -72,7 +72,7 @@ interactions: User-Agent: - AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.26058-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_alias000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_alias000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_alias000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1","name":"tm1","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Performance","dnsConfig":{"relativeName":"mytesttrafficmanager12","fqdn":"mytesttrafficmanager12.preprodtrafficmanager.azure","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_tmlink.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_tmlink.yaml index f3fda59ea18..a4e72a5fb86 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_tmlink.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_dns_tmlink.yaml @@ -72,7 +72,7 @@ interactions: User-Agent: - AZURECLI/2.67.0 azsdk-python-core/1.28.0 Python/3.8.10 (Windows-10-10.0.26100-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_tmlink000001/providers/Microsoft.Network/trafficmanagerprofiles/tm2?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_tmlink000001/providers/Microsoft.Network/trafficmanagerprofiles/tm2?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm2","name":"tm2","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Performance","dnsConfig":{"relativeName":"mytesttrafficmanager2","fqdn":"mytesttrafficmanager2.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager.yaml index 1a5ddd11e9e..a103e085bfb 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager.yaml @@ -19,7 +19,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: POST - uri: https://management.azure.com/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=2022-04-01 + uri: https://management.azure.com/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=2024-04-01-preview response: body: string: '{"name":"myfoobar1","type":"Microsoft.Network\/trafficManagerProfiles","nameAvailable":true,"reason":null,"message":null}' @@ -74,7 +74,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"doo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -118,7 +118,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"doo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -166,7 +166,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"doo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -224,7 +224,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"boo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -272,7 +272,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles?api-version=2024-04-01-preview response: body: string: '{"value":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"boo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}]}' @@ -325,7 +325,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/externalEndpoints/myendpoint?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/externalEndpoints/myendpoint?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile\/externalEndpoints\/myendpoint","name":"myendpoint","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.microsoft.com","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}' @@ -369,7 +369,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/externalEndpoints/myendpoint?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/externalEndpoints/myendpoint?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile\/externalEndpoints\/myendpoint","name":"myendpoint","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.microsoft.com","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}' @@ -424,7 +424,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/externalEndpoints/myendpoint?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/externalEndpoints/myendpoint?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile\/externalEndpoints\/myendpoint","name":"myendpoint","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.contoso.com","weight":25,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}' @@ -468,7 +468,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/ExternalEndpoints/myendpoint?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/ExternalEndpoints/myendpoint?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile\/externalEndpoints\/myendpoint","name":"myendpoint","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.contoso.com","weight":25,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}' @@ -516,7 +516,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"boo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"CheckingEndpoints","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile\/externalEndpoints\/myendpoint","name":"myendpoint","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.contoso.com","weight":25,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -562,7 +562,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=2022-04-01 + uri: https://management.azure.com/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=2024-04-01-preview response: body: string: "{\"id\":\"\\/providers\\/Microsoft.Network\\/trafficManagerGeographicHierarchies\\/default\",\"name\":\"default\",\"type\":\"Microsoft.Network\\/trafficManagerGeographicHierarchies\",\"properties\":{\"geographicHierarchy\":{\"code\":\"WORLD\",\"name\":\"World\",\"regions\":[{\"code\":\"GEO-EU\",\"name\":\"Europe\",\"regions\":[{\"code\":\"AD\",\"name\":\"Andorra\",\"regions\":[]},{\"code\":\"AL\",\"name\":\"Albania\",\"regions\":[]},{\"code\":\"AT\",\"name\":\"Austria\",\"regions\":[]},{\"code\":\"AX\",\"name\":\"\xC5land @@ -683,7 +683,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"boo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"CheckingEndpoints","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile\/externalEndpoints\/myendpoint","name":"myendpoint","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.contoso.com","weight":25,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -744,7 +744,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"boo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"CheckingEndpoints","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile\/externalEndpoints\/myendpoint","name":"myendpoint","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.contoso.com","weight":25,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -794,7 +794,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/ExternalEndpoints/myendpoint?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile/ExternalEndpoints/myendpoint?api-version=2024-04-01-preview response: body: string: '' @@ -836,7 +836,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile","name":"mytmprofile","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"boo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"mytrafficmanager001100a","fqdn":"mytrafficmanager001100a.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -886,7 +886,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: DELETE - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile?api-version=2024-04-01-preview response: body: string: '' diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager2.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager2.yaml index 4ad4b969ffb..14fa9695b65 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager2.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager2.yaml @@ -22,7 +22,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager2000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile2?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager2000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile2?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager2000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile2","name":"mytmprofile2","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"doo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"MultiValue","dnsConfig":{"relativeName":"mytrafficmanager001100a2","fqdn":"mytrafficmanager001100a2.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":3}}' @@ -66,7 +66,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager2000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile2?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager2000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile2?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager2000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile2","name":"mytmprofile2","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"doo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"MultiValue","dnsConfig":{"relativeName":"mytrafficmanager001100a2","fqdn":"mytrafficmanager001100a2.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":3}}' @@ -124,7 +124,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager2000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile2?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager2000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile2?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager2000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile2","name":"mytmprofile2","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{"foo":"boo"},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"MultiValue","dnsConfig":{"relativeName":"mytrafficmanager001100a2","fqdn":"mytrafficmanager001100a2.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":4}}' diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_always_serve.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_always_serve.yaml index 6a1cb09fc9e..3610ecb9593 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_always_serve.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_always_serve.yaml @@ -22,7 +22,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_always_serve000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/profile-000002","name":"profile-000002","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Weighted","dnsConfig":{"relativeName":"mytrafficmanager001100a1","fqdn":"mytrafficmanager001100a1.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}' @@ -71,7 +71,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002/externalEndpoints/endpoint-000003?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002/externalEndpoints/endpoint-000003?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_always_serve000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/profile-000002\/externalEndpoints\/endpoint-000003","name":"endpoint-000003","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"Unmonitored","targetResourceId":null,"target":"www.microsoft.com","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Enabled"}}' @@ -115,7 +115,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002/externalEndpoints/endpoint-000003?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002/externalEndpoints/endpoint-000003?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_always_serve000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/profile-000002\/externalEndpoints\/endpoint-000003","name":"endpoint-000003","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"Unmonitored","targetResourceId":null,"target":"www.microsoft.com","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Enabled"}}' @@ -170,7 +170,7 @@ interactions: User-Agent: - AZURECLI/2.50.0 (AAZ) azsdk-python-core/1.26.0 Python/3.9.5 (Windows-10-10.0.22621-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002/externalEndpoints/endpoint-000003?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_always_serve000001/providers/Microsoft.Network/trafficmanagerprofiles/profile-000002/externalEndpoints/endpoint-000003?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_always_serve000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/profile-000002\/externalEndpoints\/endpoint-000003","name":"endpoint-000003","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"www.contoso.com","weight":25,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}' diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type.yaml new file mode 100644 index 00000000000..75f8abd8fea --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type.yaml @@ -0,0 +1,201 @@ +interactions: +- request: + body: '{"location": "global", "name": "mytmprofile-rt", "properties": {"dnsConfig": + {"relativeName": "testtmrt000002", "ttl": 30}, "monitorConfig": {"path": "/", + "port": 80, "protocol": "HTTP"}, "profileStatus": "Enabled", "recordType": "A", + "trafficRoutingMethod": "Priority"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile create + Connection: + - keep-alive + Content-Length: + - '271' + Content-Type: + - application/json + ParameterSetName: + - -n -g --routing-method --unique-dns-name --record-type + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rt?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rt","name":"mytmprofile-rt","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrt000002","fqdn":"testtmrt000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":"A"}}' + headers: + cache-control: + - private + content-length: + - '732' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:37:15 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/westus/67ced5dc-7c57-46e8-8c9d-9d8d220f952b + x-ms-ratelimit-remaining-subscription-resource-requests: + - '799' + x-msedge-ref: + - 'Ref A: 19F01A1A4C1D475DB364CCA07916A2CC Ref B: BL2AA2010204027 Ref C: 2026-06-05T18:37:11Z' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rt?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rt","name":"mytmprofile-rt","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrt000002","fqdn":"testtmrt000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":"A"}}' + headers: + cache-control: + - private + content-length: + - '742' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:37:16 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '1099' + x-msedge-ref: + - 'Ref A: AB731B937267461FB03E1E0A132986A5 Ref B: BL2AA2030101031 Ref C: 2026-06-05T18:37:16Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile list + Connection: + - keep-alive + ParameterSetName: + - -g + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type000001/providers/Microsoft.Network/trafficmanagerprofiles?api-version=2024-04-01-preview + response: + body: + string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type000001/providers/Microsoft.Network/trafficManagerProfiles/mytmprofile-rt","name":"mytmprofile-rt","type":"Microsoft.Network/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrt000002","fqdn":"testtmrt000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":"A"}}]}' + headers: + cache-control: + - private + content-length: + - '744' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:37:17 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-original-request-ids: + - 93f1c9c4-610d-11f1-b683-6045bda80ec5 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '1099' + x-msedge-ref: + - 'Ref A: E1759A2833374F42BBBE67BCAD710AB6 Ref B: MNZ221060610019 Ref C: 2026-06-05T18:37:17Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rt?api-version=2024-04-01-preview + response: + body: + string: '{"properties":{"boolean":true}}' + headers: + cache-control: + - private + content-length: + - '31' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:37:21 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/westus/74387032-a7ed-4a93-a9ff-45a4336a6d52 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '799' + x-msedge-ref: + - 'Ref A: B5FB98C40A7D4F65908BAC6F0A2DD54D Ref B: BL2AA2010204021 Ref C: 2026-06-05T18:37:18Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type_update.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type_update.yaml new file mode 100644 index 00000000000..3fdbf2fb05d --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_record_type_update.yaml @@ -0,0 +1,457 @@ +interactions: +- request: + body: '{"location": "global", "name": "mytmprofile-rtu", "properties": {"dnsConfig": + {"relativeName": "testtmrtu000002", "ttl": 30}, "monitorConfig": {"path": "/", + "port": 80, "protocol": "HTTP"}, "profileStatus": "Enabled", "trafficRoutingMethod": + "Priority"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile create + Connection: + - keep-alive + Content-Length: + - '254' + Content-Type: + - application/json + ParameterSetName: + - -n -g --routing-method --unique-dns-name + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu","name":"mytmprofile-rtu","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrtu000002","fqdn":"testtmrtu000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' + headers: + cache-control: + - private + content-length: + - '744' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:04 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/westus/6c0ebd15-1680-4ebc-9e42-f9bc9dc8321c + x-ms-ratelimit-remaining-subscription-resource-requests: + - '799' + x-msedge-ref: + - 'Ref A: 6CB512E169434E2CBF5CD095B068C49F Ref B: BL2AA2010205035 Ref C: 2026-06-05T18:49:02Z' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu","name":"mytmprofile-rtu","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrtu000002","fqdn":"testtmrtu000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' + headers: + cache-control: + - private + content-length: + - '754' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:07 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '1099' + x-msedge-ref: + - 'Ref A: EC35FD5A4353498684C2FA84E8C45B85 Ref B: MNZ221060609025 Ref C: 2026-06-05T18:49:06Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"name": "myendpoint-rtu", "properties": {"target": "10.0.0.1", "weight": + 50}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager endpoint create + Connection: + - keep-alive + Content-Length: + - '78' + Content-Type: + - application/json + ParameterSetName: + - -n --profile-name -g --type --weight --target + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu/externalEndpoints/myendpoint-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu\/externalEndpoints\/myendpoint-rtu","name":"myendpoint-rtu","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"10.0.0.1","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}' + headers: + cache-control: + - private + content-length: + - '557' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:09 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/westus/45ce61d6-b0a7-4617-a30d-a4f21d5757e6 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '799' + x-msedge-ref: + - 'Ref A: 030AAD011D2D4B72A86714DD2982F59C Ref B: BL2AA2010205039 Ref C: 2026-06-05T18:49:07Z' + x-powered-by: + - ASP.NET + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu","name":"mytmprofile-rtu","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrtu000002","fqdn":"testtmrtu000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"CheckingEndpoints","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu\/externalEndpoints\/myendpoint-rtu","name":"myendpoint-rtu","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"10.0.0.1","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' + headers: + cache-control: + - private + content-length: + - '1320' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:11 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '1099' + x-msedge-ref: + - 'Ref A: 388AD1EBDA144F20A16D03BF87625AF9 Ref B: BL2AA2010205049 Ref C: 2026-06-05T18:49:10Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile update + Connection: + - keep-alive + ParameterSetName: + - -n -g --record-type + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu","name":"mytmprofile-rtu","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrtu000002","fqdn":"testtmrtu000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"CheckingEndpoints","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu\/externalEndpoints\/myendpoint-rtu","name":"myendpoint-rtu","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"10.0.0.1","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' + headers: + cache-control: + - private + content-length: + - '1320' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:12 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '1099' + x-msedge-ref: + - 'Ref A: 9E9AEA0AB6554F54A11C1173F019471F Ref B: BL2AA2010204037 Ref C: 2026-06-05T18:49:12Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: '{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficManagerProfiles/mytmprofile-rtu", + "location": "global", "name": "mytmprofile-rtu", "properties": {"dnsConfig": + {"relativeName": "testtmrtu000002", "ttl": 30}, "endpoints": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficManagerProfiles/mytmprofile-rtu/externalEndpoints/myendpoint-rtu", + "name": "myendpoint-rtu", "properties": {"alwaysServe": "Disabled", "endpointMonitorStatus": + "CheckingEndpoint", "endpointStatus": "Enabled", "priority": 1, "target": "10.0.0.1", + "weight": 50}, "type": "Microsoft.Network/trafficManagerProfiles/externalEndpoints"}], + "monitorConfig": {"intervalInSeconds": 30, "path": "/", "port": 80, "profileMonitorStatus": + "CheckingEndpoints", "protocol": "HTTP", "timeoutInSeconds": 10, "toleratedNumberOfFailures": + 3}, "profileStatus": "Enabled", "recordType": "A", "trafficRoutingMethod": "Priority", + "trafficViewEnrollmentStatus": "Disabled"}, "tags": {}, "type": "Microsoft.Network/trafficManagerProfiles"}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile update + Connection: + - keep-alive + Content-Length: + - '1206' + Content-Type: + - application/json + ParameterSetName: + - -n -g --record-type + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu","name":"mytmprofile-rtu","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrtu000002","fqdn":"testtmrtu000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"CheckingEndpoints","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu\/externalEndpoints\/myendpoint-rtu","name":"myendpoint-rtu","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"10.0.0.1","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":"A"}}' + headers: + cache-control: + - private + content-length: + - '1319' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:14 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/eastus2/0941a525-550b-4c01-b918-6b31c0f1830e + x-ms-ratelimit-remaining-subscription-resource-requests: + - '799' + x-msedge-ref: + - 'Ref A: C75BE42E2C074709869C1444A94374C1 Ref B: MNZ221060619017 Ref C: 2026-06-05T18:49:13Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu","name":"mytmprofile-rtu","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Priority","dnsConfig":{"relativeName":"testtmrtu000002","fqdn":"testtmrtu000002.tmpreview.watmtest.azure-test.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"CheckingEndpoints","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_record_type_update000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/mytmprofile-rtu\/externalEndpoints\/myendpoint-rtu","name":"myendpoint-rtu","type":"Microsoft.Network\/trafficManagerProfiles\/externalEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":null,"target":"10.0.0.1","weight":50,"priority":1,"endpointLocation":null,"minChildEndpoints":null,"alwaysServe":"Disabled"}}],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":"A"}}' + headers: + cache-control: + - private + content-length: + - '1319' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:15 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-resource-requests: + - '1099' + x-msedge-ref: + - 'Ref A: 087648F184694AD1987515F318FFDBDE Ref B: BL2AA2010204047 Ref C: 2026-06-05T18:49:15Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager endpoint delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g --profile-name -t -n + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu/ExternalEndpoints/myendpoint-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"properties":{"boolean":true}}' + headers: + cache-control: + - private + content-length: + - '31' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:18 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/westus/11bc5b1e-0191-45da-9eca-2f0cf3263bab + x-ms-ratelimit-remaining-subscription-deletes: + - '799' + x-ms-ratelimit-remaining-subscription-global-deletes: + - '11999' + x-msedge-ref: + - 'Ref A: 7AB439D25B8D4697B2DD3F4CEC21B1A4 Ref B: MNZ221060609031 Ref C: 2026-06-05T18:49:16Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager profile delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_record_type_update000001/providers/Microsoft.Network/trafficmanagerprofiles/mytmprofile-rtu?api-version=2024-04-01-preview + response: + body: + string: '{"properties":{"boolean":true}}' + headers: + cache-control: + - private + content-length: + - '31' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 18:49:22 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/westus/d54d4d01-acad-4f66-8a11-ed57c2662405 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '799' + x-msedge-ref: + - 'Ref A: 059FF207D8EE4D5D839F3D80DCE0768A Ref B: BL2AA2010204027 Ref C: 2026-06-05T18:49:18Z' + x-powered-by: + - ASP.NET + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_subnet_routing.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_subnet_routing.yaml index 168adee3a07..d9ca01a2b29 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_subnet_routing.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_subnet_routing.yaml @@ -23,7 +23,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1","name":"tm1","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Subnet","dnsConfig":{"relativeName":"testtm000002","fqdn":"testtm000002.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10,"customHeaders":[{"name":"foo","value":"bar"}],"expectedStatusCodeRanges":[{"min":200,"max":202}]},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' @@ -329,7 +329,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1","name":"tm1","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Subnet","dnsConfig":{"relativeName":"testtm000002","fqdn":"testtm000002.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10,"customHeaders":[{"name":"foo","value":"bar"}],"expectedStatusCodeRanges":[{"min":200,"max":202}]},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' @@ -386,7 +386,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1","name":"tm1","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","tags":{},"properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Subnet","dnsConfig":{"relativeName":"testtm000002","fqdn":"testtm000002.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10,"customHeaders":[{"name":"foo","value":"doo"},{"name":"test","value":"best"}],"expectedStatusCodeRanges":[{"min":200,"max":204}]},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}' @@ -439,7 +439,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1\/azureEndpoints\/ep1","name":"ep1","type":"Microsoft.Network\/trafficManagerProfiles\/azureEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/publicIPAddresses\/ip1","target":"testpip000003.westus.cloudapp.azure.com","weight":1,"priority":1,"endpointLocation":"West @@ -488,7 +488,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1\/azureEndpoints\/ep1","name":"ep1","type":"Microsoft.Network\/trafficManagerProfiles\/azureEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/publicIPAddresses\/ip1","target":"testpip000003.westus.cloudapp.azure.com","weight":1,"priority":1,"endpointLocation":"West @@ -547,7 +547,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1\/azureEndpoints\/ep1","name":"ep1","type":"Microsoft.Network\/trafficManagerProfiles\/azureEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/publicIPAddresses\/ip1","target":"testpip000003.westus.cloudapp.azure.com","weight":1,"priority":1,"endpointLocation":"West @@ -596,7 +596,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: GET - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1\/azureEndpoints\/ep1","name":"ep1","type":"Microsoft.Network\/trafficManagerProfiles\/azureEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/publicIPAddresses\/ip1","target":"testpip000003.westus.cloudapp.azure.com","weight":1,"priority":1,"endpointLocation":"West @@ -655,7 +655,7 @@ interactions: User-Agent: - AZURECLI/2.73.0 azsdk-python-core/1.31.0 Python/3.12.10 (Windows-11-10.0.26100-SP0) method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2022-04-01 + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_traffic_manager_subnet000001/providers/Microsoft.Network/trafficmanagerprofiles/tm1/azureEndpoints/ep1?api-version=2024-04-01-preview response: body: string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm1\/azureEndpoints\/ep1","name":"ep1","type":"Microsoft.Network\/trafficManagerProfiles\/azureEndpoints","properties":{"endpointStatus":"Enabled","endpointMonitorStatus":"CheckingEndpoint","targetResourceId":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_traffic_manager_subnet000001\/providers\/Microsoft.Network\/publicIPAddresses\/ip1","target":"testpip000003.westus.cloudapp.azure.com","weight":1,"priority":1,"endpointLocation":"West 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 184e4cf72fc..5f0cabe5a4a 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 @@ -7959,6 +7959,109 @@ def test_network_traffic_manager_always_serve(self, resource_group): ] ) + @ResourceGroupPreparer('cli_test_traffic_manager_record_type') + def test_network_traffic_manager_record_type(self, resource_group): + self.kwargs.update({ + 'tm': 'mytmprofile-rt', + 'dns': self.create_random_name('testtmrt', 20), + 'endpoint': 'myendpoint-rt', + }) + + # Create a profile with record-type A + self.cmd( + 'network traffic-manager profile create -n {tm} -g {rg} ' + '--routing-method priority --unique-dns-name {dns} --record-type A', + checks=[ + self.check('TrafficManagerProfile.recordType', 'A'), + ] + ) + + # Verify record-type is returned on show + self.cmd( + 'network traffic-manager profile show -g {rg} -n {tm}', + checks=[ + self.check('recordType', 'A'), + self.check('dnsConfig.relativeName', '{dns}'), + ] + ) + + # Verify record-type is returned on list + self.cmd( + 'network traffic-manager profile list -g {rg}', + checks=[ + self.check('length(@)', 1), + self.check('[0].recordType', 'A'), + ] + ) + + # Clean up + self.cmd('network traffic-manager profile delete -g {rg} -n {tm}') + + @ResourceGroupPreparer('cli_test_traffic_manager_record_type_update') + def test_network_traffic_manager_record_type_update(self, resource_group): + self.kwargs.update({ + 'tm': 'mytmprofile-rtu', + 'dns': self.create_random_name('testtmrtu', 20), + 'endpoint': 'myendpoint-rtu', + }) + + # Create a profile without record-type + self.cmd( + 'network traffic-manager profile create -n {tm} -g {rg} ' + '--routing-method priority --unique-dns-name {dns}', + checks=[ + self.check('TrafficManagerProfile.recordType', None), + ] + ) + + # Show and confirm no record-type + self.cmd( + 'network traffic-manager profile show -g {rg} -n {tm}', + checks=[ + self.check('recordType', None), + ] + ) + + # Add an endpoint with IPv4 target + self.cmd( + 'network traffic-manager endpoint create -n {endpoint} --profile-name {tm} -g {rg} ' + '--type externalEndpoints --weight 50 --target 10.0.0.1', + checks=[ + self.check('type', 'Microsoft.Network/trafficManagerProfiles/externalEndpoints'), + ] + ) + + # Show and confirm still no record-type + self.cmd( + 'network traffic-manager profile show -g {rg} -n {tm}', + checks=[ + self.check('recordType', None), + self.check('length(endpoints)', 1), + ] + ) + + # Update the profile to set record-type A + self.cmd( + 'network traffic-manager profile update -n {tm} -g {rg} --record-type A', + checks=[ + self.check('recordType', 'A'), + ] + ) + + # Show and confirm record-type is set and endpoint still exists + self.cmd( + 'network traffic-manager profile show -g {rg} -n {tm}', + checks=[ + self.check('recordType', 'A'), + self.check('length(endpoints)', 1), + self.check('endpoints[0].name', '{endpoint}'), + ] + ) + + # Clean up + self.cmd('network traffic-manager endpoint delete -g {rg} --profile-name {tm} -t externalEndpoints -n {endpoint}') + self.cmd('network traffic-manager profile delete -g {rg} -n {tm}') + class NetworkWatcherConfigureScenarioTest(LiveScenarioTest): From 9bf3c4ea38403a32c4a9864818c5ba4a21be8735 Mon Sep 17 00:00:00 2001 From: Ranjana Sinha Date: Fri, 5 Jun 2026 16:17:06 -0400 Subject: [PATCH 2/5] Remove user-metrics-key and heat-map commands (API not ready for testing) --- .../profile/heat_map/__cmd_group.py | 23 -- .../profile/heat_map/__init__.py | 12 - .../traffic_manager/profile/heat_map/_show.py | 256 ------------------ .../user_metrics_key/__cmd_group.py | 23 -- .../user_metrics_key/__init__.py | 14 - .../user_metrics_key/_create.py | 151 ----------- .../user_metrics_key/_delete.py | 146 ---------- .../traffic_manager/user_metrics_key/_show.py | 151 ----------- ...work_traffic_manager_user_metrics_key.yaml | 51 ++++ 9 files changed, 51 insertions(+), 776 deletions(-) delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py create mode 100644 src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py deleted file mode 100644 index 9a774e694db..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "network traffic-manager profile heat-map", -) -class __CMDGroup(AAZCommandGroup): - """Manage Heat Map - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py deleted file mode 100644 index 28d5f355813..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * -from ._show import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py deleted file mode 100644 index f4458153a7e..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/heat_map/_show.py +++ /dev/null @@ -1,256 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "network traffic-manager profile heat-map show", -) -class Show(AAZCommand): - """Get latest heatmap for Traffic Manager profile. - """ - - _aaz_info = { - "version": "2024-04-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/trafficmanagerprofiles/{}/heatmaps/{}", "2024-04-01-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - _args_schema = cls._args_schema - _args_schema.heat_map_type = AAZStrArg( - options=["-n", "--name", "--heat-map-type"], - help="The type of the heatmap.", - required=True, - id_part="child_name_1", - enum={"default": "default"}, - ) - _args_schema.profile_name = AAZStrArg( - options=["--profile-name"], - help="The name of the Traffic Manager profile.", - required=True, - id_part="name", - ) - _args_schema.resource_group = AAZResourceGroupNameArg( - required=True, - ) - _args_schema.bot_right = AAZListArg( - options=["--bot-right"], - help="The bottom right latitude,longitude pair of the rectangular viewport to query for.", - fmt=AAZListArgFormat( - max_length=2, - min_length=2, - ), - ) - _args_schema.top_left = AAZListArg( - options=["--top-left"], - help="The top left latitude,longitude pair of the rectangular viewport to query for.", - fmt=AAZListArgFormat( - max_length=2, - min_length=2, - ), - ) - - bot_right = cls._args_schema.bot_right - bot_right.Element = AAZFloatArg() - - top_left = cls._args_schema.top_left - top_left.Element = AAZFloatArg() - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.HeatMapGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class HeatMapGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/heatMaps/{heatMapType}", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "heatMapType", self.ctx.args.heat_map_type, - required=True, - ), - **self.serialize_url_param( - "profileName", self.ctx.args.profile_name, - required=True, - ), - **self.serialize_url_param( - "resourceGroupName", self.ctx.args.resource_group, - required=True, - ), - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "botRight", self.ctx.args.bot_right, - ), - **self.serialize_query_param( - "topLeft", self.ctx.args.top_left, - ), - **self.serialize_query_param( - "api-version", "2024-04-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.type = AAZStrType() - - properties = cls._schema_on_200.properties - properties.end_time = AAZStrType( - serialized_name="endTime", - ) - properties.endpoints = AAZListType() - properties.start_time = AAZStrType( - serialized_name="startTime", - ) - properties.traffic_flows = AAZListType( - serialized_name="trafficFlows", - ) - - endpoints = cls._schema_on_200.properties.endpoints - endpoints.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.endpoints.Element - _element.endpoint_id = AAZIntType( - serialized_name="endpointId", - ) - _element.resource_id = AAZStrType( - serialized_name="resourceId", - ) - - traffic_flows = cls._schema_on_200.properties.traffic_flows - traffic_flows.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.traffic_flows.Element - _element.latitude = AAZFloatType() - _element.longitude = AAZFloatType() - _element.query_experiences = AAZListType( - serialized_name="queryExperiences", - ) - _element.source_ip = AAZStrType( - serialized_name="sourceIp", - ) - - query_experiences = cls._schema_on_200.properties.traffic_flows.Element.query_experiences - query_experiences.Element = AAZObjectType() - - _element = cls._schema_on_200.properties.traffic_flows.Element.query_experiences.Element - _element.endpoint_id = AAZIntType( - serialized_name="endpointId", - flags={"required": True}, - ) - _element.latency = AAZFloatType() - _element.query_count = AAZIntType( - serialized_name="queryCount", - flags={"required": True}, - ) - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py deleted file mode 100644 index 17d48c5390d..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__cmd_group.py +++ /dev/null @@ -1,23 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command_group( - "network traffic-manager user-metrics-key", -) -class __CMDGroup(AAZCommandGroup): - """Manage Traffic Manager User Metrics Key - """ - pass - - -__all__ = ["__CMDGroup"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py deleted file mode 100644 index 45df27f97a0..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from .__cmd_group import * -from ._create import * -from ._delete import * -from ._show import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py deleted file mode 100644 index 3508608f58c..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_create.py +++ /dev/null @@ -1,151 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "network traffic-manager user-metrics-key create", -) -class Create(AAZCommand): - """Create a subscription-level key used for Real User Metrics collection. - """ - - _aaz_info = { - "version": "2024-04-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerusermetricskeys/default", "2024-04-01-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.TrafficManagerUserMetricsKeysCreateOrUpdate(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class TrafficManagerUserMetricsKeysCreateOrUpdate(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [201]: - return self.on_201(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", - **self.url_parameters - ) - - @property - def method(self): - return "PUT" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2024-04-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_201(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_201 - ) - - _schema_on_201 = None - - @classmethod - def _build_schema_on_201(cls): - if cls._schema_on_201 is not None: - return cls._schema_on_201 - - cls._schema_on_201 = AAZObjectType() - - _schema_on_201 = cls._schema_on_201 - _schema_on_201.id = AAZStrType() - _schema_on_201.name = AAZStrType() - _schema_on_201.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_201.type = AAZStrType() - - properties = cls._schema_on_201.properties - properties.key = AAZStrType() - - return cls._schema_on_201 - - -class _CreateHelper: - """Helper class for Create""" - - -__all__ = ["Create"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py deleted file mode 100644 index 67425f1f57b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_delete.py +++ /dev/null @@ -1,146 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "network traffic-manager user-metrics-key delete", - confirmation="Are you sure you want to perform this operation?", -) -class Delete(AAZCommand): - """Delete a subscription-level key used for Real User Metrics collection. - """ - - _aaz_info = { - "version": "2024-04-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerusermetricskeys/default", "2024-04-01-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.TrafficManagerUserMetricsKeysDelete(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class TrafficManagerUserMetricsKeysDelete(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", - **self.url_parameters - ) - - @property - def method(self): - return "DELETE" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2024-04-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.boolean = AAZBoolType( - flags={"read_only": True}, - ) - - return cls._schema_on_200 - - -class _DeleteHelper: - """Helper class for Delete""" - - -__all__ = ["Delete"] diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py deleted file mode 100644 index a2d52da583b..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/user_metrics_key/_show.py +++ /dev/null @@ -1,151 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "network traffic-manager user-metrics-key show", -) -class Show(AAZCommand): - """Get the subscription-level key used for Real User Metrics collection. - """ - - _aaz_info = { - "version": "2024-04-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/trafficmanagerusermetricskeys/default", "2024-04-01-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.TrafficManagerUserMetricsKeysGet(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class TrafficManagerUserMetricsKeysGet(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default", - **self.url_parameters - ) - - @property - def method(self): - return "GET" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2024-04-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.id = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.properties = AAZObjectType( - flags={"client_flatten": True}, - ) - _schema_on_200.type = AAZStrType() - - properties = cls._schema_on_200.properties - properties.key = AAZStrType() - - return cls._schema_on_200 - - -class _ShowHelper: - """Helper class for Show""" - - -__all__ = ["Show"] diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml new file mode 100644 index 00000000000..387b189e8f8 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml @@ -0,0 +1,51 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - network traffic-manager user-metrics-key create + Connection: + - keep-alive + Content-Length: + - '0' + User-Agent: + - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default?api-version=2024-04-01-preview + response: + body: + string: '{"error":{"code":"BadRequest","message":"Operation input is malformed. + Please retry the request."}}' + headers: + cache-control: + - private + content-length: + - '99' + content-type: + - application/json; charset=utf-8 + date: + - Fri, 05 Jun 2026 20:02:00 GMT + strict-transport-security: + - max-age=31536000; includeSubDomains + x-aspnet-version: + - 4.0.30319 + x-cache: + - CONFIG_NOCACHE + x-content-type-options: + - nosniff + x-ms-operation-identifier: + - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/eastus2/2fba2ced-32b5-4d38-9fc3-3086b609d515 + x-ms-ratelimit-remaining-subscription-resource-requests: + - '799' + x-msedge-ref: + - 'Ref A: E22A1F271A5541C9B9E362D04C84529D Ref B: BL2AA2010205037 Ref C: 2026-06-05T20:01:59Z' + x-powered-by: + - ASP.NET + status: + code: 400 + message: Bad Request +version: 1 From af5d2c5bbf389ba2636361ed136ada7720058776 Mon Sep 17 00:00:00 2001 From: Ranjana Sinha Date: Fri, 5 Jun 2026 16:19:00 -0400 Subject: [PATCH 3/5] Remove stale test recording for user-metrics-key --- ...work_traffic_manager_user_metrics_key.yaml | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml deleted file mode 100644 index 387b189e8f8..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_traffic_manager_user_metrics_key.yaml +++ /dev/null @@ -1,51 +0,0 @@ -interactions: -- request: - body: null - headers: - Accept: - - application/json - Accept-Encoding: - - gzip, deflate - CommandName: - - network traffic-manager user-metrics-key create - Connection: - - keep-alive - Content-Length: - - '0' - User-Agent: - - AZURECLI/2.87.0 azsdk-python-core/1.39.0 Python/3.12.10 (Windows-11-10.0.26200-SP0) - method: PUT - uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/trafficManagerUserMetricsKeys/default?api-version=2024-04-01-preview - response: - body: - string: '{"error":{"code":"BadRequest","message":"Operation input is malformed. - Please retry the request."}}' - headers: - cache-control: - - private - content-length: - - '99' - content-type: - - application/json; charset=utf-8 - date: - - Fri, 05 Jun 2026 20:02:00 GMT - strict-transport-security: - - max-age=31536000; includeSubDomains - x-aspnet-version: - - 4.0.30319 - x-cache: - - CONFIG_NOCACHE - x-content-type-options: - - nosniff - x-ms-operation-identifier: - - tenantId=72f988bf-86f1-41af-91ab-2d7cd011db47,objectId=0ad5f21d-ae69-4b02-ad3f-df93019dc86e/eastus2/2fba2ced-32b5-4d38-9fc3-3086b609d515 - x-ms-ratelimit-remaining-subscription-resource-requests: - - '799' - x-msedge-ref: - - 'Ref A: E22A1F271A5541C9B9E362D04C84529D Ref B: BL2AA2010205037 Ref C: 2026-06-05T20:01:59Z' - x-powered-by: - - ASP.NET - status: - code: 400 - message: Bad Request -version: 1 From 780b49a2a8531f2363b8abd81d66d6f73be98def Mon Sep 17 00:00:00 2001 From: Ranjana Sinha Date: Fri, 5 Jun 2026 16:22:24 -0400 Subject: [PATCH 4/5] Make record_type conditional in create_traffic_manager_profile --- src/azure-cli/azure/cli/command_modules/network/custom.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/network/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index cb169aeb2cc..272cec3aa3b 100644 --- a/src/azure-cli/azure/cli/command_modules/network/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/custom.py @@ -5381,9 +5381,10 @@ def create_traffic_manager_profile(cmd, traffic_manager_profile_name, resource_g "port": monitor_port, "protocol": monitor_protocol, "timeout": timeout, - "max_failures": max_failures, - "record_type": record_type + "max_failures": max_failures } + if record_type is not None: + args["record_type"] = record_type return Create(cli_ctx=cmd.cli_ctx)(command_args=args) From 4c1dc3c1bd1b26b254b7206bc625cbccc5126622 Mon Sep 17 00:00:00 2001 From: Ranjana Sinha Date: Fri, 5 Jun 2026 16:41:26 -0400 Subject: [PATCH 5/5] Remove check-dns-v2 command --- .../traffic_manager/profile/__init__.py | 1 - .../traffic_manager/profile/_check_dns_v2.py | 178 ------------------ 2 files changed, 179 deletions(-) delete mode 100644 src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py index e9b58065516..d028234dbce 100644 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py +++ b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/__init__.py @@ -10,7 +10,6 @@ from .__cmd_group import * from ._check_dns import * -from ._check_dns_v2 import * from ._create import * from ._delete import * from ._list import * diff --git a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py b/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py deleted file mode 100644 index afeb3563585..00000000000 --- a/src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/traffic_manager/profile/_check_dns_v2.py +++ /dev/null @@ -1,178 +0,0 @@ -# -------------------------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# -# Code generated by aaz-dev-tools -# -------------------------------------------------------------------------------------------- - -# pylint: skip-file -# flake8: noqa - -from azure.cli.core.aaz import * - - -@register_command( - "network traffic-manager profile check-dns-v2", -) -class CheckDnsV2(AAZCommand): - """Checks the availability of a Traffic Manager Relative DNS name. - """ - - _aaz_info = { - "version": "2024-04-01-preview", - "resources": [ - ["mgmt-plane", "/subscriptions/{}/providers/microsoft.network/checktrafficmanagernameavailabilityv2", "2024-04-01-preview"], - ] - } - - def _handler(self, command_args): - super()._handler(command_args) - self._execute_operations() - return self._output() - - _args_schema = None - - @classmethod - def _build_arguments_schema(cls, *args, **kwargs): - if cls._args_schema is not None: - return cls._args_schema - cls._args_schema = super()._build_arguments_schema(*args, **kwargs) - - # define Arg Group "" - - # define Arg Group "Parameters" - - _args_schema = cls._args_schema - _args_schema.name = AAZStrArg( - options=["--name"], - arg_group="Parameters", - help="The name of the resource.", - ) - _args_schema.type = AAZStrArg( - options=["--type"], - arg_group="Parameters", - help="The type of the resource.", - ) - return cls._args_schema - - def _execute_operations(self): - self.pre_operations() - self.ProfilesCheckTrafficManagerNameAvailabilityV2(ctx=self.ctx)() - self.post_operations() - - @register_callback - def pre_operations(self): - pass - - @register_callback - def post_operations(self): - pass - - def _output(self, *args, **kwargs): - result = self.deserialize_output(self.ctx.vars.instance, client_flatten=True) - return result - - class ProfilesCheckTrafficManagerNameAvailabilityV2(AAZHttpOperation): - CLIENT_TYPE = "MgmtClient" - - def __call__(self, *args, **kwargs): - request = self.make_request() - session = self.client.send_request(request=request, stream=False, **kwargs) - if session.http_response.status_code in [200]: - return self.on_200(session) - - return self.on_error(session.http_response) - - @property - def url(self): - return self.client.format_url( - "/subscriptions/{subscriptionId}/providers/Microsoft.Network/checkTrafficManagerNameAvailabilityV2", - **self.url_parameters - ) - - @property - def method(self): - return "POST" - - @property - def error_format(self): - return "ODataV4Format" - - @property - def url_parameters(self): - parameters = { - **self.serialize_url_param( - "subscriptionId", self.ctx.subscription_id, - required=True, - ), - } - return parameters - - @property - def query_parameters(self): - parameters = { - **self.serialize_query_param( - "api-version", "2024-04-01-preview", - required=True, - ), - } - return parameters - - @property - def header_parameters(self): - parameters = { - **self.serialize_header_param( - "Content-Type", "application/json", - ), - **self.serialize_header_param( - "Accept", "application/json", - ), - } - return parameters - - @property - def content(self): - _content_value, _builder = self.new_content_builder( - self.ctx.args, - typ=AAZObjectType, - typ_kwargs={"flags": {"required": True, "client_flatten": True}} - ) - _builder.set_prop("name", AAZStrType, ".name") - _builder.set_prop("type", AAZStrType, ".type") - - return self.serialize_content(_content_value) - - def on_200(self, session): - data = self.deserialize_http_content(session) - self.ctx.set_var( - "instance", - data, - schema_builder=self._build_schema_on_200 - ) - - _schema_on_200 = None - - @classmethod - def _build_schema_on_200(cls): - if cls._schema_on_200 is not None: - return cls._schema_on_200 - - cls._schema_on_200 = AAZObjectType() - - _schema_on_200 = cls._schema_on_200 - _schema_on_200.message = AAZStrType() - _schema_on_200.name = AAZStrType() - _schema_on_200.name_available = AAZBoolType( - serialized_name="nameAvailable", - ) - _schema_on_200.reason = AAZStrType() - _schema_on_200.type = AAZStrType() - - return cls._schema_on_200 - - -class _CheckDnsV2Helper: - """Helper class for CheckDnsV2""" - - -__all__ = ["CheckDnsV2"]