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/_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/_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/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index 2813ad8cd04..272cec3aa3b 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 = '/' @@ -5382,6 +5383,8 @@ def create_traffic_manager_profile(cmd, traffic_manager_profile_name, resource_g "timeout": timeout, "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) @@ -5390,7 +5393,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 +5426,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):