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 @@ -46,3 +46,7 @@ def backup_policies_mgmt_client_factory(cli_ctx, _):

def vaults_mgmt_client_factory(cli_ctx, _):
return cf_netappfiles(cli_ctx).vaults


def subvolumes_mgmt_client_factory(cli_ctx, _):
return cf_netappfiles(cli_ctx).subvolumes
186 changes: 176 additions & 10 deletions src/azure-cli/azure/cli/command_modules/netappfiles/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,27 @@
- name: --server-root-ca-cert
short-summary: When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes.
- name: --backup-operators
short-summary: Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier
short-summary: Users to be added to the Built-in Backup Operator active directory group. A space separated string of unique usernames without domain specifier
- name: --aes-encryption
short-summary: If enabled, AES encryption will be enabled for SMB communication
- name: --ldap-signing
short-summary: Specifies whether or not the LDAP traffic needs to be signed
- name: --security-operators
short-summary: Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier
short-summary: Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A space seperated list of unique usernames without domain specifier
- name: --ldap-over-tls
short-summary: Specifies whether or not the LDAP traffic needs to be secured via TLS
- name: --allow-local-ldap-users
short-summary: If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes
- name: --administrators
short-summary: Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier.
short-summary: Users to be added to the Built-in Administrators active directory group. A space seperated string of unique usernames without domain specifier.
- name: --encrypt-dc-conn
short-summary: If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted
- name: --user-dn
short-summary: This specifies the user DN, which overrides the base DN for user lookups
- name: --group-dn
short-summary: This specifies the group DN, which overrides the base DN for group lookups
- name: --group-filter
short-summary: This specifies the custom LDAP search filter to be used when looking up group membership from LDAP server
examples:
- name: Add an active directory to the account
text: >
Expand Down Expand Up @@ -95,21 +101,27 @@
- name: --server-root-ca-cert
short-summary: When LDAP over SSL/TLS is enabled, the LDAP client is required to have base64 encoded Active Directory Certificate Service's self-signed root CA certificate, this optional parameter is used only for dual protocol with LDAP user-mapping volumes.
- name: --backup-operators
short-summary: Users to be added to the Built-in Backup Operator active directory group. A list of unique usernames without domain specifier
short-summary: Users to be added to the Built-in Backup Operator active directory group. A space seperated list of unique usernames without domain specifier
- name: --aes-encryption
short-summary: If enabled, AES encryption will be enabled for SMB communication
- name: --ldap-signing
short-summary: Specifies whether or not the LDAP traffic needs to be signed
- name: --security-operators
short-summary: Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A list of unique usernames without domain specifier
short-summary: Domain Users in the Active directory to be given SeSecurityPrivilege privilege (Needed for SMB Continuously available shares for SQL). A space seperated list of unique usernames without domain specifier
- name: --ldap-over-tls
short-summary: Specifies whether or not the LDAP traffic needs to be secured via TLS
- name: --allow-local-ldap-users
short-summary: If enabled, NFS client local users can also (in addition to LDAP users) access the NFS volumes
- name: --administrators
short-summary: Users to be added to the Built-in Administrators active directory group. A list of unique usernames without domain specifier.
short-summary: Users to be added to the Built-in Administrators active directory group. A space seperated list of unique usernames without domain specifier.
- name: --encrypt-dc-conn
short-summary: If enabled, Traffic between the SMB server to Domain Controller (DC) will be encrypted
- name: --user-dn
short-summary: This specifies the user DN, which overrides the base DN for user lookups.
- name: --group-dn
short-summary: This specifies the group DN, which overrides the base DN for group lookups.
- name: --group-filter
short-summary: This specifies the custom LDAP search filter to be used when looking up group membership from LDAP server.
examples:
- name: Update an active directory on the account
text: >
Expand Down Expand Up @@ -513,6 +525,28 @@
az netappfiles snapshot show -g mygroup --account-name myaccname --pool-name mypoolname --volume-name myvolname --name mysnapname
"""

helps['netappfiles snapshot restore-files'] = """
type: command
short-summary: Restore specified files from the specified snapshot to the active filesystem.
parameters:
- name: --account-name -a
short-summary: The name of the ANF account
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --volume-name -v
short-summary: The name of the ANF volume
- name: --name --snapshot-name -n -s
short-summary: The name of the ANF snapshot
- name: --file-paths
short-summary: Required. A space seperated string of filed to be restored
- name: --destination-path
short-summary: Destination folder where the files will be restored
examples:
- name: Restore files from snapshot
text: >
az netappfiles snapshot restore-files -g mygroup --account-name myaccname --pool-name mypoolname --volume-name myvolname --name mysnapname --file-paths myfilepaths
"""

helps['netappfiles volume'] = """
type: group
short-summary: Manage Azure NetApp Files (ANF) Volume Resources.
Expand Down Expand Up @@ -622,6 +656,8 @@
short-summary: Specifies whether the volume is enabled for Azure VMware Solution (AVS) datastore purpose. Possible values are Enabled and Disabled. Default value is Disabled.
- name: --network-features
short-summary: Basic network, or Standard features available to the volume. Possible values are Basic and Standard. Default value is Basic.
- name: --enable-subvolumes
short-summary: Flag indicating whether subvolume operations are enabled on the volume. Possible values are Enabled and Disabled. Default value is Disabled
examples:
- name: Create an ANF volume
text: >
Expand All @@ -638,6 +674,8 @@
short-summary: The name of the ANF pool
- name: --name --volume-name -n -v
short-summary: The name of the ANF volume
- name: --force-delete
short-summary: An option to force delete the volume. Will cleanup resources connected to the particular volume.
examples:
- name: Delete an ANF volume
text: >
Expand Down Expand Up @@ -912,11 +950,13 @@
- name: --is-def-quota-enabled
short-summary: Specifies if default quota is enabled for the volume.
- name: --default-user-quota
short-summary: Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies.
short-summary: Default user quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies
- name: --default-group-quota
short-summary: Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies.
short-summary: Default group quota for volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies
- name: --throughput-mibps
short-summary: Maximum throughput in Mibps that can be achieved by this volume and this will be accepted as input only for manual qosType volume.
short-summary: Maximum throughput in Mibps that can be achieved by this volume and this will be accepted as input only for manual qosType volume
- name: --unix-permissions
short-summary: UNIX permissions for NFS volume accepted in octal 4 digit format. First digit selects the set user ID(4), set group ID (2) and sticky (1) attributes. Second digit selects permission for the owner of the file- read (4), write (2) and execute (1). Third selects permissions for other users in the same group. the fourth for other users not in the group. 0755 - gives read/write/execute permissions to owner and read/execute to group and other users.
examples:
- name: Update an ANF volume
text: >
Expand Down Expand Up @@ -1009,7 +1049,7 @@
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --name --volume-name -n -v
short-summary: The name of the ANF pool
short-summary: The name of the ANF volume
examples:
- name: Returns the backup status of the given ANF Volume
text: >
Expand Down Expand Up @@ -1216,3 +1256,129 @@
text: >
az netappfiles vault list -g mygroup --account-name myname
"""

helps['netappfiles subvolume'] = """
type: group
short-summary: Manage Azure NetApp Files (ANF) Subvolume Resources.
"""

helps['netappfiles subvolume create'] = """
type: command
short-summary: Create a subvolume in the specified path or clones the subvolume specified in the parentPath
parameters:
- name: --account-name -a
short-summary: The name of the ANF account
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --volume-name -v
short-summary: The name of the ANF volume
- name: --subvolume-name
short-summary: The name of the ANF subvolume
- name: --path
short-summary: Path to the subvolume
- name: --size
short-summary: Size of the subvolume
- name: --parent-path
short-summary: Path to the parent subvolume
examples:
- name: Create a ANF subvolume
text: >
az netappfiles subvolume create -g mygroup --account-name myaccountname --pool-name mypoolname --volume-name myvolumename --subvolume-name mysubvolumename
"""

helps['netappfiles subvolume update'] = """
type: command
short-summary: Update a specified ANF subvolume.
parameters:
- name: --account-name -a
short-summary: The name of the ANF account
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --volume-name -v
short-summary: The name of the ANF volume
- name: --subvolume-name
short-summary: The name of the ANF subvolume
- name: --path
short-summary: Path to the subvolume
- name: --size
short-summary: Size of the subvolume
examples:
- name: Update a subvolume
text: >
az netappfiles subvolume update -g mygroup --account-name myaccountname --pool-name mypoolname --volume-name myvolumename --subvolume-name mysubvolumename
"""

helps['netappfiles subvolume list'] = """
type: command
short-summary: List all ANF subvolumes in the specified NetApp volume.
parameters:
- name: --account-name -a
short-summary: The name of the ANF account
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --volume-name -v
short-summary: The name of the ANF volume
examples:
- name: List all subvolumes of a ANF volume
text: >
az netappfiles subvolume list -g mygroup --account-name myaccountname --pool-name mypoolname --volume-name myvolumename
"""

helps['netappfiles subvolume show'] = """
type: command
short-summary: Get the path associated with a subvolumeName
parameters:
- name: --account-name -a
short-summary: The name of the ANF account
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --volume-name -v
short-summary: The name of the ANF volume
- name: --subvolume-name
short-summary: The name of the ANF subvolume
examples:
- name: Get a subvolume of the ANF volume
text: >
az netappfiles subvolume show -g mygroup --account-name myaccountname --pool-name mypoolname --volume-name myvolumename --subvolume-name mysubvolumename
"""

helps['netappfiles subvolume delete'] = """
type: command
short-summary: Delete a specified ANF subvolume.
parameters:
- name: --account-name -a
short-summary: The name of the ANF account
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --volume-name -v
short-summary: The name of the ANF volume
- name: --subvolume-name
short-summary: The name of the ANF subvolume
examples:
- name: Delete a subvolume of the ANF volume
text: >
az netappfiles subvolume delete -g mygroup --account-name myaccountname --pool-name mypoolname --volume-name myvolumename --subvolume-name mysubvolumename
"""

helps['netappfiles subvolume metadata'] = """
type: group
short-summary: Manage Azure NetApp Files (ANF) Subvolume Metadata Resources.
"""

helps['netappfiles subvolume metadata show'] = """
type: command
short-summary: Get the specified ANF metadata of a subvolume.
parameters:
- name: --account-name -a
short-summary: The name of the ANF account
- name: --pool-name -p
short-summary: The name of the ANF pool
- name: --volume-name -v
short-summary: The name of the ANF volume
- name: --subvolume-name
short-summary: The name of the ANF subvolume
examples:
- name: Get a metadata of an ANF subvolume
text: >
az netappfiles subvolume metadata show -g mygroup --account-name myaccountname --pool-name mypoolname --volume-name myvolumename --subvolume-name mysubvolumename
"""
48 changes: 35 additions & 13 deletions src/azure-cli/azure/cli/command_modules/netappfiles/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

# pylint: disable=line-too-long
# pylint: disable=line-too-long, disable=too-many-statements
from azure.cli.core.commands.parameters import tags_type, resource_group_name_type, get_enum_type, get_three_state_flag
from knack.arguments import CLIArgumentType

Expand All @@ -16,7 +16,7 @@ def load_arguments(self, _):
with self.argument_context('netappfiles') as c:
c.argument('resource_group', resource_group_name_type)
c.argument('tags', arg_type=tags_type)
c.argument('protocol_types', arg_type=tags_type)
c.argument('protocol_types', nargs="+")
c.argument('account_name', account_name_type)
c.argument('pool_name', pool_name_type)
c.argument('volume_name', volume_name_type)
Expand All @@ -32,10 +32,13 @@ def load_arguments(self, _):
c.argument('account_name', help='The name of the ANF account', id_part=None)

with self.argument_context('netappfiles account ad') as c:
c.argument('backup_operators', arg_type=tags_type)
c.argument('security_operators', arg_type=tags_type)
c.argument('allow_local_ldap_users', arg_type=tags_type)
c.argument('backup_operators', nargs="+")
c.argument('security_operators', nargs="+")
c.argument('administrators', nargs="+")
c.argument('allow_local_ldap_users', arg_type=get_three_state_flag())
c.argument('encrypt_dc_conn', options_list=['--encrypt-dc-conn'], arg_type=get_three_state_flag())
c.argument('ldap_signing', arg_type=get_three_state_flag())
c.argument('aes_encryption', arg_type=get_three_state_flag())

with self.argument_context('netappfiles account ad list') as c:
c.argument('account_name', help='The name of the ANF account', id_part=None)
Expand All @@ -54,13 +57,14 @@ def load_arguments(self, _):
with self.argument_context('netappfiles account backup') as c:
c.argument('account_name', account_name_type, id_part=None)

load_poolArguments(self, account_name_type, pool_name_type)
load_volumeArguments(self, account_name_type, pool_name_type, volume_name_type)
load_snapshotArguments(self, account_name_type, pool_name_type, volume_name_type)
load_vaultArguments(self, account_name_type)
load_pool_arguments(self, account_name_type, pool_name_type)
load_volume_arguments(self, account_name_type, pool_name_type, volume_name_type)
load_snapshot_arguments(self, account_name_type, pool_name_type, volume_name_type)
load_vault_arguments(self, account_name_type)
load_subvolume_arguments(self, account_name_type, pool_name_type, volume_name_type)


def load_poolArguments(self, account_name_type, pool_name_type):
def load_pool_arguments(self, account_name_type, pool_name_type):
with self.argument_context('netappfiles pool') as c:
c.argument('account_name', id_part='name')
c.argument('pool_name', pool_name_type, options_list=['--pool-name', '-p', '--name', '-n'])
Expand All @@ -70,7 +74,7 @@ def load_poolArguments(self, account_name_type, pool_name_type):
c.argument('account_name', account_name_type, id_part=None)


def load_volumeArguments(self, account_name_type, pool_name_type, volume_name_type):
def load_volume_arguments(self, account_name_type, pool_name_type, volume_name_type):
with self.argument_context('netappfiles volume') as c:
c.argument('account_name', id_part='name')
c.argument('pool_name', pool_name_type)
Expand All @@ -87,6 +91,9 @@ def load_volumeArguments(self, account_name_type, pool_name_type, volume_name_ty
c.argument('cool_access', arg_type=get_three_state_flag())
c.argument('is_def_quota_enabled', arg_type=get_three_state_flag())

with self.argument_context('netappfiles volume delete') as c:
c.argument('force_delete', arg_type=get_three_state_flag())

with self.argument_context('netappfiles volume list') as c:
c.argument('account_name', account_name_type, id_part=None)
c.argument('pool_name', options_list=['--pool-name', '-p'], help='Name of the ANF pool.', id_part=None)
Expand Down Expand Up @@ -131,12 +138,13 @@ def load_volumeArguments(self, account_name_type, pool_name_type, volume_name_ty
c.argument('backup_name', options_list=['--backup-name', '-b'], id_part=None)


def load_snapshotArguments(self, account_name_type, pool_name_type, volume_name_type):
def load_snapshot_arguments(self, account_name_type, pool_name_type, volume_name_type):
with self.argument_context('netappfiles snapshot') as c:
c.argument('account_name', account_name_type)
c.argument('pool_name', pool_name_type)
c.argument('volume_name', volume_name_type)
c.argument('snapshot_name', id_part='child_name_3', options_list=['--name', '--snapshot-name', '-n', '-s'], help='The name of the ANF snapshot')
c.argument('file_paths', nargs="+")

with self.argument_context('netappfiles snapshot list') as c:
c.argument('account_name', account_name_type, id_part=None)
Expand All @@ -155,6 +163,20 @@ def load_snapshotArguments(self, account_name_type, pool_name_type, volume_name_
c.argument('snapshot_policy_name', options_list=['--snapshot-policy-name', '--name', '-n'], help='The name of the snapshot policy')


def load_vaultArguments(self, account_name_type):
def load_vault_arguments(self, account_name_type):
with self.argument_context('netappfiles vault list') as c:
c.argument('account_name', account_name_type, id_part=None)


def load_subvolume_arguments(self, account_name_type, pool_name_type, volume_name_type):
with self.argument_context('netappfiles subvolume') as c:
c.argument('account_name', account_name_type)
c.argument('pool_name', pool_name_type)
c.argument('volume_name', volume_name_type)
c.argument('subvolume_name', id_part="child_name_3")

with self.argument_context('netappfiles subvolume list') as c:
c.argument('account_name', id_part=None)
c.argument('pool_name', id_part=None)
c.argument('volume_name', id_part=None)
c.argument('subvolume_name', id_part=None)
Loading