Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<unique-dns-name>.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)])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
]
}

Expand Down Expand Up @@ -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,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
]
}

Expand Down Expand Up @@ -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,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
]
}

Expand Down Expand Up @@ -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,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
]
}

Expand Down Expand Up @@ -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,
),
}
Expand Down Expand Up @@ -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,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
]
}

Expand Down Expand Up @@ -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,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "/"
Expand All @@ -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"],
]
}

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
),
}
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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"

Expand Down Expand Up @@ -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,
),
}
Expand Down
Loading
Loading