Skip to content

Commit

Permalink
Change parameter names to be shorter
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesvoongms committed Nov 15, 2024
1 parent 48fc4f3 commit 0e9a235
Show file tree
Hide file tree
Showing 23 changed files with 1,678 additions and 1,491 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Create(AAZCommand):
"""Create a DNS security rule for a DNS resolver policy.
:example: Upsert DNS security rule
az dns-resolver policy dns-security-rule create --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsResolverPolicy --dns-security-rule-name sampleDnsSecurityRule --location westus2 --tags "{key1:value1}" --priority 100 --action "{action-type:Block,block-response-code:SERVFAIL}" --dns-resolver-domain-lists "[{id:/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolverDomainLists/sampleDnsResolverDomainList}]" --dns-security-rule-state Enabled
az dns-resolver policy dns-security-rule create --resource-group sampleResourceGroup --policy-name sampleDnsResolverPolicy --dns-security-rule-name sampleDnsSecurityRule --location westus2 --tags "{key1:value1}" --priority 100 --action "{action-type:Block,block-response-code:SERVFAIL}" --domain-lists "[{id:/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolverDomainLists/sampleDnsResolverDomainList}]" --rule-state Enabled
"""

_aaz_info = {
Expand Down Expand Up @@ -53,8 +53,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--if-none-match"],
help="Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.",
)
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -106,14 +106,14 @@ def _build_arguments_schema(cls, *args, **kwargs):
help="The action to take on DNS requests that match the DNS security rule.",
required=True,
)
_args_schema.dns_resolver_domain_lists = AAZListArg(
options=["--dns-resolver-domain-lists"],
_args_schema.domain_lists = AAZListArg(
options=["--domain-lists"],
arg_group="Properties",
help="DNS resolver policy domains lists that the DNS security rule applies to.",
required=True,
)
_args_schema.dns_security_rule_state = AAZStrArg(
options=["--dns-security-rule-state"],
_args_schema.rule_state = AAZStrArg(
options=["--rule-state"],
arg_group="Properties",
help="The state of DNS security rule.",
enum={"Disabled": "Disabled", "Enabled": "Enabled"},
Expand All @@ -137,10 +137,10 @@ def _build_arguments_schema(cls, *args, **kwargs):
enum={"SERVFAIL": "SERVFAIL"},
)

dns_resolver_domain_lists = cls._args_schema.dns_resolver_domain_lists
dns_resolver_domain_lists.Element = AAZObjectArg()
domain_lists = cls._args_schema.domain_lists
domain_lists.Element = AAZObjectArg()

_element = cls._args_schema.dns_resolver_domain_lists.Element
_element = cls._args_schema.domain_lists.Element
_element.id = AAZStrArg(
options=["id"],
help="Resource ID.",
Expand Down Expand Up @@ -211,7 +211,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down Expand Up @@ -271,8 +271,8 @@ def content(self):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("action", AAZObjectType, ".action", typ_kwargs={"flags": {"required": True}})
properties.set_prop("dnsResolverDomainLists", AAZListType, ".dns_resolver_domain_lists", typ_kwargs={"flags": {"required": True}})
properties.set_prop("dnsSecurityRuleState", AAZStrType, ".dns_security_rule_state")
properties.set_prop("dnsResolverDomainLists", AAZListType, ".domain_lists", typ_kwargs={"flags": {"required": True}})
properties.set_prop("dnsSecurityRuleState", AAZStrType, ".rule_state")
properties.set_prop("priority", AAZIntType, ".priority", typ_kwargs={"flags": {"required": True}})

action = _builder.get(".properties.action")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Delete(AAZCommand):
"""Delete a DNS security rule for a DNS resolver policy. WARNING: This operation cannot be undone.
:example: Delete DNS security rule for DNS resolver policy
az dns-resolver policy dns-security-rule delete --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsDnsResolverPolicy --dns-security-rule-name sampleDnsSecurityRule
az dns-resolver policy dns-security-rule delete --resource-group sampleResourceGroup --policy-name sampleDnsDnsResolverPolicy --dns-security-rule-name sampleDnsSecurityRule
"""

_aaz_info = {
Expand Down Expand Up @@ -50,8 +50,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--if-match"],
help="ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes.",
)
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
id_part="name",
Expand Down Expand Up @@ -145,7 +145,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class List(AAZCommand):
"""List DNS security rules for a DNS resolver policy.
:example: List DNS security rules by DNS resolver policy
az dns-resolver policy dns-security-rule list --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsResolverPolicy
az dns-resolver policy dns-security-rule list --resource-group sampleResourceGroup --policy-name sampleDnsResolverPolicy
"""

_aaz_info = {
Expand All @@ -45,8 +45,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -112,7 +112,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Show(AAZCommand):
"""Get properties of a DNS security rule for a DNS resolver policy.
:example: Retrieve DNS security rule for DNS resolver policy
az dns-resolver policy dns-security-rule show --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsResolverPolicy --dns-security-rule-name sampleDnsSecurityRule
az dns-resolver policy dns-security-rule show --resource-group sampleResourceGroup --policy-name sampleDnsResolverPolicy --dns-security-rule-name sampleDnsSecurityRule
"""

_aaz_info = {
Expand All @@ -44,8 +44,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
id_part="name",
Expand Down Expand Up @@ -118,7 +118,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Update(AAZCommand):
"""Update a DNS security rule for a DNS resolver policy.
:example: Update a DNS security rule
az dns-resolver policy dns-security-rule update --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsResolverPolicy --dns-security-rule-name sampleDnsSecurityRule --location westus2 --tags "{key2:value2}" --priority 100 --action "{action-type:Block,block-response-code:SERVFAIL}" --dns-resolver-domain-lists "[{id:/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolverDomainLists/sampleDnsResolverDomainList}]" --dns-security-rule-state Disabled
az dns-resolver policy dns-security-rule update --resource-group sampleResourceGroup --policy-name sampleDnsResolverPolicy --rule-name sampleDnsSecurityRule --location westus2 --tags "{key2:value2}" --priority 100 --action "{action-type:Block,block-response-code:SERVFAIL}" --domain-lists "[{id:/subscriptions/abdd4249-9f34-4cc6-8e42-c2e32110603e/resourceGroups/sampleResourceGroup/providers/Microsoft.Network/dnsResolverDomainLists/sampleDnsResolverDomainList}]" --rule-state Disabled
"""

_aaz_info = {
Expand Down Expand Up @@ -55,8 +55,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--if-none-match"],
help="Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.",
)
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
id_part="name",
Expand Down Expand Up @@ -104,13 +104,13 @@ def _build_arguments_schema(cls, *args, **kwargs):
arg_group="Properties",
help="The action to take on DNS requests that match the DNS security rule.",
)
_args_schema.dns_resolver_domain_lists = AAZListArg(
options=["--dns-resolver-domain-lists"],
_args_schema.domain_lists = AAZListArg(
options=["--domain-lists"],
arg_group="Properties",
help="DNS resolver policy domains lists that the DNS security rule applies to.",
)
_args_schema.dns_security_rule_state = AAZStrArg(
options=["--dns-security-rule-state"],
_args_schema.rule_state = AAZStrArg(
options=["--rule-state"],
arg_group="Properties",
help="The state of DNS security rule.",
nullable=True,
Expand All @@ -136,12 +136,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
enum={"SERVFAIL": "SERVFAIL"},
)

dns_resolver_domain_lists = cls._args_schema.dns_resolver_domain_lists
dns_resolver_domain_lists.Element = AAZObjectArg(
domain_lists = cls._args_schema.domain_lists
domain_lists.Element = AAZObjectArg(
nullable=True,
)

_element = cls._args_schema.dns_resolver_domain_lists.Element
_element = cls._args_schema.domain_lists.Element
_element.id = AAZStrArg(
options=["id"],
help="Resource ID.",
Expand Down Expand Up @@ -208,7 +208,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down Expand Up @@ -311,7 +311,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down Expand Up @@ -403,8 +403,8 @@ def _update_instance(self, instance):
properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("action", AAZObjectType, ".action", typ_kwargs={"flags": {"required": True}})
properties.set_prop("dnsResolverDomainLists", AAZListType, ".dns_resolver_domain_lists", typ_kwargs={"flags": {"required": True}})
properties.set_prop("dnsSecurityRuleState", AAZStrType, ".dns_security_rule_state")
properties.set_prop("dnsResolverDomainLists", AAZListType, ".domain_lists", typ_kwargs={"flags": {"required": True}})
properties.set_prop("dnsSecurityRuleState", AAZStrType, ".rule_state")
properties.set_prop("priority", AAZIntType, ".priority", typ_kwargs={"flags": {"required": True}})

action = _builder.get(".properties.action")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
id_part="name",
Expand Down Expand Up @@ -114,7 +114,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Create(AAZCommand):
"""Create a DNS resolver policy virtual network link.
:example: Upsert DNS resolver policy virtual network link
az dns-resolver policy vnet-link create --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsResolverPolicy --dns-resolver-policy-virtual-network-link-name sampleVirtualNetworkLink --location westus2 --tags "{key1:value1}" --virtual-network "{id:/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork}"
az dns-resolver policy vnet-link create --resource-group sampleResourceGroup --policy-name sampleDnsResolverPolicy --dns-resolver-policy-virtual-network-link-name sampleVirtualNetworkLink --location westus2 --tags "{key1:value1}" --virtual-network "{id:/subscriptions/0403cfa9-9659-4f33-9f30-1f191c51d111/resourceGroups/sampleVnetResourceGroupName/providers/Microsoft.Network/virtualNetworks/sampleVirtualNetwork}"
"""

_aaz_info = {
Expand Down Expand Up @@ -53,8 +53,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--if-none-match"],
help="Set to '*' to allow a new resource to be created, but to prevent updating an existing resource. Other values will be ignored.",
)
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -178,7 +178,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Delete(AAZCommand):
"""Delete a DNS resolver policy virtual network link. WARNING: This operation cannot be undone.
:example: Delete DNS resolver policy virtual network link
az dns-resolver policy dns-resolver-policy-link delete --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsResolverPolicy --dns-resolver-policy-virtual-network-link-name sampleVirtualNetworkLink
az dns-resolver policy dns-resolver-policy-link delete --resource-group sampleResourceGroup --policy-name sampleDnsResolverPolicy --dns-resolver-policy-virtual-network-link-name sampleVirtualNetworkLink
"""

_aaz_info = {
Expand Down Expand Up @@ -50,8 +50,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
options=["--if-match"],
help="ETag of the resource. Omit this value to always overwrite the current resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent changes.",
)
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
id_part="name",
Expand Down Expand Up @@ -145,7 +145,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class List(AAZCommand):
"""List DNS resolver policy virtual network links.
:example: List DNS resolver policy virtual network links by DNS resolver policy
az dns-resolver policy dns-resolver-policy-link list --resource-group sampleResourceGroup --dns-resolver-policy-name sampleDnsResolverPolicy
az dns-resolver policy dns-resolver-policy-link list --resource-group sampleResourceGroup --policy-name sampleDnsResolverPolicy
"""

_aaz_info = {
Expand All @@ -45,8 +45,8 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group ""

_args_schema = cls._args_schema
_args_schema.dns_resolver_policy_name = AAZStrArg(
options=["--dns-resolver-policy-name"],
_args_schema.policy_name = AAZStrArg(
options=["--policy-name"],
help="The name of the DNS resolver policy.",
required=True,
fmt=AAZStrArgFormat(
Expand Down Expand Up @@ -112,7 +112,7 @@ def error_format(self):
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"dnsResolverPolicyName", self.ctx.args.dns_resolver_policy_name,
"dnsResolverPolicyName", self.ctx.args.policy_name,
required=True,
),
**self.serialize_url_param(
Expand Down
Loading

0 comments on commit 0e9a235

Please sign in to comment.