|
24 | 24 | validate_key_import_source, validate_key_type, validate_policy_permissions, validate_principal, |
25 | 25 | validate_resource_group_name, validate_x509_certificate_chain, |
26 | 26 | secret_text_encoding_values, secret_binary_encoding_values, validate_subnet, validate_ip_address, |
27 | | - validate_vault_or_hsm, validate_key_id, validate_sas_definition_id, validate_storage_account_id, |
28 | | - validate_storage_disabled_attribute, validate_deleted_vault_or_hsm_name, validate_encryption, validate_decryption, |
| 27 | + validate_vault_or_hsm, validate_key_id, |
| 28 | + validate_deleted_vault_or_hsm_name, validate_encryption, validate_decryption, |
29 | 29 | validate_vault_name_and_hsm_name, set_vault_base_url, validate_keyvault_resource_id, |
30 | 30 | process_hsm_name, KeyEncryptionDataType, process_key_release_policy, process_certificate_policy, |
31 | 31 | process_certificate_import) |
|
38 | 38 |
|
39 | 39 | # pylint: disable=too-many-locals, too-many-branches, too-many-statements, line-too-long |
40 | 40 | def load_arguments(self, _): |
41 | | - (JsonWebKeyOperation, SasTokenType, |
42 | | - SasDefinitionAttributes, StorageAccountAttributes) = self.get_models( |
43 | | - 'JsonWebKeyOperation', 'SasTokenType', |
44 | | - 'SasDefinitionAttributes', 'StorageAccountAttributes', |
45 | | - resource_type=ResourceType.DATA_KEYVAULT) |
46 | 41 |
|
47 | 42 | JsonWebKeyType = self.get_sdk('KeyType', resource_type=ResourceType.DATA_KEYVAULT_KEYS, mod='_enums') |
48 | 43 | KeyCurveName = self.get_sdk('KeyCurveName', resource_type=ResourceType.DATA_KEYVAULT_KEYS, mod='_enums') |
@@ -674,77 +669,6 @@ class CLISecurityDomainOperation(str, Enum): |
674 | 669 |
|
675 | 670 | # endregion |
676 | 671 |
|
677 | | - # region KeyVault Storage Account |
678 | | - with self.argument_context('keyvault storage', arg_group='Id') as c: |
679 | | - c.argument('storage_account_name', options_list=['--name', '-n'], |
680 | | - help='Name to identify the storage account in the vault.', id_part='child_name_1', |
681 | | - completer=get_keyvault_name_completion_list('storage_account')) |
682 | | - c.argument('vault_base_url', vault_name_type, type=get_vault_base_url_type(self.cli_ctx), id_part=None) |
683 | | - |
684 | | - for scope in ['keyvault storage add', 'keyvault storage update']: |
685 | | - with self.argument_context(scope) as c: |
686 | | - c.extra('disabled', arg_type=get_three_state_flag(), help='Add the storage account in a disabled state.', |
687 | | - validator=validate_storage_disabled_attribute( |
688 | | - 'storage_account_attributes', StorageAccountAttributes)) |
689 | | - c.ignore('storage_account_attributes') |
690 | | - c.argument('auto_regenerate_key', arg_type=get_three_state_flag(), required=False) |
691 | | - c.argument('regeneration_period', help='The key regeneration time duration specified in ISO-8601 format, ' |
692 | | - 'such as "P30D" for rotation every 30 days.') |
693 | | - for scope in ['backup', 'show', 'update', 'remove', 'regenerate-key']: |
694 | | - with self.argument_context('keyvault storage ' + scope, arg_group='Id') as c: |
695 | | - c.extra('identifier', options_list=['--id'], |
696 | | - help='Id of the storage account. If specified all other \'Id\' arguments should be omitted.', |
697 | | - validator=validate_storage_account_id) |
698 | | - c.argument('storage_account_name', required=False, |
699 | | - help='Name to identify the storage account in the vault. Required if --id is not specified.') |
700 | | - c.argument('vault_base_url', help='Name of the Key Vault. Required if --id is not specified.', |
701 | | - required=False) |
702 | | - |
703 | | - with self.argument_context('keyvault storage backup') as c: |
704 | | - c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), |
705 | | - help='Local file path in which to store storage account backup.') |
706 | | - |
707 | | - with self.argument_context('keyvault storage restore') as c: |
708 | | - c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), |
709 | | - help='Local key backup from which to restore storage account.') |
710 | | - |
711 | | - with self.argument_context('keyvault storage sas-definition', arg_group='Id') as c: |
712 | | - c.argument('storage_account_name', options_list=['--account-name'], |
713 | | - help='Name to identify the storage account in the vault.', id_part='child_name_1', |
714 | | - completer=get_keyvault_name_completion_list('storage_account')) |
715 | | - c.argument('sas_definition_name', options_list=['--name', '-n'], |
716 | | - help='Name to identify the SAS definition in the vault.', id_part='child_name_2') |
717 | | - |
718 | | - for scope in ['keyvault storage sas-definition create', 'keyvault storage sas-definition update']: |
719 | | - with self.argument_context(scope) as c: |
720 | | - c.extra('disabled', arg_type=get_three_state_flag(), help='Add the storage account in a disabled state.', |
721 | | - validator=validate_storage_disabled_attribute('sas_definition_attributes', SasDefinitionAttributes)) |
722 | | - c.ignore('sas_definition_attributes') |
723 | | - c.argument('sas_type', arg_type=get_enum_type(SasTokenType)) |
724 | | - c.argument('template_uri', |
725 | | - help='The SAS definition token template signed with the key 00000000. ' |
726 | | - 'In the case of an account token this is only the sas token itself, for service tokens, ' |
727 | | - 'the full service endpoint url along with the sas token. Tokens created according to the ' |
728 | | - 'SAS definition will have the same properties as the template.') |
729 | | - c.argument('validity_period', |
730 | | - help='The validity period of SAS tokens created according to the SAS definition in ISO-8601, ' |
731 | | - 'such as "PT12H" for 12 hour tokens.') |
732 | | - c.argument('auto_regenerate_key', arg_type=get_three_state_flag()) |
733 | | - |
734 | | - for scope in ['keyvault storage sas-definition delete', 'keyvault storage sas-definition show', |
735 | | - 'keyvault storage sas-definition update']: |
736 | | - with self.argument_context(scope, arg_group='Id') as c: |
737 | | - c.extra('identifier', options_list=['--id'], |
738 | | - help='Id of the SAS definition. If specified all other \'Id\' arguments should be omitted.', |
739 | | - validator=validate_sas_definition_id) |
740 | | - c.argument('storage_account_name', required=False, |
741 | | - help='Name to identify the storage account in the vault. Required if --id is not specified.') |
742 | | - c.argument('sas_definition_name', required=False, |
743 | | - help='Name to identify the SAS definition in the vault. Required if --id is not specified.') |
744 | | - c.argument('vault_base_url', help='Name of the Key Vault. Required if --id is not specified.', |
745 | | - required=False) |
746 | | - # endregion |
747 | | - |
748 | 672 | # KeyVault Certificate |
749 | 673 | with self.argument_context('keyvault certificate issuer admin') as c: |
750 | 674 | c.argument('email', help='Admin e-mail address. Must be unique within the vault.') |
|
0 commit comments