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 @@ -52,6 +52,8 @@
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
examples:
- name: Add an active directory to the account
text: >
Expand Down Expand Up @@ -496,6 +498,10 @@
short-summary: Kerberos5p Read and write access
- name: --has-root-access
short-summary: Has root access to volume
- name: --smb-encryption
short-summary: Enables encryption for in-flight smb3 data. Only applicable for SMB/DualProtocol volume. To be used with swagger version 2020-08-01 or later. Default value is False
- name: --smb-continuously-avl
short-summary: Enables continuously available share property for smb volume. Only applicable for SMB volume. Default value is False
examples:
- name: Create an ANF volume
text: >
Expand Down
38 changes: 22 additions & 16 deletions src/azure-cli/azure/cli/command_modules/netappfiles/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,24 @@ def load_arguments(self, _):
with self.argument_context('netappfiles account list') as c:
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)

with self.argument_context('netappfiles account ad list') as c:
c.argument('account_name', help='The name of the ANF account', id_part=None)

with self.argument_context('netappfiles account backup-policy') as c:
c.argument('account_name', account_name_type)
c.argument('backup_policy_name', options_list=['--backup-policy-name', '-b'], help='The name of the backup policy', id_part='child_name_1')
c.argument('daily_backups', options_list=['--daily-backups', '-d'], help='Daily backups count to keep', id_part=None)
c.argument('weekly_backups', options_list=['--weekly-backups', '-w'], help='Weekly backups count to keep', id_part=None)
c.argument('monthly_backups', options_list=['--monthly-backups', '-m'], help='Monthly backups count to keep', id_part=None)
c.argument('yearly_backups', options_list=['--yearly-backups', '-y'], help='Yearly backups count to keep', id_part=None)
c.argument('daily_backups', options_list=['--daily-backups', '-d'], help='Daily backups count to keep')
c.argument('weekly_backups', options_list=['--weekly-backups', '-w'], help='Weekly backups count to keep')
c.argument('monthly_backups', options_list=['--monthly-backups', '-m'], help='Monthly backups count to keep')
c.argument('yearly_backups', options_list=['--yearly-backups', '-y'], help='Yearly backups count to keep')

with self.argument_context('netappfiles account backup-policy list') as c:
c.argument('account_name', account_name_type, id_part=None)
c.argument('backup_policy_name', options_list=['--backup-policy-name', '-b'], help='The name of the backup policy', id_part=None)
c.argument('backup_policy_name', options_list=['--backup-policy-name', '-b'], help='The name of the backup policy')

with self.argument_context('netappfiles account backup') as c:
c.argument('account_name', account_name_type, id_part=None)
Expand Down Expand Up @@ -77,9 +81,11 @@ def load_volumeArguments(self, account_name_type, pool_name_type, volume_name_ty
c.argument('account_name', id_part='name')
c.argument('pool_name', pool_name_type)
c.argument('volume_name', volume_name_type, options_list=['--volume-name', '-v', '--name', '-n'])
c.argument('backup_enabled', arg_type=get_three_state_flag(), id_part=None)
c.argument('policy_enforced', arg_type=get_three_state_flag(), id_part=None)
c.argument('kerberos-enabled', arg_type=get_three_state_flag(), id_part=None)
c.argument('backup_enabled', arg_type=get_three_state_flag())
c.argument('policy_enforced', arg_type=get_three_state_flag())
c.argument('kerberos_enabled', arg_type=get_three_state_flag())
c.argument('smb_encryption', arg_type=get_three_state_flag())
c.argument('smb_continuously_available', options_list=['--smb-continuously-avl'], 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)
Expand All @@ -92,7 +98,7 @@ def load_volumeArguments(self, account_name_type, pool_name_type, volume_name_ty
c.argument('snapshot_id', options_list=['--snapshot-id', '-s'], help='Resource id of the snapshot', id_part=None)

with self.argument_context('netappfiles volume pool-change') as c:
c.argument('new_pool_resource_id', options_list=['--new-pool-resource-id', '-d'], help='Resource id of the new pool', id_part=None)
c.argument('new_pool_resource_id', options_list=['--new-pool-resource-id', '-d'], help='Resource id of the new pool')

with self.argument_context('netappfiles volume export-policy list') as c:
c.argument('account_name', id_part=None)
Expand All @@ -103,10 +109,10 @@ def load_volumeArguments(self, account_name_type, pool_name_type, volume_name_ty
c.argument('account_name', id_part=None)
c.argument('pool_name', pool_name_type, id_part=None)
c.argument('volume_name', volume_name_type, options_list=['--volume-name', '-v', '--name', '-n'], id_part=None)
c.argument('remote_volume_resource_id', options_list=['--remote-volume-resource-id', '-d'], help='The id of the destination replication volume', id_part=None)
c.argument('remote_volume_resource_id', options_list=['--remote-volume-resource-id', '-d'], help='The id of the destination replication volume')

with self.argument_context('netappfiles volume replication suspend') as c:
c.argument('force_break_replication', options_list=['--force', '--force-break-replication', '-f'], arg_type=get_three_state_flag(), id_part=None)
c.argument('force_break_replication', options_list=['--force', '--force-break-replication', '-f'], arg_type=get_three_state_flag())

with self.argument_context('netappfiles volume export-policy add') as c:
c.argument('unix_read_only', help="Indication of read only access", arg_type=get_three_state_flag())
Expand Down Expand Up @@ -138,14 +144,14 @@ def load_snapshotArguments(self, account_name_type, pool_name_type, volume_name_
with self.argument_context('netappfiles snapshot policy') as c:
c.argument('account_name', account_name_type)
c.argument('snapshot_policy_name', help='The name of the snapshot policy', id_part='child_name_1')
c.argument('hourly_snapshots', options_list=['--hourly-snapshots', '-u'], help='The amount of hourly snapshots to keep', id_part=None)
c.argument('daily_snapshots', options_list=['--daily-snapshots', '-d'], help='The amount of daily snapshots to keep', id_part=None)
c.argument('weekly_snapshots', options_list=['--weekly-snapshots', '-w'], help='The amount of weekly snapshots to keep', id_part=None)
c.argument('monthly_snapshots', options_list=['--monthly-snapshots', '-m'], help='The amount of monthly snapshots to keep', id_part=None)
c.argument('hourly_snapshots', options_list=['--hourly-snapshots', '-u'], help='The amount of hourly snapshots to keep')
c.argument('daily_snapshots', options_list=['--daily-snapshots', '-d'], help='The amount of daily snapshots to keep')
c.argument('weekly_snapshots', options_list=['--weekly-snapshots', '-w'], help='The amount of weekly snapshots to keep')
c.argument('monthly_snapshots', options_list=['--monthly-snapshots', '-m'], help='The amount of monthly snapshots to keep')

with self.argument_context('netappfiles snapshot policy list') as c:
c.argument('account_name', account_name_type, id_part=None)
c.argument('snapshot_policy_name', options_list=['--snapshot-policy-name', '--name', '-n'], help='The name of the snapshot policy', id_part=None)
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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def load_command_table(self, _):
)
load_vaults_command_groups(self, netappfiles_vaults_sdk)

with self.command_group('netappfiles', is_preview=True):
with self.command_group('netappfiles', is_preview=False):
pass


Expand Down
19 changes: 12 additions & 7 deletions src/azure-cli/azure/cli/command_modules/netappfiles/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ def create_account(cmd, client, account_name, resource_group_name, location, tag
# current limitation is 1 AD/subscription
def add_active_directory(cmd, instance, account_name, resource_group_name, username, password, domain, dns,
smb_server_name, organizational_unit=None, kdc_ip=None, ad_name=None,
server_root_ca_cert=None, backup_operators=None, aes_encryption=None, ldap_signing=None):
server_root_ca_cert=None, backup_operators=None, aes_encryption=None, ldap_signing=None,
security_operators=None, tags=None):
active_directories = []
active_directory = ActiveDirectory(username=username, password=password, domain=domain, dns=dns,
smb_server_name=smb_server_name, organizational_unit=organizational_unit,
kdc_ip=kdc_ip, ad_name=ad_name, backup_operators=backup_operators,
server_root_ca_certificate=server_root_ca_cert, aes_encryption=aes_encryption,
ldap_signing=ldap_signing)
ldap_signing=ldap_signing, security_operators=security_operators)
active_directories.append(active_directory)
body = NetAppAccountPatch(active_directories=active_directories)
_update_mapper(instance, body, ['active_directories'])
Expand Down Expand Up @@ -108,16 +109,18 @@ def create_volume(cmd, client, account_name, pool_name, volume_name, resource_gr
policy_enforced=None, vault_id=None, kerberos_enabled=None, security_style=None, throughput_mibps=None,
kerberos5_r=None, kerberos5_rw=None, kerberos5i_r=None,
kerberos5i_rw=None, kerberos5p_r=None, kerberos5p_rw=None,
has_root_access=None, snapshot_dir_visible=None):
has_root_access=None, snapshot_dir_visible=None,
smb_encryption=None, smb_continuously_available=None):
subs_id = get_subscription_id(cmd.cli_ctx)

# default the resource group of the subnet to the volume's rg unless the subnet is specified by id
subnet_rg = resource_group_name

# determine vnet - supplied value can be name or ARM resource Id
if is_valid_resource_id(vnet):
resource_parts = parse_resource_id(vnet)
vnet = resource_parts['resource_name']

# default the resource group of the subnet to the volume's rg unless the subnet is specified by id
subnet_rg = resource_group_name
subnet_rg = resource_parts['resource_group']

# determine subnet - supplied value can be name or ARM reource Id
if is_valid_resource_id(subnet):
Expand Down Expand Up @@ -179,7 +182,9 @@ def create_volume(cmd, client, account_name, pool_name, volume_name, resource_gr
snapshot_directory_visible=snapshot_dir_visible,
security_style=security_style,
tags=tags,
snapshot_id=snapshot_id)
snapshot_id=snapshot_id,
smb_encryption=smb_encryption,
smb_continuously_available=smb_continuously_available)

return client.create_or_update(body, resource_group_name, account_name, pool_name, volume_name)

Expand Down
Loading