Skip to content
Merged
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 @@ -2,3 +2,6 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
from azure.cli.core.breaking_change import register_argument_deprecate
register_argument_deprecate('netappfiles volume create', '--endpoint-type')
register_argument_deprecate('netappfiles volume update', '--endpoint-type')
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class CheckFilePathAvailability(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/checkfilepathavailability", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/checkfilepathavailability", "2025-06-01"],
]
}

Expand Down Expand Up @@ -132,7 +132,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class CheckNameAvailability(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/checknameavailability", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/checknameavailability", "2025-06-01"],
]
}

Expand Down Expand Up @@ -133,7 +133,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ class CheckQuotaAvailability(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/checkquotaavailability", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/checkquotaavailability", "2025-06-01"],
]
}

Expand Down Expand Up @@ -133,7 +133,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class QueryNetworkSiblingSet(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/querynetworksiblingset", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/querynetworksiblingset", "2025-06-01"],
]
}

Expand Down Expand Up @@ -134,7 +134,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class UpdateNetworkSiblingSet(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/updatenetworksiblingset", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/locations/{}/updatenetworksiblingset", "2025-06-01"],
]
}

Expand Down Expand Up @@ -165,7 +165,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class ChangeKeyVault(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}/changekeyvault", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}/changekeyvault", "2025-06-01"],
]
}

Expand Down Expand Up @@ -167,7 +167,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=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": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}", "2025-06-01"],
]
}

Expand Down Expand Up @@ -123,18 +123,33 @@ def _build_arguments_schema(cls, *args, **kwargs):
# define Arg Group "Identity"

_args_schema = cls._args_schema
_args_schema.mi_system_assigned = AAZStrArg(
options=["--system-assigned", "--mi-system-assigned"],
arg_group="Identity",
help="Set the system managed identity.",
blank="True",
)
_args_schema.identity_type = AAZStrArg(
options=["--type", "--identity-type"],
arg_group="Identity",
help="Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).",
enum={"None": "None", "SystemAssigned": "SystemAssigned", "SystemAssigned,UserAssigned": "SystemAssigned,UserAssigned", "UserAssigned": "UserAssigned"},
)
_args_schema.mi_user_assigned = AAZListArg(
options=["--user-assigned", "--mi-user-assigned"],
arg_group="Identity",
help="Set the user managed identities.",
blank=[],
)
_args_schema.user_assigned_identities = AAZDictArg(
options=["--user-ids", "--user-assigned-identities"],
arg_group="Identity",
help="The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.",
)

mi_user_assigned = cls._args_schema.mi_user_assigned
mi_user_assigned.Element = AAZStrArg()

user_assigned_identities = cls._args_schema.user_assigned_identities
user_assigned_identities.Element = AAZObjectArg(
nullable=True,
Expand Down Expand Up @@ -401,7 +416,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand All @@ -426,7 +441,7 @@ def content(self):
typ=AAZObjectType,
typ_kwargs={"flags": {"required": True, "client_flatten": True}}
)
_builder.set_prop("identity", AAZObjectType)
_builder.set_prop("identity", AAZIdentityObjectType)
_builder.set_prop("location", AAZStrType, ".location", typ_kwargs={"flags": {"required": True}})
_builder.set_prop("properties", AAZObjectType, typ_kwargs={"flags": {"client_flatten": True}})
_builder.set_prop("tags", AAZDictType, ".tags")
Expand All @@ -435,11 +450,17 @@ def content(self):
if identity is not None:
identity.set_prop("type", AAZStrType, ".identity_type", typ_kwargs={"flags": {"required": True}})
identity.set_prop("userAssignedIdentities", AAZDictType, ".user_assigned_identities")
identity.set_prop("userAssigned", AAZListType, ".mi_user_assigned", typ_kwargs={"flags": {"action": "create"}})
identity.set_prop("systemAssigned", AAZStrType, ".mi_system_assigned", typ_kwargs={"flags": {"action": "create"}})

user_assigned_identities = _builder.get(".identity.userAssignedIdentities")
if user_assigned_identities is not None:
user_assigned_identities.set_elements(AAZObjectType, ".", typ_kwargs={"nullable": True})

user_assigned = _builder.get(".identity.userAssigned")
if user_assigned is not None:
user_assigned.set_elements(AAZStrType, ".")

properties = _builder.get(".properties")
if properties is not None:
properties.set_prop("activeDirectories", AAZListType, ".active_directories")
Expand Down Expand Up @@ -539,7 +560,7 @@ def _build_schema_on_200_201(cls):
_schema_on_200_201.id = AAZStrType(
flags={"read_only": True},
)
_schema_on_200_201.identity = AAZObjectType()
_schema_on_200_201.identity = AAZIdentityObjectType()
_schema_on_200_201.location = AAZStrType(
flags={"required": True},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class Delete(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}", "2025-06-01"],
]
}

Expand Down Expand Up @@ -146,7 +146,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class GetKeyVaultStatus(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}/getkeyvaultstatus", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts/{}/getkeyvaultstatus", "2025-06-01"],
]
}

Expand Down Expand Up @@ -140,7 +140,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class List(AAZCommand):
"""

_aaz_info = {
"version": "2025-01-01",
"version": "2025-06-01",
"resources": [
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/netappaccounts", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts", "2025-01-01"],
["mgmt-plane", "/subscriptions/{}/providers/microsoft.netapp/netappaccounts", "2025-06-01"],
["mgmt-plane", "/subscriptions/{}/resourcegroups/{}/providers/microsoft.netapp/netappaccounts", "2025-06-01"],
]
}

Expand All @@ -51,12 +51,12 @@ def _build_arguments_schema(cls, *args, **kwargs):

def _execute_operations(self):
self.pre_operations()
condition_0 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
condition_1 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_0 = has_value(self.ctx.subscription_id) and has_value(self.ctx.args.resource_group) is not True
condition_1 = has_value(self.ctx.args.resource_group) and has_value(self.ctx.subscription_id)
if condition_0:
self.AccountsList(ctx=self.ctx)()
if condition_1:
self.AccountsListBySubscription(ctx=self.ctx)()
if condition_1:
self.AccountsList(ctx=self.ctx)()
self.post_operations()

@register_callback
Expand All @@ -72,7 +72,7 @@ def _output(self, *args, **kwargs):
next_link = self.deserialize_output(self.ctx.vars.instance.next_link)
return result, next_link

class AccountsList(AAZHttpOperation):
class AccountsListBySubscription(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -86,7 +86,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts",
"/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts",
**self.url_parameters
)

Expand All @@ -101,10 +101,6 @@ def error_format(self):
@property
def url_parameters(self):
parameters = {
**self.serialize_url_param(
"resourceGroupName", self.ctx.args.resource_group,
required=True,
),
**self.serialize_url_param(
"subscriptionId", self.ctx.subscription_id,
required=True,
Expand All @@ -116,7 +112,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down Expand Up @@ -164,7 +160,7 @@ def _build_schema_on_200(cls):
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.identity = AAZObjectType()
_element.identity = AAZIdentityObjectType()
_element.location = AAZStrType(
flags={"required": True},
)
Expand Down Expand Up @@ -390,7 +386,7 @@ def _build_schema_on_200(cls):

return cls._schema_on_200

class AccountsListBySubscription(AAZHttpOperation):
class AccountsList(AAZHttpOperation):
CLIENT_TYPE = "MgmtClient"

def __call__(self, *args, **kwargs):
Expand All @@ -404,7 +400,7 @@ def __call__(self, *args, **kwargs):
@property
def url(self):
return self.client.format_url(
"/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts",
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts",
**self.url_parameters
)

Expand All @@ -419,6 +415,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,
Expand All @@ -430,7 +430,7 @@ def url_parameters(self):
def query_parameters(self):
parameters = {
**self.serialize_query_param(
"api-version", "2025-01-01",
"api-version", "2025-06-01",
required=True,
),
}
Expand Down Expand Up @@ -478,7 +478,7 @@ def _build_schema_on_200(cls):
_element.id = AAZStrType(
flags={"read_only": True},
)
_element.identity = AAZObjectType()
_element.identity = AAZIdentityObjectType()
_element.location = AAZStrType(
flags={"required": True},
)
Expand Down
Loading
Loading