Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KeyVault] Hotfix: GA for managed-HSM ralated commands and parameters #17727

Merged
merged 2 commits into from
Apr 19, 2021
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
12 changes: 6 additions & 6 deletions src/azure-cli/azure/cli/command_modules/keyvault/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,24 @@ class CLISecurityDomainOperation(str, Enum):
help='Name of the deleted Vault.', options_list=['--vault-name'], metavar='NAME', id_part=None)

hsm_name_type = CLIArgumentType(help='Name of the HSM.',
options_list=['--hsm-name'], id_part=None, is_preview=True)
options_list=['--hsm-name'], id_part=None)
hsm_url_type = CLIArgumentType(help='Name of the HSM.', type=get_hsm_base_url_type(self.cli_ctx),
options_list=['--hsm-name'], id_part=None, is_preview=True)
options_list=['--hsm-name'], id_part=None)

mgmt_plane_hsm_name_type = CLIArgumentType(help='Name of the HSM. (--hsm-name and --name/-n are mutually '
'exclusive, please specify just one of them)',
options_list=['--hsm-name'], id_part=None, is_preview=True,
options_list=['--hsm-name'], id_part=None,
validator=validate_vault_name_and_hsm_name)

data_plane_hsm_name_type = CLIArgumentType(help='Name of the HSM. (--hsm-name and --vault-name are '
'mutually exclusive, please specify just one of them)',
type=get_hsm_base_url_type(self.cli_ctx),
options_list=['--hsm-name'], id_part=None, is_preview=True,
options_list=['--hsm-name'], id_part=None,
validator=set_vault_base_url)

deleted_hsm_name_type = CLIArgumentType(help='Name of the deleted HSM. (--hsm-name and --name/-n are '
'mutually exclusive, please specify just one of them)',
options_list=['--hsm-name'], id_part=None, is_preview=True,
options_list=['--hsm-name'], id_part=None,
validator=validate_vault_name_and_hsm_name)

# region vault (management)
Expand Down Expand Up @@ -158,7 +158,7 @@ class CLISecurityDomainOperation(str, Enum):
with self.argument_context('keyvault create') as c:
c.argument('resource_group_name', resource_group_name_type, required=True, completer=None, validator=None)
c.argument('vault_name', vault_name_type, options_list=['--name', '-n'])
c.argument('administrators', nargs='+', is_preview=True,
c.argument('administrators', nargs='+',
help='[HSM Only] Administrator role for data plane operations for Managed HSM. '
'It accepts a space separated list of OIDs that will be assigned.')
c.argument('sku', help='Required. SKU details. Allowed values for Vault: premium, standard. Default: standard.'
Expand Down
13 changes: 5 additions & 8 deletions src/azure-cli/azure/cli/command_modules/keyvault/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def load_command_table(self, _):
client_factory=mgmt_hsms_entity.client_factory) as g:
g.generic_update_command(
'update-hsm', setter_name='update_hsm_setter', setter_type=kv_hsms_custom,
custom_func_name='update_hsm', is_preview=True, supports_no_wait=True,
custom_func_name='update_hsm', supports_no_wait=True,
doc_string_source=mgmt_hsms_entity.models_docs_tmpl.format('ManagedHsmProperties'))
g.custom_wait_command('wait-hsm', 'wait_hsm', is_preview=True)
g.custom_wait_command('wait-hsm', 'wait_hsm')

with self.command_group('keyvault network-rule',
mgmt_vaults_entity.command_type,
Expand Down Expand Up @@ -125,18 +125,15 @@ def load_command_table(self, _):

# Data Plane Commands
if not is_azure_stack_profile(self):
with self.command_group('keyvault backup', data_backup_entity.command_type,
is_preview=True) as g:
with self.command_group('keyvault backup', data_backup_entity.command_type) as g:
g.keyvault_custom('start', 'full_backup',
doc_string_source=data_backup_entity.operations_docs_tmpl.format('begin_backup'))

with self.command_group('keyvault restore', data_backup_entity.command_type,
is_preview=True) as g:
with self.command_group('keyvault restore', data_backup_entity.command_type) as g:
g.keyvault_custom('start', 'full_restore',
doc_string_source=data_backup_entity.operations_docs_tmpl.format('begin_restore'))

with self.command_group('keyvault security-domain', private_data_entity.command_type,
is_preview=True) as g:
with self.command_group('keyvault security-domain', private_data_entity.command_type) as g:
g.keyvault_custom('init-recovery', 'security_domain_init_recovery')
g.keyvault_custom('upload', 'security_domain_upload', supports_no_wait=True)
g.keyvault_custom('download', 'security_domain_download', supports_no_wait=True)
Expand Down