From 5e61b6f55c823d521ebad38f975244bea5db6d58 Mon Sep 17 00:00:00 2001 From: Scott Schaab Date: Thu, 19 Apr 2018 10:50:21 -0700 Subject: [PATCH] initial extension commit (rebased previous commits) --- .gitignore | 3 + src/keyvault/README.md | 17 + src/keyvault/azext_keyvault/__init__.py | 42 + .../azext_keyvault/_client_factory.py | 41 + src/keyvault/azext_keyvault/_command_type.py | 164 + src/keyvault/azext_keyvault/_completers.py | 52 + src/keyvault/azext_keyvault/_help.py | 173 + src/keyvault/azext_keyvault/_params.py | 228 + src/keyvault/azext_keyvault/_validators.py | 245 + src/keyvault/azext_keyvault/commands.py | 155 + src/keyvault/azext_keyvault/custom.py | 954 +++ .../azext_keyvault/keyvault/__init__.py | 52 + .../keyvault/custom/__init__.py | 6 + .../keyvault/custom/http_bearer_challenge.py | 104 + .../http_bearer_challenge_cache/__init__.py | 83 + .../keyvault/custom/http_challenge.py | 121 + .../keyvault/custom/http_message_security.py | 198 + .../keyvault/custom/internal.py | 416 ++ .../custom/key_vault_authentication.py | 249 + .../keyvault/custom/key_vault_client.py | 100 + .../keyvault/custom/key_vault_id.py | 448 ++ .../keyvault/key_vault_client.py | 5783 +++++++++++++++++ .../keyvault/models/__init__.py | 298 + .../azext_keyvault/keyvault/models/action.py | 35 + .../keyvault/models/action_py3.py | 35 + .../keyvault/models/administrator_details.py | 46 + .../models/administrator_details_py3.py | 46 + .../keyvault/models/attributes.py | 58 + .../keyvault/models/attributes_py3.py | 58 + .../models/backup_certificate_result.py | 41 + .../models/backup_certificate_result_py3.py | 41 + .../keyvault/models/backup_key_result.py | 41 + .../keyvault/models/backup_key_result_py3.py | 41 + .../keyvault/models/backup_secret_result.py | 41 + .../models/backup_secret_result_py3.py | 41 + .../keyvault/models/backup_storage_result.py | 41 + .../models/backup_storage_result_py3.py | 41 + .../keyvault/models/certificate_attributes.py | 65 + .../models/certificate_attributes_py3.py | 65 + .../keyvault/models/certificate_bundle.py | 77 + .../keyvault/models/certificate_bundle_py3.py | 77 + .../models/certificate_create_parameters.py | 43 + .../certificate_create_parameters_py3.py | 43 + .../models/certificate_import_parameters.py | 60 + .../certificate_import_parameters_py3.py | 60 + .../models/certificate_issuer_item.py | 38 + .../models/certificate_issuer_item_paged.py | 33 + .../models/certificate_issuer_item_py3.py | 38 + .../certificate_issuer_set_parameters.py | 53 + .../certificate_issuer_set_parameters_py3.py | 53 + .../certificate_issuer_update_parameters.py | 47 + ...ertificate_issuer_update_parameters_py3.py | 47 + .../keyvault/models/certificate_item.py | 46 + .../keyvault/models/certificate_item_paged.py | 33 + .../keyvault/models/certificate_item_py3.py | 46 + .../models/certificate_merge_parameters.py | 50 + .../certificate_merge_parameters_py3.py | 50 + .../keyvault/models/certificate_operation.py | 77 + .../models/certificate_operation_py3.py | 77 + .../certificate_operation_update_parameter.py | 41 + ...tificate_operation_update_parameter_py3.py | 41 + .../keyvault/models/certificate_policy.py | 69 + .../keyvault/models/certificate_policy_py3.py | 69 + .../models/certificate_restore_parameters.py | 41 + .../certificate_restore_parameters_py3.py | 41 + .../models/certificate_update_parameters.py | 43 + .../certificate_update_parameters_py3.py | 43 + .../azext_keyvault/keyvault/models/contact.py | 42 + .../keyvault/models/contact_py3.py | 42 + .../keyvault/models/contacts.py | 45 + .../keyvault/models/contacts_py3.py | 45 + .../models/deleted_certificate_bundle.py | 85 + .../models/deleted_certificate_bundle_py3.py | 85 + .../models/deleted_certificate_item.py | 65 + .../models/deleted_certificate_item_paged.py | 33 + .../models/deleted_certificate_item_py3.py | 65 + .../keyvault/models/deleted_key_bundle.py | 67 + .../keyvault/models/deleted_key_bundle_py3.py | 67 + .../keyvault/models/deleted_key_item.py | 67 + .../keyvault/models/deleted_key_item_paged.py | 33 + .../keyvault/models/deleted_key_item_py3.py | 67 + .../models/deleted_sas_definition_bundle.py | 85 + .../deleted_sas_definition_bundle_py3.py | 85 + .../models/deleted_sas_definition_item.py | 69 + .../deleted_sas_definition_item_paged.py | 33 + .../models/deleted_sas_definition_item_py3.py | 69 + .../keyvault/models/deleted_secret_bundle.py | 78 + .../models/deleted_secret_bundle_py3.py | 78 + .../keyvault/models/deleted_secret_item.py | 69 + .../models/deleted_secret_item_paged.py | 33 + .../models/deleted_secret_item_py3.py | 69 + .../models/deleted_storage_account_item.py | 69 + .../deleted_storage_account_item_paged.py | 33 + .../deleted_storage_account_item_py3.py | 69 + .../keyvault/models/deleted_storage_bundle.py | 83 + .../models/deleted_storage_bundle_py3.py | 83 + .../azext_keyvault/keyvault/models/error.py | 51 + .../keyvault/models/error_py3.py | 51 + .../keyvault/models/issuer_attributes.py | 50 + .../keyvault/models/issuer_attributes_py3.py | 50 + .../keyvault/models/issuer_bundle.py | 58 + .../keyvault/models/issuer_bundle_py3.py | 58 + .../keyvault/models/issuer_credentials.py | 38 + .../keyvault/models/issuer_credentials_py3.py | 38 + .../keyvault/models/issuer_parameters.py | 45 + .../keyvault/models/issuer_parameters_py3.py | 45 + .../keyvault/models/json_web_key.py | 97 + .../keyvault/models/json_web_key_py3.py | 97 + .../keyvault/models/key_attributes.py | 64 + .../keyvault/models/key_attributes_py3.py | 64 + .../keyvault/models/key_bundle.py | 54 + .../keyvault/models/key_bundle_py3.py | 54 + .../keyvault/models/key_create_parameters.py | 64 + .../models/key_create_parameters_py3.py | 64 + .../keyvault/models/key_import_parameters.py | 52 + .../models/key_import_parameters_py3.py | 52 + .../keyvault/models/key_item.py | 54 + .../keyvault/models/key_item_paged.py | 33 + .../keyvault/models/key_item_py3.py | 54 + .../keyvault/models/key_operation_result.py | 46 + .../models/key_operation_result_py3.py | 46 + .../models/key_operations_parameters.py | 47 + .../models/key_operations_parameters_py3.py | 47 + .../keyvault/models/key_properties.py | 47 + .../keyvault/models/key_properties_py3.py | 47 + .../keyvault/models/key_restore_parameters.py | 41 + .../models/key_restore_parameters_py3.py | 41 + .../keyvault/models/key_sign_parameters.py | 50 + .../models/key_sign_parameters_py3.py | 50 + .../keyvault/models/key_update_parameters.py | 43 + .../models/key_update_parameters_py3.py | 43 + .../keyvault/models/key_vault_client_enums.py | 100 + .../keyvault/models/key_vault_error.py | 54 + .../keyvault/models/key_vault_error_py3.py | 54 + .../keyvault/models/key_verify_parameters.py | 54 + .../models/key_verify_parameters_py3.py | 54 + .../keyvault/models/key_verify_result.py | 41 + .../keyvault/models/key_verify_result_py3.py | 41 + .../keyvault/models/lifetime_action.py | 39 + .../keyvault/models/lifetime_action_py3.py | 39 + .../keyvault/models/organization_details.py | 38 + .../models/organization_details_py3.py | 38 + ...ding_certificate_signing_request_result.py | 42 + ..._certificate_signing_request_result_py3.py | 42 + .../models/sas_definition_attributes.py | 62 + .../models/sas_definition_attributes_py3.py | 62 + .../keyvault/models/sas_definition_bundle.py | 76 + .../models/sas_definition_bundle_py3.py | 76 + .../sas_definition_create_parameters.py | 63 + .../sas_definition_create_parameters_py3.py | 63 + .../keyvault/models/sas_definition_item.py | 56 + .../models/sas_definition_item_paged.py | 33 + .../models/sas_definition_item_py3.py | 56 + .../sas_definition_update_parameters.py | 55 + .../sas_definition_update_parameters_py3.py | 55 + .../keyvault/models/secret_attributes.py | 64 + .../keyvault/models/secret_attributes_py3.py | 64 + .../keyvault/models/secret_bundle.py | 68 + .../keyvault/models/secret_bundle_py3.py | 68 + .../keyvault/models/secret_item.py | 58 + .../keyvault/models/secret_item_paged.py | 33 + .../keyvault/models/secret_item_py3.py | 58 + .../keyvault/models/secret_properties.py | 34 + .../keyvault/models/secret_properties_py3.py | 34 + .../models/secret_restore_parameters.py | 41 + .../models/secret_restore_parameters_py3.py | 41 + .../keyvault/models/secret_set_parameters.py | 52 + .../models/secret_set_parameters_py3.py | 52 + .../models/secret_update_parameters.py | 42 + .../models/secret_update_parameters_py3.py | 42 + .../models/storage_account_attributes.py | 62 + .../models/storage_account_attributes_py3.py | 62 + .../storage_account_create_parameters.py | 65 + .../storage_account_create_parameters_py3.py | 65 + .../keyvault/models/storage_account_item.py | 56 + .../models/storage_account_item_paged.py | 33 + .../models/storage_account_item_py3.py | 56 + ...torage_account_regenerte_key_parameters.py | 40 + ...ge_account_regenerte_key_parameters_py3.py | 40 + .../storage_account_update_parameters.py | 53 + .../storage_account_update_parameters_py3.py | 53 + .../keyvault/models/storage_bundle.py | 74 + .../keyvault/models/storage_bundle_py3.py | 74 + .../models/storage_restore_parameters.py | 41 + .../models/storage_restore_parameters_py3.py | 41 + .../models/subject_alternative_names.py | 42 + .../models/subject_alternative_names_py3.py | 42 + .../azext_keyvault/keyvault/models/trigger.py | 46 + .../keyvault/models/trigger_py3.py | 46 + .../models/x509_certificate_properties.py | 57 + .../models/x509_certificate_properties_py3.py | 57 + .../azext_keyvault/keyvault/version.py | 19 + src/keyvault/azext_keyvault/mgmt/__init__.py | 7 + .../azext_keyvault/mgmt/keyvault/__init__.py | 24 + .../keyvault/key_vault_management_client.py | 96 + .../mgmt/keyvault/models/__init__.py | 118 + .../keyvault/models/access_policy_entry.py | 60 + .../models/access_policy_entry_py3.py | 60 + .../models/check_name_availability_result.py | 56 + .../check_name_availability_result_py3.py | 56 + .../mgmt/keyvault/models/deleted_vault.py | 55 + .../keyvault/models/deleted_vault_paged.py | 33 + .../models/deleted_vault_properties.py | 61 + .../models/deleted_vault_properties_py3.py | 61 + .../mgmt/keyvault/models/deleted_vault_py3.py | 55 + .../mgmt/keyvault/models/ip_rule.py | 43 + .../mgmt/keyvault/models/ip_rule_py3.py | 43 + .../key_vault_management_client_enums.py | 125 + .../mgmt/keyvault/models/log_specification.py | 42 + .../keyvault/models/log_specification_py3.py | 42 + .../mgmt/keyvault/models/network_rule_set.py | 51 + .../keyvault/models/network_rule_set_py3.py | 51 + .../mgmt/keyvault/models/operation.py | 48 + .../mgmt/keyvault/models/operation_display.py | 46 + .../keyvault/models/operation_display_py3.py | 46 + .../mgmt/keyvault/models/operation_paged.py | 33 + .../mgmt/keyvault/models/operation_py3.py | 48 + .../mgmt/keyvault/models/permissions.py | 47 + .../mgmt/keyvault/models/permissions_py3.py | 47 + .../mgmt/keyvault/models/resource.py | 63 + .../mgmt/keyvault/models/resource_paged.py | 33 + .../mgmt/keyvault/models/resource_py3.py | 63 + .../keyvault/models/service_specification.py | 35 + .../models/service_specification_py3.py | 35 + .../mgmt/keyvault/models/sku.py | 51 + .../mgmt/keyvault/models/sku_py3.py | 51 + .../mgmt/keyvault/models/vault.py | 63 + .../models/vault_access_policy_parameters.py | 63 + .../vault_access_policy_parameters_py3.py | 63 + .../models/vault_access_policy_properties.py | 42 + .../vault_access_policy_properties_py3.py | 42 + ...ault_check_name_availability_parameters.py | 50 + ..._check_name_availability_parameters_py3.py | 50 + .../vault_create_or_update_parameters.py | 50 + .../vault_create_or_update_parameters_py3.py | 50 + .../mgmt/keyvault/models/vault_paged.py | 33 + .../keyvault/models/vault_patch_parameters.py | 38 + .../models/vault_patch_parameters_py3.py | 38 + .../keyvault/models/vault_patch_properties.py | 88 + .../models/vault_patch_properties_py3.py | 88 + .../mgmt/keyvault/models/vault_properties.py | 100 + .../keyvault/models/vault_properties_py3.py | 100 + .../mgmt/keyvault/models/vault_py3.py | 63 + .../keyvault/models/virtual_network_rule.py | 42 + .../models/virtual_network_rule_py3.py | 42 + .../mgmt/keyvault/operations/__init__.py | 24 + .../mgmt/keyvault/operations/operations.py | 105 + .../keyvault/operations/vaults_operations.py | 933 +++ .../azext_keyvault/mgmt/keyvault/version.py | 19 + src/keyvault/azext_keyvault/source.md | 3 + src/keyvault/azext_keyvault/tests/__init__.py | 10 + .../tests/latest/TestBYOK-EU.byok | Bin 0 -> 5486 bytes .../tests/latest/TestBYOK-NA.byok | Bin 0 -> 5486 bytes .../azext_keyvault/tests/latest/__init__.py | 10 + .../latest/import_pem_encrypted_pwd_123.pem | 50 + .../latest/import_pem_encrypted_pwd_1234.pem | 48 + .../tests/latest/import_pem_plain.pem | 47 + .../tests/latest/import_pfx.pfx | Bin 0 -> 2701 bytes .../tests/latest/mydomain.test.encrypted.pem | 53 + .../tests/latest/mydomain.test.pem | 31 + .../azext_keyvault/tests/latest/policy.json | 42 + .../azext_keyvault/tests/latest/policy2.json | 42 + .../tests/latest/policy_import_pem.json | 14 + .../tests/latest/policy_import_pfx.json | 14 + .../tests/latest/policy_pending.json | 32 + .../recordings/test_keyvault_certificate.yaml | 227 + .../test_keyvault_certificate_contacts.yaml | 524 ++ .../test_keyvault_certificate_crud.yaml | 734 +++ .../test_keyvault_certificate_download.yaml | 227 + ...yvault_certificate_get_default_policy.yaml | 59 + .../test_keyvault_certificate_import.yaml | 227 + .../test_keyvault_certificate_issuers.yaml | 830 +++ .../latest/recordings/test_keyvault_key.yaml | 686 ++ .../latest/recordings/test_keyvault_mgmt.yaml | 899 +++ .../test_keyvault_pending_certificate.yaml | 439 ++ .../recordings/test_keyvault_secret.yaml | 890 +++ .../recordings/test_keyvault_softdelete.yaml | 191 + .../tests/latest/test_keyvault_commands.py | 789 +++ .../tests/latest/test_secret.txt | 1 + src/keyvault/setup.cfg | 2 + src/keyvault/setup.py | 44 + src/keyvault/update_extension.py | 121 + 282 files changed, 30177 insertions(+) create mode 100644 src/keyvault/README.md create mode 100644 src/keyvault/azext_keyvault/__init__.py create mode 100644 src/keyvault/azext_keyvault/_client_factory.py create mode 100644 src/keyvault/azext_keyvault/_command_type.py create mode 100644 src/keyvault/azext_keyvault/_completers.py create mode 100644 src/keyvault/azext_keyvault/_help.py create mode 100644 src/keyvault/azext_keyvault/_params.py create mode 100644 src/keyvault/azext_keyvault/_validators.py create mode 100644 src/keyvault/azext_keyvault/commands.py create mode 100644 src/keyvault/azext_keyvault/custom.py create mode 100644 src/keyvault/azext_keyvault/keyvault/__init__.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/__init__.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge_cache/__init__.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/http_challenge.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/http_message_security.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/internal.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/key_vault_authentication.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/key_vault_client.py create mode 100644 src/keyvault/azext_keyvault/keyvault/custom/key_vault_id.py create mode 100644 src/keyvault/azext_keyvault/keyvault/key_vault_client.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/__init__.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/action.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/action_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/administrator_details.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/administrator_details_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/attributes.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/attributes_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_key_result.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_key_result_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_secret_result.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_secret_result_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_storage_result.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/backup_storage_result_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_attributes.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_attributes_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_operation.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_operation_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_policy.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_policy_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/contact.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/contact_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/contacts.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/contacts_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_key_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/error.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/error_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_attributes.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_attributes_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_credentials.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_credentials_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/issuer_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/json_web_key.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/json_web_key_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_attributes.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_attributes_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_create_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_create_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_import_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_import_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_operation_result.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_operation_result_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_properties.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_properties_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_update_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_update_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_vault_client_enums.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_vault_error.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_vault_error_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_verify_result.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/key_verify_result_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/lifetime_action.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/lifetime_action_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/organization_details.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/organization_details_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_attributes.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_attributes_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_properties.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_properties_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_item.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_item_paged.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_item_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_bundle.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_bundle_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/trigger.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/trigger_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties.py create mode 100644 src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties_py3.py create mode 100644 src/keyvault/azext_keyvault/keyvault/version.py create mode 100644 src/keyvault/azext_keyvault/mgmt/__init__.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/__init__.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/key_vault_management_client.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/__init__.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_paged.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/key_vault_management_client_enums.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/operation.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_paged.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/resource.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_paged.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/sku.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/sku_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_paged.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule_py3.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/operations/__init__.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/operations/operations.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/operations/vaults_operations.py create mode 100644 src/keyvault/azext_keyvault/mgmt/keyvault/version.py create mode 100644 src/keyvault/azext_keyvault/source.md create mode 100644 src/keyvault/azext_keyvault/tests/__init__.py create mode 100644 src/keyvault/azext_keyvault/tests/latest/TestBYOK-EU.byok create mode 100644 src/keyvault/azext_keyvault/tests/latest/TestBYOK-NA.byok create mode 100644 src/keyvault/azext_keyvault/tests/latest/__init__.py create mode 100644 src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_123.pem create mode 100644 src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_1234.pem create mode 100644 src/keyvault/azext_keyvault/tests/latest/import_pem_plain.pem create mode 100644 src/keyvault/azext_keyvault/tests/latest/import_pfx.pfx create mode 100644 src/keyvault/azext_keyvault/tests/latest/mydomain.test.encrypted.pem create mode 100644 src/keyvault/azext_keyvault/tests/latest/mydomain.test.pem create mode 100644 src/keyvault/azext_keyvault/tests/latest/policy.json create mode 100644 src/keyvault/azext_keyvault/tests/latest/policy2.json create mode 100644 src/keyvault/azext_keyvault/tests/latest/policy_import_pem.json create mode 100644 src/keyvault/azext_keyvault/tests/latest/policy_import_pfx.json create mode 100644 src/keyvault/azext_keyvault/tests/latest/policy_pending.json create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_contacts.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_crud.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_download.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_get_default_policy.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_import.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_issuers.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_key.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_mgmt.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_pending_certificate.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_secret.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_softdelete.yaml create mode 100644 src/keyvault/azext_keyvault/tests/latest/test_keyvault_commands.py create mode 100644 src/keyvault/azext_keyvault/tests/latest/test_secret.txt create mode 100644 src/keyvault/setup.cfg create mode 100644 src/keyvault/setup.py create mode 100644 src/keyvault/update_extension.py diff --git a/.gitignore b/.gitignore index 27970066f69..05e98cf806c 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,6 @@ ENV/ # Sphinx _build/ + +# Jet Brains +.idea/ \ No newline at end of file diff --git a/src/keyvault/README.md b/src/keyvault/README.md new file mode 100644 index 00000000000..301d7a39c79 --- /dev/null +++ b/src/keyvault/README.md @@ -0,0 +1,17 @@ + +# Key Vault Azure CLI Extension + +The Azure CLI extension for Key Vault is an extension which previews unreleased functionality in the keyvault command module. + +__NOTE__: The code for this extension is automatedly pulled from the [azure-sdk-for-python](https://github.com/azure/azure-sdk-for-python) and the [azure-cli](https://github.com/azure/azure-cli) repos using update_extension.py, and updated to run as an Azure CLI extension. Changes may cause incorrect behavior and will be lost if the code is regenerated. + +## Manually updating the Extension + +Clone the [azure-sdk-for-python](https://github.com/azure/azure-sdk-for-python) and the [azure-cli](https://github.com/azure/azure-cli) repos: + + $ git clone https://github.com/azure/azure-sdk-for-python.git + $ git clone https://github.com/azure/azure-cli + +Using python 3.* run update_extension.py: + + $ python update_extension.py --sdk --cli \ No newline at end of file diff --git a/src/keyvault/azext_keyvault/__init__.py b/src/keyvault/azext_keyvault/__init__.py new file mode 100644 index 00000000000..f5537b850f7 --- /dev/null +++ b/src/keyvault/azext_keyvault/__init__.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# 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 import AzCommandsLoader + +import azext_keyvault._help # pylint: disable=unused-import + + +class KeyVaultCommandsLoader(AzCommandsLoader): + + def __init__(self, cli_ctx=None): + from azure.cli.core.commands import CliCommandType + from ._client_factory import keyvault_client_factory + from ._command_type import KeyVaultCommandGroup, KeyVaultArgumentContext + keyvault_custom = CliCommandType( + operations_tmpl='azext_keyvault.custom#{}', + client_factory=keyvault_client_factory + ) + super(KeyVaultCommandsLoader, self).__init__(cli_ctx=cli_ctx, + custom_command_type=keyvault_custom, + command_group_cls=KeyVaultCommandGroup, + argument_context_cls=KeyVaultArgumentContext) + + def load_command_table(self, args): + from .commands import load_command_table + load_command_table(self, args) + return self.command_table + + def load_arguments(self, command): + from ._params import load_arguments + load_arguments(self, command) + + +COMMAND_LOADER_CLS = KeyVaultCommandsLoader diff --git a/src/keyvault/azext_keyvault/_client_factory.py b/src/keyvault/azext_keyvault/_client_factory.py new file mode 100644 index 00000000000..6f4d570c6ec --- /dev/null +++ b/src/keyvault/azext_keyvault/_client_factory.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + + +def keyvault_client_factory(cli_ctx, **_): + from azure.cli.core.commands.client_factory import get_mgmt_service_client + from azext_keyvault.mgmt.keyvault import KeyVaultManagementClient + return get_mgmt_service_client(cli_ctx, KeyVaultManagementClient) + + +def keyvault_client_vaults_factory(cli_ctx, _): + return keyvault_client_factory(cli_ctx).vaults + + +def keyvault_data_plane_factory(cli_ctx, _): + from azext_keyvault.keyvault import KeyVaultClient, KeyVaultAuthentication + + def get_token(server, resource, scope): # pylint: disable=unused-argument + import adal + from azure.cli.core._profile import Profile + try: + return Profile(cli_ctx=cli_ctx).get_login_credentials(resource)[0]._token_retriever() # pylint: disable=protected-access + except adal.AdalError as err: + from knack.util import CLIError + # pylint: disable=no-member + if (hasattr(err, 'error_response') and + ('error_description' in err.error_response) and + ('AADSTS70008:' in err.error_response['error_description'])): + raise CLIError( + "Credentials have expired due to inactivity. Please run 'az login'") + raise CLIError(err) + + return KeyVaultClient(KeyVaultAuthentication(get_token)) diff --git a/src/keyvault/azext_keyvault/_command_type.py b/src/keyvault/azext_keyvault/_command_type.py new file mode 100644 index 00000000000..dcd05c0e2c6 --- /dev/null +++ b/src/keyvault/azext_keyvault/_command_type.py @@ -0,0 +1,164 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import base64 + +from knack.introspection import extract_full_summary_from_signature, extract_args_from_signature +from knack.util import CLIError + +from azure.cli.core.commands import LongRunningOperation, AzCommandGroup, AzArgumentContext + + +def _encode_hex(item): + """ Recursively crawls the object structure and converts bytes or bytearrays to base64 + encoded strings. """ + if isinstance(item, list): + return [_encode_hex(x) for x in item] + elif hasattr(item, '__dict__'): + for key, val in item.__dict__.items(): + if not key.startswith('_'): + try: + setattr(item, key, _encode_hex(val)) + except TypeError: + item.__dict__[key] = _encode_hex(val) + return item + elif isinstance(item, (bytes, bytearray)): + return base64.b64encode(item).decode('utf-8') + return item + + +def keyvault_exception_handler(ex): + from msrest.exceptions import ValidationError, ClientRequestError + from azext_keyvault.keyvault.models import KeyVaultErrorException + if isinstance(ex, (ValidationError, KeyVaultErrorException)): + try: + raise CLIError(ex.inner_exception.error.message) + except AttributeError: + raise CLIError(ex) + elif isinstance(ex, ClientRequestError): + if 'Failed to establish a new connection' in str(ex.inner_exception): + raise CLIError('Max retries exceeded attempting to connect to vault. ' + 'The vault may not exist or you may need to flush your DNS cache ' + 'and try again later.') + raise CLIError(ex) + + +class KeyVaultCommandGroup(AzCommandGroup): + + def __init__(self, command_loader, group_name, **kwargs): + from ._client_factory import keyvault_data_plane_factory + # all regular and custom commands should use the keyvault data plane client + merged_kwargs = self._merge_kwargs(kwargs, base_kwargs=command_loader.module_kwargs) + merged_kwargs['custom_command_type'].settings['client_factory'] = keyvault_data_plane_factory + super(KeyVaultCommandGroup, self).__init__(command_loader, group_name, **kwargs) + + def _create_keyvault_command(self, name, method_name=None, command_type_name=None, **kwargs): + self._check_stale() + + merged_kwargs = self._flatten_kwargs(kwargs, command_type_name) + operations_tmpl = merged_kwargs['operations_tmpl'] + command_name = '{} {}'.format(self.group_name, name) if self.group_name else name + + def get_op_handler(): + return self.command_loader.get_op_handler(operations_tmpl.format(method_name)) + + def keyvault_arguments_loader(): + op = get_op_handler() + self.command_loader._apply_doc_string(op, merged_kwargs) # pylint: disable=protected-access + cmd_args = list( + extract_args_from_signature(op, excluded_params=self.command_loader.excluded_command_handler_args)) + return cmd_args + + def keyvault_description_loader(): + op = get_op_handler() + self.command_loader._apply_doc_string(op, merged_kwargs) # pylint: disable=protected-access + return extract_full_summary_from_signature(op) + + def keyvault_command_handler(command_args): + from azure.cli.core.util import get_arg_list + from azure.cli.core.commands.client_factory import resolve_client_arg_name + from msrest.paging import Paged + from azure.cli.core.util import poller_classes + + op = get_op_handler() + op_args = get_arg_list(op) + command_type = merged_kwargs.get('command_type', None) + client_factory = command_type.settings.get('client_factory', None) if command_type \ + else merged_kwargs.get('client_factory', None) + + client_arg_name = resolve_client_arg_name(operations_tmpl.format(method_name), kwargs) + if client_arg_name in op_args: + client = client_factory(self.command_loader.cli_ctx, command_args) + command_args[client_arg_name] = client + try: + result = op(**command_args) + # apply results transform if specified + transform_result = merged_kwargs.get('transform', None) + if transform_result: + return _encode_hex(transform_result(result)) + + # otherwise handle based on return type of results + if isinstance(result, poller_classes()): + return _encode_hex( + LongRunningOperation(self.command_loader.cli_ctx, 'Starting {}'.format(name))(result)) + elif isinstance(result, Paged): + try: + return _encode_hex(list(result)) + except TypeError: + # TODO: Workaround for an issue in either KeyVault server-side or msrest + # See https://github.com/Azure/autorest/issues/1309 + return [] + else: + return _encode_hex(result) + except Exception as ex: # pylint: disable=broad-except + return keyvault_exception_handler(ex) + + self.command_loader._cli_command(command_name, handler=keyvault_command_handler, # pylint: disable=protected-access + argument_loader=keyvault_arguments_loader, + description_loader=keyvault_description_loader, + **merged_kwargs) + + def keyvault_command(self, name, method_name=None, command_type=None, **kwargs): + """ Registers an Azure CLI KeyVault Data Plane command. These commands must respond to a + challenge from the service when they make requests. """ + command_type_name = 'command_type' + if command_type: + kwargs[command_type_name] = command_type + self._create_keyvault_command(name, method_name, command_type_name, **kwargs) + + def keyvault_custom(self, name, method_name=None, command_type=None, **kwargs): + command_type_name = 'custom_command_type' + if command_type: + kwargs[command_type_name] = command_type + self._create_keyvault_command(name, method_name, command_type_name, **kwargs) + + +class KeyVaultArgumentContext(AzArgumentContext): + + def attributes_argument(self, name, attr_class, create=False, ignore=None): + from ._validators import get_attribute_validator, datetime_type + from azure.cli.core.commands.parameters import get_three_state_flag + + from knack.arguments import ignore_type + + ignore = ignore or [] + self.argument('{}_attributes'.format(name), ignore_type, + validator=get_attribute_validator(name, attr_class, create)) + if create: + self.extra('disabled', help='Create {} in disabled state.'.format(name), arg_type=get_three_state_flag()) + else: + self.extra('enabled', help='Enable the {}.'.format(name), arg_type=get_three_state_flag()) + if 'expires' not in ignore: + self.extra('expires', default=None, help='Expiration UTC datetime (Y-m-d\'T\'H:M:S\'Z\').', + type=datetime_type) + if 'not_before' not in ignore: + self.extra('not_before', default=None, type=datetime_type, + help='Key not usable before the provided UTC datetime (Y-m-d\'T\'H:M:S\'Z\').') diff --git a/src/keyvault/azext_keyvault/_completers.py b/src/keyvault/azext_keyvault/_completers.py new file mode 100644 index 00000000000..b0b2b3d91aa --- /dev/null +++ b/src/keyvault/azext_keyvault/_completers.py @@ -0,0 +1,52 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# 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.decorators import Completer +from azure.cli.core._profile import Profile + + +def _get_token(cli_ctx, server, resource, scope): # pylint: disable=unused-argument + return Profile(cli_ctx=cli_ctx).get_login_credentials(resource)[0]._token_retriever() # pylint: disable=protected-access + + +def get_keyvault_name_completion_list(resource_name): + + @Completer + def completer(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument + from azext_keyvault.keyvault import KeyVaultClient, KeyVaultAuthentication + client = KeyVaultClient(KeyVaultAuthentication(_get_token)) + func_name = 'get_{}s'.format(resource_name) + vault = namespace.vault_base_url + items = [] + for y in list(getattr(client, func_name)(vault)): + id_val = getattr(y, 'id', None) or getattr(y, 'kid', None) + items.append(id_val.rsplit('/', 1)[1]) + return items + + return completer + + +def get_keyvault_version_completion_list(resource_name): + + @Completer + def completer(cmd, prefix, namespace, **kwargs): # pylint: disable=unused-argument + from azext_keyvault.keyvault import KeyVaultClient, KeyVaultAuthentication + client = KeyVaultClient(KeyVaultAuthentication(_get_token)) + func_name = 'get_{}_versions'.format(resource_name) + vault = namespace.vault_base_url + name = getattr(namespace, '{}_name'.format(resource_name)) + items = [] + for y in list(getattr(client, func_name)(vault, name)): + id_val = getattr(y, 'id', None) or getattr(y, 'kid', None) + items.append(id_val.rsplit('/', 1)[1]) + return items + + return completer diff --git a/src/keyvault/azext_keyvault/_help.py b/src/keyvault/azext_keyvault/_help.py new file mode 100644 index 00000000000..e636b0326d0 --- /dev/null +++ b/src/keyvault/azext_keyvault/_help.py @@ -0,0 +1,173 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from knack.help_files import helps + + +helps['keyvault'] = """ + type: group + short-summary: Safeguard and maintain control of keys, secrets, and certificates. +""" + +helps['keyvault create'] = """ + type: command + short-summary: Create a key vault. + long-summary: Default permissions are created for the current user or service principal unless the `--no-self-perms` flag is specified. +""" + +helps['keyvault delete'] = """ + type: command + short-summary: Delete a key vault. +""" + +helps['keyvault list'] = """ + type: command + short-summary: List key vaults. +""" + +helps['keyvault show'] = """ + type: command + short-summary: Show details of a key vault. +""" + +helps['keyvault update'] = """ + type: command + short-summary: Update the properties of a key vault. +""" + +helps['keyvault recover'] = """ + type: command + short-summary: Recover a key vault. + long-summary: Recovers a previously deleted key vault for which soft delete was enabled. +""" + +helps['keyvault key'] = """ + type: group + short-summary: Manage keys. +""" + +helps['keyvault secret'] = """ + type: group + short-summary: Manage secrets. +""" + +helps['keyvault certificate'] = """ + type: group + short-summary: Manage certificates. +""" + +helps['keyvault storage'] = """ + type: group + short-summary: Manage storage accounts. +""" + +helps['keyvault storage sas-definition'] = """ + type: group + short-summary: Manage storage account SAS definitions. +""" + +helps['keyvault network-rule'] = """ + type: group + short-summary: Manage vault network ACLs. +""" + +helps['keyvault certificate download'] = """ + type: command + short-summary: Download the public portion of a Key Vault certificate. + long-summary: The certificate formatted as either PEM or DER. PEM is the default. + examples: + - name: Download a certificate as PEM and check its fingerprint in openssl. + text: > + az keyvault certificate download --vault-name vault -n cert-name -f cert.pem && \\ + openssl x509 -in cert.pem -inform PEM -noout -sha1 -fingerprint + - name: Download a certificate as DER and check its fingerprint in openssl. + text: > + az keyvault certificate download --vault-name vault -n cert-name -f cert.crt -e DER && \\ + openssl x509 -in cert.crt -inform DER -noout -sha1 -fingerprint +""" + +helps['keyvault certificate get-default-policy'] = """ + type: command + short-summary: Get the default policy for self-signed certificates. + long-summary: > + This default policy can be used in conjunction with `az keyvault create` to create a self-signed certificate. + The default policy can also be used as a starting point to create derivative policies.\n + + For more details, see: https://docs.microsoft.com/en-us/rest/api/keyvault/certificates-and-policies + examples: + - name: Create a self-signed certificate with the default policy + text: > + az keyvault certificate create --vault-name vaultname -n cert1 \\ + -p "$(az keyvault certificate get-default-policy)" +""" + +helps['keyvault certificate create'] = """ + type: command + short-summary: Create a Key Vault certificate. + long-summary: Certificates can be used as a secrets for provisioned virtual machines. + examples: + - name: Create a self-signed certificate with the default policy and add it to a virtual machine. + text: > + az keyvault certificate create --vault-name vaultname -n cert1 \\ + -p "$(az keyvault certificate get-default-policy)" + + secrets=$(az keyvault secret list-versions --vault-name vaultname \\ + -n cert1 --query "[?attributes.enabled].id" -o tsv) + + vm_secrets=$(az vm secret format -s "$secrets") \n + + az vm create -g group-name -n vm-name --admin-username deploy \\ + --image debian --secrets "$vm_secrets" +""" + +helps['keyvault certificate import'] = """ + type: command + short-summary: Import a certificate into KeyVault. + long-summary: Certificates can also be used as a secrets in provisioned virtual machines. + examples: + - name: Create a service principal with a certificate, add the certificate to Key Vault and provision a VM with that certificate. + text: > + service_principal=$(az ad sp create-for-rbac --create-cert) \n + + cert_file=$(echo $service_principal | jq .fileWithCertAndPrivateKey -r) \n + + az keyvault create -g my-group -n vaultname \n + + az keyvault certificate import --vault-name vaultname -n cert_file \n + + secrets=$(az keyvault secret list-versions --vault-name vaultname \\ + -n cert1 --query "[?attributes.enabled].id" -o tsv) + + vm_secrets=$(az vm secret format -s "$secrets") \n + + az vm create -g group-name -n vm-name --admin-username deploy \\ + --image debian --secrets "$vm_secrets" +""" + +helps['keyvault certificate pending'] = """ + type: group + short-summary: Manage pending certificate creation operations. +""" + +helps['keyvault certificate contact'] = """ + type: group + short-summary: Manage contacts for certificate management. +""" + +helps['keyvault certificate issuer'] = """ + type: group + short-summary: Manage certificate issuer information. +""" + +helps['keyvault certificate issuer admin'] = """ + type: group + short-summary: Manage admin information for certificate issuers. +""" diff --git a/src/keyvault/azext_keyvault/_params.py b/src/keyvault/azext_keyvault/_params.py new file mode 100644 index 00000000000..fc8c1de49d1 --- /dev/null +++ b/src/keyvault/azext_keyvault/_params.py @@ -0,0 +1,228 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from argcomplete.completers import FilesCompleter + +from knack.arguments import CLIArgumentType + +import azure.cli.core.commands.arm # pylint: disable=unused-import +from azure.cli.core.commands.validators import get_default_location_from_resource_group +from azure.cli.core.commands.parameters import ( + get_resource_name_completion_list, resource_group_name_type, tags_type, file_type, get_three_state_flag, + get_enum_type) +from azure.cli.core.util import get_json_object + +from ._completers import ( + get_keyvault_name_completion_list, get_keyvault_version_completion_list) +from ._validators import ( + datetime_type, certificate_type, + get_vault_base_url_type, validate_key_import_source, + validate_key_type, validate_policy_permissions, + validate_principal, validate_resource_group_name, + validate_x509_certificate_chain, + secret_text_encoding_values, secret_binary_encoding_values, validate_subnet) + + +# CUSTOM CHOICE LISTS + +secret_encoding_values = secret_text_encoding_values + secret_binary_encoding_values +certificate_format_values = ['PEM', 'DER'] + + +# pylint: disable=too-many-locals, too-many-branches, too-many-statements, line-too-long +def load_arguments(self, _): + from azext_keyvault.keyvault.models import JsonWebKeyOperation + from azext_keyvault.keyvault.models import KeyAttributes, SecretAttributes, CertificateAttributes, StorageAccountAttributes + from azext_keyvault.mgmt.keyvault.models.key_vault_management_client_enums import ( + SkuName, KeyPermissions, SecretPermissions, CertificatePermissions, StoragePermissions, NetworkRuleBypassOptions, NetworkRuleAction) + + # ARGUMENT DEFINITIONS + vault_name_type = CLIArgumentType( + help='Name of the key vault.', options_list=['--vault-name'], metavar='NAME', id_part=None, + completer=get_resource_name_completion_list('Microsoft.KeyVault/vaults')) + + # region vault (management) + with self.argument_context('keyvault') as c: + c.argument('resource_group_name', resource_group_name_type, id_part=None, required=False, help='Proceed only if Key Vault belongs to the specified resource group.', validator=validate_resource_group_name) + c.argument('vault_name', vault_name_type, options_list=['--name', '-n']) + c.argument('object_id', help='a GUID that identifies the principal that will receive permissions') + c.argument('spn', help='name of a service principal that will receive permissions') + c.argument('upn', help='name of a user principal that will receive permissions') + c.argument('tags', tags_type) + c.argument('enabled_for_deployment', arg_type=get_three_state_flag(), help='Allow Virtual Machines to retrieve certificates stored as secrets from the vault.') + c.argument('enabled_for_disk_encryption', arg_type=get_three_state_flag(), help='Allow Disk Encryption to retrieve secrets from the vault and unwrap keys.') + c.argument('enabled_for_template_deployment', arg_type=get_three_state_flag(), help='Allow Resource Manager to retrieve secrets from the vault.') + c.argument('enable_soft_delete', arg_type=get_three_state_flag(), help='Enable vault deletion recovery for the vault, and all contained entities') + c.argument('enable_purge_protection', arg_type=get_three_state_flag(), help='Prevents manual purging of deleted vault, and all contained entities') + + with self.argument_context('keyvault', arg_group='Network Rule') as c: + c.argument('bypass', arg_type=get_enum_type(NetworkRuleBypassOptions), nargs='+', help='Bypass traffic for space-separated uses.') + c.argument('default_action', arg_type=get_enum_type(NetworkRuleAction), help='Default action to apply when no rule matches.') + + 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', completer=None) + c.argument('sku', arg_type=get_enum_type(SkuName, default=SkuName.standard.value)) + c.argument('no_self_perms', arg_type=get_three_state_flag(), help="Don't add permissions for the current user/service principal in the new vault.") + c.argument('location', validator=get_default_location_from_resource_group) + + with self.argument_context('keyvault list') as c: + c.argument('resource_group_name', resource_group_name_type, validator=None) + + with self.argument_context('keyvault delete-policy') as c: + c.argument('object_id', validator=validate_principal) + + with self.argument_context('keyvault set-policy', arg_group='Permission') as c: + c.argument('key_permissions', arg_type=get_enum_type(KeyPermissions), metavar='PERM', nargs='*', help='Space-separated list of key permissions to assign.', validator=validate_policy_permissions) + c.argument('secret_permissions', arg_type=get_enum_type(SecretPermissions), metavar='PERM', nargs='*', help='Space-separated list of secret permissions to assign.') + c.argument('certificate_permissions', arg_type=get_enum_type(CertificatePermissions), metavar='PERM', nargs='*', help='Space-separated list of certificate permissions to assign.') + c.argument('storage_permissions', arg_type=get_enum_type(StoragePermissions), metavar='PERM', nargs='*', help='Space-separated list of storage permissions to assign.') + + with self.argument_context('keyvault network-rule') as c: + c.argument('ip_address', help='IPv4 address or CIDR range.') + c.argument('subnet', help='Name or ID of subnet. If name is supplied, `--vnet-name` must be supplied.') + c.argument('vnet_name', help='Name of a virtual network.', validator=validate_subnet) + # endregion + + # region Shared + for item in ['key', 'secret', 'certificate', 'storage']: + with self.argument_context('keyvault ' + item) as c: + c.argument(item.replace('-', '_') + '_name', options_list=['--name', '-n'], help='Name of the {}.'.format(item), id_part='child_name_1', completer=get_keyvault_name_completion_list(item)) + c.argument('vault_base_url', vault_name_type, type=get_vault_base_url_type(self.cli_ctx), id_part=None) + # endregion + + # region keys + with self.argument_context('keyvault key') as c: + c.argument('key_ops', arg_type=get_enum_type(JsonWebKeyOperation), options_list=['--ops'], nargs='*', help='Space-separated list of permitted JSON web key operations.') + c.argument('key_version', options_list=['--version', '-v'], help='The key version. If omitted, uses the latest version.', default='', required=False, completer=get_keyvault_version_completion_list('key')) + + for scope in ['keyvault key create', 'keyvault key import']: + with self.argument_context(scope) as c: + c.argument('destination', arg_type=get_enum_type(['software', 'hsm']), options_list=['--protection', '-p'], help='Specifies the type of key protection.', validator=validate_key_type) + c.argument('disabled', arg_type=get_three_state_flag(), help='Create key in disabled state.') + c.argument('key_size', options_list=['--size'], type=int) + c.argument('expires', default=None, help='Expiration UTC datetime (Y-m-d\'T\'H:M:S\'Z\').', type=datetime_type) + c.argument('not_before', default=None, help='Key not usable before the provided UTC datetime (Y-m-d\'T\'H:M:S\'Z\').', type=datetime_type) + + with self.argument_context('keyvault key import', arg_group='Key Source') as c: + c.argument('pem_file', type=file_type, help='PEM file containing the key to be imported.', completer=FilesCompleter(), validator=validate_key_import_source) + c.argument('pem_password', help='Password of PEM file.') + c.argument('byok_file', type=file_type, help='BYOK file containing the key to be imported. Must not be password protected.', completer=FilesCompleter()) + + with self.argument_context('keyvault key backup') as c: + c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='Local file path in which to store key backup.') + + with self.argument_context('keyvault key restore') as c: + c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='Local key backup from which to restore key.') + + with self.argument_context('keyvault key set-attributes') as c: + c.attributes_argument('key', KeyAttributes) + # endregion + + # region KeyVault Secret + with self.argument_context('keyvault secret') as c: + c.argument('secret_version', options_list=['--version', '-v'], help='The secret version. If omitted, uses the latest version.', default='', required=False, completer=get_keyvault_version_completion_list('secret')) + + with self.argument_context('keyvault secret set') as c: + c.argument('content_type', options_list=['--description'], help='Description of the secret contents (e.g. password, connection string, etc)') + c.attributes_argument('secret', SecretAttributes, create=True) + + with self.argument_context('keyvault secret set', arg_group='Content Source') as c: + c.argument('value', options_list=['--value'], help="Plain text secret value. Cannot be used with '--file' or '--encoding'", required=False) + c.extra('file_path', options_list=['--file', '-f'], type=file_type, help="Source file for secret. Use in conjunction with '--encoding'", completer=FilesCompleter()) + c.extra('encoding', arg_type=get_enum_type(secret_encoding_values, default='utf-8'), options_list=['--encoding', '-e'], help='Source file encoding. The value is saved as a tag (`file-encoding=`) and used during download to automatically encode the resulting file.') + + with self.argument_context('keyvault secret set-attributes') as c: + c.attributes_argument('secret', SecretAttributes) + + with self.argument_context('keyvault secret download') as c: + c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='File to receive the secret contents.') + c.argument('encoding', arg_type=get_enum_type(secret_encoding_values), options_list=['--encoding', '-e'], help="Encoding of the destination file. By default, will look for the 'file-encoding' tag on the secret. Otherwise will assume 'utf-8'.", default=None) + # endregion + + # region KeyVault Storage Account + + with self.argument_context('keyvault storage') as c: + c.argument('storage_account_name', options_list=['--name', '-n'], help='Name to identify the storage account in the vault.', id_part='child_name_1', completer=get_keyvault_name_completion_list('storage_account')) + + with self.argument_context('keyvault storage add') as c: + c.attributes_argument('storage_account', StorageAccountAttributes, create=True) + + with self.argument_context('keyvault storage backup') as c: + c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='Local file path in which to store storage account backup.') + + with self.argument_context('keyvault storagerestore') as c: + c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='Local key backup from which to restore storage account.') + + # endregion + + # KeyVault Certificate + with self.argument_context('keyvault certificate') as c: + c.argument('certificate_version', options_list=['--version', '-v'], help='The certificate version. If omitted, uses the latest version.', default='', required=False, completer=get_keyvault_version_completion_list('certificate')) + c.argument('validity', type=int, help='Number of months the certificate is valid for. Overrides the value specified with --policy/-p') + + # TODO: Remove workaround when https://github.com/Azure/azure-rest-api-specs/issues/1153 is fixed + with self.argument_context('keyvault certificate create') as c: + c.attributes_argument('certificate', CertificateAttributes, True, ignore=['expires', 'not_before']) + + with self.argument_context('keyvault certificate set-attributes') as c: + c.attributes_argument('certificate', CertificateAttributes, ignore=['expires', 'not_before']) + + for item in ['create', 'set-attributes', 'import']: + with self.argument_context('keyvault certificate ' + item) as c: + c.argument('certificate_policy', options_list=['--policy', '-p'], help='JSON encoded policy defintion. Use @{file} to load from a file.', type=get_json_object) + + with self.argument_context('keyvault certificate import') as c: + c.argument('certificate_data', options_list=['--file', '-f'], completer=FilesCompleter(), help='PKCS12 file or PEM file containing the certificate and private key.', type=certificate_type) + c.argument('password', help="If the private key in certificate is encrypted, the password used for encryption.") + c.extra('disabled', arg_type=get_three_state_flag(), help='Import the certificate in disabled state.') + + with self.argument_context('keyvault certificate download') as c: + c.argument('file_path', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='File to receive the binary certificate contents.') + c.argument('encoding', arg_type=get_enum_type(certificate_format_values), options_list=['--encoding', '-e'], help='Encoding of the certificate. DER will create a binary DER formatted x509 certificate, and PEM will create a base64 PEM x509 certificate.') + + # TODO: Fix once service side issue is fixed that there is no way to list pending certificates + with self.argument_context('keyvault certificate pending') as c: + c.argument('certificate_name', options_list=['--name', '-n'], help='Name of the pending certificate.', id_part='child_name_1', completer=None) + + with self.argument_context('keyvault certificate pending merge') as c: + c.argument('x509_certificates', options_list=['--file', '-f'], type=file_type, completer=FilesCompleter(), help='File containing the certificate or certificate chain to merge.', validator=validate_x509_certificate_chain) + c.attributes_argument('certificate', CertificateAttributes, True) + + with self.argument_context('keyvault certificate pending cancel') as c: + c.ignore('cancellation_requested') + + with self.argument_context('keyvault certificate contact') as c: + c.argument('contact_email', options_list=['--email'], help='Contact e-mail address. Must be unique.') + c.argument('contact_name', options_list=['--name'], help='Full contact name.') + c.argument('contact_phone', options_list=['--phone'], help='Contact phone number.') + + with self.argument_context('keyvault certificate issuer admin') as c: + c.argument('email', options_list=['--email'], help='Admin e-mail address. Must be unique within the vault.') + c.argument('name', options_list=['--name'], help='Full admin name.') + c.argument('phone', options_list=['--phone'], help='Amin phone number.') + + with self.argument_context('keyvault certificate issuer') as c: + c.argument('issuer_name', help='Certificate issuer name.') + c.argument('disabled', arg_type=get_three_state_flag(), help='Set issuer to disabled state.') + c.argument('enabled', arg_type=get_three_state_flag(), help='Set issuer enabled state.') + + with self.argument_context('keyvault certificate issuer', arg_group='Issuer Credential') as c: + c.argument('account_id') + c.argument('password') + + with self.argument_context('keyvault certificate issuer', arg_group='Organization Detail') as c: + c.argument('organization_id') + c.argument('admin_first_name') + c.argument('admin_last_name') + c.argument('admin_email') + c.argument('admin_phone') + # endregion diff --git a/src/keyvault/azext_keyvault/_validators.py b/src/keyvault/azext_keyvault/_validators.py new file mode 100644 index 00000000000..f2fb4d94751 --- /dev/null +++ b/src/keyvault/azext_keyvault/_validators.py @@ -0,0 +1,245 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import argparse +import base64 +import binascii +from datetime import datetime +import re + +from knack.util import CLIError + +from azure.cli.core.commands.client_factory import get_mgmt_service_client +from azure.cli.core.commands.validators import validate_tags + + +secret_text_encoding_values = ['utf-8', 'utf-16le', 'utf-16be', 'ascii'] +secret_binary_encoding_values = ['base64', 'hex'] + + +def _extract_version(item_id): + return item_id.split('/')[-1] + + +def _get_resource_group_from_vault_name(cli_ctx, vault_name): + """ + Fetch resource group from vault name + :param str vault_name: name of the key vault + :return: resource group name or None + :rtype: str + """ + from azext_keyvault.mgmt.keyvault import KeyVaultManagementClient + from msrestazure.tools import parse_resource_id + + client = get_mgmt_service_client(cli_ctx, KeyVaultManagementClient).vaults + for vault in client.list(): + id_comps = parse_resource_id(vault.id) + if id_comps['name'] == vault_name: + return id_comps['resource_group'] + return None + + +# COMMAND NAMESPACE VALIDATORS + + +def process_certificate_cancel_namespace(namespace): + namespace.cancellation_requested = True + + +def process_secret_set_namespace(namespace): + validate_tags(namespace) + + content = namespace.value + file_path = namespace.file_path + encoding = namespace.encoding + tags = namespace.tags or {} + + use_error = CLIError("incorrect usage: [Required] --value VALUE | --file PATH") + + if (content and file_path) or (not content and not file_path): + raise use_error + + encoding = encoding or 'utf-8' + if file_path: + if encoding in secret_text_encoding_values: + with open(file_path, 'r') as f: + try: + content = f.read() + except UnicodeDecodeError: + raise CLIError("Unable to decode file '{}' with '{}' encoding.".format( + file_path, encoding)) + encoded_str = content + encoded = content.encode(encoding) + decoded = encoded.decode(encoding) + elif encoding == 'base64': + with open(file_path, 'rb') as f: + content = f.read() + try: + encoded = base64.encodebytes(content) + except AttributeError: + encoded = base64.encodestring(content) # pylint: disable=deprecated-method + encoded_str = encoded.decode('utf-8') + decoded = base64.b64decode(encoded_str) + elif encoding == 'hex': + with open(file_path, 'rb') as f: + content = f.read() + encoded = binascii.b2a_hex(content) + encoded_str = encoded.decode('utf-8') + decoded = binascii.unhexlify(encoded_str) + + if content != decoded: + raise CLIError("invalid encoding '{}'".format(encoding)) + + content = encoded_str + + tags.update({'file-encoding': encoding}) + namespace.tags = tags + namespace.value = content + + +# PARAMETER NAMESPACE VALIDATORS + + +def get_attribute_validator(name, attribute_class, create=False): + def validator(ns): + ns_dict = ns.__dict__ + enabled = not ns_dict.pop('disabled') if create else ns_dict.pop('enabled') + attributes = attribute_class( + enabled=enabled, + not_before=ns_dict.pop('not_before', None), + expires=ns_dict.pop('expires', None)) + setattr(ns, '{}_attributes'.format(name), attributes) + + return validator + + +def validate_key_import_source(ns): + byok_file = ns.byok_file + pem_file = ns.pem_file + pem_password = ns.pem_password + if (not byok_file and not pem_file) or (byok_file and pem_file): + raise ValueError('supply exactly one: --byok-file, --pem-file') + if byok_file and pem_password: + raise ValueError('--byok-file cannot be used with --pem-password') + if pem_password and not pem_file: + raise ValueError('--pem-password must be used with --pem-file') + + +def validate_key_type(ns): + if ns.destination: + dest_to_type_map = { + 'software': 'RSA', + 'hsm': 'RSA-HSM' + } + ns.destination = dest_to_type_map[ns.destination] + if ns.destination == 'RSA' and hasattr(ns, 'byok_file') and ns.byok_file: + raise CLIError('BYOK keys are hardware protected. Omit --protection') + + +def validate_policy_permissions(ns): + key_perms = ns.key_permissions + secret_perms = ns.secret_permissions + cert_perms = ns.certificate_permissions + storage_perms = ns.storage_permissions + + if not any([key_perms, secret_perms, cert_perms, storage_perms]): + raise argparse.ArgumentError( + None, + 'specify at least one: --key-permissions, --secret-permissions, ' + '--certificate-permissions --storage-permissions') + + +def validate_principal(ns): + num_set = sum(1 for p in [ns.object_id, ns.spn, ns.upn] if p) + if num_set != 1: + raise argparse.ArgumentError( + None, 'specify exactly one: --object-id, --spn, --upn') + + +def validate_resource_group_name(cmd, ns): + if not ns.resource_group_name: + vault_name = ns.vault_name + group_name = _get_resource_group_from_vault_name(cmd.cli_ctx, vault_name) + if group_name: + ns.resource_group_name = group_name + else: + msg = "The Resource 'Microsoft.KeyVault/vaults/{}' not found within subscription." + raise CLIError(msg.format(vault_name)) + + +def validate_x509_certificate_chain(ns): + def _load_certificate_as_bytes(file_name): + cert_list = [] + regex = r'-----BEGIN CERTIFICATE-----([^-]+)-----END CERTIFICATE-----' + with open(file_name, 'r') as f: + cert_data = f.read() + for entry in re.findall(regex, cert_data): + cert_list.append(base64.b64decode(entry.replace('\n', ''))) + return cert_list + + ns.x509_certificates = _load_certificate_as_bytes(ns.x509_certificates) + + +# ARGUMENT TYPES + + +def certificate_type(string): + """ Loads file and outputs contents as base64 encoded string. """ + import os + with open(os.path.expanduser(string), 'rb') as f: + cert_data = f.read() + return cert_data + + +def datetime_type(string): + """ Validates UTC datettime in accepted format. Examples: 2017-12-31T01:11:59Z, + 2017-12-31T01:11Z or 2017-12-31T01Z or 2017-12-31 """ + accepted_date_formats = ['%Y-%m-%dT%H:%M:%SZ', '%Y-%m-%dT%H:%MZ', + '%Y-%m-%dT%HZ', '%Y-%m-%d'] + for form in accepted_date_formats: + try: + return datetime.strptime(string, form) + except ValueError: # checks next format + pass + raise ValueError("Input '{}' not valid. Valid example: 2000-12-31T12:59:59Z".format(string)) + + +def get_vault_base_url_type(cli_ctx): + + suffix = cli_ctx.cloud.suffixes.keyvault_dns + + def vault_base_url_type(name): + return 'https://{}{}'.format(name, suffix) + + return vault_base_url_type + + +def validate_subnet(cmd, namespace): + from msrestazure.tools import resource_id, is_valid_resource_id + from azure.cli.core.commands.client_factory import get_subscription_id + + subnet = namespace.subnet + subnet_is_id = is_valid_resource_id(subnet) + vnet = namespace.vnet_name + + if (subnet_is_id and not vnet) or (not subnet and not vnet): + return + elif subnet and not subnet_is_id and vnet: + namespace.subnet = resource_id( + subscription=get_subscription_id(cmd.cli_ctx), + resource_group=namespace.resource_group_name, + namespace='Microsoft.Network', + type='virtualNetworks', + name=vnet, + child_type_1='subnets', + child_name_1=subnet) + else: + raise CLIError('incorrect usage: [--subnet ID | --subnet NAME --vnet-name NAME]') diff --git a/src/keyvault/azext_keyvault/commands.py b/src/keyvault/azext_keyvault/commands.py new file mode 100644 index 00000000000..06c1e0ba7c3 --- /dev/null +++ b/src/keyvault/azext_keyvault/commands.py @@ -0,0 +1,155 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# 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.commands import CliCommandType +from azure.cli.core.util import empty_on_404 + +from ._client_factory import ( + keyvault_client_vaults_factory, keyvault_data_plane_factory) + +from ._validators import ( + process_secret_set_namespace, process_certificate_cancel_namespace) + + +# pylint: disable=too-many-locals, too-many-statements +def load_command_table(self, _): + + # region Command Types + kv_vaults_custom = CliCommandType( + operations_tmpl='azext_keyvault.custom#{}', + client_factory=keyvault_client_vaults_factory + ) + + kv_vaults_sdk = CliCommandType( + operations_tmpl='azext_keyvault.mgmt.keyvault.operations.vaults_operations#VaultsOperations.{}', + client_factory=keyvault_client_vaults_factory + ) + + kv_data_sdk = CliCommandType( + operations_tmpl='azext_keyvault.keyvault.key_vault_client#KeyVaultClient.{}', + client_factory=keyvault_data_plane_factory + ) + # endregion + + def _data_sdk_path(method): + return kv_data_sdk.settings['operations_tmpl'].format(method) + + # Management Plane Commands + with self.command_group('keyvault', kv_vaults_sdk, client_factory=keyvault_client_vaults_factory) as g: + g.custom_command('create', 'create_keyvault', doc_string_source='azext_keyvault.mgmt.keyvault.models#VaultProperties') + g.custom_command('recover', 'recover_keyvault') + g.custom_command('list', 'list_keyvault') + g.command('show', 'get', exception_handler=empty_on_404) + g.command('delete', 'delete') + g.command('purge', 'purge_deleted') + g.custom_command('set-policy', 'set_policy') + g.custom_command('delete-policy', 'delete_policy') + g.command('list-deleted', 'list_deleted') + g.generic_update_command('update', setter_name='update_keyvault_setter', setter_type=kv_vaults_custom, + custom_func_name='update_keyvault') + + with self.command_group('keyvault network-rule', kv_vaults_sdk, client_factory=keyvault_client_vaults_factory) as g: + g.custom_command('add', 'add_network_rule') + g.custom_command('remove', 'remove_network_rule') + g.custom_command('list', 'list_network_rules') + + # Data Plane Commands + with self.command_group('keyvault key', kv_data_sdk) as g: + g.keyvault_command('list', 'get_keys') + g.keyvault_command('list-versions', 'get_key_versions') + g.keyvault_command('list-deleted', 'get_deleted_keys') + g.keyvault_custom('create', 'create_key', doc_string_source=_data_sdk_path('create_key')) + g.keyvault_command('set-attributes', 'update_key') + g.keyvault_command('show', 'get_key') + g.keyvault_command('show-deleted', 'get_deleted_key') + g.keyvault_command('delete', 'delete_key') + g.keyvault_command('purge', 'purge_deleted_key') + g.keyvault_command('recover', 'recover_deleted_key') + g.keyvault_custom('backup', 'backup_key', doc_string_source=_data_sdk_path('backup_key')) + g.keyvault_custom('restore', 'restore_key', doc_string_source=_data_sdk_path('restore_key')) + g.keyvault_custom('import', 'import_key') + + with self.command_group('keyvault secret', kv_data_sdk) as g: + g.keyvault_command('list', 'get_secrets') + g.keyvault_command('list-versions', 'get_secret_versions') + g.keyvault_command('list-deleted', 'get_deleted_secrets') + g.keyvault_command('set', 'set_secret', validator=process_secret_set_namespace) + g.keyvault_command('set-attributes', 'update_secret') + g.keyvault_command('show', 'get_secret') + g.keyvault_command('show-deleted', 'get_deleted_secret') + g.keyvault_command('delete', 'delete_secret') + g.keyvault_command('purge', 'purge_deleted_secret') + g.keyvault_command('recover', 'recover_deleted_secret') + g.keyvault_custom('download', 'download_secret') + g.keyvault_custom('backup', 'backup_secret', doc_string_source=_data_sdk_path('backup_secret')) + g.keyvault_custom('restore', 'restore_secret', doc_string_source=_data_sdk_path('restore_secret')) + + with self.command_group('keyvault certificate', kv_data_sdk) as g: + g.keyvault_custom('create', 'create_certificate', doc_string_source=_data_sdk_path('create_certificate')) + g.keyvault_command('list', 'get_certificates') + g.keyvault_command('list-versions', 'get_certificate_versions') + g.keyvault_command('list-deleted', 'get_deleted_certificates') + g.keyvault_command('show', 'get_certificate') + g.keyvault_command('show-deleted', 'get_deleted_certificate') + g.keyvault_command('delete', 'delete_certificate') + g.keyvault_command('purge', 'purge_deleted_certificate') + g.keyvault_command('recover', 'recover_deleted_certificate') + g.keyvault_command('set-attributes', 'update_certificate') + g.keyvault_custom('import', 'import_certificate') + g.keyvault_custom('download', 'download_certificate') + g.keyvault_custom('get-default-policy', 'get_default_policy') + + with self.command_group('keyvault certificate pending', kv_data_sdk) as g: + g.keyvault_command('merge', 'merge_certificate') + g.keyvault_command('show', 'get_certificate_operation') + g.keyvault_command('delete', 'delete_certificate_operation', validator=process_certificate_cancel_namespace) + + with self.command_group('keyvault certificate contact', kv_data_sdk) as g: + g.keyvault_command('list', 'get_certificate_contacts') + g.keyvault_custom('add', 'add_certificate_contact') + g.keyvault_custom('delete', 'delete_certificate_contact') + + with self.command_group('keyvault certificate issuer', kv_data_sdk) as g: + g.keyvault_custom('update', 'update_certificate_issuer') + g.keyvault_command('list', 'get_certificate_issuers') + g.keyvault_custom('create', 'create_certificate_issuer') + g.keyvault_command('show', 'get_certificate_issuer') + g.keyvault_command('delete', 'delete_certificate_issuer') + + with self.command_group('keyvault certificate issuer admin', kv_data_sdk) as g: + g.keyvault_custom('list', 'list_certificate_issuer_admins') + g.keyvault_custom('add', 'add_certificate_issuer_admin') + g.keyvault_custom('delete', 'delete_certificate_issuer_admin') + + with self.command_group('keyvault storage', kv_data_sdk) as g: + g.keyvault_command('add', 'set_storage_account') + g.keyvault_command('list', 'get_storage_accounts') + g.keyvault_command('list-deleted', 'get_deleted_storage_accounts') + g.keyvault_command('show', 'get_storage_account') + g.keyvault_command('show-deleted', 'get_deleted_storage_account') + g.keyvault_command('remove', 'delete_storage_account') + g.keyvault_command('purge', 'purge_deleted_storage_account') + g.keyvault_command('recover', 'recover_deleted_storage_account') + g.keyvault_custom('backup', + 'backup_storage_account', + doc_string_source=_data_sdk_path('backup_storage_account')) + g.keyvault_custom('restore', + 'restore_storage_account', + doc_string_source=_data_sdk_path('restore_storage_account')) + + with self.command_group('keyvault storage sas-definition', kv_data_sdk) as g: + g.keyvault_command('create', 'set_sas_definition') + g.keyvault_command('list', 'get_sas_definitions') + g.keyvault_command('list-deleted', 'get_deleted_sas_definitions') + g.keyvault_command('show', 'get_sas_definition') + g.keyvault_command('show-deleted', 'get_deleted_sas_definition') + g.keyvault_command('delete', 'delete_sas_definition') + g.keyvault_command('recover', 'recover_deleted_sas_definition') diff --git a/src/keyvault/azext_keyvault/custom.py b/src/keyvault/azext_keyvault/custom.py new file mode 100644 index 00000000000..5dbfb845cde --- /dev/null +++ b/src/keyvault/azext_keyvault/custom.py @@ -0,0 +1,954 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +import codecs +import json +import os +import re +import time + +from knack.log import get_logger +from knack.util import CLIError + +from OpenSSL import crypto + +import azure.cli.core.telemetry as telemetry + +from ._validators import secret_text_encoding_values + +logger = get_logger(__name__) + + +def _default_certificate_profile(): + + from azext_keyvault.keyvault.models import \ + (Action, ActionType, KeyUsageType, CertificateAttributes, CertificatePolicy, IssuerParameters, + KeyProperties, LifetimeAction, SecretProperties, X509CertificateProperties, Trigger) + + template = CertificatePolicy( + key_properties=KeyProperties( + exportable=True, + key_type=u'RSA', + key_size=2048, + reuse_key=True + ), + secret_properties=SecretProperties( + content_type=u'application/x-pkcs12' + ), + x509_certificate_properties=X509CertificateProperties( + key_usage=[ + KeyUsageType.c_rl_sign, + KeyUsageType.data_encipherment, + KeyUsageType.digital_signature, + KeyUsageType.key_encipherment, + KeyUsageType.key_agreement, + KeyUsageType.key_cert_sign + ], + subject=u'CN=CLIGetDefaultPolicy', + validity_in_months=12 + ), + lifetime_actions=[LifetimeAction( + trigger=Trigger( + days_before_expiry=90 + ), + action=Action( + action_type=ActionType.auto_renew + ) + )], + issuer_parameters=IssuerParameters( + name=u'Self', + ), + attributes=CertificateAttributes( + enabled=True + ) + ) + del template.id + del template.attributes + del template.issuer_parameters.certificate_type + del template.lifetime_actions[0].trigger.lifetime_percentage + del template.x509_certificate_properties.subject_alternative_names + del template.x509_certificate_properties.ekus + return template + + +def _scaffold_certificate_profile(): + from azext_keyvault.keyvault.models import \ + (Action, ActionType, KeyUsageType, CertificateAttributes, CertificatePolicy, IssuerParameters, + KeyProperties, LifetimeAction, SecretProperties, X509CertificateProperties, SubjectAlternativeNames, Trigger) + + template = CertificatePolicy( + key_properties=KeyProperties( + exportable=True, + key_type=u'(optional) RSA or RSA-HSM (default RSA)', + key_size=2048, + reuse_key=True + ), + secret_properties=SecretProperties( + content_type=u'application/x-pkcs12 or application/x-pem-file' + ), + x509_certificate_properties=X509CertificateProperties( + key_usage=[ + KeyUsageType.c_rl_sign, + KeyUsageType.data_encipherment, + KeyUsageType.digital_signature, + KeyUsageType.key_encipherment, + KeyUsageType.key_agreement, + KeyUsageType.key_cert_sign + ], + subject_alternative_names=SubjectAlternativeNames( + emails=[u'hello@contoso.com'], + dns_names=[u'hr.contoso.com', u'm.contoso.com'], + upns=[] + ), + subject=u'C=US, ST=WA, L=Redmond, O=Contoso, OU=Contoso HR, CN=www.contoso.com', + ekus=[u'1.3.6.1.5.5.7.3.1'], + validity_in_months=24 + ), + lifetime_actions=[LifetimeAction( + trigger=Trigger( + days_before_expiry=90 + ), + action=Action( + action_type=ActionType.auto_renew + ) + )], + issuer_parameters=IssuerParameters( + name=u'Unknown, Self, or {IssuerName}', + certificate_type=u'(optional) DigiCert, GlobalSign or WoSign' + ), + attributes=CertificateAttributes( + enabled=True + ) + ) + del template.id + del template.attributes + return template + + +def list_keyvault(client, resource_group_name=None): + vault_list = client.list_by_resource_group(resource_group_name=resource_group_name) \ + if resource_group_name else client.list() + return list(vault_list) + + +# pylint: disable=inconsistent-return-statements +def _get_current_user_object_id(graph_client): + from msrestazure.azure_exceptions import CloudError + try: + current_user = graph_client.objects.get_current_user() + if current_user and current_user.object_id: # pylint:disable=no-member + return current_user.object_id # pylint:disable=no-member + except CloudError: + pass + + +def _get_object_id_by_spn(graph_client, spn): + accounts = list(graph_client.service_principals.list( + filter="servicePrincipalNames/any(c:c eq '{}')".format(spn))) + if not accounts: + logger.warning("Unable to find user with spn '%s'", spn) + return None + if len(accounts) > 1: + logger.warning("Multiple service principals found with spn '%s'. " + "You can avoid this by specifying object id.", spn) + return None + return accounts[0].object_id + + +def _get_object_id_by_upn(graph_client, upn): + accounts = list(graph_client.users.list(filter="userPrincipalName eq '{}'".format(upn))) + if not accounts: + logger.warning("Unable to find user with upn '%s'", upn) + return None + if len(accounts) > 1: + logger.warning("Multiple users principals found with upn '%s'. " + "You can avoid this by specifying object id.", upn) + return None + return accounts[0].object_id + + +def _get_object_id_from_subscription(graph_client, subscription): + if subscription['user']: + if subscription['user']['type'] == 'user': + return _get_object_id_by_upn(graph_client, subscription['user']['name']) + elif subscription['user']['type'] == 'servicePrincipal': + return _get_object_id_by_spn(graph_client, subscription['user']['name']) + else: + logger.warning("Unknown user type '%s'", subscription['user']['type']) + else: + logger.warning('Current credentials are not from a user or service principal. ' + 'Azure Key Vault does not work with certificate credentials.') + return None + + +def _get_object_id(graph_client, subscription=None, spn=None, upn=None): + if spn: + return _get_object_id_by_spn(graph_client, spn) + if upn: + return _get_object_id_by_upn(graph_client, upn) + return _get_object_id_from_subscription(graph_client, subscription) + + +def _create_network_rule_set(bypass=None, default_action=None): + from azext_keyvault.mgmt.keyvault.models import NetworkRuleSet, NetworkRuleBypassOptions, NetworkRuleAction + + return NetworkRuleSet(bypass=bypass or NetworkRuleBypassOptions.azure_services.value, + default_action=default_action or NetworkRuleAction.allow.value) + + +# region KeyVault Vault +def get_default_policy(client, scaffold=False): # pylint: disable=unused-argument + """ + Get a default certificate policy to be used with `az keyvault certificate create` + :param client: + :param bool scaffold: create a fully formed policy structure with default values + :return: policy dict + :rtype: dict + """ + return _scaffold_certificate_profile() if scaffold else _default_certificate_profile() + + +def recover_keyvault(cmd, client, vault_name, resource_group_name, location): + from azext_keyvault.mgmt.keyvault.models import ( + VaultCreateOrUpdateParameters, CreateMode, Sku, SkuName) + from azure.cli.core._profile import Profile + + profile = Profile(cli_ctx=cmd.cli_ctx) + _, _, tenant_id = profile.get_login_credentials( + resource=cmd.cli_ctx.cloud.endpoints.active_directory_graph_resource_id) + + params = VaultCreateOrUpdateParameters(location=location, + properties={'tenant_id': tenant_id, + 'sku': Sku(name=SkuName.standard.value), + 'create_mode': CreateMode.recover.value}) + + return client.create_or_update(resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=params) + + +def create_keyvault(cmd, client, # pylint: disable=too-many-locals + resource_group_name, vault_name, location=None, sku=None, + enabled_for_deployment=None, + enabled_for_disk_encryption=None, + enabled_for_template_deployment=None, + enable_soft_delete=None, + enable_purge_protection=None, + bypass=None, + default_action=None, + no_self_perms=None, + tags=None): + from azext_keyvault.mgmt.keyvault.models import ( + VaultCreateOrUpdateParameters, Permissions, KeyPermissions, SecretPermissions, + CertificatePermissions, StoragePermissions, AccessPolicyEntry, Sku, VaultProperties) + from azure.cli.core._profile import Profile + from azure.graphrbac.models import GraphErrorException + from azure.graphrbac import GraphRbacManagementClient + + profile = Profile(cli_ctx=cmd.cli_ctx) + cred, _, tenant_id = profile.get_login_credentials( + resource=cmd.cli_ctx.cloud.endpoints.active_directory_graph_resource_id) + + graph_client = GraphRbacManagementClient( + cred, + tenant_id, + base_url=cmd.cli_ctx.cloud.endpoints.active_directory_graph_resource_id) + subscription = profile.get_subscription() + + # if bypass or default_action was specified create a NetworkRuleSet + # if neither were specified we make network_acls None + network_acls = _create_network_rule_set(bypass, default_action) if bypass or default_action else None + + if no_self_perms: + access_policies = [] + else: + permissions = Permissions(keys=[KeyPermissions.get, + KeyPermissions.create, + KeyPermissions.delete, + KeyPermissions.list, + KeyPermissions.update, + KeyPermissions.import_enum, + KeyPermissions.backup, + KeyPermissions.restore, + KeyPermissions.recover], + secrets=[ + SecretPermissions.get, + SecretPermissions.list, + SecretPermissions.set, + SecretPermissions.delete, + SecretPermissions.backup, + SecretPermissions.restore, + SecretPermissions.recover], + certificates=[ + CertificatePermissions.get, + CertificatePermissions.list, + CertificatePermissions.delete, + CertificatePermissions.create, + CertificatePermissions.import_enum, + CertificatePermissions.update, + CertificatePermissions.managecontacts, + CertificatePermissions.getissuers, + CertificatePermissions.listissuers, + CertificatePermissions.setissuers, + CertificatePermissions.deleteissuers, + CertificatePermissions.manageissuers, + CertificatePermissions.recover], + storage=[ + StoragePermissions.get, + StoragePermissions.list, + StoragePermissions.delete, + StoragePermissions.set, + StoragePermissions.update, + StoragePermissions.regeneratekey, + StoragePermissions.setsas, + StoragePermissions.listsas, + StoragePermissions.getsas, + StoragePermissions.deletesas]) + try: + object_id = _get_current_user_object_id(graph_client) + except GraphErrorException: + object_id = _get_object_id(graph_client, subscription=subscription) + if not object_id: + raise CLIError('Cannot create vault.\nUnable to query active directory for information ' + 'about the current user.\nYou may try the --no-self-perms flag to ' + 'create a vault without permissions.') + access_policies = [AccessPolicyEntry(tenant_id=tenant_id, + object_id=object_id, + permissions=permissions)] + properties = VaultProperties(tenant_id=tenant_id, + sku=Sku(name=sku), + access_policies=access_policies, + vault_uri=None, + enabled_for_deployment=enabled_for_deployment, + enabled_for_disk_encryption=enabled_for_disk_encryption, + enabled_for_template_deployment=enabled_for_template_deployment, + enable_soft_delete=enable_soft_delete, + enable_purge_protection=enable_purge_protection, + network_acls=network_acls) + parameters = VaultCreateOrUpdateParameters(location=location, + tags=tags, + properties=properties) + return client.create_or_update(resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=parameters) + + +def update_keyvault_setter(client, parameters, resource_group_name, vault_name): + from azext_keyvault.mgmt.keyvault.models import VaultCreateOrUpdateParameters + return client.create_or_update(resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=VaultCreateOrUpdateParameters( + location=parameters.location, + properties=parameters.properties)) + + +def update_keyvault(instance, enabled_for_deployment=None, + enabled_for_disk_encryption=None, + enabled_for_template_deployment=None, + enable_soft_delete=None, + enable_purge_protection=None, + bypass=None, + default_action=None,): + if enabled_for_deployment is not None: + instance.properties.enabled_for_deployment = enabled_for_deployment + + if enabled_for_disk_encryption is not None: + instance.properties.enabled_for_disk_encryption = enabled_for_disk_encryption + + if enabled_for_template_deployment is not None: + instance.properties.enabled_for_template_deployment = enabled_for_template_deployment + + if enable_soft_delete is not None: + instance.properties.properties.enable_soft_delete = enable_soft_delete + + if enable_purge_protection is not None: + instance.properties.properties.enable_purge_protection = enable_purge_protection + + if bypass or default_action: + if instance.properties.properties.network_acls is None: + instance.properties.properties.network_acls = _create_network_rule_set(bypass, default_action) + else: + if bypass: + instance.properties.properties.network_acls.bypass = bypass + if default_action: + instance.properties.properties.network_acls.default_action = default_action + return instance + + +def _object_id_args_helper(cli_ctx, object_id, spn, upn): + if not object_id: + from azure.cli.core._profile import Profile + from azure.graphrbac import GraphRbacManagementClient + + profile = Profile(cli_ctx=cli_ctx) + cred, _, tenant_id = profile.get_login_credentials( + resource=cli_ctx.cloud.endpoints.active_directory_graph_resource_id) + graph_client = GraphRbacManagementClient(cred, + tenant_id, + base_url=cli_ctx.cloud.endpoints.active_directory_graph_resource_id) + object_id = _get_object_id(graph_client, spn=spn, upn=upn) + if not object_id: + raise CLIError('Unable to get object id from principal name.') + return object_id + + +def set_policy(cmd, client, resource_group_name, vault_name, + object_id=None, spn=None, upn=None, key_permissions=None, secret_permissions=None, + certificate_permissions=None, storage_permissions=None): + """ Update security policy settings for a Key Vault. """ + from azext_keyvault.mgmt.keyvault.models import ( + VaultCreateOrUpdateParameters, AccessPolicyEntry, Permissions) + object_id = _object_id_args_helper(cmd.cli_ctx, object_id, spn, upn) + vault = client.get(resource_group_name=resource_group_name, + vault_name=vault_name) + # Find the existing policy to set + policy = next((p for p in vault.properties.access_policies + if object_id.lower() == p.object_id.lower() and + vault.properties.tenant_id.lower() == p.tenant_id.lower()), None) + if not policy: + # Add new policy as none found + vault.properties.access_policies.append(AccessPolicyEntry( + tenant_id=vault.properties.tenant_id, + object_id=object_id, + permissions=Permissions(keys=key_permissions, + secrets=secret_permissions, + certificates=certificate_permissions, + storage=storage_permissions))) + else: + # Modify existing policy. + # If key_permissions is not set, use prev. value (similarly with secret_permissions). + keys = policy.permissions.keys if key_permissions is None else key_permissions + secrets = policy.permissions.secrets if secret_permissions is None else secret_permissions + certs = policy.permissions.certificates \ + if certificate_permissions is None else certificate_permissions + storage = policy.permissions.storage if storage_permissions is None else storage_permissions + policy.permissions = Permissions(keys=keys, secrets=secrets, certificates=certs, storage=storage) + return client.create_or_update(resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=VaultCreateOrUpdateParameters( + location=vault.location, + tags=vault.tags, + properties=vault.properties)) + + +def add_network_rule(cmd, client, resource_group_name, vault_name, ip_address=None, subnet=None, vnet_name=None): # pylint: disable=unused-argument + """ Add a network rule to the network ACLs for a Key Vault. """ + from azext_keyvault.mgmt.keyvault.models import VirtualNetworkRule, IPRule, VaultCreateOrUpdateParameters + + vault = client.get(resource_group_name=resource_group_name, vault_name=vault_name) + vault.properties.network_acls = vault.properties.network_acls or _create_network_rule_set() + rules = vault.properties.network_acls + + if subnet: + rules.virtual_network_rules = rules.virtual_network_rules or [] + rules.virtual_network_rules.append(VirtualNetworkRule(id=subnet)) + + if ip_address: + rules.ip_rules = rules.ip_rules or [] + rules.ip_rules.append(IPRule(value=ip_address)) + + return client.create_or_update(resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=VaultCreateOrUpdateParameters( + location=vault.location, + tags=vault.tags, + properties=vault.properties)) + + +def remove_network_rule(cmd, client, resource_group_name, vault_name, ip_address=None, subnet=None, vnet_name=None): # pylint: disable=unused-argument + """ Removes a network rule from the network ACLs for a Key Vault. """ + from azext_keyvault.mgmt.keyvault.models import VaultCreateOrUpdateParameters + + vault = client.get(resource_group_name=resource_group_name, vault_name=vault_name) + + if not vault.properties.network_acls: + return vault + + rules = vault.properties.network_acls + + modified = False + + if subnet and rules.virtual_network_rules: + new_rules = [x for x in rules.virtual_network_rules if x.id != subnet] + modified |= len(new_rules) != len(rules.virtual_network_rules) + if modified: + rules.virtual_network_rules = new_rules + + if ip_address and rules.ip_rules: + new_rules = [x for x in rules.ip_rules if x.value != ip_address] + modified |= len(new_rules) != len(rules.ip_rules) + if modified: + rules.ip_rules = new_rules + + # if we didn't modify the network rules just return the vault as is + if not modified: + return vault + + # otherwise update + return client.create_or_update(resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=VaultCreateOrUpdateParameters( + location=vault.location, + tags=vault.tags, + properties=vault.properties)) + + +def list_network_rules(cmd, client, resource_group_name, vault_name): # pylint: disable=unused-argument + """ Lists the network rules from the network ACLs for a Key Vault. """ + vault = client.get(resource_group_name=resource_group_name, vault_name=vault_name) + return vault.properties.network_acls + + +def delete_policy(cmd, client, resource_group_name, vault_name, object_id=None, spn=None, upn=None): + """ Delete security policy settings for a Key Vault. """ + from azext_keyvault.mgmt.keyvault.models import VaultCreateOrUpdateParameters + object_id = _object_id_args_helper(cmd.cli_ctx, object_id, spn, upn) + vault = client.get(resource_group_name=resource_group_name, + vault_name=vault_name) + prev_policies_len = len(vault.properties.access_policies) + vault.properties.access_policies = [p for p in vault.properties.access_policies if + vault.properties.tenant_id.lower() != p.tenant_id.lower() or + object_id.lower() != p.object_id.lower()] + if len(vault.properties.access_policies) == prev_policies_len: + raise CLIError('No matching policies found') + return client.create_or_update(resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=VaultCreateOrUpdateParameters( + location=vault.location, + tags=vault.tags, + properties=vault.properties)) +# endregion + + +# region KeyVault Key +def create_key(client, vault_base_url, key_name, destination, key_size=None, key_ops=None, + disabled=False, expires=None, not_before=None, tags=None): + from azext_keyvault.keyvault.models import KeyAttributes + key_attrs = KeyAttributes(enabled=not disabled, not_before=not_before, expires=expires) + return client.create_key( + vault_base_url, key_name, destination, key_size, key_ops, key_attrs, tags) + + +def backup_key(client, vault_base_url, key_name, file_path): + backup = client.backup_key(vault_base_url, key_name).value + with open(file_path, 'wb') as output: + output.write(backup) + + +def restore_key(client, vault_base_url, file_path): + with open(file_path, 'rb') as file_in: + data = file_in.read() + return client.restore_key(vault_base_url, data) + + +def import_key(client, vault_base_url, key_name, destination=None, key_ops=None, disabled=False, expires=None, + not_before=None, tags=None, pem_file=None, pem_password=None, byok_file=None): + """ Import a private key. Supports importing base64 encoded private keys from PEM files. + Supports importing BYOK keys into HSM for premium KeyVaults. """ + from azext_keyvault.keyvault.models import KeyAttributes, JsonWebKey + + def _to_bytes(hex_string): + # zero pads and decodes a hex string + if len(hex_string) % 2: + hex_string = '0{}'.format(hex_string) + return codecs.decode(hex_string, 'hex_codec') + + def _set_rsa_parameters(dest, src): + # map OpenSSL parameter names to JsonWebKey property names + conversion_dict = { + 'modulus': 'n', + 'publicExponent': 'e', + 'privateExponent': 'd', + 'prime1': 'p', + 'prime2': 'q', + 'exponent1': 'dp', + 'exponent2': 'dq', + 'coefficient': 'qi' + } + # regex: looks for matches that fit the following patterns: + # integerPattern: 65537 (0x10001) + # hexPattern: + # 00:a0:91:4d:00:23:4a:c6:83:b2:1b:4c:15:d5:be: + # d8:87:bd:c9:59:c2:e5:7a:f5:4a:e7:34:e8:f0:07: + # The desired match should always be the first component of the match + regex = re.compile(r'([^:\s]*(:[^\:)]+\))|([^:\s]*(:\s*[0-9A-Fa-f]{2})+))') + # regex2: extracts the hex string from a format like: 65537 (0x10001) + regex2 = re.compile(r'(?<=\(0x{1})([0-9A-Fa-f]*)(?=\))') + + key_params = crypto.dump_privatekey(crypto.FILETYPE_TEXT, src).decode('utf-8') + for match in regex.findall(key_params): + comps = match[0].split(':', 1) + name = conversion_dict.get(comps[0], None) + if name: + value = comps[1].replace(' ', '').replace('\n', '').replace(':', '') + try: + value = _to_bytes(value) + except Exception: # pylint:disable=broad-except + # if decoding fails it is because of an integer pattern. Extract the hex + # string and retry + value = _to_bytes(regex2.findall(value)[0]) + setattr(dest, name, value) + + key_attrs = KeyAttributes(enabled=not disabled, not_before=not_before, expires=expires) + key_obj = JsonWebKey(key_ops=key_ops) + if pem_file: + key_obj.kty = 'RSA' + logger.info('Reading %s', pem_file) + with open(pem_file, 'r') as f: + pem_data = f.read() + # load private key and prompt for password if encrypted + try: + pem_password = str(pem_password).encode() if pem_password else None + # despite documentation saying password should be a string, it needs to actually + # be UTF-8 encoded bytes + pkey = crypto.load_privatekey(crypto.FILETYPE_PEM, pem_data, pem_password) + except crypto.Error: + raise CLIError( + 'Import failed: Unable to decrypt private key. --pem-password may be incorrect.') + except TypeError: + raise CLIError('Invalid --pem-password.') + logger.info('setting RSA parameters from PEM data') + _set_rsa_parameters(key_obj, pkey) + elif byok_file: + with open(byok_file, 'rb') as f: + byok_data = f.read() + key_obj.kty = 'RSA-HSM' + key_obj.t = byok_data + + return client.import_key( + vault_base_url, key_name, key_obj, destination == 'hsm', key_attrs, tags) +# endregion + + +# region KeyVault Secret +def download_secret(client, vault_base_url, secret_name, file_path, encoding=None, + secret_version=''): + """ Download a secret from a KeyVault. """ + if os.path.isfile(file_path) or os.path.isdir(file_path): + raise CLIError("File or directory named '{}' already exists.".format(file_path)) + + secret = client.get_secret(vault_base_url, secret_name, secret_version) + + if not encoding: + encoding = secret.tags.get('file-encoding', 'utf-8') if secret.tags else 'utf-8' + + secret_value = secret.value + + try: + if encoding in secret_text_encoding_values: + with open(file_path, 'w') as f: + f.write(secret_value) + else: + if encoding == 'base64': + import base64 + decoded = base64.b64decode(secret_value) + elif encoding == 'hex': + import binascii + decoded = binascii.unhexlify(secret_value) + + with open(file_path, 'wb') as f: + f.write(decoded) + except Exception as ex: # pylint: disable=broad-except + if os.path.isfile(file_path): + os.remove(file_path) + raise ex + + +def backup_secret(client, vault_base_url, secret_name, file_path): + backup = client.backup_secret(vault_base_url, secret_name).value + with open(file_path, 'wb') as output: + output.write(backup) + + +def restore_secret(client, vault_base_url, file_path): + with open(file_path, 'rb') as file_in: + data = file_in.read() + return client.restore_secret(vault_base_url, data) +# endregion + + +# region KeyVault Certificate +# pylint: disable=inconsistent-return-statements +def create_certificate(client, vault_base_url, certificate_name, certificate_policy, + disabled=False, tags=None, validity=None): + from azext_keyvault.keyvault.models import CertificateAttributes + cert_attrs = CertificateAttributes(enabled=not disabled) + logger.info("Starting long-running operation 'keyvault certificate create'") + + if validity is not None: + certificate_policy['x509_certificate_properties']['validity_in_months'] = validity + + client.create_certificate( + vault_base_url, certificate_name, certificate_policy, cert_attrs, tags) + + if certificate_policy['issuer_parameters']['name'].lower() == 'unknown': + # return immediately for a pending certificate + return client.get_certificate_operation(vault_base_url, certificate_name) + + # otherwise loop until the certificate creation is complete + while True: + check = client.get_certificate_operation(vault_base_url, certificate_name) + if check.status != 'inProgress': + logger.info( + "Long-running operation 'keyvault certificate create' finished with result %s.", + check) + return check + try: + time.sleep(10) + except KeyboardInterrupt: + logger.info("Long-running operation wait cancelled.") + raise + except Exception as client_exception: + telemetry.set_exception(exception=client_exception, fault_type='cert-create-error', + summary='Unexpected client exception during cert creation') + message = getattr(client_exception, 'message', client_exception) + + try: + ex_message = json.loads(client_exception.response.text) # pylint: disable=no-member + message = str(message) + ' ' + ex_message['error']['details'][0]['message'] + except: # pylint: disable=bare-except + pass + + raise CLIError('{}'.format(message)) + + +def _asn1_to_iso8601(asn1_date): + import dateutil.parser + if isinstance(asn1_date, bytes): + asn1_date = asn1_date.decode('utf-8') + return dateutil.parser.parse(asn1_date) + + +def import_certificate(client, vault_base_url, certificate_name, certificate_data, + disabled=False, password=None, certificate_policy=None, tags=None): + import binascii + from azext_keyvault.keyvault.models import CertificateAttributes, SecretProperties, CertificatePolicy + + x509 = None + content_type = None + try: + x509 = crypto.load_certificate(crypto.FILETYPE_PEM, certificate_data) + # if we get here, we know it was a PEM file + content_type = 'application/x-pem-file' + try: + # for PEM files (including automatic endline conversion for Windows) + certificate_data = certificate_data.decode('utf-8').replace('\r\n', '\n') + except UnicodeDecodeError: + certificate_data = binascii.b2a_base64(certificate_data).decode('utf-8') + except (ValueError, crypto.Error): + pass + + if not x509: + try: + if password: + x509 = crypto.load_pkcs12(certificate_data, password).get_certificate() + else: + x509 = crypto.load_pkcs12(certificate_data).get_certificate() + content_type = 'application/x-pkcs12' + certificate_data = binascii.b2a_base64(certificate_data).decode('utf-8') + except crypto.Error: + raise CLIError( + 'We could not parse the provided certificate as .pem or .pfx. Please verify the certificate with OpenSSL.') # pylint: disable=line-too-long + + not_before, not_after = None, None + + if x509.get_notBefore(): + not_before = _asn1_to_iso8601(x509.get_notBefore()) + + if x509.get_notAfter(): + not_after = _asn1_to_iso8601(x509.get_notAfter()) + + cert_attrs = CertificateAttributes( + enabled=not disabled, + not_before=not_before, + expires=not_after) + + if certificate_policy: + secret_props = certificate_policy.get('secret_properties') + if secret_props: + secret_props['content_type'] = content_type + elif certificate_policy and not secret_props: + certificate_policy['secret_properties'] = SecretProperties(content_type=content_type) + else: + certificate_policy = CertificatePolicy( + secret_properties=SecretProperties(content_type=content_type)) + + logger.info("Starting 'keyvault certificate import'") + result = client.import_certificate(vault_base_url=vault_base_url, + certificate_name=certificate_name, + base64_encoded_certificate=certificate_data, + certificate_attributes=cert_attrs, + certificate_policy=certificate_policy, + tags=tags, + password=password) + logger.info("Finished 'keyvault certificate import'") + return result + + +def download_certificate(client, vault_base_url, certificate_name, file_path, + encoding='PEM', certificate_version=''): + """ Download a certificate from a KeyVault. """ + if os.path.isfile(file_path) or os.path.isdir(file_path): + raise CLIError("File or directory named '{}' already exists.".format(file_path)) + + cert = client.get_certificate( + vault_base_url, certificate_name, certificate_version).cer + + try: + with open(file_path, 'wb') as f: + if encoding == 'DER': + f.write(cert) + else: + import base64 + encoded = base64.encodestring(cert) # pylint:disable=deprecated-method + if isinstance(encoded, bytes): + encoded = encoded.decode("utf-8") + encoded = '-----BEGIN CERTIFICATE-----\n' + encoded + '-----END CERTIFICATE-----\n' + f.write(encoded.encode("utf-8")) + except Exception as ex: # pylint: disable=broad-except + if os.path.isfile(file_path): + os.remove(file_path) + raise ex + + +def add_certificate_contact(client, vault_base_url, contact_email, contact_name=None, + contact_phone=None): + """ Add a contact to the specified vault to receive notifications of certificate operations. """ + from azext_keyvault.keyvault.models import \ + (Contact, Contacts, KeyVaultErrorException) + try: + contacts = client.get_certificate_contacts(vault_base_url) + except KeyVaultErrorException: + contacts = Contacts(contact_list=[]) + contact = Contact(email_address=contact_email, name=contact_name, phone=contact_phone) + if any((x for x in contacts.contact_list if x.email_address == contact_email)): + raise CLIError("contact '{}' already exists".format(contact_email)) + contacts.contact_list.append(contact) + return client.set_certificate_contacts(vault_base_url, contacts.contact_list) + + +def delete_certificate_contact(client, vault_base_url, contact_email): + """ Remove a certificate contact from the specified vault. """ + from azext_keyvault.keyvault.models import Contacts + orig_contacts = client.get_certificate_contacts(vault_base_url).contact_list + remaining_contacts = [x for x in client.get_certificate_contacts(vault_base_url).contact_list + if x.email_address != contact_email] + remaining = Contacts(contact_list=remaining_contacts) + if len(remaining_contacts) == len(orig_contacts): + raise CLIError("contact '{}' not found in vault '{}'".format(contact_email, vault_base_url)) + if remaining.contact_list: + return client.set_certificate_contacts(vault_base_url, remaining.contact_list) + return client.delete_certificate_contacts(vault_base_url) + + +def create_certificate_issuer(client, vault_base_url, issuer_name, provider_name, account_id=None, + password=None, disabled=None, organization_id=None): + """ Create a certificate issuer record. + :param issuer_name: Unique identifier for the issuer settings. + :param provider_name: The certificate provider name. Must be registered with your + tenant ID and in your region. + :param account_id: The issuer account id/username/etc. + :param password: The issuer account password/secret/etc. + :param organization_id: The organization id. + """ + from azext_keyvault.keyvault.models import IssuerCredentials, OrganizationDetails, IssuerAttributes + credentials = IssuerCredentials(account_id=account_id, password=password) + issuer_attrs = IssuerAttributes(enabled=not disabled) + org_details = OrganizationDetails(id=organization_id, admin_details=[]) + return client.set_certificate_issuer( + vault_base_url, issuer_name, provider_name, credentials, org_details, issuer_attrs) + + +def update_certificate_issuer(client, vault_base_url, issuer_name, provider_name=None, + account_id=None, password=None, enabled=None, organization_id=None): + """ Update a certificate issuer record. + :param issuer_name: Unique identifier for the issuer settings. + :param provider_name: The certificate provider name. Must be registered with your + tenant ID and in your region. + :param account_id: The issuer account id/username/etc. + :param password: The issuer account password/secret/etc. + :param organization_id: The organization id. + """ + def update(obj, prop, value, nullable=False): + set_value = value if value is not None else getattr(obj, prop, None) + if set_value is None and not nullable: + raise CLIError("property '{}' cannot be cleared".format(prop)) + elif not set_value and nullable: + set_value = None + setattr(obj, prop, set_value) + + issuer = client.get_certificate_issuer(vault_base_url, issuer_name) + update(issuer.credentials, 'account_id', account_id, True) + update(issuer.credentials, 'password', password, True) + update(issuer.attributes, 'enabled', enabled) + update(issuer.organization_details, 'id', organization_id, True) + update(issuer, 'provider', provider_name) + return client.set_certificate_issuer( + vault_base_url, issuer_name, issuer.provider, issuer.credentials, + issuer.organization_details, issuer.attributes) + + +def list_certificate_issuer_admins(client, vault_base_url, issuer_name): + """ List admins for a specified certificate issuer. """ + return client.get_certificate_issuer( + vault_base_url, issuer_name).organization_details.admin_details + + +def add_certificate_issuer_admin(client, vault_base_url, issuer_name, email, first_name=None, + last_name=None, phone=None): + """ Add admin details for a specified certificate issuer. """ + from azext_keyvault.keyvault.models import AdministratorDetails + + issuer = client.get_certificate_issuer(vault_base_url, issuer_name) + org_details = issuer.organization_details + admins = org_details.admin_details + if any((x for x in admins if x.email_address == email)): + raise CLIError("admin '{}' already exists".format(email)) + new_admin = AdministratorDetails(first_name=first_name, last_name=last_name, email_address=email, phone=phone) + admins.append(new_admin) + org_details.admin_details = admins + result = client.set_certificate_issuer( + vault_base_url, issuer_name, issuer.provider, issuer.credentials, org_details, + issuer.attributes) + created_admin = next(x for x in result.organization_details.admin_details + if x.email_address == email) + return created_admin + + +def delete_certificate_issuer_admin(client, vault_base_url, issuer_name, email): + """ Remove admin details for the specified certificate issuer. """ + issuer = client.get_certificate_issuer(vault_base_url, issuer_name) + org_details = issuer.organization_details + admins = org_details.admin_details + remaining = [x for x in admins if x.email_address != email] + if len(remaining) == len(admins): + raise CLIError("admin '{}' not found for issuer '{}'".format(email, issuer_name)) + org_details.admin_details = remaining + client.set_certificate_issuer( + vault_base_url, issuer_name, issuer.provider, issuer.credentials, org_details, + issuer.attributes) +# endregion + +# region storage_account + + +def backup_storage_account(client, vault_base_url, storage_account_name, file_path): + backup = client.backup_storage_account(vault_base_url, storage_account_name).value + with open(file_path, 'wb') as output: + output.write(backup) + + +def restore_storage_account(client, vault_base_url, file_path): + with open(file_path, 'rb') as file_in: + data = file_in.read() + return client.restore_storage_account(vault_base_url, data) + +# endregion diff --git a/src/keyvault/azext_keyvault/keyvault/__init__.py b/src/keyvault/azext_keyvault/keyvault/__init__.py new file mode 100644 index 00000000000..2f52c31e74e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/__init__.py @@ -0,0 +1,52 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .custom import http_bearer_challenge_cache as HttpBearerChallengeCache +from .custom.http_bearer_challenge import HttpBearerChallenge +from .custom.http_challenge import HttpChallenge +from .custom.key_vault_client import CustomKeyVaultClient as KeyVaultClient +from .custom.key_vault_id import (KeyVaultId, + KeyId, + SecretId, + CertificateId, + CertificateIssuerId, + CertificateOperationId, + StorageAccountId, + StorageSasDefinitionId) +from .custom.key_vault_authentication import KeyVaultAuthentication, KeyVaultAuthBase, AccessToken +from .custom.http_message_security import generate_pop_key +from .version import VERSION + +__all__ = ['KeyVaultClient', + 'KeyVaultId', + 'KeyId', + 'SecretId', + 'CertificateId', + 'CertificateIssuerId', + 'CertificateOperationId', + 'StorageAccountId', + 'StorageSasDefinitionId', + 'HttpBearerChallengeCache', + 'HttpBearerChallenge', + 'HttpChallenge', + 'KeyVaultAuthentication', + 'KeyVaultAuthBase', + 'generate_pop_key', + 'AccessToken'] + +__version__ = VERSION + diff --git a/src/keyvault/azext_keyvault/keyvault/custom/__init__.py b/src/keyvault/azext_keyvault/keyvault/custom/__init__.py new file mode 100644 index 00000000000..1ce69603ab7 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/__init__.py @@ -0,0 +1,6 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- diff --git a/src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge.py b/src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge.py new file mode 100644 index 00000000000..9d6cd377008 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge.py @@ -0,0 +1,104 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +#--------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +#--------------------------------------------------------------------------------------------- + +try: + import urllib.parse as parse +except ImportError: + import urlparse as parse # pylint: disable=import-error + + +class HttpBearerChallenge(object): + + def __init__(self, request_uri, challenge): + """ Parses an HTTP WWW-Authentication Bearer challenge from a server. """ + self.source_authority = self._validate_request_uri(request_uri) + self.source_uri = request_uri + self._parameters = {} + + trimmed_challenge = self._validate_challenge(challenge) + + # split trimmed challenge into comma-separated name=value pairs. Values are expected + # to be surrounded by quotes which are stripped here. + for item in trimmed_challenge.split(','): + # process name=value pairs + comps = item.split('=') + if len(comps) == 2: + key = comps[0].strip(' "') + value = comps[1].strip(' "') + if key: + self._parameters[key] = value + + # minimum set of parameters + if not self._parameters: + raise ValueError('Invalid challenge parameters') + + # must specify authorization or authorization_uri + if 'authorization' not in self._parameters and 'authorization_uri' not in self._parameters: + raise ValueError('Invalid challenge parameters') + + # pylint: disable=no-self-use + @staticmethod + def is_bearer_challenge(authentication_header): + """ Tests whether an authentication header is a Bearer challenge. + :param authentication_header: the authentication header to test + rtype: bool """ + if not authentication_header: + return False + + return authentication_header.strip().startswith('Bearer ') + + def get_value(self, key): + return self._parameters.get(key) + + def get_authorization_server(self): + """ Returns the URI for the authorization server if present, otherwise empty string. """ + value = '' + for key in ['authorization_uri', 'authorization']: + value = self.get_value(key) or '' + if value: + break + return value + + def get_resource(self): + """ Returns the resource if present, otherwise empty string. """ + return self.get_value('resource') or '' + + def get_scope(self): + """ Returns the scope if present, otherwise empty string. """ + return self.get_value('scope') or '' + + # pylint: disable=no-self-use + def _validate_challenge(self, challenge): + """ Verifies that the challenge is a Bearer challenge and returns the key=value pairs. """ + bearer_string = 'Bearer ' + if not challenge: + raise ValueError('Challenge cannot be empty') + + challenge = challenge.strip() + if not challenge.startswith(bearer_string): + raise ValueError('Challenge is not Bearer') + + return challenge[len(bearer_string):] + + # pylint: disable=no-self-use + def _validate_request_uri(self, uri): + """ Extracts the host authority from the given URI. """ + if not uri: + raise ValueError('request_uri cannot be empty') + + uri = parse.urlparse(uri) + if not uri.netloc: + raise ValueError('request_uri must be an absolute URI') + + if uri.scheme.lower() not in ['http', 'https']: + raise ValueError('request_uri must be HTTP or HTTPS') + + return uri.netloc diff --git a/src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge_cache/__init__.py b/src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge_cache/__init__.py new file mode 100644 index 00000000000..de7538fa49e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/http_bearer_challenge_cache/__init__.py @@ -0,0 +1,83 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +#--------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +#--------------------------------------------------------------------------------------------- + +from threading import Lock + +try: + import urllib.parse as parse +except ImportError: + import urlparse as parse # pylint: disable=import-error + +_cache = {} +_lock = Lock() + +def get_challenge_for_url(url): + """ Gets the challenge for the cached URL. + :param url: the URL the challenge is cached for. + :rtype: HttpBearerChallenge """ + if not url: + raise ValueError('URL cannot be None') + + url = parse.urlparse(url) + + _lock.acquire() + + val = _cache.get(url.netloc) + + _lock.release() + + return val + + +def remove_challenge_for_url(url): + """ Removes the cached challenge for the specified URL. + :param url: the URL for which to remove the cached challenge """ + if not url: + raise ValueError('URL cannot be empty') + + url = parse.urlparse(url) + + _lock.acquire() + + del _cache[url.netloc] + + _lock.release() + + +def set_challenge_for_url(url, challenge): + """ Caches the challenge for the specified URL. + :param url: the URL for which to cache the challenge + :param challenge: the challenge to cache """ + if not url: + raise ValueError('URL cannot be empty') + + if not challenge: + raise ValueError('Challenge cannot be empty') + + src_url = parse.urlparse(url) + if src_url.netloc != challenge.source_authority: + raise ValueError('Source URL and Challenge URL do not match') + + _lock.acquire() + + _cache[src_url.netloc] = challenge + + _lock.release() + + +def clear(): + """ Clears the cache. """ + + _lock.acquire() + + _cache.clear() # pylint: disable=redefined-outer-name,unused-variable + + _lock.release() diff --git a/src/keyvault/azext_keyvault/keyvault/custom/http_challenge.py b/src/keyvault/azext_keyvault/keyvault/custom/http_challenge.py new file mode 100644 index 00000000000..6db8f22a3e3 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/http_challenge.py @@ -0,0 +1,121 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +#--------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +#--------------------------------------------------------------------------------------------- + +try: + import urllib.parse as parse +except ImportError: + import urlparse as parse # pylint: disable=import-error + + +class HttpChallenge(object): + + def __init__(self, request_uri, challenge, response_headers=None): + """ Parses an HTTP WWW-Authentication Bearer challenge from a server. """ + self.source_authority = self._validate_request_uri(request_uri) + self.source_uri = request_uri + self._parameters = {} + + # get the scheme of the challenge and remove from the challenge string + trimmed_challenge = self._validate_challenge(challenge) + split_challenge = trimmed_challenge.split(' ', 1) + self.scheme = split_challenge[0] + trimmed_challenge = split_challenge[1] + + # split trimmed challenge into comma-separated name=value pairs. Values are expected + # to be surrounded by quotes which are stripped here. + for item in trimmed_challenge.split(','): + # process name=value pairs + comps = item.split('=') + if len(comps) == 2: + key = comps[0].strip(' "') + value = comps[1].strip(' "') + if key: + self._parameters[key] = value + + # minimum set of parameters + if not self._parameters: + raise ValueError('Invalid challenge parameters') + + # must specify authorization or authorization_uri + if 'authorization' not in self._parameters and 'authorization_uri' not in self._parameters: + raise ValueError('Invalid challenge parameters') + + # if the response headers were supplied + if response_headers: + # get the message signing key and message key encryption key from the headers + self.server_signature_key = response_headers.get('x-ms-message-signing-key', None) + self.server_encryption_key = response_headers.get('x-ms-message-encryption-key', None) + + def is_bearer_challenge(self): + """ Tests whether the HttpChallenge a Bearer challenge. + rtype: bool """ + if not self.scheme: + return False + + return self.scheme.lower() == 'bearer' + + def is_pop_challenge(self): + """ Tests whether the HttpChallenge is a proof of possession challenge. + rtype: bool """ + if not self.scheme: + return False + + return self.scheme.lower() == 'pop' + + def get_value(self, key): + return self._parameters.get(key) + + def get_authorization_server(self): + """ Returns the URI for the authorization server if present, otherwise empty string. """ + value = '' + for key in ['authorization_uri', 'authorization']: + value = self.get_value(key) or '' + if value: + break + return value + + def get_resource(self): + """ Returns the resource if present, otherwise empty string. """ + return self.get_value('resource') or '' + + def get_scope(self): + """ Returns the scope if present, otherwise empty string. """ + return self.get_value('scope') or '' + + def supports_pop(self): + """ Returns True if challenge supports pop token auth else False """ + return self._parameters.get('supportspop', '').lower() == 'true' + + def supports_message_protection(self): + """ Returns True if challenge vault supports message protection """ + return self.supports_pop() and self.server_encryption_key and self.server_signature_key + + def _validate_challenge(self, challenge): + """ Verifies that the challenge is a valid auth challenge and returns the key=value pairs. """ + if not challenge: + raise ValueError('Challenge cannot be empty') + + return challenge.strip() + + # pylint: disable=no-self-use + def _validate_request_uri(self, uri): + """ Extracts the host authority from the given URI. """ + if not uri: + raise ValueError('request_uri cannot be empty') + + uri = parse.urlparse(uri) + if not uri.netloc: + raise ValueError('request_uri must be an absolute URI') + + if uri.scheme.lower() not in ['http', 'https']: + raise ValueError('request_uri must be HTTP or HTTPS') + + return uri.netloc diff --git a/src/keyvault/azext_keyvault/keyvault/custom/http_message_security.py b/src/keyvault/azext_keyvault/keyvault/custom/http_message_security.py new file mode 100644 index 00000000000..2275f565eb0 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/http_message_security.py @@ -0,0 +1,198 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +#--------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +#--------------------------------------------------------------------------------------------- + +import json +import time +import os +from .internal import _a128cbc_hs256_encrypt, _a128cbc_hs256_decrypt, _JwsHeader, _JwsObject, \ + _JweHeader, _JweObject, _str_to_b64url, _bstr_to_b64url, _b64_to_bstr, _RsaKey + + +def generate_pop_key(): + """ + Generates a key which can be used for Proof Of Possession token authentication. + :return: + """ + return _RsaKey.generate() + + +class HttpMessageSecurity(object): + """ + Used for message authorization, encryption and decrtyption. + + This class is intended for internal use only. Details are subject to non-compatible changes, consumers of the + azure-keyvault module should not take dependencies on this class or its current implementation. + """ + def __init__(self, client_security_token=None, + client_signature_key=None, + client_encryption_key=None, + server_signature_key=None, + server_encryption_key=None): + self.client_security_token = client_security_token + self.client_signature_key = client_signature_key + self.client_encryption_key = client_encryption_key + self.server_signature_key = server_signature_key + self.server_encryption_key = server_encryption_key + + def protect_request(self, request): + """ + Adds authorization header, and encrypts and signs the request if supported on the specific request. + :param request: unprotected request to apply security protocol + :return: protected request with appropriate security protocal applied + """ + # Setup the auth header on the request + # Due to limitations in the service we hard code the auth scheme to 'Bearer' as the service will fail with any + # other scheme or a different casing such as 'bearer', once this is fixed the following line should be replaced: + # request.headers['Authorization'] = '{} {}'.format(auth[0], auth[1]) + request.headers['Authorization'] = '{} {}'.format('Bearer', self.client_security_token) + + # if the current message security doesn't support message protection, or the body is empty + # skip protection and return the original request + if not self.supports_protection() or len(request.body) == 0: + return request + + plain_text = request.body + + # if the client encryption key is specified add it to the body of the request + if self.client_encryption_key: + # note that this assumes that the body is already json and not simple string content + # this is true for all requests which currently support message encryption, but might + # need to be revisited when the types of + body_dict = json.loads(plain_text) + body_dict['rek'] = {'jwk': self.client_encryption_key.to_jwk().serialize()} + plain_text = json.dumps(body_dict).encode(encoding='utf8') + + # build the header for the jws body + jws_header = _JwsHeader() + jws_header.alg = 'RS256' + jws_header.kid = self.client_signature_key.kid + jws_header.at = self.client_security_token + jws_header.ts = int(time.time()) + jws_header.typ = 'PoP' + + jws = _JwsObject() + + jws.protected = jws_header.to_compact_header() + jws.payload = self._protect_payload(plain_text) + data = (jws.protected + '.' + jws.payload).encode('ascii') + jws.signature = _bstr_to_b64url(self.client_signature_key.sign(data)) + + request.headers['Content-Type'] = 'application/jose+json' + + request.prepare_body(data=jws.to_flattened_jws(), files=None) + + return request + + def unprotect_response(self, response, **kwargs): + """ + Removes protection from the specified response + :param request: response from the key vault service + :return: unprotected response with any security protocal encryption removed + """ + body = response.content + # if the current message security doesn't support message protection, the body is empty, or the request failed + # skip protection and return the original response + if not self.supports_protection() or len(response.content) == 0 or response.status_code != 200: + return response + + # ensure the content-type is application/jose+json + if 'application/jose+json' not in response.headers.get('content-type', '').lower(): + raise ValueError('Invalid protected response') + + # deserialize the response into a JwsObject, using response.text so requests handles the encoding + jws = _JwsObject().deserialize(body) + + # deserialize the protected header + jws_header = _JwsHeader.from_compact_header(jws.protected) + + # ensure the jws signature kid matches the key from original challenge + # and the alg matches expected signature alg + if jws_header.kid != self.server_signature_key.kid \ + or jws_header.alg != 'RS256': + raise ValueError('Invalid protected response') + + # validate the signature of the jws + data = (jws.protected + '.' + jws.payload).encode('ascii') + # verify will raise an InvalidSignature exception if the signature doesn't match + self.server_signature_key.verify(signature=_b64_to_bstr(jws.signature), data=data) + + # get the unprotected response body + decrypted = self._unprotect_payload(jws.payload) + + response._content = decrypted + response.headers['Content-Type'] = 'application/json' + + return response + + def supports_protection(self): + """ + Determines if the the current HttpMessageSecurity object supports the message protection protocol. + :return: True if the current object supports protection, otherwise False + """ + return self.client_signature_key \ + and self.client_encryption_key \ + and self.server_signature_key \ + and self.server_encryption_key + + def _protect_payload(self, plaintext): + # create the jwe header for the payload + kek = self.server_encryption_key + jwe_header = _JweHeader() + jwe_header.alg = 'RSA-OAEP' + jwe_header.kid = kek.kid + jwe_header.enc = 'A128CBC-HS256' + + # create the jwe object + jwe = _JweObject() + jwe.protected = jwe_header.to_compact_header() + + # generate the content encryption key and iv + cek = os.urandom(32) + iv = os.urandom(16) + jwe.iv = _bstr_to_b64url(iv) + # wrap the cek using the server encryption key + wrapped = _bstr_to_b64url(kek.encrypt(cek)) + jwe.encrypted_key = wrapped + + # encrypt the plaintext body with the cek using the protected header + # as the authdata to get the ciphertext and the authtag + ciphertext, tag = _a128cbc_hs256_encrypt(cek, iv, plaintext, jwe.protected.encode('ascii')) + + jwe.ciphertext = _bstr_to_b64url(ciphertext) + jwe.tag = _bstr_to_b64url(tag) + + # flatten and encode the jwe for the final jws payload content + flat = jwe.to_flattened_jwe() + return _str_to_b64url(flat) + + def _unprotect_payload(self, payload): + # deserialize the payload + jwe = _JweObject().deserialize_b64(payload) + + # deserialize the payload header + jwe_header = _JweHeader.from_compact_header(jwe.protected) + + # ensure the kid matches the specified client encryption key + # and the key wrap alg and the data encryption enc match the expected + if self.client_encryption_key.kid != jwe_header.kid \ + or jwe_header.alg != 'RSA-OAEP' \ + or jwe_header.enc != 'A128CBC-HS256': + raise ValueError('Invalid protected response') + + # unwrap the cek using the client encryption key + cek = self.client_encryption_key.decrypt(_b64_to_bstr(jwe.encrypted_key)) + + # decrypt the cipher text to get the unprotected body content + return _a128cbc_hs256_decrypt(cek, + _b64_to_bstr(jwe.iv), + _b64_to_bstr(jwe.ciphertext), + jwe.protected.encode('ascii'), + _b64_to_bstr(jwe.tag)) \ No newline at end of file diff --git a/src/keyvault/azext_keyvault/keyvault/custom/internal.py b/src/keyvault/azext_keyvault/keyvault/custom/internal.py new file mode 100644 index 00000000000..4698dc7c2b0 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/internal.py @@ -0,0 +1,416 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +#--------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +#--------------------------------------------------------------------------------------------- + +import json +import uuid +import codecs +from base64 import b64encode, b64decode +import cryptography +from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives.asymmetric.rsa import RSAPrivateNumbers, RSAPublicNumbers, \ + generate_private_key, rsa_crt_dmp1, rsa_crt_dmq1, rsa_crt_iqmp, RSAPrivateKey, RSAPublicKey +from cryptography.hazmat.primitives.asymmetric import padding as asym_padding +from cryptography.hazmat.primitives import hashes, constant_time, padding, hmac + +from ..models import JsonWebKey + +def _a128cbc_hs256_encrypt(key, iv, plaintext, authdata): + if not key or not len(key) >= 32: + raise ValueError('key must be at least 256 bits for algorithm "A128CBC-HS256"') + if not iv or len(iv) != 16: + raise ValueError('iv must be 128 bits for algorithm "A128CBC-HS256"') + if not plaintext: + raise ValueError('plaintext must be specified') + if not authdata: + raise ValueError('authdata must be specified') + + # get the hmac key and the aes key from the specified key + hmac_key = key[:16] + aes_key = key[16:32] + + # calculate the length of authdata and store as bytes + auth_data_length = _int_to_bigendian_8_bytes(len(authdata) * 8) + + # pad the plaintext with pkcs7 + padder = padding.PKCS7(128).padder() + plaintext = padder.update(plaintext) + padder.finalize() + + # create the cipher and encrypt the plaintext + cipher = Cipher(algorithms.AES(aes_key), modes.CBC(iv), backend=default_backend()) + encryptor = cipher.encryptor() + ciphertext = encryptor.update(plaintext) + encryptor.finalize() + + # get the data to hash with HMAC, hash the data and take the first 16 bytes + hashdata = authdata + iv + ciphertext + auth_data_length + hmac_hash = hmac.HMAC(hmac_key, hashes.SHA256(), backend=default_backend()) + hmac_hash.update(hashdata) + tag = hmac_hash.finalize()[:16] + + return ciphertext, tag + + +def _a128cbc_hs256_decrypt(key, iv, ciphertext, authdata, authtag): + if not key or not len(key) >= 32: + raise ValueError('key must be at least 256 bits for algorithm "A128CBC-HS256"') + if not iv or len(iv) != 16: + raise ValueError('iv must be 128 bits for algorithm "A128CBC-HS256"') + if not ciphertext: + raise ValueError('ciphertext must be specified') + if not authdata: + raise ValueError('authdata must be specified') + if not authtag or len(authtag) != 16: + raise ValueError('authtag must be be 128 bits for algorithm "A128CBC-HS256"') + + hmac_key = key[:16] + aes_key = key[16:32] + auth_data_length = _int_to_bigendian_8_bytes(len(authdata) * 8) + + # ensure the authtag is the expected length for SHA256 hash + if not len(authtag) == 16: + raise ValueError('invalid tag') + + hashdata = authdata + iv + ciphertext + auth_data_length + hmac_hash = hmac.HMAC(hmac_key, hashes.SHA256(), backend=default_backend()) + hmac_hash.update(hashdata) + tag = hmac_hash.finalize()[:16] + + if not constant_time.bytes_eq(tag, authtag): + raise ValueError('"ciphertext" is not authentic') + + cipher = Cipher(algorithms.AES(aes_key), modes.CBC(iv), backend=default_backend()) + decryptor = cipher.decryptor() + plaintext = decryptor.update(ciphertext) + decryptor.finalize() + + # unpad the decrypted plaintext + padder = padding.PKCS7(128).unpadder() + plaintext = padder.update(plaintext) + padder.finalize() + + return plaintext + + +def _bytes_to_int(b): + if not b or not isinstance(b, bytes): + raise ValueError('b must be non-empty byte string') + + return int(codecs.encode(b, 'hex'), 16) + + +def _int_to_bytes(i): + h = hex(i) + if len(h) > 1 and h[0:2] == '0x': + h = h[2:] + + # need to strip L in python 2.x + h = h.strip('L') + + if len(h) % 2: + h = '0' + h + return codecs.decode(h, 'hex') + + +def _bstr_to_b64url(bstr, **kwargs): + """Serialize bytes into base-64 string. + :param str: Object to be serialized. + :rtype: str + """ + encoded = b64encode(bstr).decode() + return encoded.strip('=').replace('+', '-').replace('/', '_') + + +def _str_to_b64url(s, **kwargs): + """Serialize str into base-64 string. + :param str: Object to be serialized. + :rtype: str + """ + return _bstr_to_b64url(s.encode(encoding='utf8')) + + +def _b64_to_bstr(b64str): + """Deserialize base64 encoded string into string. + :param str b64str: response string to be deserialized. + :rtype: bytearray + :raises: TypeError if string format invalid. + """ + padding = '=' * (3 - (len(b64str) + 3) % 4) + b64str = b64str + padding + encoded = b64str.replace('-', '+').replace('_', '/') + return b64decode(encoded) + + +def _b64_to_str(b64str): + """Deserialize base64 encoded string into string. + :param str b64str: response string to be deserialized. + :rtype: str + :raises: TypeError if string format invalid. + """ + return _b64_to_bstr(b64str).decode('utf8') + + +def _int_to_bigendian_8_bytes(i): + b = _int_to_bytes(i) + + if len(b) > 8: + raise ValueError('the specified integer is to large to be represented by 8 bytes') + + if len(b) < 8: + b = (b'\0' * (8 - len(b))) + b + + return b + + +class _JoseObject(object): + + def deserialize(self, s): + d = json.loads(s) + self.__dict__ = d + return self + + def deserialize_b64(self, s): + self.deserialize(_b64_to_str(s)) + return self + + def serialize(self): + return json.dumps(self.__dict__) + + def serialize_b64url(self): + return _str_to_b64url(self.serialize()) + + +class _JoseHeader(_JoseObject): + + def to_compact_header(self): + return _str_to_b64url(json.dumps(self.__dict__)) + + +class _JweHeader(_JoseHeader): + def __init__(self, alg=None, kid=None, enc=None): + self.alg = alg + self.kid = kid + self.enc = enc + + @staticmethod + def from_compact_header(compact): + header = _JweHeader() + header.__dict__ = json.loads(_b64_to_str(compact)) + return header + + +class _JweObject(_JoseObject): + def __init__(self): + self.protected = None + self.encrypted_key = None + self.iv = None + self.ciphertext = None + self.tag = None + + def to_flattened_jwe(self): + if not (self.protected, self.encrypted_key, self.iv, self.ciphertext, self.tag): + raise ValueError('JWE is not complete.') + + return json.dumps(self.__dict__) + + +class _JwsHeader(_JoseHeader): + def __init__(self): + self.alg = None + self.kid = None + self.at = None + self.ts = None + self.p = None + self.typ = None + + @staticmethod + def from_compact_header(compact): + header = _JwsHeader() + header.__dict__ = json.loads(_b64_to_str(compact)) + return header + + +class _JwsObject(_JoseObject): + def __init__(self): + self.protected = None + self.payload = None + self.signature = None + + def to_flattened_jws(self): + if not (self.protected, self.payload, self.signature): + raise ValueError('JWS is not complete.') + + return json.dumps(self.__dict__) + + + +def _default_encryption_padding(): + return asym_padding.OAEP(mgf=asym_padding.MGF1(algorithm=hashes.SHA1()), algorithm=hashes.SHA1(), label=None) + + +def _default_signature_padding(): + return asym_padding.PKCS1v15() + + +def _default_signature_algorithm(): + return hashes.SHA256() + + +class _RsaKey(object): + PUBLIC_KEY_DEFAULT_OPS = ['encrypt', 'wrapKey', 'verify'] + PRIVATE_KEY_DEFAULT_OPS = ['encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'verify', 'sign'] + + def __init__(self): + self.kid = None + self.kty = None + self.key_ops = None + self._rsa_impl = None + + @property + def n(self): + return _int_to_bytes(self._public_key_material().n) + + @property + def e(self): + return _int_to_bytes(self._public_key_material().e) + + @property + def q(self): + return _int_to_bytes(self._private_key_material().q) if self.is_private_key() else None + + @property + def p(self): + return _int_to_bytes(self._private_key_material().p) if self.is_private_key() else None + + @property + def d(self): + return _int_to_bytes(self._private_key_material().d) if self.is_private_key() else None + + @property + def dq(self): + return _int_to_bytes(self._private_key_material().dmq1) if self.is_private_key() else None + + @property + def dp(self): + return _int_to_bytes(self._private_key_material().dmp1) if self.is_private_key() else None + + @property + def qi(self): + return _int_to_bytes(self._private_key_material().iqmp) if self.is_private_key() else None + + @property + def private_key(self): + return self._rsa_impl if self.is_private_key() else None + + @property + def public_key(self): + return self._rsa_impl.public_key() if self.is_private_key() else self._rsa_impl + + @staticmethod + def generate(kid=None, kty='RSA', size=2048, e=65537): + key = _RsaKey() + key.kid = kid or str(uuid.uuid4()) + key.kty = kty + key.key_ops = _RsaKey.PRIVATE_KEY_DEFAULT_OPS + key._rsa_impl = generate_private_key(public_exponent=e, + key_size=size, + backend=cryptography.hazmat.backends.default_backend()) + return key + + @staticmethod + def from_jwk_str(s): + jwk_dict = json.loads(s) + jwk = JsonWebKey.from_dict(jwk_dict) + return _RsaKey.from_jwk(jwk) + + @staticmethod + def from_jwk(jwk): + if not isinstance(jwk, JsonWebKey): + raise TypeError('The specified jwk must be a JsonWebKey') + + if jwk.kty != 'RSA' and jwk.kty != 'RSA-HSM': + raise ValueError('The specified jwk must have a key type of "RSA" or "RSA-HSM"') + + if not jwk.n or not jwk.e: + raise ValueError('Invalid RSA jwk, both n and e must be have values') + + rsa_key = _RsaKey() + rsa_key.kid = jwk.kid + rsa_key.kty = jwk.kty + rsa_key.key_ops = jwk.key_ops + + pub = RSAPublicNumbers(n=_bytes_to_int(jwk.n), e=_bytes_to_int(jwk.e)) + + # if the private key values are specified construct a private key + # only the secret primes and private exponent are needed as other fields can be calculated + if jwk.p and jwk.q and jwk.d: + # convert the values of p, q, and d from bytes to int + p = _bytes_to_int(jwk.p) + q = _bytes_to_int(jwk.q) + d = _bytes_to_int(jwk.d) + + # convert or compute the remaining private key numbers + dmp1 = _bytes_to_int(jwk.dp) if jwk.dp else rsa_crt_dmp1(private_exponent=d, p=p) + dmq1 = _bytes_to_int(jwk.dq) if jwk.dq else rsa_crt_dmq1(private_exponent=d, q=q) + iqmp = _bytes_to_int(jwk.qi) if jwk.qi else rsa_crt_iqmp(p=p, q=q) + + # create the private key from the jwk key values + priv = RSAPrivateNumbers(p=p, q=q, d=d, dmp1=dmp1, dmq1=dmq1, iqmp=iqmp, public_numbers=pub) + key_impl = priv.private_key(cryptography.hazmat.backends.default_backend()) + + # if the necessary private key values are not specified create the public key + else: + key_impl = pub.public_key(cryptography.hazmat.backends.default_backend()) + + rsa_key._rsa_impl = key_impl + + return rsa_key + + def to_jwk(self, include_private=False): + jwk = JsonWebKey(kid=self.kid, + kty=self.kty, + key_ops=self.key_ops if include_private else _RsaKey.PUBLIC_KEY_DEFAULT_OPS, + n=self.n, + e=self.e) + + if include_private: + jwk.q = self.q + jwk.p = self.p + jwk.d = self.d + jwk.dq = self.dq + jwk.dp = self.dp + jwk.qi = self.qi + + return jwk + + def encrypt(self, plaintext, padding=_default_encryption_padding()): + return self.public_key.encrypt(plaintext, padding) + + def decrypt(self, ciphertext, padding=_default_encryption_padding()): + if not self.is_private_key(): + raise NotImplementedError('The current RsaKey does not support decrypt') + + return self.private_key.decrypt(ciphertext, padding) + + def sign(self, data, padding=_default_signature_padding(), algorithm=_default_signature_algorithm()): + if not self.is_private_key(): + raise NotImplementedError('The current RsaKey does not support sign') + + return self.private_key.sign(data, padding, algorithm) + + def verify(self, signature, data, padding=_default_signature_padding(), algorithm=_default_signature_algorithm()): + return self.public_key.verify(signature, data, padding, algorithm) + + def is_private_key(self): + return isinstance(self._rsa_impl, RSAPrivateKey) + + def _public_key_material(self): + return self.public_key.public_numbers() + + def _private_key_material(self): + return self.private_key.private_numbers() if self.private_key else None diff --git a/src/keyvault/azext_keyvault/keyvault/custom/key_vault_authentication.py b/src/keyvault/azext_keyvault/keyvault/custom/key_vault_authentication.py new file mode 100644 index 00000000000..67d873fd568 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/key_vault_authentication.py @@ -0,0 +1,249 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +#--------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +#--------------------------------------------------------------------------------------------- + +import threading +import requests +import inspect +from collections import namedtuple +from requests.auth import AuthBase +from requests.cookies import extract_cookies_to_jar +from .http_challenge import HttpChallenge +from . import http_bearer_challenge_cache as ChallengeCache +from msrest.authentication import OAuthTokenAuthentication +from .http_message_security import HttpMessageSecurity +from .internal import _RsaKey + + +AccessToken = namedtuple('AccessToken', ['scheme', 'token', 'key']) +AccessToken.__new__.__defaults__ = ('Bearer', None, None) + +_message_protection_supported_methods = ['sign', 'verify', 'encrypt', 'decrypt', 'wrapkey', 'unwrapkey'] + + +def _message_protection_supported(challenge, request): + # right now only specific key operations are supported so return true only + # if the vault supports message protection, the request is to the keys collection + # and the requested operation supports it + return challenge.supports_message_protection() \ + and '/keys/' in request.url \ + and request.url.split('?')[0].strip('/').split('/')[-1].lower() in _message_protection_supported_methods + + +class KeyVaultAuthBase(AuthBase): + """ + Used for handling authentication challenges, by hooking into the request AuthBase extension model. + """ + + def __init__(self, authorization_callback): + """ + Creates a new KeyVaultAuthBase instance used for handling authentication challenges, by hooking into the request AuthBase + extension model. + :param authorization_callback: A callback used to provide authentication credentials to the key vault data service. + This callback should take four str arguments: authorization uri, resource, scope, and scheme, and return + an AccessToken + return AccessToken(scheme=token['token_type'], token=token['access_token']) + Note: for backward compatibility a tuple of the scheme and token can also be returned. + return token['token_type'], token['access_token'] + """ + self._user_callback = authorization_callback + self._callback = self._auth_callback_compat + self._token = None + self._thread_local = threading.local() + self._thread_local.pos = None + self._thread_local.auth_attempted = False + self._thread_local.orig_body = None + + # for backwards compatibility we need to support callbacks which don't accept the scheme + def _auth_callback_compat(self, server, resource, scope, scheme): + return self._user_callback(server, resource, scope) \ + if len(inspect.getargspec(self._user_callback).args) == 3 \ + else self._user_callback(server, resource, scope, scheme) + + def __call__(self, request): + """ + Called prior to requests being sent. + :param request: Request to be sent + :return: returns the original request, registering hooks on the response if it is the first time this url has been called and an + auth challenge might be returned + """ + # attempt to pre-fetch challenge if cached + if self._callback: + challenge = ChallengeCache.get_challenge_for_url(request.url) + if challenge: + # if challenge cached get the message security + security = self._get_message_security(request, challenge) + # protect the request + security.protect_request(request) + # register a response hook to unprotect the response + request.register_hook('response', security.unprotect_response) + else: + # if the challenge is not cached we will strip the body and proceed without the auth header so we + # get back the auth challenge for the request + self._thread_local.orig_body = request.body + request.body = '' + request.headers['Content-Length'] = 0 + request.register_hook('response', self._handle_401) + request.register_hook('response', self._handle_redirect) + self._thread_local.auth_attempted = False + + return request + + def _handle_redirect(self, r, **kwargs): + """Reset auth_attempted on redirects.""" + if r.is_redirect: + self._thread_local.auth_attempted = False + + def _handle_401(self, response, **kwargs): + """ + Takes the response authenticates and resends if neccissary + :return: The final response to the authenticated request + :rtype: requests.Response + """ + # If response is not 401 do not auth and return response + if not response.status_code == 401: + self._thread_local.auth_attempted = False + return response + + # If we've already attempted to auth for this request once, do not auth and return response + if self._thread_local.auth_attempted: + self._thread_local.auth_attempted = False + return response + + auth_header = response.headers.get('www-authenticate', '') + + # Otherwise authenticate and retry the request + self._thread_local.auth_attempted = True + + # parse the challenge + challenge = HttpChallenge(response.request.url, auth_header, response.headers) + + # bearer and PoP are the only authentication schemes supported at this time + # if the response auth header is not a bearer challenge or pop challange do not auth and return response + if not (challenge.is_bearer_challenge() or challenge.is_pop_challenge()): + self._thread_local.auth_attempted = False + return response + + # add the challenge to the cache + ChallengeCache.set_challenge_for_url(response.request.url, challenge) + + # Consume content and release the original connection + # to allow our new request to reuse the same one. + response.content + response.close() + + # copy the request to resend + prep = response.request.copy() + + if self._thread_local.orig_body is not None: + # replace the body with the saved body + prep.prepare_body(data=self._thread_local.orig_body, files=None) + + extract_cookies_to_jar(prep._cookies, response.request, response.raw) + prep.prepare_cookies(prep._cookies) + + security = self._get_message_security(prep, challenge) + + # auth and protect the prepped request message + security.protect_request(prep) + + # resend the request with proper authentication and message protection + _response = response.connection.send(prep, **kwargs) + _response.history.append(response) + _response.request = prep + + # unprotected the response + security.unprotect_response(_response) + + return _response + + def _get_message_security(self, request, challenge): + scheme = challenge.scheme + + # if the given request can be protected ensure the scheme is PoP so the proper access token is requested + if _message_protection_supported(challenge, request): + scheme = 'PoP' + + # use the authentication_callback to get the token and create the message security + token = AccessToken(*self._callback(challenge.get_authorization_server(), + challenge.get_resource(), + challenge.get_scope(), + scheme)) + security = HttpMessageSecurity(client_security_token=token.token) + + # if the given request can be protected add the appropriate keys to the message security + if scheme == 'PoP': + security.client_signature_key = token.key + security.client_encryption_key = _RsaKey.generate() + security.server_encryption_key = _RsaKey.from_jwk_str(challenge.server_encryption_key) + security.server_signature_key = _RsaKey.from_jwk_str(challenge.server_signature_key) + + return security + + +class KeyVaultAuthentication(OAuthTokenAuthentication): + """ + Authentication class to be used as credentials for the KeyVaultClient. + :Example Usage: + def auth_callack(server, resource, scope): + self.data_creds = self.data_creds or ServicePrincipalCredentials(client_id=self.config.client_id, + secret=self.config.client_secret, + tenant=self.config.tenant_id, + resource=resource) + token = self.data_creds.token + return token['token_type'], token['access_token'] + + self.keyvault_data_client = KeyVaultClient(KeyVaultAuthentication(auth_callack)) + """ + + def __init__(self, authorization_callback=None, credentials=None): + """ + Creates a new KeyVaultAuthentication instance used for authentication in the KeyVaultClient + :param authorization_callback: A callback used to provide authentication credentials to the key vault data service. + This callback should take three str arguments: authorization uri, resource, and scope, and return + a tuple of (token type, access token). + :param credentials:: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + """ + if not authorization_callback and not credentials: + raise ValueError("Either parameter 'authorization_callback' or parameter 'credentials' must be specified.") + + # super(KeyVaultAuthentication, self).__init__() + + self._credentials = credentials + + if not authorization_callback: + def auth_callback(server, resource, scope, scheme): + if self._credentials.resource != resource: + self._credentials.resource = resource + self._credentials.set_token() + token = self._credentials.token + return AccessToken(scheme=token['token_type'], token=token['access_token'], key=None) + + authorization_callback = auth_callback + + self.auth = KeyVaultAuthBase(authorization_callback) + self._callback = authorization_callback + + def signed_session(self, session=None): + session = session or requests.Session() + session.auth = self.auth + return session + + def refresh_session(self): + """Return updated session if token has expired, attempts to + refresh using refresh token. + + :rtype: requests.Session. + """ + if self._credentials: + self._credentials.refresh_session() + return self.signed_session() diff --git a/src/keyvault/azext_keyvault/keyvault/custom/key_vault_client.py b/src/keyvault/azext_keyvault/keyvault/custom/key_vault_client.py new file mode 100644 index 00000000000..f59605bfcec --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/key_vault_client.py @@ -0,0 +1,100 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +#--------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +#--------------------------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse + +from .key_vault_authentication import KeyVaultAuthentication +from ..key_vault_client import KeyVaultClient as KeyVaultClientBase +from ..models import KeyVaultErrorException +from msrest.authentication import BasicTokenAuthentication + + +class CustomKeyVaultClient(KeyVaultClientBase): + + def __init__(self, credentials): + """The key vault client performs cryptographic key operations and vault operations against the Key Vault service. + + :ivar config: Configuration for client. + :vartype config: KeyVaultClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` or :mod:`A KeyVaultAuthentication + object` + """ + + # if the supplied credentials instance is not derived from KeyVaultAuthBase but is an AAD credential type + if not isinstance(credentials, KeyVaultAuthentication) and isinstance(credentials, BasicTokenAuthentication): + + # wrap the supplied credentials with a KeyVaultAuthentication instance. Use that for the credentials supplied to the base client + credentials = KeyVaultAuthentication(credentials=credentials) + + super(CustomKeyVaultClient, self).__init__(credentials) + + def get_pending_certificate_signing_request(self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Gets the Base64 pending certificate signing request (PKCS-10). + + :param vault_base_url: The vault name, e.g. + https://myvault.vault.azure.net + :type vault_base_url: str + :param certificate_name: The name of the certificate + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Base64 encoded pending certificate signing request (PKCS-10). + :rtype: str + :rtype: :class:`ClientRawResponse` + if raw=true + """ + # Construct URL + url = '/certificates/{certificate-name}/pending' + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + header_parameters['Accept'] = 'application/pkcs10' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, **operation_config) + + if response.status_code not in [200]: + raise KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = response.content + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized diff --git a/src/keyvault/azext_keyvault/keyvault/custom/key_vault_id.py b/src/keyvault/azext_keyvault/keyvault/custom/key_vault_id.py new file mode 100644 index 00000000000..3daca168571 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/custom/key_vault_id.py @@ -0,0 +1,448 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# --------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# --------------------------------------------------------------------------------------------- + +try: + import urllib.parse as parse +except ImportError: + import urlparse as parse # pylint: disable=import-error + +from enum import Enum + + +class KeyVaultCollectionType(Enum): + keys = 'keys' + secrets = 'secrets' + certificates = 'certificates' + certificate_issuers = 'certificates/issuers' + + +class KeyVaultId(object): + """ + An identifier for an Azure Key Vault resource. + """ + version_none = '' + + def __init__(self, collection, vault, name, version): + """ + :param collection: The resource collection type. + :type collection: str + :param vault: The vault URI. + :type vault: str + :param name: The resource name. + :type name: str + :param version: The resource version. + :type version: str + """ + self.vault = vault + self.name = name + self.collection = collection + self.version = version or KeyVaultId.version_none + + def __str__(self): + """ + :return: The identifier string of the current KeyVaultId + :rtype: str + """ + return self.id + + @property + def id(self): + return '{}/{}'.format(self.base_id, self.version) if self.version != KeyVaultId.version_none else self.base_id + + @property + def base_id(self): + return '{}/{}/{}'.format(self.vault, self.collection, self.name) + + @staticmethod + def create_object_id(collection, vault, name, version): + """ + :param collection: The resource collection type. + :type collection: str + :param vault: The vault URI. + :type vault: str + :param name: The resource name. + :type name: str + :param version: The resource version. + :type version: str + :rtype: KeyVaultId + """ + collection = _validate_string_argument(collection, 'collection') + vault = _validate_string_argument(vault, 'vault') + name = _validate_string_argument(name, 'name') + version = _validate_string_argument(version, 'version', True) + _parse_uri_argument(vault) # check that vault is a valid URI but don't change it + return KeyVaultIdentifier(collection=collection, vault=vault, name=name, version=version) + + @staticmethod + def parse_object_id(collection, id): + """ + :param collection: The resource collection type. + :type collection: str + :param id: The resource uri. + :type id: str + :rtype: KeyVaultId + """ + collection = _validate_string_argument(collection, 'collection') + return KeyVaultIdentifier(uri=id, collection=collection) + + @staticmethod + def create_key_id(vault, name, version=None): + """ + :param vault: The vault uri. + :type vault: str + :param name: The key name. + :type name: str + :param version: The key version. + :type version: str + :rtype: KeyVaultId + """ + return KeyId(vault=vault, name=name, version=version) + + @staticmethod + def parse_key_id(id): + """ + :param id: The key uri. + :type id: str + :rtype: KeyVaultId + """ + return KeyId(id) + + @staticmethod + def create_secret_id(vault, name, version=None): + """ + :param vault: The vault uri. + :type vault: str + :param name: The secret name. + :type name: str + :param version: The secret version. + :type version: str + :rtype: KeyVaultId + """ + return SecretId(vault=vault, name=name, version=version) + + @staticmethod + def parse_secret_id(id): + """ + :param id: The secret uri. + :type id: str + :rtype: KeyVaultId + """ + return SecretId(id) + + @staticmethod + def create_certificate_id(vault, name, version=None): + """ + :param vault: The vault uri. + :type vault: str + :param name: The certificate name. + :type name: str + :param version: The certificate version. + :type version: str + :rtype: KeyVaultId + """ + return CertificateId(vault=vault, name=name, version=version) + + @staticmethod + def parse_certificate_id(id): + """ + :param id: The resource collection type. + :type id: str + :rtype: KeyVaultId + """ + return CertificateId(id) + + @staticmethod + def create_certificate_operation_id(vault, name): + """ + :param vault: The vault uri. + :type vault: str + :param name: The certificate name. + :type name: str + :rtype: KeyVaultId + """ + return CertificateOperationId(vault=vault, name=name) + + @staticmethod + def parse_certificate_operation_id(id): + """ + :param id: The resource collection type. + :type id: str + :rtype: KeyVaultId + """ + return CertificateOperationId(id) + + @staticmethod + def create_certificate_issuer_id(vault, name): + """ + :param vault: The vault uri. + :type vault: str + :param name: The certificate name. + :type name: str + :rtype: KeyVaultId + """ + return CertificateIssuerId(vault=vault, name=name) + + @staticmethod + def parse_certificate_issuer_id(id): + """ + :param id: The resource collection type. + :type id: str + :rtype: KeyVaultId + """ + return CertificateIssuerId(id) + + +class KeyVaultIdentifier(KeyVaultId): + _id_format = '{vault}/{collection}/{name}/{version?}' + version_none = '' + + def __init__(self, uri=None, **kwargs): + """ + Creates a KeyVaultIdentifier based of the specified uri or keyword arguments + :param uri: The uri of the key vault object identifier + :param kwargs: The format parameters for the key vault object identifier. If uri is specified these are used to validate the + components of the uri. + """ + self.version = KeyVaultIdentifier.version_none + + # add all the keyword arguments as attributes + for key, value in kwargs.items(): + self.__dict__[key] = _validate_string_argument(value, key, True) + + self.version = self.version or KeyVaultIdentifier.version_none + + # if uri is specified parse the segment values from the specified uri + if uri: + self._parse(uri, kwargs) + + @property + def id(self): + """ + :return: The full key vault object identifier uri + """ + return self._format() + + @property + def base_id(self): + """ + :return: The version-less key vault object identifier uri, + """ + return self._format(fmt=self._id_format.replace('/{version?}', '')) + + def _format(self, fmt=None): + """ + Formats the KeyVaultIdentifier into a identifier uri based of the specified format string + :param fmt: The format string for the identifier uri + :return: The formatted key vault object identifier uri + """ + # if no fmt was specified use the _id_format from the current object + fmt = fmt or self._id_format + segments = [] + + # split the formatting string into segments + for fmt_seg in fmt.split('/'): + # if the segment is a substitution element + if fmt_seg.startswith('{') and fmt_seg.endswith('}'): + + # get the attribute name from the segment element + fmt_seg = fmt_seg[1:-1] + fmt_prop = fmt_seg.rstrip('?') + # get the value of the attribute from the current object + seg_val = getattr(self, fmt_prop) + + # if the attribute is specified add the value to the formatted segments + if seg_val: + segments.append(seg_val.strip('/').strip()) + # if the attribute is not specified and the substitution is not optional raise an error + else: + if not fmt_seg.endswith('?'): + raise ValueError('invalid id: No value specified for the required segment "{}"'.format(fmt_prop)) + + # if the segment is a literal element simply add it to the formatted segments + else: + segments.append(fmt_seg) + + # join all the formatted segments together + return '/'.join(segments) + + def _parse(self, uri, validation_args): + """ + Parses the specified uri, using _id_format as a format string, and sets the parsed format arguments as + attributes on the current id object. + :param uri: The key vault identifier uri to be parsed + :param validation_args: format arguments to be validated + :return: None + """ + def format_error(): + return ValueError('invalid id: The specified uri "{}", does to match the specified format "{}"'.format(uri, self._id_format)) + + uri = _validate_string_argument(uri, 'uri') + parsed_uri = _parse_uri_argument(uri) + + # split all the id segments from the uri path using and insert the host as the first segment + id_segs = list(filter(None, parsed_uri.path.split('/'))) + id_segs.insert(0, '{}://{}'.format(parsed_uri.scheme, parsed_uri.hostname)) + + # split the format segments from the classes format string + fmt_segs = list(filter(None, self._id_format.split('/'))) + + for ix in range(len(fmt_segs)): + # get the format segment and the id segment + fmt_seg = fmt_segs[ix] + id_seg = id_segs.pop(0) if len(id_segs) > 0 else '' + + # if the segment is a substitution element + if fmt_seg.startswith('{') and fmt_seg.endswith('}'): + prop = fmt_seg[1:-1] + prop_strip = prop.rstrip('?') + # if the segment is not present in the specified uri and is not optional raise an error + if not id_seg and not prop.endswith('?'): + raise format_error() + # if the segment is in the segments to validate and doesn't match the expected vault raise an error + if prop_strip in validation_args and validation_args[prop_strip] and validation_args[prop_strip] != id_seg: + if id_seg and not prop.endswith('?'): + raise ValueError('invalid id: The {} "{}" does not match the expected "{}"'.format(prop, id_seg, validation_args[prop_strip])) + # set the attribute to the value parsed from the uri + self.__dict__[prop_strip] = id_seg + # otherwise the segment is a literal element + else: + # if the value parsed from the uri doesn't match the literal value from the format string raise an error + if not fmt_seg == id_seg: + raise format_error() + + # if there are still segments left in the uri which were not accounted for in the format string raise an error + if len(id_segs) > 0: + raise format_error() + + +class KeyId(KeyVaultIdentifier): + _id_format = '{vault}/{collection}/{name}/{version?}' + + def __init__(self, uri=None, vault=None, name=None, version=None): + """ + Creates a key vault key id. If uri is specified the id properties are parsed from the uri, otherwise + builds the id from the specified vault, name and version. + :param uri: The uri of the key vault key + :param vault: The vault uri + :param name: The key name + :param version: The key version + """ + super(KeyId, self).__init__(uri=uri, collection='keys', vault=vault, name=name, version=version) + + +class SecretId(KeyVaultIdentifier): + _id_format = '{vault}/{collection}/{name}/{version?}' + + def __init__(self, uri=None, vault=None, name=None, version=None): + """ + Creates a key vault secret id. If uri is specified the id properties are parsed from the uri, otherwise + builds the id from the specified vault, name and version. + :param uri: The uri of the key vault secret + :param vault: The vault uri + :param name: The secret name + :param version: The secret version + """ + super(SecretId, self).__init__(uri=uri, collection='secrets', vault=vault, name=name, version=version) + + +class CertificateId(KeyVaultIdentifier): + _id_format = '{vault}/{collection}/{name}/{version?}' + + def __init__(self, uri=None, vault=None, name=None, version=None): + """ + Creates a key vault certificate id. If uri is specified the id properties are parsed from the uri, otherwise + builds the id from the specified vault, name and version. + :param uri: The uri of the key vault certificate + :param vault: The vault uri + :param name: The certificate name + :param version: The certificate version + """ + super(CertificateId, self).__init__(uri=uri, collection='certificates', vault=vault, name=name, version=version) + + +class CertificateOperationId(KeyVaultIdentifier): + _id_format = '{vault}/{collection}/{name}/{version?}' + + def __init__(self, uri=None, vault=None, name=None): + """ + Creates a key vault certificate operation id. If uri is specified the id properties are parsed from the uri, otherwise + builds the id from the specified vault and name. + :param uri: The uri of the key vault certificate operation + :param vault: The vault uri + :param name: The certificate name + """ + super(CertificateOperationId, self).__init__(uri=uri, collection='certificates', version='pending', vault=vault, name=name) + + +class CertificateIssuerId(KeyVaultIdentifier): + _id_format = '{vault}/{collection}/issuers/{name}' + + def __init__(self, uri=None, vault=None, name=None): + """ + Creates a key vault certificate issuer id. If uri is specified the id properties are parsed from the uri, otherwise + builds the id from the specified vault and name. + :param uri: The uri of the key vault certificate issuer + :param vault: The vault uri + :param name: The certificate issuer name + """ + super(CertificateIssuerId, self).__init__(uri=uri, collection='certificates', vault=vault, name=name) + + +class StorageAccountId(KeyVaultIdentifier): + _id_format = '{vault}/{collection}/{name}' + + def __init__(self, uri=None, vault=None, name=None): + """ + Creates a key vault storage account id. If uri is specified the id properties are parsed from the uri, otherwise + builds the id from the specified vault and name. + :param uri: The uri of the key vault storage account + :param vault: The vault uri + :param name: The storage account name + """ + super(StorageAccountId, self).__init__(uri=uri, collection='storage', vault=vault, name=name) + + +class StorageSasDefinitionId(KeyVaultIdentifier): + _id_format = '{vault}/{collection}/{account_name}/sas/{sas_definition}' + + def __init__(self, uri=None, vault=None, account_name=None, sas_definition=None): + """ + Creates a key vault storage account sas definition id. If uri is specified the id properties are parsed from the uri, otherwise + builds the id from the specified vault, account_name, and sas_definition. + :param uri: The uri of the key vault storage account sas definition + :param vault: The vault uri + :param account_name: The storage account name + :param sas_definition: The sas definition name + """ + super(StorageSasDefinitionId, self).__init__(uri=uri, collection='storage', vault=vault, account_name=account_name, sas_definition=sas_definition) + + +def _validate_string_argument(prop, name, nullable=False): + try: + prop = prop.strip() + except AttributeError: + if not nullable: + raise TypeError("argument '{}' must by of type string".format(name)) + prop = prop if prop else None # force falsy types to None + if not prop and not nullable: + raise ValueError("argument '{}' must be specified".format(name)) + return prop + + +def _parse_uri_argument(uri): + try: + parsed_uri = parse.urlparse(uri) + except Exception: # pylint: disable=broad-except + raise ValueError("'{}' is not not a valid URI".format(uri)) + if not (parsed_uri.scheme and parsed_uri.hostname): + raise ValueError("'{}' is not not a valid URI".format(uri)) + return parsed_uri + diff --git a/src/keyvault/azext_keyvault/keyvault/key_vault_client.py b/src/keyvault/azext_keyvault/keyvault/key_vault_client.py new file mode 100644 index 00000000000..55276a01d70 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/key_vault_client.py @@ -0,0 +1,5783 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from msrest.pipeline import ClientRawResponse +import uuid +from . import models + + +class KeyVaultClientConfiguration(AzureConfiguration): + """Configuration for KeyVaultClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + """ + + def __init__( + self, credentials): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + base_url = '{vaultBaseUrl}' + + super(KeyVaultClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-keyvault/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + + +class KeyVaultClient(object): + """The key vault client performs cryptographic key operations and vault operations against the Key Vault service. + + :ivar config: Configuration for client. + :vartype config: KeyVaultClientConfiguration + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + """ + + def __init__( + self, credentials): + + self.config = KeyVaultClientConfiguration(credentials) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '7.0-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + + def create_key( + self, vault_base_url, key_name, kty, key_size=None, key_ops=None, key_attributes=None, tags=None, curve=None, custom_headers=None, raw=False, **operation_config): + """Creates a new key, stores it, then returns key parameters and + attributes to the client. + + The create key operation can be used to create any key type in Azure + Key Vault. If the named key already exists, Azure Key Vault creates a + new version of the key. It requires the keys/create permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name for the new key. The system will generate + the version name for the new key. + :type key_name: str + :param kty: The type of key to create. For valid values, see + JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', + 'RSA-HSM', 'oct' + :type kty: str or ~azure.keyvault.models.JsonWebKeyType + :param key_size: The key size in bytes. For example, 1024 or 2048. + :type key_size: int + :param key_ops: + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param curve: Elliptic curve name. For valid values, see + JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', + 'P-521', 'SECP256K1' + :type curve: str or ~azure.keyvault.models.JsonWebKeyCurveName + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyCreateParameters(kty=kty, key_size=key_size, key_ops=key_ops, key_attributes=key_attributes, tags=tags, curve=curve) + + # Construct URL + url = self.create_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyCreateParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_key.metadata = {'url': '/keys/{key-name}/create'} + + def import_key( + self, vault_base_url, key_name, key, hsm=None, key_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Imports an externally created key, stores it, and returns key + parameters and attributes to the client. + + The import key operation may be used to import any key type into an + Azure Key Vault. If the named key already exists, Azure Key Vault + creates a new version of the key. This operation requires the + keys/import permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: Name for the imported key. + :type key_name: str + :param key: The Json web key + :type key: ~azure.keyvault.models.JsonWebKey + :param hsm: Whether to import as a hardware key (HSM) or software key. + :type hsm: bool + :param key_attributes: The key management attributes. + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyImportParameters(hsm=hsm, key=key, key_attributes=key_attributes, tags=tags) + + # Construct URL + url = self.import_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str', pattern=r'^[0-9a-zA-Z-]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyImportParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_key.metadata = {'url': '/keys/{key-name}'} + + def delete_key( + self, vault_base_url, key_name, custom_headers=None, raw=False, **operation_config): + """Deletes a key of any type from storage in Azure Key Vault. + + The delete key operation cannot be used to remove individual versions + of a key. This operation removes the cryptographic material associated + with the key, which means the key is not usable for Sign/Verify, + Wrap/Unwrap or Encrypt/Decrypt operations. This operation requires the + keys/delete permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key to delete. + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedKeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedKeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedKeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_key.metadata = {'url': '/keys/{key-name}'} + + def update_key( + self, vault_base_url, key_name, key_version, key_ops=None, key_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """The update key operation changes specified attributes of a stored key + and can be applied to any key type and key version stored in Azure Key + Vault. + + In order to perform this operation, the key must already exist in the + Key Vault. Note: The cryptographic material of a key itself cannot be + changed. This operation requires the keys/update permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of key to update. + :type key_name: str + :param key_version: The version of the key to update. + :type key_version: str + :param key_ops: Json web key operations. For more information on + possible key operations, see JsonWebKeyOperation. + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyUpdateParameters(key_ops=key_ops, key_attributes=key_attributes, tags=tags) + + # Construct URL + url = self.update_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_key.metadata = {'url': '/keys/{key-name}/{key-version}'} + + def get_key( + self, vault_base_url, key_name, key_version, custom_headers=None, raw=False, **operation_config): + """Gets the public part of a stored key. + + The get key operation is applicable to all key types. If the requested + key is symmetric, then no key material is released in the response. + This operation requires the keys/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key to get. + :type key_name: str + :param key_version: Adding the version parameter retrieves a specific + version of a key. + :type key_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_key.metadata = {'url': '/keys/{key-name}/{key-version}'} + + def get_key_versions( + self, vault_base_url, key_name, maxresults=None, custom_headers=None, raw=False, **operation_config): + """Retrieves a list of individual key versions with the same key name. + + The full key identifier, attributes, and tags are provided in the + response. This operation requires the keys/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of KeyItem + :rtype: + ~azure.keyvault.models.KeyItemPaged[~azure.keyvault.models.KeyItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_key_versions.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.KeyItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.KeyItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_key_versions.metadata = {'url': '/keys/{key-name}/versions'} + + def get_keys( + self, vault_base_url, maxresults=None, custom_headers=None, raw=False, **operation_config): + """List keys in the specified vault. + + Retrieves a list of the keys in the Key Vault as JSON Web Key + structures that contain the public part of a stored key. The LIST + operation is applicable to all key types, however only the base key + identifier, attributes, and tags are provided in the response. + Individual versions of a key are not listed in the response. This + operation requires the keys/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of KeyItem + :rtype: + ~azure.keyvault.models.KeyItemPaged[~azure.keyvault.models.KeyItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_keys.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.KeyItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.KeyItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_keys.metadata = {'url': '/keys'} + + def backup_key( + self, vault_base_url, key_name, custom_headers=None, raw=False, **operation_config): + """Requests that a backup of the specified key be downloaded to the + client. + + The Key Backup operation exports a key from Azure Key Vault in a + protected form. Note that this operation does NOT return key material + in a form that can be used outside the Azure Key Vault system, the + returned key material is either protected to a Azure Key Vault HSM or + to Azure Key Vault itself. The intent of this operation is to allow a + client to GENERATE a key in one Azure Key Vault instance, BACKUP the + key, and then RESTORE it into another Azure Key Vault instance. The + BACKUP operation may be used to export, in protected form, any key type + from Azure Key Vault. Individual versions of a key cannot be backed up. + BACKUP / RESTORE can be performed within geographical boundaries only; + meaning that a BACKUP from one geographical area cannot be restored to + another geographical area. For example, a backup from the US + geographical area cannot be restored in an EU geographical area. This + operation requires the key/backup permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupKeyResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.BackupKeyResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.backup_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupKeyResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + backup_key.metadata = {'url': '/keys/{key-name}/backup'} + + def restore_key( + self, vault_base_url, key_bundle_backup, custom_headers=None, raw=False, **operation_config): + """Restores a backed up key to a vault. + + Imports a previously backed up key into Azure Key Vault, restoring the + key, its key identifier, attributes and access control policies. The + RESTORE operation may be used to import a previously backed up key. + Individual versions of a key cannot be restored. The key is restored in + its entirety with the same key name as it had when it was backed up. If + the key name is not available in the target Key Vault, the RESTORE + operation will be rejected. While the key name is retained during + restore, the final key identifier will change if the key is restored to + a different vault. Restore will restore all versions and preserve + version identifiers. The RESTORE operation is subject to security + constraints: The target Key Vault must be owned by the same Microsoft + Azure Subscription as the source Key Vault The user must have RESTORE + permission in the target Key Vault. This operation requires the + keys/restore permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_bundle_backup: The backup blob associated with a key + bundle. + :type key_bundle_backup: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyRestoreParameters(key_bundle_backup=key_bundle_backup) + + # Construct URL + url = self.restore_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + restore_key.metadata = {'url': '/keys/restore'} + + def encrypt( + self, vault_base_url, key_name, key_version, algorithm, value, custom_headers=None, raw=False, **operation_config): + """Encrypts an arbitrary sequence of bytes using an encryption key that is + stored in a key vault. + + The ENCRYPT operation encrypts an arbitrary sequence of bytes using an + encryption key that is stored in Azure Key Vault. Note that the ENCRYPT + operation only supports a single block of data, the size of which is + dependent on the target key and the encryption algorithm to be used. + The ENCRYPT operation is only strictly necessary for symmetric keys + stored in Azure Key Vault since protection with an asymmetric key can + be performed using public portion of the key. This operation is + supported for asymmetric keys as a convenience for callers that have a + key-reference but do not have access to the public key material. This + operation requires the keys/encypt permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param algorithm: algorithm identifier. Possible values include: + 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm + :param value: + :type value: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value) + + # Construct URL + url = self.encrypt.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyOperationsParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + encrypt.metadata = {'url': '/keys/{key-name}/{key-version}/encrypt'} + + def decrypt( + self, vault_base_url, key_name, key_version, algorithm, value, custom_headers=None, raw=False, **operation_config): + """Decrypts a single block of encrypted data. + + The DECRYPT operation decrypts a well-formed block of ciphertext using + the target encryption key and specified algorithm. This operation is + the reverse of the ENCRYPT operation; only a single block of data may + be decrypted, the size of this block is dependent on the target key and + the algorithm to be used. The DECRYPT operation applies to asymmetric + and symmetric keys stored in Azure Key Vault since it uses the private + portion of the key. This operation requires the keys/decrypt + permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param algorithm: algorithm identifier. Possible values include: + 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm + :param value: + :type value: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value) + + # Construct URL + url = self.decrypt.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyOperationsParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + decrypt.metadata = {'url': '/keys/{key-name}/{key-version}/decrypt'} + + def sign( + self, vault_base_url, key_name, key_version, algorithm, value, custom_headers=None, raw=False, **operation_config): + """Creates a signature from a digest using the specified key. + + The SIGN operation is applicable to asymmetric and symmetric keys + stored in Azure Key Vault since this operation uses the private portion + of the key. This operation requires the keys/sign permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param algorithm: The signing/verification algorithm identifier. For + more information on possible algorithm types, see + JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', + 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', + 'ES384', 'ES512', 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param value: + :type value: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeySignParameters(algorithm=algorithm, value=value) + + # Construct URL + url = self.sign.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeySignParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + sign.metadata = {'url': '/keys/{key-name}/{key-version}/sign'} + + def verify( + self, vault_base_url, key_name, key_version, algorithm, digest, signature, custom_headers=None, raw=False, **operation_config): + """Verifies a signature using a specified key. + + The VERIFY operation is applicable to symmetric keys stored in Azure + Key Vault. VERIFY is not strictly necessary for asymmetric keys stored + in Azure Key Vault since signature verification can be performed using + the public portion of the key but this operation is supported as a + convenience for callers that only have a key-reference and not the + public portion of the key. This operation requires the keys/verify + permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param algorithm: The signing/verification algorithm. For more + information on possible algorithm types, see + JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', + 'PS384', 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', + 'ES384', 'ES512', 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param digest: The digest used for signing. + :type digest: bytes + :param signature: The signature to be verified. + :type signature: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyVerifyResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyVerifyResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyVerifyParameters(algorithm=algorithm, digest=digest, signature=signature) + + # Construct URL + url = self.verify.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyVerifyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyVerifyResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + verify.metadata = {'url': '/keys/{key-name}/{key-version}/verify'} + + def wrap_key( + self, vault_base_url, key_name, key_version, algorithm, value, custom_headers=None, raw=False, **operation_config): + """Wraps a symmetric key using a specified key. + + The WRAP operation supports encryption of a symmetric key using a key + encryption key that has previously been stored in an Azure Key Vault. + The WRAP operation is only strictly necessary for symmetric keys stored + in Azure Key Vault since protection with an asymmetric key can be + performed using the public portion of the key. This operation is + supported for asymmetric keys as a convenience for callers that have a + key-reference but do not have access to the public key material. This + operation requires the keys/wrapKey permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param algorithm: algorithm identifier. Possible values include: + 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm + :param value: + :type value: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value) + + # Construct URL + url = self.wrap_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyOperationsParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + wrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/wrapkey'} + + def unwrap_key( + self, vault_base_url, key_name, key_version, algorithm, value, custom_headers=None, raw=False, **operation_config): + """Unwraps a symmetric key using the specified key that was initially used + for wrapping that key. + + The UNWRAP operation supports decryption of a symmetric key using the + target key encryption key. This operation is the reverse of the WRAP + operation. The UNWRAP operation applies to asymmetric and symmetric + keys stored in Azure Key Vault since it uses the private portion of the + key. This operation requires the keys/unwrapKey permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param key_version: The version of the key. + :type key_version: str + :param algorithm: algorithm identifier. Possible values include: + 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm + :param value: + :type value: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyOperationResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyOperationResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.KeyOperationsParameters(algorithm=algorithm, value=value) + + # Construct URL + url = self.unwrap_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str'), + 'key-version': self._serialize.url("key_version", key_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'KeyOperationsParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + unwrap_key.metadata = {'url': '/keys/{key-name}/{key-version}/unwrapkey'} + + def get_deleted_keys( + self, vault_base_url, maxresults=None, custom_headers=None, raw=False, **operation_config): + """Lists the deleted keys in the specified vault. + + Retrieves a list of the keys in the Key Vault as JSON Web Key + structures that contain the public part of a deleted key. This + operation includes deletion-specific information. The Get Deleted Keys + operation is applicable for vaults enabled for soft-delete. While the + operation can be invoked on any vault, it will return an error if + invoked on a non soft-delete enabled vault. This operation requires the + keys/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedKeyItem + :rtype: + ~azure.keyvault.models.DeletedKeyItemPaged[~azure.keyvault.models.DeletedKeyItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_deleted_keys.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DeletedKeyItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeletedKeyItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_deleted_keys.metadata = {'url': '/deletedkeys'} + + def get_deleted_key( + self, vault_base_url, key_name, custom_headers=None, raw=False, **operation_config): + """Gets the public part of a deleted key. + + The Get Deleted Key operation is applicable for soft-delete enabled + vaults. While the operation can be invoked on any vault, it will return + an error if invoked on a non soft-delete enabled vault. This operation + requires the keys/get permission. . + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key. + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedKeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedKeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_deleted_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedKeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} + + def purge_deleted_key( + self, vault_base_url, key_name, custom_headers=None, raw=False, **operation_config): + """Permanently deletes the specified key. + + The Purge Deleted Key operation is applicable for soft-delete enabled + vaults. While the operation can be invoked on any vault, it will return + an error if invoked on a non soft-delete enabled vault. This operation + requires the keys/purge permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the key + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.purge_deleted_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.KeyVaultErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + purge_deleted_key.metadata = {'url': '/deletedkeys/{key-name}'} + + def recover_deleted_key( + self, vault_base_url, key_name, custom_headers=None, raw=False, **operation_config): + """Recovers the deleted key to its latest version. + + The Recover Deleted Key operation is applicable for deleted keys in + soft-delete enabled vaults. It recovers the deleted key back to its + latest version under /keys. An attempt to recover an non-deleted key + will return an error. Consider this the inverse of the delete operation + on soft-delete enabled vaults. This operation requires the keys/recover + permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param key_name: The name of the deleted key. + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: KeyBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.KeyBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.recover_deleted_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'key-name': self._serialize.url("key_name", key_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('KeyBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + recover_deleted_key.metadata = {'url': '/deletedkeys/{key-name}/recover'} + + def set_secret( + self, vault_base_url, secret_name, value, tags=None, content_type=None, secret_attributes=None, custom_headers=None, raw=False, **operation_config): + """Sets a secret in a specified key vault. + + The SET operation adds a secret to the Azure Key Vault. If the named + secret already exists, Azure Key Vault creates a new version of that + secret. This operation requires the secrets/set permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param value: The value of the secret. + :type value: str + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecretBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SecretBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.SecretSetParameters(value=value, tags=tags, content_type=content_type, secret_attributes=secret_attributes) + + # Construct URL + url = self.set_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str', pattern=r'^[0-9a-zA-Z-]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SecretSetParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecretBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_secret.metadata = {'url': '/secrets/{secret-name}'} + + def delete_secret( + self, vault_base_url, secret_name, custom_headers=None, raw=False, **operation_config): + """Deletes a secret from a specified key vault. + + The DELETE operation applies to any secret stored in Azure Key Vault. + DELETE cannot be applied to an individual version of a secret. This + operation requires the secrets/delete permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedSecretBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedSecretBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedSecretBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_secret.metadata = {'url': '/secrets/{secret-name}'} + + def update_secret( + self, vault_base_url, secret_name, secret_version, content_type=None, secret_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates the attributes associated with a specified secret in a given + key vault. + + The UPDATE operation changes specified attributes of an existing stored + secret. Attributes that are not specified in the request are left + unchanged. The value of a secret itself cannot be changed. This + operation requires the secrets/set permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param secret_version: The version of the secret. + :type secret_version: str + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecretBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SecretBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.SecretUpdateParameters(content_type=content_type, secret_attributes=secret_attributes, tags=tags) + + # Construct URL + url = self.update_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str'), + 'secret-version': self._serialize.url("secret_version", secret_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SecretUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecretBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} + + def get_secret( + self, vault_base_url, secret_name, secret_version, custom_headers=None, raw=False, **operation_config): + """Get a specified secret from a given key vault. + + The GET operation is applicable to any secret stored in Azure Key + Vault. This operation requires the secrets/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param secret_version: The version of the secret. + :type secret_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecretBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SecretBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str'), + 'secret-version': self._serialize.url("secret_version", secret_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecretBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_secret.metadata = {'url': '/secrets/{secret-name}/{secret-version}'} + + def get_secrets( + self, vault_base_url, maxresults=None, custom_headers=None, raw=False, **operation_config): + """List secrets in a specified key vault. + + The Get Secrets operation is applicable to the entire vault. However, + only the base secret identifier and its attributes are provided in the + response. Individual secret versions are not listed in the response. + This operation requires the secrets/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified, the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecretItem + :rtype: + ~azure.keyvault.models.SecretItemPaged[~azure.keyvault.models.SecretItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_secrets.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SecretItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecretItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_secrets.metadata = {'url': '/secrets'} + + def get_secret_versions( + self, vault_base_url, secret_name, maxresults=None, custom_headers=None, raw=False, **operation_config): + """List all versions of the specified secret. + + The full secret identifier and attributes are provided in the response. + No values are returned for the secrets. This operations requires the + secrets/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param maxresults: Maximum number of results to return in a page. If + not specified, the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SecretItem + :rtype: + ~azure.keyvault.models.SecretItemPaged[~azure.keyvault.models.SecretItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_secret_versions.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SecretItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SecretItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_secret_versions.metadata = {'url': '/secrets/{secret-name}/versions'} + + def get_deleted_secrets( + self, vault_base_url, maxresults=None, custom_headers=None, raw=False, **operation_config): + """Lists deleted secrets for the specified vault. + + The Get Deleted Secrets operation returns the secrets that have been + deleted for a vault enabled for soft-delete. This operation requires + the secrets/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedSecretItem + :rtype: + ~azure.keyvault.models.DeletedSecretItemPaged[~azure.keyvault.models.DeletedSecretItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_deleted_secrets.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DeletedSecretItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeletedSecretItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_deleted_secrets.metadata = {'url': '/deletedsecrets'} + + def get_deleted_secret( + self, vault_base_url, secret_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified deleted secret. + + The Get Deleted Secret operation returns the specified deleted secret + along with its attributes. This operation requires the secrets/get + permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedSecretBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedSecretBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_deleted_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedSecretBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} + + def purge_deleted_secret( + self, vault_base_url, secret_name, custom_headers=None, raw=False, **operation_config): + """Permanently deletes the specified secret. + + The purge deleted secret operation removes the secret permanently, + without the possibility of recovery. This operation can only be enabled + on a soft-delete enabled vault. This operation requires the + secrets/purge permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.purge_deleted_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.KeyVaultErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + purge_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}'} + + def recover_deleted_secret( + self, vault_base_url, secret_name, custom_headers=None, raw=False, **operation_config): + """Recovers the deleted secret to the latest version. + + Recovers the deleted secret in the specified vault. This operation can + only be performed on a soft-delete enabled vault. This operation + requires the secrets/recover permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the deleted secret. + :type secret_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecretBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SecretBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.recover_deleted_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecretBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + recover_deleted_secret.metadata = {'url': '/deletedsecrets/{secret-name}/recover'} + + def backup_secret( + self, vault_base_url, secret_name, custom_headers=None, raw=False, **operation_config): + """Backs up the specified secret. + + Requests that a backup of the specified secret be downloaded to the + client. All versions of the secret will be downloaded. This operation + requires the secrets/backup permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_name: The name of the secret. + :type secret_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupSecretResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.BackupSecretResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.backup_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'secret-name': self._serialize.url("secret_name", secret_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupSecretResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + backup_secret.metadata = {'url': '/secrets/{secret-name}/backup'} + + def restore_secret( + self, vault_base_url, secret_bundle_backup, custom_headers=None, raw=False, **operation_config): + """Restores a backed up secret to a vault. + + Restores a backed up secret, and all its versions, to a vault. This + operation requires the secrets/restore permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param secret_bundle_backup: The backup blob associated with a secret + bundle. + :type secret_bundle_backup: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SecretBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SecretBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.SecretRestoreParameters(secret_bundle_backup=secret_bundle_backup) + + # Construct URL + url = self.restore_secret.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SecretRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SecretBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + restore_secret.metadata = {'url': '/secrets/restore'} + + def get_certificates( + self, vault_base_url, maxresults=None, include_pending=None, custom_headers=None, raw=False, **operation_config): + """List certificates in a specified key vault. + + The GetCertificates operation returns the set of certificates resources + in the specified key vault. This operation requires the + certificates/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param include_pending: Specifies whether to include certificates + which are not completely provisioned. + :type include_pending: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CertificateItem + :rtype: + ~azure.keyvault.models.CertificateItemPaged[~azure.keyvault.models.CertificateItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_certificates.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + if include_pending is not None: + query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CertificateItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CertificateItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_certificates.metadata = {'url': '/certificates'} + + def delete_certificate( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Deletes a certificate from a specified key vault. + + Deletes all versions of a certificate object along with its associated + policy. Delete certificate cannot be used to remove individual versions + of a certificate object. This operation requires the + certificates/delete permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedCertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedCertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedCertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_certificate.metadata = {'url': '/certificates/{certificate-name}'} + + def set_certificate_contacts( + self, vault_base_url, contact_list=None, custom_headers=None, raw=False, **operation_config): + """Sets the certificate contacts for the specified key vault. + + Sets the certificate contacts for the specified key vault. This + operation requires the certificates/managecontacts permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param contact_list: The contact list for the vault certificates. + :type contact_list: list[~azure.keyvault.models.Contact] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Contacts or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.Contacts or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + contacts = models.Contacts(contact_list=contact_list) + + # Construct URL + url = self.set_certificate_contacts.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(contacts, 'Contacts') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Contacts', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_certificate_contacts.metadata = {'url': '/certificates/contacts'} + + def get_certificate_contacts( + self, vault_base_url, custom_headers=None, raw=False, **operation_config): + """Lists the certificate contacts for a specified key vault. + + The GetCertificateContacts operation returns the set of certificate + contact resources in the specified key vault. This operation requires + the certificates/managecontacts permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Contacts or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.Contacts or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_certificate_contacts.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Contacts', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_certificate_contacts.metadata = {'url': '/certificates/contacts'} + + def delete_certificate_contacts( + self, vault_base_url, custom_headers=None, raw=False, **operation_config): + """Deletes the certificate contacts for a specified key vault. + + Deletes the certificate contacts for a specified key vault certificate. + This operation requires the certificates/managecontacts permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Contacts or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.Contacts or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_certificate_contacts.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Contacts', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_certificate_contacts.metadata = {'url': '/certificates/contacts'} + + def get_certificate_issuers( + self, vault_base_url, maxresults=None, custom_headers=None, raw=False, **operation_config): + """List certificate issuers for a specified key vault. + + The GetCertificateIssuers operation returns the set of certificate + issuer resources in the specified key vault. This operation requires + the certificates/manageissuers/getissuers permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CertificateIssuerItem + :rtype: + ~azure.keyvault.models.CertificateIssuerItemPaged[~azure.keyvault.models.CertificateIssuerItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_certificate_issuers.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CertificateIssuerItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CertificateIssuerItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_certificate_issuers.metadata = {'url': '/certificates/issuers'} + + def set_certificate_issuer( + self, vault_base_url, issuer_name, provider, credentials=None, organization_details=None, attributes=None, custom_headers=None, raw=False, **operation_config): + """Sets the specified certificate issuer. + + The SetCertificateIssuer operation adds or updates the specified + certificate issuer. This operation requires the certificates/setissuers + permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param issuer_name: The name of the issuer. + :type issuer_name: str + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided + to the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IssuerBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.IssuerBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameter = models.CertificateIssuerSetParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes) + + # Construct URL + url = self.set_certificate_issuer.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameter, 'CertificateIssuerSetParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IssuerBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} + + def update_certificate_issuer( + self, vault_base_url, issuer_name, provider=None, credentials=None, organization_details=None, attributes=None, custom_headers=None, raw=False, **operation_config): + """Updates the specified certificate issuer. + + The UpdateCertificateIssuer operation performs an update on the + specified certificate issuer entity. This operation requires the + certificates/setissuers permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param issuer_name: The name of the issuer. + :type issuer_name: str + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided + to the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IssuerBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.IssuerBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameter = models.CertificateIssuerUpdateParameters(provider=provider, credentials=credentials, organization_details=organization_details, attributes=attributes) + + # Construct URL + url = self.update_certificate_issuer.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameter, 'CertificateIssuerUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IssuerBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} + + def get_certificate_issuer( + self, vault_base_url, issuer_name, custom_headers=None, raw=False, **operation_config): + """Lists the specified certificate issuer. + + The GetCertificateIssuer operation returns the specified certificate + issuer resources in the specified key vault. This operation requires + the certificates/manageissuers/getissuers permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param issuer_name: The name of the issuer. + :type issuer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IssuerBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.IssuerBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_certificate_issuer.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IssuerBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} + + def delete_certificate_issuer( + self, vault_base_url, issuer_name, custom_headers=None, raw=False, **operation_config): + """Deletes the specified certificate issuer. + + The DeleteCertificateIssuer operation permanently removes the specified + certificate issuer from the vault. This operation requires the + certificates/manageissuers/deleteissuers permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param issuer_name: The name of the issuer. + :type issuer_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: IssuerBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.IssuerBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_certificate_issuer.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'issuer-name': self._serialize.url("issuer_name", issuer_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('IssuerBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_certificate_issuer.metadata = {'url': '/certificates/issuers/{issuer-name}'} + + def create_certificate( + self, vault_base_url, certificate_name, certificate_policy=None, certificate_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Creates a new certificate. + + If this is the first version, the certificate resource is created. This + operation requires the certificates/create permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: + ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateOperation or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateOperation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.CertificateCreateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags) + + # Construct URL + url = self.create_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateCreateParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [202]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 202: + deserialized = self._deserialize('CertificateOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_certificate.metadata = {'url': '/certificates/{certificate-name}/create'} + + def import_certificate( + self, vault_base_url, certificate_name, base64_encoded_certificate, password=None, certificate_policy=None, certificate_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Imports a certificate into a specified key vault. + + Imports an existing valid certificate, containing a private key, into + Azure Key Vault. The certificate to be imported can be in either PFX or + PEM format. If the certificate is in PEM format the PEM file must + contain the key as well as x509 certificates. This operation requires + the certificates/import permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param base64_encoded_certificate: Base64 encoded representation of + the certificate object to import. This certificate needs to contain + the private key. + :type base64_encoded_certificate: str + :param password: If the private key in base64EncodedCertificate is + encrypted, the password used for encryption. + :type password: str + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: + ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.CertificateImportParameters(base64_encoded_certificate=base64_encoded_certificate, password=password, certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags) + + # Construct URL + url = self.import_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str', pattern=r'^[0-9a-zA-Z-]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateImportParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + import_certificate.metadata = {'url': '/certificates/{certificate-name}/import'} + + def get_certificate_versions( + self, vault_base_url, certificate_name, maxresults=None, custom_headers=None, raw=False, **operation_config): + """List the versions of a certificate. + + The GetCertificateVersions operation returns the versions of a + certificate in the specified key vault. This operation requires the + certificates/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of CertificateItem + :rtype: + ~azure.keyvault.models.CertificateItemPaged[~azure.keyvault.models.CertificateItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_certificate_versions.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.CertificateItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.CertificateItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_certificate_versions.metadata = {'url': '/certificates/{certificate-name}/versions'} + + def get_certificate_policy( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Lists the policy for a certificate. + + The GetCertificatePolicy operation returns the specified certificate + policy resources in the specified key vault. This operation requires + the certificates/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate in a given key + vault. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificatePolicy or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificatePolicy or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_certificate_policy.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificatePolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} + + def update_certificate_policy( + self, vault_base_url, certificate_name, certificate_policy, custom_headers=None, raw=False, **operation_config): + """Updates the policy for a certificate. + + Set specified members in the certificate policy. Leave others as null. + This operation requires the certificates/update permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate in the given + vault. + :type certificate_name: str + :param certificate_policy: The policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificatePolicy or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificatePolicy or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.update_certificate_policy.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(certificate_policy, 'CertificatePolicy') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificatePolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_certificate_policy.metadata = {'url': '/certificates/{certificate-name}/policy'} + + def update_certificate( + self, vault_base_url, certificate_name, certificate_version, certificate_policy=None, certificate_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates the specified attributes associated with the given certificate. + + The UpdateCertificate operation applies the specified update on the + given certificate; the only elements updated are the certificate's + attributes. This operation requires the certificates/update permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate in the given key + vault. + :type certificate_name: str + :param certificate_version: The version of the certificate. + :type certificate_version: str + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: + ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.CertificateUpdateParameters(certificate_policy=certificate_policy, certificate_attributes=certificate_attributes, tags=tags) + + # Construct URL + url = self.update_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'), + 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} + + def get_certificate( + self, vault_base_url, certificate_name, certificate_version, custom_headers=None, raw=False, **operation_config): + """Gets information about a certificate. + + Gets information about a specific certificate. This operation requires + the certificates/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate in the given + vault. + :type certificate_name: str + :param certificate_version: The version of the certificate. + :type certificate_version: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str'), + 'certificate-version': self._serialize.url("certificate_version", certificate_version, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_certificate.metadata = {'url': '/certificates/{certificate-name}/{certificate-version}'} + + def update_certificate_operation( + self, vault_base_url, certificate_name, cancellation_requested, custom_headers=None, raw=False, **operation_config): + """Updates a certificate operation. + + Updates a certificate creation operation that is already in progress. + This operation requires the certificates/update permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param cancellation_requested: Indicates if cancellation was requested + on the certificate operation. + :type cancellation_requested: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateOperation or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateOperation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + certificate_operation = models.CertificateOperationUpdateParameter(cancellation_requested=cancellation_requested) + + # Construct URL + url = self.update_certificate_operation.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(certificate_operation, 'CertificateOperationUpdateParameter') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} + + def get_certificate_operation( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Gets the creation operation of a certificate. + + Gets the creation operation associated with a specified certificate. + This operation requires the certificates/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateOperation or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateOperation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_certificate_operation.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} + + def delete_certificate_operation( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Deletes the creation operation for a specific certificate. + + Deletes the creation operation for a specified certificate that is in + the process of being created. The certificate is no longer created. + This operation requires the certificates/update permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateOperation or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateOperation or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_certificate_operation.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_certificate_operation.metadata = {'url': '/certificates/{certificate-name}/pending'} + + def merge_certificate( + self, vault_base_url, certificate_name, x509_certificates, certificate_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Merges a certificate or a certificate chain with a key pair existing on + the server. + + The MergeCertificate operation performs the merging of a certificate or + certificate chain with a key pair currently available in the service. + This operation requires the certificates/create permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param x509_certificates: The certificate or the certificate chain to + merge. + :type x509_certificates: list[bytearray] + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: + ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.CertificateMergeParameters(x509_certificates=x509_certificates, certificate_attributes=certificate_attributes, tags=tags) + + # Construct URL + url = self.merge_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateMergeParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [201]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 201: + deserialized = self._deserialize('CertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + merge_certificate.metadata = {'url': '/certificates/{certificate-name}/pending/merge'} + + def backup_certificate( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Backs up the specified certificate. + + Requests that a backup of the specified certificate be downloaded to + the client. All versions of the certificate will be downloaded. This + operation requires the certificates/backup permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate. + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupCertificateResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.BackupCertificateResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.backup_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupCertificateResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + backup_certificate.metadata = {'url': '/certificates/{certificate-name}/backup'} + + def restore_certificate( + self, vault_base_url, certificate_bundle_backup, custom_headers=None, raw=False, **operation_config): + """Restores a backed up certificate to a vault. + + Restores a backed up certificate, and all its versions, to a vault. + This operation requires the certificates/restore permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_bundle_backup: The backup blob associated with a + certificate bundle. + :type certificate_bundle_backup: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.CertificateRestoreParameters(certificate_bundle_backup=certificate_bundle_backup) + + # Construct URL + url = self.restore_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CertificateRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + restore_certificate.metadata = {'url': '/certificates/restore'} + + def get_deleted_certificates( + self, vault_base_url, maxresults=None, include_pending=None, custom_headers=None, raw=False, **operation_config): + """Lists the deleted certificates in the specified vault currently + available for recovery. + + The GetDeletedCertificates operation retrieves the certificates in the + current vault which are in a deleted state and ready for recovery or + purging. This operation includes deletion-specific information. This + operation requires the certificates/get/list permission. This operation + can only be enabled on soft-delete enabled vaults. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param include_pending: Specifies whether to include certificates + which are not completely provisioned. + :type include_pending: bool + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedCertificateItem + :rtype: + ~azure.keyvault.models.DeletedCertificateItemPaged[~azure.keyvault.models.DeletedCertificateItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_deleted_certificates.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + if include_pending is not None: + query_parameters['includePending'] = self._serialize.query("include_pending", include_pending, 'bool') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DeletedCertificateItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeletedCertificateItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_deleted_certificates.metadata = {'url': '/deletedcertificates'} + + def get_deleted_certificate( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Retrieves information about the specified deleted certificate. + + The GetDeletedCertificate operation retrieves the deleted certificate + information plus its attributes, such as retention interval, scheduled + permanent deletion and the current deletion recovery level. This + operation requires the certificates/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedCertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedCertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_deleted_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedCertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} + + def purge_deleted_certificate( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Permanently deletes the specified deleted certificate. + + The PurgeDeletedCertificate operation performs an irreversible deletion + of the specified certificate, without possibility for recovery. The + operation is not available if the recovery level does not specify + 'Purgeable'. This operation requires the certificate/purge permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the certificate + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.purge_deleted_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.KeyVaultErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + purge_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}'} + + def recover_deleted_certificate( + self, vault_base_url, certificate_name, custom_headers=None, raw=False, **operation_config): + """Recovers the deleted certificate back to its current version under + /certificates. + + The RecoverDeletedCertificate operation performs the reversal of the + Delete operation. The operation is applicable in vaults enabled for + soft-delete, and must be issued during the retention interval + (available in the deleted certificate's attributes). This operation + requires the certificates/recover permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param certificate_name: The name of the deleted certificate + :type certificate_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CertificateBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.CertificateBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.recover_deleted_certificate.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'certificate-name': self._serialize.url("certificate_name", certificate_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CertificateBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + recover_deleted_certificate.metadata = {'url': '/deletedcertificates/{certificate-name}/recover'} + + def get_storage_accounts( + self, vault_base_url, maxresults=None, custom_headers=None, raw=False, **operation_config): + """List storage accounts managed by the specified key vault. This + operation requires the storage/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of StorageAccountItem + :rtype: + ~azure.keyvault.models.StorageAccountItemPaged[~azure.keyvault.models.StorageAccountItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_storage_accounts.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.StorageAccountItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.StorageAccountItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_storage_accounts.metadata = {'url': '/storage'} + + def get_deleted_storage_accounts( + self, vault_base_url, maxresults=None, custom_headers=None, raw=False, **operation_config): + """Lists deleted storage accounts for the specified vault. + + The Get Deleted Storage Accounts operation returns the storage accounts + that have been deleted for a vault enabled for soft-delete. This + operation requires the storage/list permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedStorageAccountItem + :rtype: + ~azure.keyvault.models.DeletedStorageAccountItemPaged[~azure.keyvault.models.DeletedStorageAccountItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_deleted_storage_accounts.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DeletedStorageAccountItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeletedStorageAccountItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_deleted_storage_accounts.metadata = {'url': '/deletedstorage'} + + def get_deleted_storage_account( + self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified deleted storage account. + + The Get Deleted Storage Account operation returns the specified deleted + storage account along with its attributes. This operation requires the + storage/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedStorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedStorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_deleted_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedStorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} + + def purge_deleted_storage_account( + self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): + """Permanently deletes the specified storage account. + + The purge deleted storage account operation removes the secret + permanently, without the possibility of recovery. This operation can + only be performed on a soft-delete enabled vault. This operation + requires the storage/purge permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.purge_deleted_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [204]: + raise models.KeyVaultErrorException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + purge_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} + + def recover_deleted_storage_account( + self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): + """Recovers the deleted storage account. + + Recovers the deleted storage account in the specified vault. This + operation can only be performed on a soft-delete enabled vault. This + operation requires the storage/recover permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.StorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.recover_deleted_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + recover_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}/recover'} + + def backup_storage_account( + self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): + """Backs up the specified storage account. + + Requests that a backup of the specified storage account be downloaded + to the client. This operation requires the storage/backup permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: BackupStorageResult or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.BackupStorageResult or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.backup_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('BackupStorageResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + backup_storage_account.metadata = {'url': '/storage/{storage-account-name}/backup'} + + def restore_storage_account( + self, vault_base_url, storage_bundle_backup, custom_headers=None, raw=False, **operation_config): + """Restores a backed up storage account to a vault. + + Restores a backed up storage account to a vault. This operation + requires the storage/restore permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_bundle_backup: The backup blob associated with a + storage account. + :type storage_bundle_backup: bytes + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.StorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.StorageRestoreParameters(storage_bundle_backup=storage_bundle_backup) + + # Construct URL + url = self.restore_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True) + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageRestoreParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + restore_storage_account.metadata = {'url': '/storage/restore'} + + def delete_storage_account( + self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): + """Deletes a storage account. This operation requires the storage/delete + permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedStorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedStorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedStorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_storage_account.metadata = {'url': '/storage/{storage-account-name}'} + + def get_storage_account( + self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a specified storage account. This operation + requires the storage/get permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.StorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_storage_account.metadata = {'url': '/storage/{storage-account-name}'} + + def set_storage_account( + self, vault_base_url, storage_account_name, resource_id, active_key_name, auto_regenerate_key, regeneration_period=None, storage_account_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a new storage account. This operation requires the + storage/set permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param resource_id: Storage account resource id. + :type resource_id: str + :param active_key_name: Current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration + specified in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage + account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.StorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.StorageAccountCreateParameters(resource_id=resource_id, active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags) + + # Construct URL + url = self.set_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageAccountCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_storage_account.metadata = {'url': '/storage/{storage-account-name}'} + + def update_storage_account( + self, vault_base_url, storage_account_name, active_key_name=None, auto_regenerate_key=None, regeneration_period=None, storage_account_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates the specified attributes associated with the given storage + account. This operation requires the storage/set/update permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param active_key_name: The current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration + specified in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage + account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.StorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.StorageAccountUpdateParameters(active_key_name=active_key_name, auto_regenerate_key=auto_regenerate_key, regeneration_period=regeneration_period, storage_account_attributes=storage_account_attributes, tags=tags) + + # Construct URL + url = self.update_storage_account.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageAccountUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_storage_account.metadata = {'url': '/storage/{storage-account-name}'} + + def regenerate_storage_account_key( + self, vault_base_url, storage_account_name, key_name, custom_headers=None, raw=False, **operation_config): + """Regenerates the specified key value for the given storage account. This + operation requires the storage/regeneratekey permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param key_name: The storage account key name. + :type key_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.StorageBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.StorageAccountRegenerteKeyParameters(key_name=key_name) + + # Construct URL + url = self.regenerate_storage_account_key.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'StorageAccountRegenerteKeyParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + regenerate_storage_account_key.metadata = {'url': '/storage/{storage-account-name}/regeneratekey'} + + def get_sas_definitions( + self, vault_base_url, storage_account_name, maxresults=None, custom_headers=None, raw=False, **operation_config): + """List storage SAS definitions for the given storage account. This + operation requires the storage/listsas permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SasDefinitionItem + :rtype: + ~azure.keyvault.models.SasDefinitionItemPaged[~azure.keyvault.models.SasDefinitionItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_sas_definitions.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.SasDefinitionItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.SasDefinitionItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_sas_definitions.metadata = {'url': '/storage/{storage-account-name}/sas'} + + def get_deleted_sas_definitions( + self, vault_base_url, storage_account_name, maxresults=None, custom_headers=None, raw=False, **operation_config): + """Lists deleted SAS definitions for the specified vault and storage + account. + + The Get Deleted Sas Definitions operation returns the SAS definitions + that have been deleted for a vault enabled for soft-delete. This + operation requires the storage/listsas permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param maxresults: Maximum number of results to return in a page. If + not specified the service will return up to 25 results. + :type maxresults: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedSasDefinitionItem + :rtype: + ~azure.keyvault.models.DeletedSasDefinitionItemPaged[~azure.keyvault.models.DeletedSasDefinitionItem] + :raises: + :class:`KeyVaultErrorException` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.get_deleted_sas_definitions.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if maxresults is not None: + query_parameters['maxresults'] = self._serialize.query("maxresults", maxresults, 'int', maximum=25, minimum=1) + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + return response + + # Deserialize response + deserialized = models.DeletedSasDefinitionItemPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeletedSasDefinitionItemPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + get_deleted_sas_definitions.metadata = {'url': '/deletedstorage/{storage-account-name}/sas'} + + def get_deleted_sas_definition( + self, vault_base_url, storage_account_name, sas_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified deleted sas definition. + + The Get Deleted SAS Definition operation returns the specified deleted + SAS definition along with its attributes. This operation requires the + storage/getsas permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param sas_definition_name: The name of the SAS definition. + :type sas_definition_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedSasDefinitionBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedSasDefinitionBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_deleted_sas_definition.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'), + 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedSasDefinitionBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}'} + + def recover_deleted_sas_definition( + self, vault_base_url, storage_account_name, sas_definition_name, custom_headers=None, raw=False, **operation_config): + """Recovers the deleted SAS definition. + + Recovers the deleted SAS definition for the specified storage account. + This operation can only be performed on a soft-delete enabled vault. + This operation requires the storage/recover permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param sas_definition_name: The name of the SAS definition. + :type sas_definition_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SasDefinitionBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SasDefinitionBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.recover_deleted_sas_definition.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'), + 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SasDefinitionBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + recover_deleted_sas_definition.metadata = {'url': '/deletedstorage/{storage-account-name}/sas/{sas-definition-name}/recover'} + + def delete_sas_definition( + self, vault_base_url, storage_account_name, sas_definition_name, custom_headers=None, raw=False, **operation_config): + """Deletes a SAS definition from a specified storage account. This + operation requires the storage/deletesas permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param sas_definition_name: The name of the SAS definition. + :type sas_definition_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedSasDefinitionBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.DeletedSasDefinitionBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.delete_sas_definition.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'), + 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedSasDefinitionBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} + + def get_sas_definition( + self, vault_base_url, storage_account_name, sas_definition_name, custom_headers=None, raw=False, **operation_config): + """Gets information about a SAS definition for the specified storage + account. This operation requires the storage/getsas permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param sas_definition_name: The name of the SAS definition. + :type sas_definition_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SasDefinitionBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SasDefinitionBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + # Construct URL + url = self.get_sas_definition.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'), + 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SasDefinitionBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} + + def set_sas_definition( + self, vault_base_url, storage_account_name, sas_definition_name, template_uri, sas_type, validity_period, sas_definition_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a new SAS definition for the specified storage + account. This operation requires the storage/setsas permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param sas_definition_name: The name of the SAS definition. + :type sas_definition_name: str + :param template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will + have the same properties as the template. + :type template_uri: str + :param sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: The validity period of SAS tokens created + according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS + definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SasDefinitionBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SasDefinitionBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.SasDefinitionCreateParameters(template_uri=template_uri, sas_type=sas_type, validity_period=validity_period, sas_definition_attributes=sas_definition_attributes, tags=tags) + + # Construct URL + url = self.set_sas_definition.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'), + 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SasDefinitionCreateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SasDefinitionBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + set_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} + + def update_sas_definition( + self, vault_base_url, storage_account_name, sas_definition_name, template_uri=None, sas_type=None, validity_period=None, sas_definition_attributes=None, tags=None, custom_headers=None, raw=False, **operation_config): + """Updates the specified attributes associated with the given SAS + definition. This operation requires the storage/setsas permission. + + :param vault_base_url: The vault name, for example + https://myvault.vault.azure.net. + :type vault_base_url: str + :param storage_account_name: The name of the storage account. + :type storage_account_name: str + :param sas_definition_name: The name of the SAS definition. + :type sas_definition_name: str + :param template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will + have the same properties as the template. + :type template_uri: str + :param sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: The validity period of SAS tokens created + according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS + definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value + pairs. + :type tags: dict[str, str] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: SasDefinitionBundle or ClientRawResponse if raw=true + :rtype: ~azure.keyvault.models.SasDefinitionBundle or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`KeyVaultErrorException` + """ + parameters = models.SasDefinitionUpdateParameters(template_uri=template_uri, sas_type=sas_type, validity_period=validity_period, sas_definition_attributes=sas_definition_attributes, tags=tags) + + # Construct URL + url = self.update_sas_definition.metadata['url'] + path_format_arguments = { + 'vaultBaseUrl': self._serialize.url("vault_base_url", vault_base_url, 'str', skip_quote=True), + 'storage-account-name': self._serialize.url("storage_account_name", storage_account_name, 'str', pattern=r'^[0-9a-zA-Z]+$'), + 'sas-definition-name': self._serialize.url("sas_definition_name", sas_definition_name, 'str', pattern=r'^[0-9a-zA-Z]+$') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SasDefinitionUpdateParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + raise models.KeyVaultErrorException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('SasDefinitionBundle', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_sas_definition.metadata = {'url': '/storage/{storage-account-name}/sas/{sas-definition-name}'} diff --git a/src/keyvault/azext_keyvault/keyvault/models/__init__.py b/src/keyvault/azext_keyvault/keyvault/models/__init__.py new file mode 100644 index 00000000000..ec1ebc53b3b --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/__init__.py @@ -0,0 +1,298 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .attributes_py3 import Attributes + from .json_web_key_py3 import JsonWebKey + from .key_attributes_py3 import KeyAttributes + from .key_bundle_py3 import KeyBundle + from .key_item_py3 import KeyItem + from .deleted_key_bundle_py3 import DeletedKeyBundle + from .deleted_key_item_py3 import DeletedKeyItem + from .secret_attributes_py3 import SecretAttributes + from .secret_bundle_py3 import SecretBundle + from .secret_item_py3 import SecretItem + from .deleted_secret_bundle_py3 import DeletedSecretBundle + from .deleted_secret_item_py3 import DeletedSecretItem + from .secret_restore_parameters_py3 import SecretRestoreParameters + from .storage_restore_parameters_py3 import StorageRestoreParameters + from .certificate_attributes_py3 import CertificateAttributes + from .certificate_item_py3 import CertificateItem + from .certificate_issuer_item_py3 import CertificateIssuerItem + from .key_properties_py3 import KeyProperties + from .secret_properties_py3 import SecretProperties + from .subject_alternative_names_py3 import SubjectAlternativeNames + from .x509_certificate_properties_py3 import X509CertificateProperties + from .trigger_py3 import Trigger + from .action_py3 import Action + from .lifetime_action_py3 import LifetimeAction + from .issuer_parameters_py3 import IssuerParameters + from .certificate_policy_py3 import CertificatePolicy + from .certificate_bundle_py3 import CertificateBundle + from .deleted_certificate_bundle_py3 import DeletedCertificateBundle + from .deleted_certificate_item_py3 import DeletedCertificateItem + from .error_py3 import Error + from .certificate_operation_py3 import CertificateOperation + from .issuer_credentials_py3 import IssuerCredentials + from .administrator_details_py3 import AdministratorDetails + from .organization_details_py3 import OrganizationDetails + from .issuer_attributes_py3 import IssuerAttributes + from .issuer_bundle_py3 import IssuerBundle + from .contact_py3 import Contact + from .contacts_py3 import Contacts + from .key_create_parameters_py3 import KeyCreateParameters + from .key_import_parameters_py3 import KeyImportParameters + from .key_operations_parameters_py3 import KeyOperationsParameters + from .key_sign_parameters_py3 import KeySignParameters + from .key_verify_parameters_py3 import KeyVerifyParameters + from .key_update_parameters_py3 import KeyUpdateParameters + from .key_restore_parameters_py3 import KeyRestoreParameters + from .secret_set_parameters_py3 import SecretSetParameters + from .secret_update_parameters_py3 import SecretUpdateParameters + from .certificate_create_parameters_py3 import CertificateCreateParameters + from .certificate_import_parameters_py3 import CertificateImportParameters + from .certificate_update_parameters_py3 import CertificateUpdateParameters + from .certificate_merge_parameters_py3 import CertificateMergeParameters + from .certificate_issuer_set_parameters_py3 import CertificateIssuerSetParameters + from .certificate_issuer_update_parameters_py3 import CertificateIssuerUpdateParameters + from .certificate_operation_update_parameter_py3 import CertificateOperationUpdateParameter + from .key_operation_result_py3 import KeyOperationResult + from .key_verify_result_py3 import KeyVerifyResult + from .backup_key_result_py3 import BackupKeyResult + from .backup_secret_result_py3 import BackupSecretResult + from .backup_storage_result_py3 import BackupStorageResult + from .pending_certificate_signing_request_result_py3 import PendingCertificateSigningRequestResult + from .storage_account_attributes_py3 import StorageAccountAttributes + from .storage_bundle_py3 import StorageBundle + from .deleted_storage_bundle_py3 import DeletedStorageBundle + from .storage_account_create_parameters_py3 import StorageAccountCreateParameters + from .storage_account_update_parameters_py3 import StorageAccountUpdateParameters + from .storage_account_regenerte_key_parameters_py3 import StorageAccountRegenerteKeyParameters + from .storage_account_item_py3 import StorageAccountItem + from .deleted_storage_account_item_py3 import DeletedStorageAccountItem + from .sas_definition_attributes_py3 import SasDefinitionAttributes + from .sas_definition_bundle_py3 import SasDefinitionBundle + from .deleted_sas_definition_bundle_py3 import DeletedSasDefinitionBundle + from .sas_definition_item_py3 import SasDefinitionItem + from .deleted_sas_definition_item_py3 import DeletedSasDefinitionItem + from .sas_definition_create_parameters_py3 import SasDefinitionCreateParameters + from .sas_definition_update_parameters_py3 import SasDefinitionUpdateParameters + from .key_vault_error_py3 import KeyVaultError, KeyVaultErrorException + from .certificate_restore_parameters_py3 import CertificateRestoreParameters + from .backup_certificate_result_py3 import BackupCertificateResult +except (SyntaxError, ImportError): + from .attributes import Attributes + from .json_web_key import JsonWebKey + from .key_attributes import KeyAttributes + from .key_bundle import KeyBundle + from .key_item import KeyItem + from .deleted_key_bundle import DeletedKeyBundle + from .deleted_key_item import DeletedKeyItem + from .secret_attributes import SecretAttributes + from .secret_bundle import SecretBundle + from .secret_item import SecretItem + from .deleted_secret_bundle import DeletedSecretBundle + from .deleted_secret_item import DeletedSecretItem + from .secret_restore_parameters import SecretRestoreParameters + from .storage_restore_parameters import StorageRestoreParameters + from .certificate_attributes import CertificateAttributes + from .certificate_item import CertificateItem + from .certificate_issuer_item import CertificateIssuerItem + from .key_properties import KeyProperties + from .secret_properties import SecretProperties + from .subject_alternative_names import SubjectAlternativeNames + from .x509_certificate_properties import X509CertificateProperties + from .trigger import Trigger + from .action import Action + from .lifetime_action import LifetimeAction + from .issuer_parameters import IssuerParameters + from .certificate_policy import CertificatePolicy + from .certificate_bundle import CertificateBundle + from .deleted_certificate_bundle import DeletedCertificateBundle + from .deleted_certificate_item import DeletedCertificateItem + from .error import Error + from .certificate_operation import CertificateOperation + from .issuer_credentials import IssuerCredentials + from .administrator_details import AdministratorDetails + from .organization_details import OrganizationDetails + from .issuer_attributes import IssuerAttributes + from .issuer_bundle import IssuerBundle + from .contact import Contact + from .contacts import Contacts + from .key_create_parameters import KeyCreateParameters + from .key_import_parameters import KeyImportParameters + from .key_operations_parameters import KeyOperationsParameters + from .key_sign_parameters import KeySignParameters + from .key_verify_parameters import KeyVerifyParameters + from .key_update_parameters import KeyUpdateParameters + from .key_restore_parameters import KeyRestoreParameters + from .secret_set_parameters import SecretSetParameters + from .secret_update_parameters import SecretUpdateParameters + from .certificate_create_parameters import CertificateCreateParameters + from .certificate_import_parameters import CertificateImportParameters + from .certificate_update_parameters import CertificateUpdateParameters + from .certificate_merge_parameters import CertificateMergeParameters + from .certificate_issuer_set_parameters import CertificateIssuerSetParameters + from .certificate_issuer_update_parameters import CertificateIssuerUpdateParameters + from .certificate_operation_update_parameter import CertificateOperationUpdateParameter + from .key_operation_result import KeyOperationResult + from .key_verify_result import KeyVerifyResult + from .backup_key_result import BackupKeyResult + from .backup_secret_result import BackupSecretResult + from .backup_storage_result import BackupStorageResult + from .pending_certificate_signing_request_result import PendingCertificateSigningRequestResult + from .storage_account_attributes import StorageAccountAttributes + from .storage_bundle import StorageBundle + from .deleted_storage_bundle import DeletedStorageBundle + from .storage_account_create_parameters import StorageAccountCreateParameters + from .storage_account_update_parameters import StorageAccountUpdateParameters + from .storage_account_regenerte_key_parameters import StorageAccountRegenerteKeyParameters + from .storage_account_item import StorageAccountItem + from .deleted_storage_account_item import DeletedStorageAccountItem + from .sas_definition_attributes import SasDefinitionAttributes + from .sas_definition_bundle import SasDefinitionBundle + from .deleted_sas_definition_bundle import DeletedSasDefinitionBundle + from .sas_definition_item import SasDefinitionItem + from .deleted_sas_definition_item import DeletedSasDefinitionItem + from .sas_definition_create_parameters import SasDefinitionCreateParameters + from .sas_definition_update_parameters import SasDefinitionUpdateParameters + from .key_vault_error import KeyVaultError, KeyVaultErrorException + from .certificate_restore_parameters import CertificateRestoreParameters + from .backup_certificate_result import BackupCertificateResult +from .key_item_paged import KeyItemPaged +from .deleted_key_item_paged import DeletedKeyItemPaged +from .secret_item_paged import SecretItemPaged +from .deleted_secret_item_paged import DeletedSecretItemPaged +from .certificate_item_paged import CertificateItemPaged +from .certificate_issuer_item_paged import CertificateIssuerItemPaged +from .deleted_certificate_item_paged import DeletedCertificateItemPaged +from .storage_account_item_paged import StorageAccountItemPaged +from .deleted_storage_account_item_paged import DeletedStorageAccountItemPaged +from .sas_definition_item_paged import SasDefinitionItemPaged +from .deleted_sas_definition_item_paged import DeletedSasDefinitionItemPaged +from .key_vault_client_enums import ( + JsonWebKeyType, + JsonWebKeyCurveName, + DeletionRecoveryLevel, + KeyUsageType, + ActionType, + JsonWebKeyOperation, + JsonWebKeyEncryptionAlgorithm, + JsonWebKeySignatureAlgorithm, + SasTokenType, +) + +__all__ = [ + 'Attributes', + 'JsonWebKey', + 'KeyAttributes', + 'KeyBundle', + 'KeyItem', + 'DeletedKeyBundle', + 'DeletedKeyItem', + 'SecretAttributes', + 'SecretBundle', + 'SecretItem', + 'DeletedSecretBundle', + 'DeletedSecretItem', + 'SecretRestoreParameters', + 'StorageRestoreParameters', + 'CertificateAttributes', + 'CertificateItem', + 'CertificateIssuerItem', + 'KeyProperties', + 'SecretProperties', + 'SubjectAlternativeNames', + 'X509CertificateProperties', + 'Trigger', + 'Action', + 'LifetimeAction', + 'IssuerParameters', + 'CertificatePolicy', + 'CertificateBundle', + 'DeletedCertificateBundle', + 'DeletedCertificateItem', + 'Error', + 'CertificateOperation', + 'IssuerCredentials', + 'AdministratorDetails', + 'OrganizationDetails', + 'IssuerAttributes', + 'IssuerBundle', + 'Contact', + 'Contacts', + 'KeyCreateParameters', + 'KeyImportParameters', + 'KeyOperationsParameters', + 'KeySignParameters', + 'KeyVerifyParameters', + 'KeyUpdateParameters', + 'KeyRestoreParameters', + 'SecretSetParameters', + 'SecretUpdateParameters', + 'CertificateCreateParameters', + 'CertificateImportParameters', + 'CertificateUpdateParameters', + 'CertificateMergeParameters', + 'CertificateIssuerSetParameters', + 'CertificateIssuerUpdateParameters', + 'CertificateOperationUpdateParameter', + 'KeyOperationResult', + 'KeyVerifyResult', + 'BackupKeyResult', + 'BackupSecretResult', + 'BackupStorageResult', + 'PendingCertificateSigningRequestResult', + 'StorageAccountAttributes', + 'StorageBundle', + 'DeletedStorageBundle', + 'StorageAccountCreateParameters', + 'StorageAccountUpdateParameters', + 'StorageAccountRegenerteKeyParameters', + 'StorageAccountItem', + 'DeletedStorageAccountItem', + 'SasDefinitionAttributes', + 'SasDefinitionBundle', + 'DeletedSasDefinitionBundle', + 'SasDefinitionItem', + 'DeletedSasDefinitionItem', + 'SasDefinitionCreateParameters', + 'SasDefinitionUpdateParameters', + 'KeyVaultError', 'KeyVaultErrorException', + 'CertificateRestoreParameters', + 'BackupCertificateResult', + 'KeyItemPaged', + 'DeletedKeyItemPaged', + 'SecretItemPaged', + 'DeletedSecretItemPaged', + 'CertificateItemPaged', + 'CertificateIssuerItemPaged', + 'DeletedCertificateItemPaged', + 'StorageAccountItemPaged', + 'DeletedStorageAccountItemPaged', + 'SasDefinitionItemPaged', + 'DeletedSasDefinitionItemPaged', + 'JsonWebKeyType', + 'JsonWebKeyCurveName', + 'DeletionRecoveryLevel', + 'KeyUsageType', + 'ActionType', + 'JsonWebKeyOperation', + 'JsonWebKeyEncryptionAlgorithm', + 'JsonWebKeySignatureAlgorithm', + 'SasTokenType', +] diff --git a/src/keyvault/azext_keyvault/keyvault/models/action.py b/src/keyvault/azext_keyvault/keyvault/models/action.py new file mode 100644 index 00000000000..e65a8ed203e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/action.py @@ -0,0 +1,35 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Action(Model): + """The action that will be executed. + + :param action_type: The type of the action. Possible values include: + 'EmailContacts', 'AutoRenew' + :type action_type: str or ~azure.keyvault.models.ActionType + """ + + _attribute_map = { + 'action_type': {'key': 'action_type', 'type': 'ActionType'}, + } + + def __init__(self, **kwargs): + super(Action, self).__init__(**kwargs) + self.action_type = kwargs.get('action_type', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/action_py3.py b/src/keyvault/azext_keyvault/keyvault/models/action_py3.py new file mode 100644 index 00000000000..a81c2efbad8 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/action_py3.py @@ -0,0 +1,35 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Action(Model): + """The action that will be executed. + + :param action_type: The type of the action. Possible values include: + 'EmailContacts', 'AutoRenew' + :type action_type: str or ~azure.keyvault.models.ActionType + """ + + _attribute_map = { + 'action_type': {'key': 'action_type', 'type': 'ActionType'}, + } + + def __init__(self, *, action_type=None, **kwargs) -> None: + super(Action, self).__init__(**kwargs) + self.action_type = action_type diff --git a/src/keyvault/azext_keyvault/keyvault/models/administrator_details.py b/src/keyvault/azext_keyvault/keyvault/models/administrator_details.py new file mode 100644 index 00000000000..66b97799480 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/administrator_details.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AdministratorDetails(Model): + """Details of the organization administrator of the certificate issuer. + + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + :param email_address: Email addresss. + :type email_address: str + :param phone: Phone number. + :type phone: str + """ + + _attribute_map = { + 'first_name': {'key': 'first_name', 'type': 'str'}, + 'last_name': {'key': 'last_name', 'type': 'str'}, + 'email_address': {'key': 'email', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AdministratorDetails, self).__init__(**kwargs) + self.first_name = kwargs.get('first_name', None) + self.last_name = kwargs.get('last_name', None) + self.email_address = kwargs.get('email_address', None) + self.phone = kwargs.get('phone', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/administrator_details_py3.py b/src/keyvault/azext_keyvault/keyvault/models/administrator_details_py3.py new file mode 100644 index 00000000000..22bffa1726a --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/administrator_details_py3.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AdministratorDetails(Model): + """Details of the organization administrator of the certificate issuer. + + :param first_name: First name. + :type first_name: str + :param last_name: Last name. + :type last_name: str + :param email_address: Email addresss. + :type email_address: str + :param phone: Phone number. + :type phone: str + """ + + _attribute_map = { + 'first_name': {'key': 'first_name', 'type': 'str'}, + 'last_name': {'key': 'last_name', 'type': 'str'}, + 'email_address': {'key': 'email', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__(self, *, first_name: str=None, last_name: str=None, email_address: str=None, phone: str=None, **kwargs) -> None: + super(AdministratorDetails, self).__init__(**kwargs) + self.first_name = first_name + self.last_name = last_name + self.email_address = email_address + self.phone = phone diff --git a/src/keyvault/azext_keyvault/keyvault/models/attributes.py b/src/keyvault/azext_keyvault/keyvault/models/attributes.py new file mode 100644 index 00000000000..0f6e81bb746 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/attributes.py @@ -0,0 +1,58 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Attributes(Model): + """The object attributes managed by the KeyVault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(Attributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.not_before = kwargs.get('not_before', None) + self.expires = kwargs.get('expires', None) + self.created = None + self.updated = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/attributes_py3.py b/src/keyvault/azext_keyvault/keyvault/models/attributes_py3.py new file mode 100644 index 00000000000..3f2a4dd31ff --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/attributes_py3.py @@ -0,0 +1,58 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Attributes(Model): + """The object attributes managed by the KeyVault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(Attributes, self).__init__(**kwargs) + self.enabled = enabled + self.not_before = not_before + self.expires = expires + self.created = None + self.updated = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result.py b/src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result.py new file mode 100644 index 00000000000..39d5f5a550a --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupCertificateResult(Model): + """The backup certificate result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up certificate. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(BackupCertificateResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result_py3.py b/src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result_py3.py new file mode 100644 index 00000000000..3cc40b18ac8 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_certificate_result_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupCertificateResult(Model): + """The backup certificate result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up certificate. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupCertificateResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_key_result.py b/src/keyvault/azext_keyvault/keyvault/models/backup_key_result.py new file mode 100644 index 00000000000..c76374e4f15 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_key_result.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupKeyResult(Model): + """The backup key result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up key. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(BackupKeyResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_key_result_py3.py b/src/keyvault/azext_keyvault/keyvault/models/backup_key_result_py3.py new file mode 100644 index 00000000000..0ac47c992a9 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_key_result_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupKeyResult(Model): + """The backup key result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up key. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupKeyResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_secret_result.py b/src/keyvault/azext_keyvault/keyvault/models/backup_secret_result.py new file mode 100644 index 00000000000..e6d0eee4b37 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_secret_result.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupSecretResult(Model): + """The backup secret result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up secret. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(BackupSecretResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_secret_result_py3.py b/src/keyvault/azext_keyvault/keyvault/models/backup_secret_result_py3.py new file mode 100644 index 00000000000..0077e329a2e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_secret_result_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupSecretResult(Model): + """The backup secret result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up secret. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupSecretResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_storage_result.py b/src/keyvault/azext_keyvault/keyvault/models/backup_storage_result.py new file mode 100644 index 00000000000..8bcc48f691f --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_storage_result.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupStorageResult(Model): + """The backup storage result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up storage account. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(BackupStorageResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/backup_storage_result_py3.py b/src/keyvault/azext_keyvault/keyvault/models/backup_storage_result_py3.py new file mode 100644 index 00000000000..1fad5650643 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/backup_storage_result_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class BackupStorageResult(Model): + """The backup storage result, containing the backup blob. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The backup blob containing the backed up storage account. + :vartype value: bytes + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(BackupStorageResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_attributes.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_attributes.py new file mode 100644 index 00000000000..d9b3af2e06d --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_attributes.py @@ -0,0 +1,65 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .attributes import Attributes + + +class CertificateAttributes(Attributes): + """The certificate management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for certificates in the current vault. If it contains 'Purgeable', + the certificate can be permanently deleted by a privileged user; + otherwise, only the system can purge the certificate, at the end of the + retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateAttributes, self).__init__(**kwargs) + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_attributes_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_attributes_py3.py new file mode 100644 index 00000000000..d1a739736c8 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_attributes_py3.py @@ -0,0 +1,65 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .attributes import Attributes + + +class CertificateAttributes(Attributes): + """The certificate management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for certificates in the current vault. If it contains 'Purgeable', + the certificate can be permanently deleted by a privileged user; + otherwise, only the system can purge the certificate, at the end of the + retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(CertificateAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs) + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_bundle.py new file mode 100644 index 00000000000..83997febd26 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_bundle.py @@ -0,0 +1,77 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateBundle(Model): + """A certificate bundle consists of a certificate (X509) plus its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :ivar kid: The key id. + :vartype kid: str + :ivar sid: The secret id. + :vartype sid: str + :ivar x509_thumbprint: Thumbprint of the certificate. + :vartype x509_thumbprint: bytes + :ivar policy: The management policy. + :vartype policy: ~azure.keyvault.models.CertificatePolicy + :param cer: CER contents of x509 certificate. + :type cer: bytearray + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'kid': {'readonly': True}, + 'sid': {'readonly': True}, + 'x509_thumbprint': {'readonly': True}, + 'policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'cer': {'key': 'cer', 'type': 'bytearray'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CertificateBundle, self).__init__(**kwargs) + self.id = None + self.kid = None + self.sid = None + self.x509_thumbprint = None + self.policy = None + self.cer = kwargs.get('cer', None) + self.content_type = kwargs.get('content_type', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_bundle_py3.py new file mode 100644 index 00000000000..3018868dfb7 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_bundle_py3.py @@ -0,0 +1,77 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateBundle(Model): + """A certificate bundle consists of a certificate (X509) plus its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :ivar kid: The key id. + :vartype kid: str + :ivar sid: The secret id. + :vartype sid: str + :ivar x509_thumbprint: Thumbprint of the certificate. + :vartype x509_thumbprint: bytes + :ivar policy: The management policy. + :vartype policy: ~azure.keyvault.models.CertificatePolicy + :param cer: CER contents of x509 certificate. + :type cer: bytearray + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'kid': {'readonly': True}, + 'sid': {'readonly': True}, + 'x509_thumbprint': {'readonly': True}, + 'policy': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'cer': {'key': 'cer', 'type': 'bytearray'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None: + super(CertificateBundle, self).__init__(**kwargs) + self.id = None + self.kid = None + self.sid = None + self.x509_thumbprint = None + self.policy = None + self.cer = cer + self.content_type = content_type + self.attributes = attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters.py new file mode 100644 index 00000000000..2e617840736 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateCreateParameters(Model): + """The certificate create parameters. + + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CertificateCreateParameters, self).__init__(**kwargs) + self.certificate_policy = kwargs.get('certificate_policy', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters_py3.py new file mode 100644 index 00000000000..f292dd3b7dd --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_create_parameters_py3.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateCreateParameters(Model): + """The certificate create parameters. + + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateCreateParameters, self).__init__(**kwargs) + self.certificate_policy = certificate_policy + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters.py new file mode 100644 index 00000000000..11632a3a28c --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters.py @@ -0,0 +1,60 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateImportParameters(Model): + """The certificate import parameters. + + All required parameters must be populated in order to send to Azure. + + :param base64_encoded_certificate: Required. Base64 encoded representation + of the certificate object to import. This certificate needs to contain the + private key. + :type base64_encoded_certificate: str + :param password: If the private key in base64EncodedCertificate is + encrypted, the password used for encryption. + :type password: str + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'base64_encoded_certificate': {'required': True}, + } + + _attribute_map = { + 'base64_encoded_certificate': {'key': 'value', 'type': 'str'}, + 'password': {'key': 'pwd', 'type': 'str'}, + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CertificateImportParameters, self).__init__(**kwargs) + self.base64_encoded_certificate = kwargs.get('base64_encoded_certificate', None) + self.password = kwargs.get('password', None) + self.certificate_policy = kwargs.get('certificate_policy', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters_py3.py new file mode 100644 index 00000000000..8f38253b71a --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_import_parameters_py3.py @@ -0,0 +1,60 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateImportParameters(Model): + """The certificate import parameters. + + All required parameters must be populated in order to send to Azure. + + :param base64_encoded_certificate: Required. Base64 encoded representation + of the certificate object to import. This certificate needs to contain the + private key. + :type base64_encoded_certificate: str + :param password: If the private key in base64EncodedCertificate is + encrypted, the password used for encryption. + :type password: str + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'base64_encoded_certificate': {'required': True}, + } + + _attribute_map = { + 'base64_encoded_certificate': {'key': 'value', 'type': 'str'}, + 'password': {'key': 'pwd', 'type': 'str'}, + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, base64_encoded_certificate: str, password: str=None, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateImportParameters, self).__init__(**kwargs) + self.base64_encoded_certificate = base64_encoded_certificate + self.password = password + self.certificate_policy = certificate_policy + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item.py new file mode 100644 index 00000000000..29481b80daa --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateIssuerItem(Model): + """The certificate issuer item containing certificate issuer metadata. + + :param id: Certificate Identifier. + :type id: str + :param provider: The issuer provider. + :type provider: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateIssuerItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.provider = kwargs.get('provider', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_paged.py new file mode 100644 index 00000000000..11e896481f0 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class CertificateIssuerItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`CertificateIssuerItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CertificateIssuerItem]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificateIssuerItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_py3.py new file mode 100644 index 00000000000..44d1210a99e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_item_py3.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateIssuerItem(Model): + """The certificate issuer item containing certificate issuer metadata. + + :param id: Certificate Identifier. + :type id: str + :param provider: The issuer provider. + :type provider: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, provider: str=None, **kwargs) -> None: + super(CertificateIssuerItem, self).__init__(**kwargs) + self.id = id + self.provider = provider diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters.py new file mode 100644 index 00000000000..d105e2af872 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters.py @@ -0,0 +1,53 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateIssuerSetParameters(Model): + """The certificate issuer set parameters. + + All required parameters must be populated in order to send to Azure. + + :param provider: Required. The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _validation = { + 'provider': {'required': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, **kwargs): + super(CertificateIssuerSetParameters, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.credentials = kwargs.get('credentials', None) + self.organization_details = kwargs.get('organization_details', None) + self.attributes = kwargs.get('attributes', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters_py3.py new file mode 100644 index 00000000000..5fa8f107936 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_set_parameters_py3.py @@ -0,0 +1,53 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateIssuerSetParameters(Model): + """The certificate issuer set parameters. + + All required parameters must be populated in order to send to Azure. + + :param provider: Required. The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _validation = { + 'provider': {'required': True}, + } + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, *, provider: str, credentials=None, organization_details=None, attributes=None, **kwargs) -> None: + super(CertificateIssuerSetParameters, self).__init__(**kwargs) + self.provider = provider + self.credentials = credentials + self.organization_details = organization_details + self.attributes = attributes diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters.py new file mode 100644 index 00000000000..3b131e162d6 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateIssuerUpdateParameters(Model): + """The certificate issuer update parameters. + + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, **kwargs): + super(CertificateIssuerUpdateParameters, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.credentials = kwargs.get('credentials', None) + self.organization_details = kwargs.get('organization_details', None) + self.attributes = kwargs.get('attributes', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters_py3.py new file mode 100644 index 00000000000..f0735ad1daf --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_issuer_update_parameters_py3.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateIssuerUpdateParameters(Model): + """The certificate issuer update parameters. + + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None: + super(CertificateIssuerUpdateParameters, self).__init__(**kwargs) + self.provider = provider + self.credentials = credentials + self.organization_details = organization_details + self.attributes = attributes diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_item.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_item.py new file mode 100644 index 00000000000..fe3f4c1daa6 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_item.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateItem(Model): + """The certificate item containing certificate metadata. + + :param id: Certificate identifier. + :type id: str + :param attributes: The certificate management attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param x509_thumbprint: Thumbprint of the certificate. + :type x509_thumbprint: bytes + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(CertificateItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) + self.x509_thumbprint = kwargs.get('x509_thumbprint', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_item_paged.py new file mode 100644 index 00000000000..cc38e55314f --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class CertificateItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`CertificateItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[CertificateItem]'} + } + + def __init__(self, *args, **kwargs): + + super(CertificateItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_item_py3.py new file mode 100644 index 00000000000..a1776ee8554 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_item_py3.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateItem(Model): + """The certificate item containing certificate metadata. + + :param id: Certificate identifier. + :type id: str + :param attributes: The certificate management attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param x509_thumbprint: Thumbprint of the certificate. + :type x509_thumbprint: bytes + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, **kwargs) -> None: + super(CertificateItem, self).__init__(**kwargs) + self.id = id + self.attributes = attributes + self.tags = tags + self.x509_thumbprint = x509_thumbprint diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters.py new file mode 100644 index 00000000000..f680bea0bb2 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateMergeParameters(Model): + """The certificate merge parameters. + + All required parameters must be populated in order to send to Azure. + + :param x509_certificates: Required. The certificate or the certificate + chain to merge. + :type x509_certificates: list[bytearray] + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'x509_certificates': {'required': True}, + } + + _attribute_map = { + 'x509_certificates': {'key': 'x5c', 'type': '[bytearray]'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CertificateMergeParameters, self).__init__(**kwargs) + self.x509_certificates = kwargs.get('x509_certificates', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters_py3.py new file mode 100644 index 00000000000..bd40be9ccec --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_merge_parameters_py3.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateMergeParameters(Model): + """The certificate merge parameters. + + All required parameters must be populated in order to send to Azure. + + :param x509_certificates: Required. The certificate or the certificate + chain to merge. + :type x509_certificates: list[bytearray] + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'x509_certificates': {'required': True}, + } + + _attribute_map = { + 'x509_certificates': {'key': 'x5c', 'type': '[bytearray]'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, x509_certificates, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateMergeParameters, self).__init__(**kwargs) + self.x509_certificates = x509_certificates + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_operation.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation.py new file mode 100644 index 00000000000..fb4201ce162 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation.py @@ -0,0 +1,77 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateOperation(Model): + """A certificate operation is returned in case of asynchronous requests. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :param issuer_parameters: Parameters for the issuer of the X509 component + of a certificate. + :type issuer_parameters: ~azure.keyvault.models.IssuerParameters + :param csr: The certificate signing request (CSR) that is being used in + the certificate operation. + :type csr: bytearray + :param cancellation_requested: Indicates if cancellation was requested on + the certificate operation. + :type cancellation_requested: bool + :param status: Status of the certificate operation. + :type status: str + :param status_details: The status details of the certificate operation. + :type status_details: str + :param error: Error encountered, if any, during the certificate operation. + :type error: ~azure.keyvault.models.Error + :param target: Location which contains the result of the certificate + operation. + :type target: str + :param request_id: Identifier for the certificate operation. + :type request_id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'issuer_parameters': {'key': 'issuer', 'type': 'IssuerParameters'}, + 'csr': {'key': 'csr', 'type': 'bytearray'}, + 'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'status_details', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'target': {'key': 'target', 'type': 'str'}, + 'request_id': {'key': 'request_id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CertificateOperation, self).__init__(**kwargs) + self.id = None + self.issuer_parameters = kwargs.get('issuer_parameters', None) + self.csr = kwargs.get('csr', None) + self.cancellation_requested = kwargs.get('cancellation_requested', None) + self.status = kwargs.get('status', None) + self.status_details = kwargs.get('status_details', None) + self.error = kwargs.get('error', None) + self.target = kwargs.get('target', None) + self.request_id = kwargs.get('request_id', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_py3.py new file mode 100644 index 00000000000..c42b06c86a3 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_py3.py @@ -0,0 +1,77 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateOperation(Model): + """A certificate operation is returned in case of asynchronous requests. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :param issuer_parameters: Parameters for the issuer of the X509 component + of a certificate. + :type issuer_parameters: ~azure.keyvault.models.IssuerParameters + :param csr: The certificate signing request (CSR) that is being used in + the certificate operation. + :type csr: bytearray + :param cancellation_requested: Indicates if cancellation was requested on + the certificate operation. + :type cancellation_requested: bool + :param status: Status of the certificate operation. + :type status: str + :param status_details: The status details of the certificate operation. + :type status_details: str + :param error: Error encountered, if any, during the certificate operation. + :type error: ~azure.keyvault.models.Error + :param target: Location which contains the result of the certificate + operation. + :type target: str + :param request_id: Identifier for the certificate operation. + :type request_id: str + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'issuer_parameters': {'key': 'issuer', 'type': 'IssuerParameters'}, + 'csr': {'key': 'csr', 'type': 'bytearray'}, + 'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'str'}, + 'status_details': {'key': 'status_details', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + 'target': {'key': 'target', 'type': 'str'}, + 'request_id': {'key': 'request_id', 'type': 'str'}, + } + + def __init__(self, *, issuer_parameters=None, csr: bytearray=None, cancellation_requested: bool=None, status: str=None, status_details: str=None, error=None, target: str=None, request_id: str=None, **kwargs) -> None: + super(CertificateOperation, self).__init__(**kwargs) + self.id = None + self.issuer_parameters = issuer_parameters + self.csr = csr + self.cancellation_requested = cancellation_requested + self.status = status + self.status_details = status_details + self.error = error + self.target = target + self.request_id = request_id diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter.py new file mode 100644 index 00000000000..ca9c6737dc1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateOperationUpdateParameter(Model): + """The certificate operation update parameters. + + All required parameters must be populated in order to send to Azure. + + :param cancellation_requested: Required. Indicates if cancellation was + requested on the certificate operation. + :type cancellation_requested: bool + """ + + _validation = { + 'cancellation_requested': {'required': True}, + } + + _attribute_map = { + 'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(CertificateOperationUpdateParameter, self).__init__(**kwargs) + self.cancellation_requested = kwargs.get('cancellation_requested', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter_py3.py new file mode 100644 index 00000000000..109163564a1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_operation_update_parameter_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateOperationUpdateParameter(Model): + """The certificate operation update parameters. + + All required parameters must be populated in order to send to Azure. + + :param cancellation_requested: Required. Indicates if cancellation was + requested on the certificate operation. + :type cancellation_requested: bool + """ + + _validation = { + 'cancellation_requested': {'required': True}, + } + + _attribute_map = { + 'cancellation_requested': {'key': 'cancellation_requested', 'type': 'bool'}, + } + + def __init__(self, *, cancellation_requested: bool, **kwargs) -> None: + super(CertificateOperationUpdateParameter, self).__init__(**kwargs) + self.cancellation_requested = cancellation_requested diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_policy.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_policy.py new file mode 100644 index 00000000000..d8792aa0c9e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_policy.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificatePolicy(Model): + """Management policy for a certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :param key_properties: Properties of the key backing a certificate. + :type key_properties: ~azure.keyvault.models.KeyProperties + :param secret_properties: Properties of the secret backing a certificate. + :type secret_properties: ~azure.keyvault.models.SecretProperties + :param x509_certificate_properties: Properties of the X509 component of a + certificate. + :type x509_certificate_properties: + ~azure.keyvault.models.X509CertificateProperties + :param lifetime_actions: Actions that will be performed by Key Vault over + the lifetime of a certificate. + :type lifetime_actions: list[~azure.keyvault.models.LifetimeAction] + :param issuer_parameters: Parameters for the issuer of the X509 component + of a certificate. + :type issuer_parameters: ~azure.keyvault.models.IssuerParameters + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'key_properties': {'key': 'key_props', 'type': 'KeyProperties'}, + 'secret_properties': {'key': 'secret_props', 'type': 'SecretProperties'}, + 'x509_certificate_properties': {'key': 'x509_props', 'type': 'X509CertificateProperties'}, + 'lifetime_actions': {'key': 'lifetime_actions', 'type': '[LifetimeAction]'}, + 'issuer_parameters': {'key': 'issuer', 'type': 'IssuerParameters'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + } + + def __init__(self, **kwargs): + super(CertificatePolicy, self).__init__(**kwargs) + self.id = None + self.key_properties = kwargs.get('key_properties', None) + self.secret_properties = kwargs.get('secret_properties', None) + self.x509_certificate_properties = kwargs.get('x509_certificate_properties', None) + self.lifetime_actions = kwargs.get('lifetime_actions', None) + self.issuer_parameters = kwargs.get('issuer_parameters', None) + self.attributes = kwargs.get('attributes', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_policy_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_policy_py3.py new file mode 100644 index 00000000000..b743068a801 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_policy_py3.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificatePolicy(Model): + """Management policy for a certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :param key_properties: Properties of the key backing a certificate. + :type key_properties: ~azure.keyvault.models.KeyProperties + :param secret_properties: Properties of the secret backing a certificate. + :type secret_properties: ~azure.keyvault.models.SecretProperties + :param x509_certificate_properties: Properties of the X509 component of a + certificate. + :type x509_certificate_properties: + ~azure.keyvault.models.X509CertificateProperties + :param lifetime_actions: Actions that will be performed by Key Vault over + the lifetime of a certificate. + :type lifetime_actions: list[~azure.keyvault.models.LifetimeAction] + :param issuer_parameters: Parameters for the issuer of the X509 component + of a certificate. + :type issuer_parameters: ~azure.keyvault.models.IssuerParameters + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'key_properties': {'key': 'key_props', 'type': 'KeyProperties'}, + 'secret_properties': {'key': 'secret_props', 'type': 'SecretProperties'}, + 'x509_certificate_properties': {'key': 'x509_props', 'type': 'X509CertificateProperties'}, + 'lifetime_actions': {'key': 'lifetime_actions', 'type': '[LifetimeAction]'}, + 'issuer_parameters': {'key': 'issuer', 'type': 'IssuerParameters'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + } + + def __init__(self, *, key_properties=None, secret_properties=None, x509_certificate_properties=None, lifetime_actions=None, issuer_parameters=None, attributes=None, **kwargs) -> None: + super(CertificatePolicy, self).__init__(**kwargs) + self.id = None + self.key_properties = key_properties + self.secret_properties = secret_properties + self.x509_certificate_properties = x509_certificate_properties + self.lifetime_actions = lifetime_actions + self.issuer_parameters = issuer_parameters + self.attributes = attributes diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters.py new file mode 100644 index 00000000000..fbe00928267 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateRestoreParameters(Model): + """The certificate restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param certificate_bundle_backup: Required. The backup blob associated + with a certificate bundle. + :type certificate_bundle_backup: bytes + """ + + _validation = { + 'certificate_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'certificate_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(CertificateRestoreParameters, self).__init__(**kwargs) + self.certificate_bundle_backup = kwargs.get('certificate_bundle_backup', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters_py3.py new file mode 100644 index 00000000000..4e0c2a477a6 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_restore_parameters_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateRestoreParameters(Model): + """The certificate restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param certificate_bundle_backup: Required. The backup blob associated + with a certificate bundle. + :type certificate_bundle_backup: bytes + """ + + _validation = { + 'certificate_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'certificate_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, certificate_bundle_backup: bytes, **kwargs) -> None: + super(CertificateRestoreParameters, self).__init__(**kwargs) + self.certificate_bundle_backup = certificate_bundle_backup diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters.py new file mode 100644 index 00000000000..eb702fe63b5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateUpdateParameters(Model): + """The certificate update parameters. + + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.certificate_policy = kwargs.get('certificate_policy', None) + self.certificate_attributes = kwargs.get('certificate_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters_py3.py new file mode 100644 index 00000000000..9ecdca62c31 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/certificate_update_parameters_py3.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CertificateUpdateParameters(Model): + """The certificate update parameters. + + :param certificate_policy: The management policy for the certificate. + :type certificate_policy: ~azure.keyvault.models.CertificatePolicy + :param certificate_attributes: The attributes of the certificate + (optional). + :type certificate_attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'certificate_policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'certificate_attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, certificate_policy=None, certificate_attributes=None, tags=None, **kwargs) -> None: + super(CertificateUpdateParameters, self).__init__(**kwargs) + self.certificate_policy = certificate_policy + self.certificate_attributes = certificate_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/contact.py b/src/keyvault/azext_keyvault/keyvault/models/contact.py new file mode 100644 index 00000000000..4e67011e050 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/contact.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Contact(Model): + """The contact information for the vault certificates. + + :param email_address: Email addresss. + :type email_address: str + :param name: Name. + :type name: str + :param phone: Phone number. + :type phone: str + """ + + _attribute_map = { + 'email_address': {'key': 'email', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Contact, self).__init__(**kwargs) + self.email_address = kwargs.get('email_address', None) + self.name = kwargs.get('name', None) + self.phone = kwargs.get('phone', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/contact_py3.py b/src/keyvault/azext_keyvault/keyvault/models/contact_py3.py new file mode 100644 index 00000000000..c5e434f1572 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/contact_py3.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Contact(Model): + """The contact information for the vault certificates. + + :param email_address: Email addresss. + :type email_address: str + :param name: Name. + :type name: str + :param phone: Phone number. + :type phone: str + """ + + _attribute_map = { + 'email_address': {'key': 'email', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'phone': {'key': 'phone', 'type': 'str'}, + } + + def __init__(self, *, email_address: str=None, name: str=None, phone: str=None, **kwargs) -> None: + super(Contact, self).__init__(**kwargs) + self.email_address = email_address + self.name = name + self.phone = phone diff --git a/src/keyvault/azext_keyvault/keyvault/models/contacts.py b/src/keyvault/azext_keyvault/keyvault/models/contacts.py new file mode 100644 index 00000000000..a578a477e0c --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/contacts.py @@ -0,0 +1,45 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Contacts(Model): + """The contacts for the vault certificates. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Identifier for the contacts collection. + :vartype id: str + :param contact_list: The contact list for the vault certificates. + :type contact_list: list[~azure.keyvault.models.Contact] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'contact_list': {'key': 'contacts', 'type': '[Contact]'}, + } + + def __init__(self, **kwargs): + super(Contacts, self).__init__(**kwargs) + self.id = None + self.contact_list = kwargs.get('contact_list', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/contacts_py3.py b/src/keyvault/azext_keyvault/keyvault/models/contacts_py3.py new file mode 100644 index 00000000000..e3a36e8d789 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/contacts_py3.py @@ -0,0 +1,45 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Contacts(Model): + """The contacts for the vault certificates. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Identifier for the contacts collection. + :vartype id: str + :param contact_list: The contact list for the vault certificates. + :type contact_list: list[~azure.keyvault.models.Contact] + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'contact_list': {'key': 'contacts', 'type': '[Contact]'}, + } + + def __init__(self, *, contact_list=None, **kwargs) -> None: + super(Contacts, self).__init__(**kwargs) + self.id = None + self.contact_list = contact_list diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle.py new file mode 100644 index 00000000000..2d9a524b717 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle.py @@ -0,0 +1,85 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .certificate_bundle import CertificateBundle + + +class DeletedCertificateBundle(CertificateBundle): + """A Deleted Certificate consisting of its previous id, attributes and its + tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :ivar kid: The key id. + :vartype kid: str + :ivar sid: The secret id. + :vartype sid: str + :ivar x509_thumbprint: Thumbprint of the certificate. + :vartype x509_thumbprint: bytes + :ivar policy: The management policy. + :vartype policy: ~azure.keyvault.models.CertificatePolicy + :param cer: CER contents of x509 certificate. + :type cer: bytearray + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs + :type tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted certificate. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the certificate is scheduled to + be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the certificate was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'kid': {'readonly': True}, + 'sid': {'readonly': True}, + 'x509_thumbprint': {'readonly': True}, + 'policy': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'cer': {'key': 'cer', 'type': 'bytearray'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedCertificateBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle_py3.py new file mode 100644 index 00000000000..6ca63817b55 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_bundle_py3.py @@ -0,0 +1,85 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .certificate_bundle import CertificateBundle + + +class DeletedCertificateBundle(CertificateBundle): + """A Deleted Certificate consisting of its previous id, attributes and its + tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The certificate id. + :vartype id: str + :ivar kid: The key id. + :vartype kid: str + :ivar sid: The secret id. + :vartype sid: str + :ivar x509_thumbprint: Thumbprint of the certificate. + :vartype x509_thumbprint: bytes + :ivar policy: The management policy. + :vartype policy: ~azure.keyvault.models.CertificatePolicy + :param cer: CER contents of x509 certificate. + :type cer: bytearray + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The certificate attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs + :type tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted certificate. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the certificate is scheduled to + be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the certificate was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'kid': {'readonly': True}, + 'sid': {'readonly': True}, + 'x509_thumbprint': {'readonly': True}, + 'policy': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'policy': {'key': 'policy', 'type': 'CertificatePolicy'}, + 'cer': {'key': 'cer', 'type': 'bytearray'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, cer: bytearray=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedCertificateBundle, self).__init__(cer=cer, content_type=content_type, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item.py new file mode 100644 index 00000000000..43c1eb0c684 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item.py @@ -0,0 +1,65 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .certificate_item import CertificateItem + + +class DeletedCertificateItem(CertificateItem): + """The deleted certificate item containing metadata about the deleted + certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Certificate identifier. + :type id: str + :param attributes: The certificate management attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param x509_thumbprint: Thumbprint of the certificate. + :type x509_thumbprint: bytes + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted certificate. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the certificate is scheduled to + be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the certificate was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedCertificateItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_paged.py new file mode 100644 index 00000000000..223b9f52cfd --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeletedCertificateItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedCertificateItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedCertificateItem]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedCertificateItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_py3.py new file mode 100644 index 00000000000..93a41549d58 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_certificate_item_py3.py @@ -0,0 +1,65 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .certificate_item import CertificateItem + + +class DeletedCertificateItem(CertificateItem): + """The deleted certificate item containing metadata about the deleted + certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Certificate identifier. + :type id: str + :param attributes: The certificate management attributes. + :type attributes: ~azure.keyvault.models.CertificateAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param x509_thumbprint: Thumbprint of the certificate. + :type x509_thumbprint: bytes + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted certificate. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the certificate is scheduled to + be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the certificate was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'CertificateAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'x509_thumbprint': {'key': 'x5t', 'type': 'base64'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, x509_thumbprint: bytes=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedCertificateItem, self).__init__(id=id, attributes=attributes, tags=tags, x509_thumbprint=x509_thumbprint, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle.py new file mode 100644 index 00000000000..3ad72d54d3d --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle.py @@ -0,0 +1,67 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .key_bundle import KeyBundle + + +class DeletedKeyBundle(KeyBundle): + """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion + info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key: The Json web key. + :type key: ~azure.keyvault.models.JsonWebKey + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted key. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the key is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the key was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedKeyBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle_py3.py new file mode 100644 index 00000000000..1cb771b3afd --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_bundle_py3.py @@ -0,0 +1,67 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .key_bundle import KeyBundle + + +class DeletedKeyBundle(KeyBundle): + """A DeletedKeyBundle consisting of a WebKey plus its Attributes and deletion + info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key: The Json web key. + :type key: ~azure.keyvault.models.JsonWebKey + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted key. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the key is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the key was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, key=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedKeyBundle, self).__init__(key=key, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item.py new file mode 100644 index 00000000000..9c7632bbfd2 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item.py @@ -0,0 +1,67 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .key_item import KeyItem + + +class DeletedKeyItem(KeyItem): + """The deleted key item containing the deleted key metadata and information + about deletion. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kid: Key identifier. + :type kid: str + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted key. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the key is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the key was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedKeyItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_paged.py new file mode 100644 index 00000000000..7d0ba80428e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeletedKeyItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedKeyItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedKeyItem]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedKeyItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_py3.py new file mode 100644 index 00000000000..0cbce57c72e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_key_item_py3.py @@ -0,0 +1,67 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .key_item import KeyItem + + +class DeletedKeyItem(KeyItem): + """The deleted key item containing the deleted key metadata and information + about deletion. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kid: Key identifier. + :type kid: str + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted key. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the key is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the key was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, kid: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedKeyItem, self).__init__(kid=kid, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle.py new file mode 100644 index 00000000000..d6e7a9f9bce --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle.py @@ -0,0 +1,85 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sas_definition_bundle import SasDefinitionBundle + + +class DeletedSasDefinitionBundle(SasDefinitionBundle): + """A deleted SAS definition bundle consisting of its previous id, attributes + and its tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The SAS definition id. + :vartype id: str + :ivar secret_id: Storage account SAS definition secret id. + :vartype secret_id: str + :ivar template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :vartype template_uri: str + :ivar sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :vartype sas_type: str or ~azure.keyvault.models.SasTokenType + :ivar validity_period: The validity period of SAS tokens created according + to the SAS definition. + :vartype validity_period: str + :ivar attributes: The SAS definition attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted SAS definition. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the SAS definition is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the SAS definition was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'template_uri': {'readonly': True}, + 'sas_type': {'readonly': True}, + 'validity_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedSasDefinitionBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle_py3.py new file mode 100644 index 00000000000..d9a5807e2f4 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_bundle_py3.py @@ -0,0 +1,85 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sas_definition_bundle import SasDefinitionBundle + + +class DeletedSasDefinitionBundle(SasDefinitionBundle): + """A deleted SAS definition bundle consisting of its previous id, attributes + and its tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The SAS definition id. + :vartype id: str + :ivar secret_id: Storage account SAS definition secret id. + :vartype secret_id: str + :ivar template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :vartype template_uri: str + :ivar sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :vartype sas_type: str or ~azure.keyvault.models.SasTokenType + :ivar validity_period: The validity period of SAS tokens created according + to the SAS definition. + :vartype validity_period: str + :ivar attributes: The SAS definition attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted SAS definition. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the SAS definition is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the SAS definition was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'template_uri': {'readonly': True}, + 'sas_type': {'readonly': True}, + 'validity_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedSasDefinitionBundle, self).__init__(, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item.py new file mode 100644 index 00000000000..db3f43ed835 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sas_definition_item import SasDefinitionItem + + +class DeletedSasDefinitionItem(SasDefinitionItem): + """The deleted SAS definition item containing metadata about the deleted SAS + definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage SAS identifier. + :vartype id: str + :ivar secret_id: The storage account SAS definition secret id. + :vartype secret_id: str + :ivar attributes: The SAS definition management attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted SAS definition. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the SAS definition is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the SAS definition was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedSasDefinitionItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_paged.py new file mode 100644 index 00000000000..d3ee5e1aea1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeletedSasDefinitionItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedSasDefinitionItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedSasDefinitionItem]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedSasDefinitionItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_py3.py new file mode 100644 index 00000000000..312f75f4ee7 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_sas_definition_item_py3.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .sas_definition_item import SasDefinitionItem + + +class DeletedSasDefinitionItem(SasDefinitionItem): + """The deleted SAS definition item containing metadata about the deleted SAS + definition. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage SAS identifier. + :vartype id: str + :ivar secret_id: The storage account SAS definition secret id. + :vartype secret_id: str + :ivar attributes: The SAS definition management attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted SAS definition. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the SAS definition is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the SAS definition was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedSasDefinitionItem, self).__init__(, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle.py new file mode 100644 index 00000000000..fa0486f5625 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle.py @@ -0,0 +1,78 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .secret_bundle import SecretBundle + + +class DeletedSecretBundle(SecretBundle): + """A Deleted Secret consisting of its previous id, attributes and its tags, as + well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The secret value. + :type value: str + :param id: The secret id. + :type id: str + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar kid: If this is a secret backing a KV certificate, then this field + specifies the corresponding key backing the KV certificate. + :vartype kid: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a secret backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted secret. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the secret is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the secret was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'kid': {'readonly': True}, + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedSecretBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle_py3.py new file mode 100644 index 00000000000..2986c5b7594 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_bundle_py3.py @@ -0,0 +1,78 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .secret_bundle import SecretBundle + + +class DeletedSecretBundle(SecretBundle): + """A Deleted Secret consisting of its previous id, attributes and its tags, as + well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The secret value. + :type value: str + :param id: The secret id. + :type id: str + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar kid: If this is a secret backing a KV certificate, then this field + specifies the corresponding key backing the KV certificate. + :vartype kid: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a secret backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted secret. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the secret is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the secret was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'kid': {'readonly': True}, + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedSecretBundle, self).__init__(value=value, id=id, content_type=content_type, attributes=attributes, tags=tags, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item.py new file mode 100644 index 00000000000..6f0b4a6ccd6 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .secret_item import SecretItem + + +class DeletedSecretItem(SecretItem): + """The deleted secret item containing metadata about the deleted secret. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Secret identifier. + :type id: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted secret. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the secret is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the secret was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedSecretItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_paged.py new file mode 100644 index 00000000000..0dd94e7b4f6 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeletedSecretItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedSecretItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedSecretItem]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedSecretItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_py3.py new file mode 100644 index 00000000000..1dbbe8e976e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_secret_item_py3.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .secret_item import SecretItem + + +class DeletedSecretItem(SecretItem): + """The deleted secret item containing metadata about the deleted secret. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Secret identifier. + :type id: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a key backing a certificate, then managed will be true. + :vartype managed: bool + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted secret. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the secret is scheduled to be + purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the secret was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'managed': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, recovery_id: str=None, **kwargs) -> None: + super(DeletedSecretItem, self).__init__(id=id, attributes=attributes, tags=tags, content_type=content_type, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item.py new file mode 100644 index 00000000000..9f4f01d14a1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .storage_account_item import StorageAccountItem + + +class DeletedStorageAccountItem(StorageAccountItem): + """The deleted storage account item containing metadata about the deleted + storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Storage identifier. + :vartype id: str + :ivar resource_id: Storage account resource Id. + :vartype resource_id: str + :ivar attributes: The storage account management attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted storage account. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the storage account is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the storage account was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedStorageAccountItem, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_paged.py new file mode 100644 index 00000000000..0c466669e3d --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeletedStorageAccountItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedStorageAccountItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedStorageAccountItem]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedStorageAccountItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_py3.py new file mode 100644 index 00000000000..6fc35610406 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_account_item_py3.py @@ -0,0 +1,69 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .storage_account_item import StorageAccountItem + + +class DeletedStorageAccountItem(StorageAccountItem): + """The deleted storage account item containing metadata about the deleted + storage account. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Storage identifier. + :vartype id: str + :ivar resource_id: Storage account resource Id. + :vartype resource_id: str + :ivar attributes: The storage account management attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted storage account. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the storage account is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the storage account was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedStorageAccountItem, self).__init__(, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle.py new file mode 100644 index 00000000000..43dda67f414 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle.py @@ -0,0 +1,83 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .storage_bundle import StorageBundle + + +class DeletedStorageBundle(StorageBundle): + """A deleted storage account bundle consisting of its previous id, attributes + and its tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage account id. + :vartype id: str + :ivar resource_id: The storage account resource id. + :vartype resource_id: str + :ivar active_key_name: The current active storage account key name. + :vartype active_key_name: str + :ivar auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :vartype auto_regenerate_key: bool + :ivar regeneration_period: The key regeneration time duration specified in + ISO-8601 format. + :vartype regeneration_period: str + :ivar attributes: The storage account attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted storage account. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the storage account is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the storage account was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'active_key_name': {'readonly': True}, + 'auto_regenerate_key': {'readonly': True}, + 'regeneration_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(DeletedStorageBundle, self).__init__(**kwargs) + self.recovery_id = kwargs.get('recovery_id', None) + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle_py3.py new file mode 100644 index 00000000000..6abde0c2579 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/deleted_storage_bundle_py3.py @@ -0,0 +1,83 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .storage_bundle import StorageBundle + + +class DeletedStorageBundle(StorageBundle): + """A deleted storage account bundle consisting of its previous id, attributes + and its tags, as well as information on when it will be purged. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage account id. + :vartype id: str + :ivar resource_id: The storage account resource id. + :vartype resource_id: str + :ivar active_key_name: The current active storage account key name. + :vartype active_key_name: str + :ivar auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :vartype auto_regenerate_key: bool + :ivar regeneration_period: The key regeneration time duration specified in + ISO-8601 format. + :vartype regeneration_period: str + :ivar attributes: The storage account attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + :param recovery_id: The url of the recovery object, used to identify and + recover the deleted storage account. + :type recovery_id: str + :ivar scheduled_purge_date: The time when the storage account is scheduled + to be purged, in UTC + :vartype scheduled_purge_date: datetime + :ivar deleted_date: The time when the storage account was deleted, in UTC + :vartype deleted_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'active_key_name': {'readonly': True}, + 'auto_regenerate_key': {'readonly': True}, + 'regeneration_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'deleted_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'recovery_id': {'key': 'recoveryId', 'type': 'str'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'unix-time'}, + 'deleted_date': {'key': 'deletedDate', 'type': 'unix-time'}, + } + + def __init__(self, *, recovery_id: str=None, **kwargs) -> None: + super(DeletedStorageBundle, self).__init__(, **kwargs) + self.recovery_id = recovery_id + self.scheduled_purge_date = None + self.deleted_date = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/error.py b/src/keyvault/azext_keyvault/keyvault/models/error.py new file mode 100644 index 00000000000..edb4d5da790 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/error.py @@ -0,0 +1,51 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """The key vault server error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar inner_error: + :vartype inner_error: ~azure.keyvault.models.Error + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innererror', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = None + self.message = None + self.inner_error = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/error_py3.py b/src/keyvault/azext_keyvault/keyvault/models/error_py3.py new file mode 100644 index 00000000000..91ea3b8a63b --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/error_py3.py @@ -0,0 +1,51 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Error(Model): + """The key vault server error. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar inner_error: + :vartype inner_error: ~azure.keyvault.models.Error + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'inner_error': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'inner_error': {'key': 'innererror', 'type': 'Error'}, + } + + def __init__(self, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = None + self.message = None + self.inner_error = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_attributes.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_attributes.py new file mode 100644 index 00000000000..d66ee3280f5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_attributes.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerAttributes(Model): + """The attributes of an issuer managed by the Key Vault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the issuer is enabled. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + } + + def __init__(self, **kwargs): + super(IssuerAttributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.created = None + self.updated = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_attributes_py3.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_attributes_py3.py new file mode 100644 index 00000000000..4a82d2fd759 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_attributes_py3.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerAttributes(Model): + """The attributes of an issuer managed by the Key Vault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the issuer is enabled. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(IssuerAttributes, self).__init__(**kwargs) + self.enabled = enabled + self.created = None + self.updated = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_bundle.py new file mode 100644 index 00000000000..d21c18dd416 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_bundle.py @@ -0,0 +1,58 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerBundle(Model): + """The issuer for Key Vault certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Identifier for the issuer object. + :vartype id: str + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, **kwargs): + super(IssuerBundle, self).__init__(**kwargs) + self.id = None + self.provider = kwargs.get('provider', None) + self.credentials = kwargs.get('credentials', None) + self.organization_details = kwargs.get('organization_details', None) + self.attributes = kwargs.get('attributes', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_bundle_py3.py new file mode 100644 index 00000000000..fc6dbccfe1c --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_bundle_py3.py @@ -0,0 +1,58 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerBundle(Model): + """The issuer for Key Vault certificate. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Identifier for the issuer object. + :vartype id: str + :param provider: The issuer provider. + :type provider: str + :param credentials: The credentials to be used for the issuer. + :type credentials: ~azure.keyvault.models.IssuerCredentials + :param organization_details: Details of the organization as provided to + the issuer. + :type organization_details: ~azure.keyvault.models.OrganizationDetails + :param attributes: Attributes of the issuer object. + :type attributes: ~azure.keyvault.models.IssuerAttributes + """ + + _validation = { + 'id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, + 'organization_details': {'key': 'org_details', 'type': 'OrganizationDetails'}, + 'attributes': {'key': 'attributes', 'type': 'IssuerAttributes'}, + } + + def __init__(self, *, provider: str=None, credentials=None, organization_details=None, attributes=None, **kwargs) -> None: + super(IssuerBundle, self).__init__(**kwargs) + self.id = None + self.provider = provider + self.credentials = credentials + self.organization_details = organization_details + self.attributes = attributes diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_credentials.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_credentials.py new file mode 100644 index 00000000000..4e2bcfb9edb --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_credentials.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerCredentials(Model): + """The credentials to be used for the certificate issuer. + + :param account_id: The user name/account name/account id. + :type account_id: str + :param password: The password/secret/account key. + :type password: str + """ + + _attribute_map = { + 'account_id': {'key': 'account_id', 'type': 'str'}, + 'password': {'key': 'pwd', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IssuerCredentials, self).__init__(**kwargs) + self.account_id = kwargs.get('account_id', None) + self.password = kwargs.get('password', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_credentials_py3.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_credentials_py3.py new file mode 100644 index 00000000000..88d48872435 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_credentials_py3.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerCredentials(Model): + """The credentials to be used for the certificate issuer. + + :param account_id: The user name/account name/account id. + :type account_id: str + :param password: The password/secret/account key. + :type password: str + """ + + _attribute_map = { + 'account_id': {'key': 'account_id', 'type': 'str'}, + 'password': {'key': 'pwd', 'type': 'str'}, + } + + def __init__(self, *, account_id: str=None, password: str=None, **kwargs) -> None: + super(IssuerCredentials, self).__init__(**kwargs) + self.account_id = account_id + self.password = password diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_parameters.py new file mode 100644 index 00000000000..6c43c875628 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_parameters.py @@ -0,0 +1,45 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerParameters(Model): + """Parameters for the issuer of the X509 component of a certificate. + + :param name: Name of the referenced issuer object or reserved names; for + example, 'Self' or 'Unknown'. + :type name: str + :param certificate_type: Type of certificate to be requested from the + issuer provider. + :type certificate_type: str + :param certificate_transparency: Indicates if the certificates generated + under this policy should be published to certificate transparency logs. + :type certificate_transparency: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'certificate_type': {'key': 'cty', 'type': 'str'}, + 'certificate_transparency': {'key': 'cert_transparency', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(IssuerParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.certificate_type = kwargs.get('certificate_type', None) + self.certificate_transparency = kwargs.get('certificate_transparency', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/issuer_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/issuer_parameters_py3.py new file mode 100644 index 00000000000..b5b4e0bcd15 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/issuer_parameters_py3.py @@ -0,0 +1,45 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IssuerParameters(Model): + """Parameters for the issuer of the X509 component of a certificate. + + :param name: Name of the referenced issuer object or reserved names; for + example, 'Self' or 'Unknown'. + :type name: str + :param certificate_type: Type of certificate to be requested from the + issuer provider. + :type certificate_type: str + :param certificate_transparency: Indicates if the certificates generated + under this policy should be published to certificate transparency logs. + :type certificate_transparency: bool + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'certificate_type': {'key': 'cty', 'type': 'str'}, + 'certificate_transparency': {'key': 'cert_transparency', 'type': 'bool'}, + } + + def __init__(self, *, name: str=None, certificate_type: str=None, certificate_transparency: bool=None, **kwargs) -> None: + super(IssuerParameters, self).__init__(**kwargs) + self.name = name + self.certificate_type = certificate_type + self.certificate_transparency = certificate_transparency diff --git a/src/keyvault/azext_keyvault/keyvault/models/json_web_key.py b/src/keyvault/azext_keyvault/keyvault/models/json_web_key.py new file mode 100644 index 00000000000..b080ca1ef86 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/json_web_key.py @@ -0,0 +1,97 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JsonWebKey(Model): + """As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18. + + :param kid: Key identifier. + :type kid: str + :param kty: JsonWebKey key type (kty). Possible values include: 'EC', + 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + :type kty: str or ~azure.keyvault.models.JsonWebKeyType + :param key_ops: + :type key_ops: list[str] + :param n: RSA modulus. + :type n: bytes + :param e: RSA public exponent. + :type e: bytes + :param d: RSA private exponent, or the D component of an EC private key. + :type d: bytes + :param dp: RSA private key parameter. + :type dp: bytes + :param dq: RSA private key parameter. + :type dq: bytes + :param qi: RSA private key parameter. + :type qi: bytes + :param p: RSA secret prime. + :type p: bytes + :param q: RSA secret prime, with p < q. + :type q: bytes + :param k: Symmetric key. + :type k: bytes + :param t: HSM Token, used with 'Bring Your Own Key'. + :type t: bytes + :param crv: Elliptic curve name. For valid values, see + JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + 'SECP256K1' + :type crv: str or ~azure.keyvault.models.JsonWebKeyCurveName + :param x: X component of an EC public key. + :type x: bytes + :param y: Y component of an EC public key. + :type y: bytes + """ + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'kty': {'key': 'kty', 'type': 'str'}, + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'n': {'key': 'n', 'type': 'base64'}, + 'e': {'key': 'e', 'type': 'base64'}, + 'd': {'key': 'd', 'type': 'base64'}, + 'dp': {'key': 'dp', 'type': 'base64'}, + 'dq': {'key': 'dq', 'type': 'base64'}, + 'qi': {'key': 'qi', 'type': 'base64'}, + 'p': {'key': 'p', 'type': 'base64'}, + 'q': {'key': 'q', 'type': 'base64'}, + 'k': {'key': 'k', 'type': 'base64'}, + 't': {'key': 'key_hsm', 'type': 'base64'}, + 'crv': {'key': 'crv', 'type': 'str'}, + 'x': {'key': 'x', 'type': 'base64'}, + 'y': {'key': 'y', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(JsonWebKey, self).__init__(**kwargs) + self.kid = kwargs.get('kid', None) + self.kty = kwargs.get('kty', None) + self.key_ops = kwargs.get('key_ops', None) + self.n = kwargs.get('n', None) + self.e = kwargs.get('e', None) + self.d = kwargs.get('d', None) + self.dp = kwargs.get('dp', None) + self.dq = kwargs.get('dq', None) + self.qi = kwargs.get('qi', None) + self.p = kwargs.get('p', None) + self.q = kwargs.get('q', None) + self.k = kwargs.get('k', None) + self.t = kwargs.get('t', None) + self.crv = kwargs.get('crv', None) + self.x = kwargs.get('x', None) + self.y = kwargs.get('y', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/json_web_key_py3.py b/src/keyvault/azext_keyvault/keyvault/models/json_web_key_py3.py new file mode 100644 index 00000000000..38cfc01a050 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/json_web_key_py3.py @@ -0,0 +1,97 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class JsonWebKey(Model): + """As of http://tools.ietf.org/html/draft-ietf-jose-json-web-key-18. + + :param kid: Key identifier. + :type kid: str + :param kty: JsonWebKey key type (kty). Possible values include: 'EC', + 'EC-HSM', 'RSA', 'RSA-HSM', 'oct' + :type kty: str or ~azure.keyvault.models.JsonWebKeyType + :param key_ops: + :type key_ops: list[str] + :param n: RSA modulus. + :type n: bytes + :param e: RSA public exponent. + :type e: bytes + :param d: RSA private exponent, or the D component of an EC private key. + :type d: bytes + :param dp: RSA private key parameter. + :type dp: bytes + :param dq: RSA private key parameter. + :type dq: bytes + :param qi: RSA private key parameter. + :type qi: bytes + :param p: RSA secret prime. + :type p: bytes + :param q: RSA secret prime, with p < q. + :type q: bytes + :param k: Symmetric key. + :type k: bytes + :param t: HSM Token, used with 'Bring Your Own Key'. + :type t: bytes + :param crv: Elliptic curve name. For valid values, see + JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + 'SECP256K1' + :type crv: str or ~azure.keyvault.models.JsonWebKeyCurveName + :param x: X component of an EC public key. + :type x: bytes + :param y: Y component of an EC public key. + :type y: bytes + """ + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'kty': {'key': 'kty', 'type': 'str'}, + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'n': {'key': 'n', 'type': 'base64'}, + 'e': {'key': 'e', 'type': 'base64'}, + 'd': {'key': 'd', 'type': 'base64'}, + 'dp': {'key': 'dp', 'type': 'base64'}, + 'dq': {'key': 'dq', 'type': 'base64'}, + 'qi': {'key': 'qi', 'type': 'base64'}, + 'p': {'key': 'p', 'type': 'base64'}, + 'q': {'key': 'q', 'type': 'base64'}, + 'k': {'key': 'k', 'type': 'base64'}, + 't': {'key': 'key_hsm', 'type': 'base64'}, + 'crv': {'key': 'crv', 'type': 'str'}, + 'x': {'key': 'x', 'type': 'base64'}, + 'y': {'key': 'y', 'type': 'base64'}, + } + + def __init__(self, *, kid: str=None, kty=None, key_ops=None, n: bytes=None, e: bytes=None, d: bytes=None, dp: bytes=None, dq: bytes=None, qi: bytes=None, p: bytes=None, q: bytes=None, k: bytes=None, t: bytes=None, crv=None, x: bytes=None, y: bytes=None, **kwargs) -> None: + super(JsonWebKey, self).__init__(**kwargs) + self.kid = kid + self.kty = kty + self.key_ops = key_ops + self.n = n + self.e = e + self.d = d + self.dp = dp + self.dq = dq + self.qi = qi + self.p = p + self.q = q + self.k = k + self.t = t + self.crv = crv + self.x = x + self.y = y diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_attributes.py b/src/keyvault/azext_keyvault/keyvault/models/key_attributes.py new file mode 100644 index 00000000000..26eb8b91d02 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_attributes.py @@ -0,0 +1,64 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .attributes import Attributes + + +class KeyAttributes(Attributes): + """The attributes of a key managed by the key vault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for keys in the current vault. If it contains 'Purgeable' the key + can be permanently deleted by a privileged user; otherwise, only the + system can purge the key, at the end of the retention interval. Possible + values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyAttributes, self).__init__(**kwargs) + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_attributes_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_attributes_py3.py new file mode 100644 index 00000000000..4ee3ec6ae5e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_attributes_py3.py @@ -0,0 +1,64 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .attributes import Attributes + + +class KeyAttributes(Attributes): + """The attributes of a key managed by the key vault service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for keys in the current vault. If it contains 'Purgeable' the key + can be permanently deleted by a privileged user; otherwise, only the + system can purge the key, at the end of the retention interval. Possible + values include: 'Purgeable', 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(KeyAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs) + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/key_bundle.py new file mode 100644 index 00000000000..b72111d2bd8 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_bundle.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyBundle(Model): + """A KeyBundle consisting of a WebKey plus its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key: The Json web key. + :type key: ~azure.keyvault.models.JsonWebKey + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(KeyBundle, self).__init__(**kwargs) + self.key = kwargs.get('key', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_bundle_py3.py new file mode 100644 index 00000000000..75f1dfffb5e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_bundle_py3.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyBundle(Model): + """A KeyBundle consisting of a WebKey plus its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param key: The Json web key. + :type key: ~azure.keyvault.models.JsonWebKey + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, key=None, attributes=None, tags=None, **kwargs) -> None: + super(KeyBundle, self).__init__(**kwargs) + self.key = key + self.attributes = attributes + self.tags = tags + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_create_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/key_create_parameters.py new file mode 100644 index 00000000000..7b73d16151f --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_create_parameters.py @@ -0,0 +1,64 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyCreateParameters(Model): + """The key create parameters. + + All required parameters must be populated in order to send to Azure. + + :param kty: Required. The type of key to create. For valid values, see + JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + 'oct' + :type kty: str or ~azure.keyvault.models.JsonWebKeyType + :param key_size: The key size in bytes. For example, 1024 or 2048. + :type key_size: int + :param key_ops: + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param curve: Elliptic curve name. For valid values, see + JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + 'SECP256K1' + :type curve: str or ~azure.keyvault.models.JsonWebKeyCurveName + """ + + _validation = { + 'kty': {'required': True, 'min_length': 1}, + } + + _attribute_map = { + 'kty': {'key': 'kty', 'type': 'str'}, + 'key_size': {'key': 'key_size', 'type': 'int'}, + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'curve': {'key': 'crv', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyCreateParameters, self).__init__(**kwargs) + self.kty = kwargs.get('kty', None) + self.key_size = kwargs.get('key_size', None) + self.key_ops = kwargs.get('key_ops', None) + self.key_attributes = kwargs.get('key_attributes', None) + self.tags = kwargs.get('tags', None) + self.curve = kwargs.get('curve', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_create_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_create_parameters_py3.py new file mode 100644 index 00000000000..eb27604482e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_create_parameters_py3.py @@ -0,0 +1,64 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyCreateParameters(Model): + """The key create parameters. + + All required parameters must be populated in order to send to Azure. + + :param kty: Required. The type of key to create. For valid values, see + JsonWebKeyType. Possible values include: 'EC', 'EC-HSM', 'RSA', 'RSA-HSM', + 'oct' + :type kty: str or ~azure.keyvault.models.JsonWebKeyType + :param key_size: The key size in bytes. For example, 1024 or 2048. + :type key_size: int + :param key_ops: + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param curve: Elliptic curve name. For valid values, see + JsonWebKeyCurveName. Possible values include: 'P-256', 'P-384', 'P-521', + 'SECP256K1' + :type curve: str or ~azure.keyvault.models.JsonWebKeyCurveName + """ + + _validation = { + 'kty': {'required': True, 'min_length': 1}, + } + + _attribute_map = { + 'kty': {'key': 'kty', 'type': 'str'}, + 'key_size': {'key': 'key_size', 'type': 'int'}, + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'curve': {'key': 'crv', 'type': 'str'}, + } + + def __init__(self, *, kty, key_size: int=None, key_ops=None, key_attributes=None, tags=None, curve=None, **kwargs) -> None: + super(KeyCreateParameters, self).__init__(**kwargs) + self.kty = kty + self.key_size = key_size + self.key_ops = key_ops + self.key_attributes = key_attributes + self.tags = tags + self.curve = curve diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_import_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/key_import_parameters.py new file mode 100644 index 00000000000..01050602aef --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_import_parameters.py @@ -0,0 +1,52 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyImportParameters(Model): + """The key import parameters. + + All required parameters must be populated in order to send to Azure. + + :param hsm: Whether to import as a hardware key (HSM) or software key. + :type hsm: bool + :param key: Required. The Json web key + :type key: ~azure.keyvault.models.JsonWebKey + :param key_attributes: The key management attributes. + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'key': {'required': True}, + } + + _attribute_map = { + 'hsm': {'key': 'Hsm', 'type': 'bool'}, + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(KeyImportParameters, self).__init__(**kwargs) + self.hsm = kwargs.get('hsm', None) + self.key = kwargs.get('key', None) + self.key_attributes = kwargs.get('key_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_import_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_import_parameters_py3.py new file mode 100644 index 00000000000..b2975fa2259 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_import_parameters_py3.py @@ -0,0 +1,52 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyImportParameters(Model): + """The key import parameters. + + All required parameters must be populated in order to send to Azure. + + :param hsm: Whether to import as a hardware key (HSM) or software key. + :type hsm: bool + :param key: Required. The Json web key + :type key: ~azure.keyvault.models.JsonWebKey + :param key_attributes: The key management attributes. + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'key': {'required': True}, + } + + _attribute_map = { + 'hsm': {'key': 'Hsm', 'type': 'bool'}, + 'key': {'key': 'key', 'type': 'JsonWebKey'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, key, hsm: bool=None, key_attributes=None, tags=None, **kwargs) -> None: + super(KeyImportParameters, self).__init__(**kwargs) + self.hsm = hsm + self.key = key + self.key_attributes = key_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_item.py b/src/keyvault/azext_keyvault/keyvault/models/key_item.py new file mode 100644 index 00000000000..68bb2d5b14f --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_item.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyItem(Model): + """The key item containing key metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kid: Key identifier. + :type kid: str + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(KeyItem, self).__init__(**kwargs) + self.kid = kwargs.get('kid', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/key_item_paged.py new file mode 100644 index 00000000000..e86da03bc03 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class KeyItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`KeyItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[KeyItem]'} + } + + def __init__(self, *args, **kwargs): + + super(KeyItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_item_py3.py new file mode 100644 index 00000000000..2d574db63ff --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_item_py3.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyItem(Model): + """The key item containing key metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param kid: Key identifier. + :type kid: str + :param attributes: The key management attributes. + :type attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar managed: True if the key's lifetime is managed by key vault. If this + is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, kid: str=None, attributes=None, tags=None, **kwargs) -> None: + super(KeyItem, self).__init__(**kwargs) + self.kid = kid + self.attributes = attributes + self.tags = tags + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_operation_result.py b/src/keyvault/azext_keyvault/keyvault/models/key_operation_result.py new file mode 100644 index 00000000000..67c492b74b1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_operation_result.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyOperationResult(Model): + """The key operation result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kid: Key identifier + :vartype kid: str + :ivar result: + :vartype result: bytes + """ + + _validation = { + 'kid': {'readonly': True}, + 'result': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'result': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(KeyOperationResult, self).__init__(**kwargs) + self.kid = None + self.result = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_operation_result_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_operation_result_py3.py new file mode 100644 index 00000000000..67f9e055d8e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_operation_result_py3.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyOperationResult(Model): + """The key operation result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar kid: Key identifier + :vartype kid: str + :ivar result: + :vartype result: bytes + """ + + _validation = { + 'kid': {'readonly': True}, + 'result': {'readonly': True}, + } + + _attribute_map = { + 'kid': {'key': 'kid', 'type': 'str'}, + 'result': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyOperationResult, self).__init__(**kwargs) + self.kid = None + self.result = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters.py new file mode 100644 index 00000000000..e9a2b7c4b62 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyOperationsParameters(Model): + """The key operations parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. algorithm identifier. Possible values include: + 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm + :param value: Required. + :type value: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(KeyOperationsParameters, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.value = kwargs.get('value', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters_py3.py new file mode 100644 index 00000000000..d0036506a62 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_operations_parameters_py3.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyOperationsParameters(Model): + """The key operations parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. algorithm identifier. Possible values include: + 'RSA-OAEP', 'RSA-OAEP-256', 'RSA1_5' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeyEncryptionAlgorithm + :param value: Required. + :type value: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, algorithm, value: bytes, **kwargs) -> None: + super(KeyOperationsParameters, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_properties.py b/src/keyvault/azext_keyvault/keyvault/models/key_properties.py new file mode 100644 index 00000000000..0d0f94993cb --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_properties.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyProperties(Model): + """Properties of the key pair backing a certificate. + + :param exportable: Indicates if the private key can be exported. + :type exportable: bool + :param key_type: The key type. + :type key_type: str + :param key_size: The key size in bytes. For example; 1024 or 2048. + :type key_size: int + :param reuse_key: Indicates if the same key pair will be used on + certificate renewal. + :type reuse_key: bool + """ + + _attribute_map = { + 'exportable': {'key': 'exportable', 'type': 'bool'}, + 'key_type': {'key': 'kty', 'type': 'str'}, + 'key_size': {'key': 'key_size', 'type': 'int'}, + 'reuse_key': {'key': 'reuse_key', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(KeyProperties, self).__init__(**kwargs) + self.exportable = kwargs.get('exportable', None) + self.key_type = kwargs.get('key_type', None) + self.key_size = kwargs.get('key_size', None) + self.reuse_key = kwargs.get('reuse_key', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_properties_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_properties_py3.py new file mode 100644 index 00000000000..2b987c3de1b --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_properties_py3.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyProperties(Model): + """Properties of the key pair backing a certificate. + + :param exportable: Indicates if the private key can be exported. + :type exportable: bool + :param key_type: The key type. + :type key_type: str + :param key_size: The key size in bytes. For example; 1024 or 2048. + :type key_size: int + :param reuse_key: Indicates if the same key pair will be used on + certificate renewal. + :type reuse_key: bool + """ + + _attribute_map = { + 'exportable': {'key': 'exportable', 'type': 'bool'}, + 'key_type': {'key': 'kty', 'type': 'str'}, + 'key_size': {'key': 'key_size', 'type': 'int'}, + 'reuse_key': {'key': 'reuse_key', 'type': 'bool'}, + } + + def __init__(self, *, exportable: bool=None, key_type: str=None, key_size: int=None, reuse_key: bool=None, **kwargs) -> None: + super(KeyProperties, self).__init__(**kwargs) + self.exportable = exportable + self.key_type = key_type + self.key_size = key_size + self.reuse_key = reuse_key diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters.py new file mode 100644 index 00000000000..0a79ddca663 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyRestoreParameters(Model): + """The key restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_bundle_backup: Required. The backup blob associated with a key + bundle. + :type key_bundle_backup: bytes + """ + + _validation = { + 'key_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'key_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(KeyRestoreParameters, self).__init__(**kwargs) + self.key_bundle_backup = kwargs.get('key_bundle_backup', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters_py3.py new file mode 100644 index 00000000000..98773863f86 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_restore_parameters_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyRestoreParameters(Model): + """The key restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_bundle_backup: Required. The backup blob associated with a key + bundle. + :type key_bundle_backup: bytes + """ + + _validation = { + 'key_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'key_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, key_bundle_backup: bytes, **kwargs) -> None: + super(KeyRestoreParameters, self).__init__(**kwargs) + self.key_bundle_backup = key_bundle_backup diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters.py new file mode 100644 index 00000000000..e061c317f8c --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeySignParameters(Model): + """The key operations parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm identifier. + For more information on possible algorithm types, see + JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param value: Required. + :type value: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(KeySignParameters, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.value = kwargs.get('value', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters_py3.py new file mode 100644 index 00000000000..d6e813e9cbc --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_sign_parameters_py3.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeySignParameters(Model): + """The key operations parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm identifier. + For more information on possible algorithm types, see + JsonWebKeySignatureAlgorithm. Possible values include: 'PS256', 'PS384', + 'PS512', 'RS256', 'RS384', 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', + 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param value: Required. + :type value: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'value': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, algorithm, value: bytes, **kwargs) -> None: + super(KeySignParameters, self).__init__(**kwargs) + self.algorithm = algorithm + self.value = value diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_update_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/key_update_parameters.py new file mode 100644 index 00000000000..7e3043aa6f0 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_update_parameters.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyUpdateParameters(Model): + """The key update parameters. + + :param key_ops: Json web key operations. For more information on possible + key operations, see JsonWebKeyOperation. + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(KeyUpdateParameters, self).__init__(**kwargs) + self.key_ops = kwargs.get('key_ops', None) + self.key_attributes = kwargs.get('key_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_update_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_update_parameters_py3.py new file mode 100644 index 00000000000..920e8ba8bb2 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_update_parameters_py3.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyUpdateParameters(Model): + """The key update parameters. + + :param key_ops: Json web key operations. For more information on possible + key operations, see JsonWebKeyOperation. + :type key_ops: list[str or ~azure.keyvault.models.JsonWebKeyOperation] + :param key_attributes: + :type key_attributes: ~azure.keyvault.models.KeyAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'key_ops': {'key': 'key_ops', 'type': '[str]'}, + 'key_attributes': {'key': 'attributes', 'type': 'KeyAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, key_ops=None, key_attributes=None, tags=None, **kwargs) -> None: + super(KeyUpdateParameters, self).__init__(**kwargs) + self.key_ops = key_ops + self.key_attributes = key_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_vault_client_enums.py b/src/keyvault/azext_keyvault/keyvault/models/key_vault_client_enums.py new file mode 100644 index 00000000000..f2586769b07 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_vault_client_enums.py @@ -0,0 +1,100 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class JsonWebKeyType(str, Enum): + + ec = "EC" + ec_hsm = "EC-HSM" + rsa = "RSA" + rsa_hsm = "RSA-HSM" + oct = "oct" + + +class JsonWebKeyCurveName(str, Enum): + + p_256 = "P-256" + p_384 = "P-384" + p_521 = "P-521" + secp256_k1 = "SECP256K1" + + +class DeletionRecoveryLevel(str, Enum): + + purgeable = "Purgeable" + recoverable_purgeable = "Recoverable+Purgeable" + recoverable = "Recoverable" + recoverable_protected_subscription = "Recoverable+ProtectedSubscription" + + +class KeyUsageType(str, Enum): + + digital_signature = "digitalSignature" + non_repudiation = "nonRepudiation" + key_encipherment = "keyEncipherment" + data_encipherment = "dataEncipherment" + key_agreement = "keyAgreement" + key_cert_sign = "keyCertSign" + c_rl_sign = "cRLSign" + encipher_only = "encipherOnly" + decipher_only = "decipherOnly" + + +class ActionType(str, Enum): + + email_contacts = "EmailContacts" + auto_renew = "AutoRenew" + + +class JsonWebKeyOperation(str, Enum): + + encrypt = "encrypt" + decrypt = "decrypt" + sign = "sign" + verify = "verify" + wrap_key = "wrapKey" + unwrap_key = "unwrapKey" + + +class JsonWebKeyEncryptionAlgorithm(str, Enum): + + rsa_oaep = "RSA-OAEP" + rsa_oaep_256 = "RSA-OAEP-256" + rsa1_5 = "RSA1_5" + + +class JsonWebKeySignatureAlgorithm(str, Enum): + + ps256 = "PS256" + ps384 = "PS384" + ps512 = "PS512" + rs256 = "RS256" + rs384 = "RS384" + rs512 = "RS512" + rsnull = "RSNULL" + es256 = "ES256" + es384 = "ES384" + es512 = "ES512" + ecdsa256 = "ECDSA256" + + +class SasTokenType(str, Enum): + + account = "account" + service = "service" diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_vault_error.py b/src/keyvault/azext_keyvault/keyvault/models/key_vault_error.py new file mode 100644 index 00000000000..81278c5eb50 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_vault_error.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class KeyVaultError(Model): + """The key vault error exception. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: + :vartype error: ~azure.keyvault.models.Error + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(KeyVaultError, self).__init__(**kwargs) + self.error = None + + +class KeyVaultErrorException(HttpOperationError): + """Server responsed with exception of type: 'KeyVaultError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(KeyVaultErrorException, self).__init__(deserialize, response, 'KeyVaultError', *args) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_vault_error_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_vault_error_py3.py new file mode 100644 index 00000000000..4c2771a07c5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_vault_error_py3.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model +from msrest.exceptions import HttpOperationError + + +class KeyVaultError(Model): + """The key vault error exception. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error: + :vartype error: ~azure.keyvault.models.Error + """ + + _validation = { + 'error': {'readonly': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyVaultError, self).__init__(**kwargs) + self.error = None + + +class KeyVaultErrorException(HttpOperationError): + """Server responsed with exception of type: 'KeyVaultError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(KeyVaultErrorException, self).__init__(deserialize, response, 'KeyVaultError', *args) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters.py new file mode 100644 index 00000000000..0922b537e81 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVerifyParameters(Model): + """The key verify parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm. For more + information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param digest: Required. The digest used for signing. + :type digest: bytes + :param signature: Required. The signature to be verified. + :type signature: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'digest': {'required': True}, + 'signature': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'digest': {'key': 'digest', 'type': 'base64'}, + 'signature': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(KeyVerifyParameters, self).__init__(**kwargs) + self.algorithm = kwargs.get('algorithm', None) + self.digest = kwargs.get('digest', None) + self.signature = kwargs.get('signature', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters_py3.py new file mode 100644 index 00000000000..81c0d107dbb --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_verify_parameters_py3.py @@ -0,0 +1,54 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVerifyParameters(Model): + """The key verify parameters. + + All required parameters must be populated in order to send to Azure. + + :param algorithm: Required. The signing/verification algorithm. For more + information on possible algorithm types, see JsonWebKeySignatureAlgorithm. + Possible values include: 'PS256', 'PS384', 'PS512', 'RS256', 'RS384', + 'RS512', 'RSNULL', 'ES256', 'ES384', 'ES512', 'ECDSA256' + :type algorithm: str or + ~azure.keyvault.models.JsonWebKeySignatureAlgorithm + :param digest: Required. The digest used for signing. + :type digest: bytes + :param signature: Required. The signature to be verified. + :type signature: bytes + """ + + _validation = { + 'algorithm': {'required': True, 'min_length': 1}, + 'digest': {'required': True}, + 'signature': {'required': True}, + } + + _attribute_map = { + 'algorithm': {'key': 'alg', 'type': 'str'}, + 'digest': {'key': 'digest', 'type': 'base64'}, + 'signature': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, algorithm, digest: bytes, signature: bytes, **kwargs) -> None: + super(KeyVerifyParameters, self).__init__(**kwargs) + self.algorithm = algorithm + self.digest = digest + self.signature = signature diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_verify_result.py b/src/keyvault/azext_keyvault/keyvault/models/key_verify_result.py new file mode 100644 index 00000000000..05a16347f28 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_verify_result.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVerifyResult(Model): + """The key verify result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: True if the signature is verified, otherwise false. + :vartype value: bool + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(KeyVerifyResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/key_verify_result_py3.py b/src/keyvault/azext_keyvault/keyvault/models/key_verify_result_py3.py new file mode 100644 index 00000000000..cd6a32c313b --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/key_verify_result_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class KeyVerifyResult(Model): + """The key verify result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: True if the signature is verified, otherwise false. + :vartype value: bool + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'bool'}, + } + + def __init__(self, **kwargs) -> None: + super(KeyVerifyResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/lifetime_action.py b/src/keyvault/azext_keyvault/keyvault/models/lifetime_action.py new file mode 100644 index 00000000000..fd91e9f96cf --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/lifetime_action.py @@ -0,0 +1,39 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LifetimeAction(Model): + """Action and its trigger that will be performed by Key Vault over the + lifetime of a certificate. + + :param trigger: The condition that will execute the action. + :type trigger: ~azure.keyvault.models.Trigger + :param action: The action that will be executed. + :type action: ~azure.keyvault.models.Action + """ + + _attribute_map = { + 'trigger': {'key': 'trigger', 'type': 'Trigger'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, **kwargs): + super(LifetimeAction, self).__init__(**kwargs) + self.trigger = kwargs.get('trigger', None) + self.action = kwargs.get('action', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/lifetime_action_py3.py b/src/keyvault/azext_keyvault/keyvault/models/lifetime_action_py3.py new file mode 100644 index 00000000000..84528386b0a --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/lifetime_action_py3.py @@ -0,0 +1,39 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LifetimeAction(Model): + """Action and its trigger that will be performed by Key Vault over the + lifetime of a certificate. + + :param trigger: The condition that will execute the action. + :type trigger: ~azure.keyvault.models.Trigger + :param action: The action that will be executed. + :type action: ~azure.keyvault.models.Action + """ + + _attribute_map = { + 'trigger': {'key': 'trigger', 'type': 'Trigger'}, + 'action': {'key': 'action', 'type': 'Action'}, + } + + def __init__(self, *, trigger=None, action=None, **kwargs) -> None: + super(LifetimeAction, self).__init__(**kwargs) + self.trigger = trigger + self.action = action diff --git a/src/keyvault/azext_keyvault/keyvault/models/organization_details.py b/src/keyvault/azext_keyvault/keyvault/models/organization_details.py new file mode 100644 index 00000000000..eecaf55e1e5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/organization_details.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OrganizationDetails(Model): + """Details of the organization of the certificate issuer. + + :param id: Id of the organization. + :type id: str + :param admin_details: Details of the organization administrator. + :type admin_details: list[~azure.keyvault.models.AdministratorDetails] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'}, + } + + def __init__(self, **kwargs): + super(OrganizationDetails, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.admin_details = kwargs.get('admin_details', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/organization_details_py3.py b/src/keyvault/azext_keyvault/keyvault/models/organization_details_py3.py new file mode 100644 index 00000000000..1e326d0f1b5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/organization_details_py3.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OrganizationDetails(Model): + """Details of the organization of the certificate issuer. + + :param id: Id of the organization. + :type id: str + :param admin_details: Details of the organization administrator. + :type admin_details: list[~azure.keyvault.models.AdministratorDetails] + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'admin_details': {'key': 'admin_details', 'type': '[AdministratorDetails]'}, + } + + def __init__(self, *, id: str=None, admin_details=None, **kwargs) -> None: + super(OrganizationDetails, self).__init__(**kwargs) + self.id = id + self.admin_details = admin_details diff --git a/src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result.py b/src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result.py new file mode 100644 index 00000000000..499cf914660 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PendingCertificateSigningRequestResult(Model): + """The pending certificate signing request result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The pending certificate signing request as Base64 encoded + string. + :vartype value: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PendingCertificateSigningRequestResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result_py3.py b/src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result_py3.py new file mode 100644 index 00000000000..2e8fb18d532 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/pending_certificate_signing_request_result_py3.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PendingCertificateSigningRequestResult(Model): + """The pending certificate signing request result. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar value: The pending certificate signing request as Base64 encoded + string. + :vartype value: str + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PendingCertificateSigningRequestResult, self).__init__(**kwargs) + self.value = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes.py new file mode 100644 index 00000000000..a2801fef748 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes.py @@ -0,0 +1,62 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionAttributes(Model): + """The SAS definition management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: the enabled state of the object. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for SAS definitions in the current vault. If it contains + 'Purgeable' the SAS definition can be permanently deleted by a privileged + user; otherwise, only the system can purge the SAS definition, at the end + of the retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SasDefinitionAttributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.created = None + self.updated = None + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes_py3.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes_py3.py new file mode 100644 index 00000000000..ec0ffe4406f --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_attributes_py3.py @@ -0,0 +1,62 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionAttributes(Model): + """The SAS definition management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: the enabled state of the object. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for SAS definitions in the current vault. If it contains + 'Purgeable' the SAS definition can be permanently deleted by a privileged + user; otherwise, only the system can purge the SAS definition, at the end + of the retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(SasDefinitionAttributes, self).__init__(**kwargs) + self.enabled = enabled + self.created = None + self.updated = None + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle.py new file mode 100644 index 00000000000..5de0c67a945 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle.py @@ -0,0 +1,76 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionBundle(Model): + """A SAS definition bundle consists of key vault SAS definition details plus + its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The SAS definition id. + :vartype id: str + :ivar secret_id: Storage account SAS definition secret id. + :vartype secret_id: str + :ivar template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :vartype template_uri: str + :ivar sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :vartype sas_type: str or ~azure.keyvault.models.SasTokenType + :ivar validity_period: The validity period of SAS tokens created according + to the SAS definition. + :vartype validity_period: str + :ivar attributes: The SAS definition attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'template_uri': {'readonly': True}, + 'sas_type': {'readonly': True}, + 'validity_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SasDefinitionBundle, self).__init__(**kwargs) + self.id = None + self.secret_id = None + self.template_uri = None + self.sas_type = None + self.validity_period = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle_py3.py new file mode 100644 index 00000000000..ad3f3bea058 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_bundle_py3.py @@ -0,0 +1,76 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionBundle(Model): + """A SAS definition bundle consists of key vault SAS definition details plus + its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The SAS definition id. + :vartype id: str + :ivar secret_id: Storage account SAS definition secret id. + :vartype secret_id: str + :ivar template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :vartype template_uri: str + :ivar sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :vartype sas_type: str or ~azure.keyvault.models.SasTokenType + :ivar validity_period: The validity period of SAS tokens created according + to the SAS definition. + :vartype validity_period: str + :ivar attributes: The SAS definition attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'template_uri': {'readonly': True}, + 'sas_type': {'readonly': True}, + 'validity_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(SasDefinitionBundle, self).__init__(**kwargs) + self.id = None + self.secret_id = None + self.template_uri = None + self.sas_type = None + self.validity_period = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters.py new file mode 100644 index 00000000000..1b4b433325d --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionCreateParameters(Model): + """The SAS definition create parameters. + + All required parameters must be populated in order to send to Azure. + + :param template_uri: Required. The SAS definition token template signed + with an arbitrary key. Tokens created according to the SAS definition + will have the same properties as the template. + :type template_uri: str + :param sas_type: Required. The type of SAS token the SAS definition will + create. Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: Required. The validity period of SAS tokens + created according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'template_uri': {'required': True}, + 'sas_type': {'required': True}, + 'validity_period': {'required': True}, + } + + _attribute_map = { + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'sas_definition_attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SasDefinitionCreateParameters, self).__init__(**kwargs) + self.template_uri = kwargs.get('template_uri', None) + self.sas_type = kwargs.get('sas_type', None) + self.validity_period = kwargs.get('validity_period', None) + self.sas_definition_attributes = kwargs.get('sas_definition_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters_py3.py new file mode 100644 index 00000000000..18ec8e1dfe4 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_create_parameters_py3.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionCreateParameters(Model): + """The SAS definition create parameters. + + All required parameters must be populated in order to send to Azure. + + :param template_uri: Required. The SAS definition token template signed + with an arbitrary key. Tokens created according to the SAS definition + will have the same properties as the template. + :type template_uri: str + :param sas_type: Required. The type of SAS token the SAS definition will + create. Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: Required. The validity period of SAS tokens + created according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'template_uri': {'required': True}, + 'sas_type': {'required': True}, + 'validity_period': {'required': True}, + } + + _attribute_map = { + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'sas_definition_attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, template_uri: str, sas_type, validity_period: str, sas_definition_attributes=None, tags=None, **kwargs) -> None: + super(SasDefinitionCreateParameters, self).__init__(**kwargs) + self.template_uri = template_uri + self.sas_type = sas_type + self.validity_period = validity_period + self.sas_definition_attributes = sas_definition_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item.py new file mode 100644 index 00000000000..2766a532653 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item.py @@ -0,0 +1,56 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionItem(Model): + """The SAS definition item containing storage SAS definition metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage SAS identifier. + :vartype id: str + :ivar secret_id: The storage account SAS definition secret id. + :vartype secret_id: str + :ivar attributes: The SAS definition management attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SasDefinitionItem, self).__init__(**kwargs) + self.id = None + self.secret_id = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_paged.py new file mode 100644 index 00000000000..2b104447de1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SasDefinitionItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`SasDefinitionItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SasDefinitionItem]'} + } + + def __init__(self, *args, **kwargs): + + super(SasDefinitionItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_py3.py new file mode 100644 index 00000000000..131bef84ecf --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_item_py3.py @@ -0,0 +1,56 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionItem(Model): + """The SAS definition item containing storage SAS definition metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage SAS identifier. + :vartype id: str + :ivar secret_id: The storage account SAS definition secret id. + :vartype secret_id: str + :ivar attributes: The SAS definition management attributes. + :vartype attributes: ~azure.keyvault.models.SasDefinitionAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'secret_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'secret_id': {'key': 'sid', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(SasDefinitionItem, self).__init__(**kwargs) + self.id = None + self.secret_id = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters.py new file mode 100644 index 00000000000..621e912a2ae --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters.py @@ -0,0 +1,55 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionUpdateParameters(Model): + """The SAS definition update parameters. + + :param template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :type template_uri: str + :param sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: The validity period of SAS tokens created + according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'sas_definition_attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SasDefinitionUpdateParameters, self).__init__(**kwargs) + self.template_uri = kwargs.get('template_uri', None) + self.sas_type = kwargs.get('sas_type', None) + self.validity_period = kwargs.get('validity_period', None) + self.sas_definition_attributes = kwargs.get('sas_definition_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters_py3.py new file mode 100644 index 00000000000..187c25189d5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/sas_definition_update_parameters_py3.py @@ -0,0 +1,55 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SasDefinitionUpdateParameters(Model): + """The SAS definition update parameters. + + :param template_uri: The SAS definition token template signed with an + arbitrary key. Tokens created according to the SAS definition will have + the same properties as the template. + :type template_uri: str + :param sas_type: The type of SAS token the SAS definition will create. + Possible values include: 'account', 'service' + :type sas_type: str or ~azure.keyvault.models.SasTokenType + :param validity_period: The validity period of SAS tokens created + according to the SAS definition. + :type validity_period: str + :param sas_definition_attributes: The attributes of the SAS definition. + :type sas_definition_attributes: + ~azure.keyvault.models.SasDefinitionAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'template_uri': {'key': 'templateUri', 'type': 'str'}, + 'sas_type': {'key': 'sasType', 'type': 'str'}, + 'validity_period': {'key': 'validityPeriod', 'type': 'str'}, + 'sas_definition_attributes': {'key': 'attributes', 'type': 'SasDefinitionAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, template_uri: str=None, sas_type=None, validity_period: str=None, sas_definition_attributes=None, tags=None, **kwargs) -> None: + super(SasDefinitionUpdateParameters, self).__init__(**kwargs) + self.template_uri = template_uri + self.sas_type = sas_type + self.validity_period = validity_period + self.sas_definition_attributes = sas_definition_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_attributes.py b/src/keyvault/azext_keyvault/keyvault/models/secret_attributes.py new file mode 100644 index 00000000000..832b6cccfdc --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_attributes.py @@ -0,0 +1,64 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .attributes import Attributes + + +class SecretAttributes(Attributes): + """The secret management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for secrets in the current vault. If it contains 'Purgeable', the + secret can be permanently deleted by a privileged user; otherwise, only + the system can purge the secret, at the end of the retention interval. + Possible values include: 'Purgeable', 'Recoverable+Purgeable', + 'Recoverable', 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecretAttributes, self).__init__(**kwargs) + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_attributes_py3.py b/src/keyvault/azext_keyvault/keyvault/models/secret_attributes_py3.py new file mode 100644 index 00000000000..329a8ec685f --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_attributes_py3.py @@ -0,0 +1,64 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .attributes import Attributes + + +class SecretAttributes(Attributes): + """The secret management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: Determines whether the object is enabled. + :type enabled: bool + :param not_before: Not before date in UTC. + :type not_before: datetime + :param expires: Expiry date in UTC. + :type expires: datetime + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for secrets in the current vault. If it contains 'Purgeable', the + secret can be permanently deleted by a privileged user; otherwise, only + the system can purge the secret, at the end of the retention interval. + Possible values include: 'Purgeable', 'Recoverable+Purgeable', + 'Recoverable', 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'not_before': {'key': 'nbf', 'type': 'unix-time'}, + 'expires': {'key': 'exp', 'type': 'unix-time'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, not_before=None, expires=None, **kwargs) -> None: + super(SecretAttributes, self).__init__(enabled=enabled, not_before=not_before, expires=expires, **kwargs) + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/secret_bundle.py new file mode 100644 index 00000000000..866834abc5e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_bundle.py @@ -0,0 +1,68 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretBundle(Model): + """A secret consisting of a value, id and its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The secret value. + :type value: str + :param id: The secret id. + :type id: str + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar kid: If this is a secret backing a KV certificate, then this field + specifies the corresponding key backing the KV certificate. + :vartype kid: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a secret backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'kid': {'readonly': True}, + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SecretBundle, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.id = kwargs.get('id', None) + self.content_type = kwargs.get('content_type', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) + self.kid = None + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/secret_bundle_py3.py new file mode 100644 index 00000000000..2536cf50e16 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_bundle_py3.py @@ -0,0 +1,68 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretBundle(Model): + """A secret consisting of a value, id and its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param value: The secret value. + :type value: str + :param id: The secret id. + :type id: str + :param content_type: The content type of the secret. + :type content_type: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :ivar kid: If this is a secret backing a KV certificate, then this field + specifies the corresponding key backing the KV certificate. + :vartype kid: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a secret backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'kid': {'readonly': True}, + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'kid': {'key': 'kid', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, value: str=None, id: str=None, content_type: str=None, attributes=None, tags=None, **kwargs) -> None: + super(SecretBundle, self).__init__(**kwargs) + self.value = value + self.id = id + self.content_type = content_type + self.attributes = attributes + self.tags = tags + self.kid = None + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_item.py b/src/keyvault/azext_keyvault/keyvault/models/secret_item.py new file mode 100644 index 00000000000..2b97601e51b --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_item.py @@ -0,0 +1,58 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretItem(Model): + """The secret item containing secret metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Secret identifier. + :type id: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SecretItem, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.attributes = kwargs.get('attributes', None) + self.tags = kwargs.get('tags', None) + self.content_type = kwargs.get('content_type', None) + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/secret_item_paged.py new file mode 100644 index 00000000000..3d119e697b5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class SecretItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`SecretItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SecretItem]'} + } + + def __init__(self, *args, **kwargs): + + super(SecretItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/secret_item_py3.py new file mode 100644 index 00000000000..0d79d6d2981 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_item_py3.py @@ -0,0 +1,58 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretItem(Model): + """The secret item containing secret metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Secret identifier. + :type id: str + :param attributes: The secret management attributes. + :type attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :ivar managed: True if the secret's lifetime is managed by key vault. If + this is a key backing a certificate, then managed will be true. + :vartype managed: bool + """ + + _validation = { + 'managed': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'managed': {'key': 'managed', 'type': 'bool'}, + } + + def __init__(self, *, id: str=None, attributes=None, tags=None, content_type: str=None, **kwargs) -> None: + super(SecretItem, self).__init__(**kwargs) + self.id = id + self.attributes = attributes + self.tags = tags + self.content_type = content_type + self.managed = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_properties.py b/src/keyvault/azext_keyvault/keyvault/models/secret_properties.py new file mode 100644 index 00000000000..dd37c6c293c --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_properties.py @@ -0,0 +1,34 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretProperties(Model): + """Properties of the key backing a certificate. + + :param content_type: The media type (MIME type). + :type content_type: str + """ + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecretProperties, self).__init__(**kwargs) + self.content_type = kwargs.get('content_type', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_properties_py3.py b/src/keyvault/azext_keyvault/keyvault/models/secret_properties_py3.py new file mode 100644 index 00000000000..17901ff363d --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_properties_py3.py @@ -0,0 +1,34 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretProperties(Model): + """Properties of the key backing a certificate. + + :param content_type: The media type (MIME type). + :type content_type: str + """ + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + } + + def __init__(self, *, content_type: str=None, **kwargs) -> None: + super(SecretProperties, self).__init__(**kwargs) + self.content_type = content_type diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters.py new file mode 100644 index 00000000000..d6b0f973a11 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretRestoreParameters(Model): + """The secret restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param secret_bundle_backup: Required. The backup blob associated with a + secret bundle. + :type secret_bundle_backup: bytes + """ + + _validation = { + 'secret_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'secret_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(SecretRestoreParameters, self).__init__(**kwargs) + self.secret_bundle_backup = kwargs.get('secret_bundle_backup', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters_py3.py new file mode 100644 index 00000000000..4c0039d1037 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_restore_parameters_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretRestoreParameters(Model): + """The secret restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param secret_bundle_backup: Required. The backup blob associated with a + secret bundle. + :type secret_bundle_backup: bytes + """ + + _validation = { + 'secret_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'secret_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, secret_bundle_backup: bytes, **kwargs) -> None: + super(SecretRestoreParameters, self).__init__(**kwargs) + self.secret_bundle_backup = secret_bundle_backup diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters.py new file mode 100644 index 00000000000..418adc3aab5 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters.py @@ -0,0 +1,52 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretSetParameters(Model): + """The secret set parameters. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + } + + def __init__(self, **kwargs): + super(SecretSetParameters, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.tags = kwargs.get('tags', None) + self.content_type = kwargs.get('content_type', None) + self.secret_attributes = kwargs.get('secret_attributes', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters_py3.py new file mode 100644 index 00000000000..befe4c2c347 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_set_parameters_py3.py @@ -0,0 +1,52 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretSetParameters(Model): + """The secret set parameters. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. The value of the secret. + :type value: str + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + } + + def __init__(self, *, value: str, tags=None, content_type: str=None, secret_attributes=None, **kwargs) -> None: + super(SecretSetParameters, self).__init__(**kwargs) + self.value = value + self.tags = tags + self.content_type = content_type + self.secret_attributes = secret_attributes diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters.py new file mode 100644 index 00000000000..506010cd5ec --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretUpdateParameters(Model): + """The secret update parameters. + + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(SecretUpdateParameters, self).__init__(**kwargs) + self.content_type = kwargs.get('content_type', None) + self.secret_attributes = kwargs.get('secret_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters_py3.py new file mode 100644 index 00000000000..21661bfa0f7 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/secret_update_parameters_py3.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SecretUpdateParameters(Model): + """The secret update parameters. + + :param content_type: Type of the secret value such as a password. + :type content_type: str + :param secret_attributes: The secret management attributes. + :type secret_attributes: ~azure.keyvault.models.SecretAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'content_type': {'key': 'contentType', 'type': 'str'}, + 'secret_attributes': {'key': 'attributes', 'type': 'SecretAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, content_type: str=None, secret_attributes=None, tags=None, **kwargs) -> None: + super(SecretUpdateParameters, self).__init__(**kwargs) + self.content_type = content_type + self.secret_attributes = secret_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes.py new file mode 100644 index 00000000000..1e4af6b3a45 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes.py @@ -0,0 +1,62 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountAttributes(Model): + """The storage account management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: the enabled state of the object. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for storage accounts in the current vault. If it contains + 'Purgeable' the storage account can be permanently deleted by a privileged + user; otherwise, only the system can purge the storage account, at the end + of the retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountAttributes, self).__init__(**kwargs) + self.enabled = kwargs.get('enabled', None) + self.created = None + self.updated = None + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes_py3.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes_py3.py new file mode 100644 index 00000000000..ce3a6cdebb3 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_attributes_py3.py @@ -0,0 +1,62 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountAttributes(Model): + """The storage account management attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param enabled: the enabled state of the object. + :type enabled: bool + :ivar created: Creation time in UTC. + :vartype created: datetime + :ivar updated: Last updated time in UTC. + :vartype updated: datetime + :ivar recovery_level: Reflects the deletion recovery level currently in + effect for storage accounts in the current vault. If it contains + 'Purgeable' the storage account can be permanently deleted by a privileged + user; otherwise, only the system can purge the storage account, at the end + of the retention interval. Possible values include: 'Purgeable', + 'Recoverable+Purgeable', 'Recoverable', + 'Recoverable+ProtectedSubscription' + :vartype recovery_level: str or + ~azure.keyvault.models.DeletionRecoveryLevel + """ + + _validation = { + 'created': {'readonly': True}, + 'updated': {'readonly': True}, + 'recovery_level': {'readonly': True}, + } + + _attribute_map = { + 'enabled': {'key': 'enabled', 'type': 'bool'}, + 'created': {'key': 'created', 'type': 'unix-time'}, + 'updated': {'key': 'updated', 'type': 'unix-time'}, + 'recovery_level': {'key': 'recoveryLevel', 'type': 'str'}, + } + + def __init__(self, *, enabled: bool=None, **kwargs) -> None: + super(StorageAccountAttributes, self).__init__(**kwargs) + self.enabled = enabled + self.created = None + self.updated = None + self.recovery_level = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters.py new file mode 100644 index 00000000000..c9f42c46ccf --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters.py @@ -0,0 +1,65 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The storage account create parameters. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Storage account resource id. + :type resource_id: str + :param active_key_name: Required. Current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: Required. whether keyvault should manage the + storage account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration specified + in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'resource_id': {'required': True}, + 'active_key_name': {'required': True}, + 'auto_regenerate_key': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'storage_account_attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.active_key_name = kwargs.get('active_key_name', None) + self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None) + self.regeneration_period = kwargs.get('regeneration_period', None) + self.storage_account_attributes = kwargs.get('storage_account_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters_py3.py new file mode 100644 index 00000000000..428228af926 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_create_parameters_py3.py @@ -0,0 +1,65 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountCreateParameters(Model): + """The storage account create parameters. + + All required parameters must be populated in order to send to Azure. + + :param resource_id: Required. Storage account resource id. + :type resource_id: str + :param active_key_name: Required. Current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: Required. whether keyvault should manage the + storage account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration specified + in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _validation = { + 'resource_id': {'required': True}, + 'active_key_name': {'required': True}, + 'auto_regenerate_key': {'required': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'storage_account_attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, resource_id: str, active_key_name: str, auto_regenerate_key: bool, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None: + super(StorageAccountCreateParameters, self).__init__(**kwargs) + self.resource_id = resource_id + self.active_key_name = active_key_name + self.auto_regenerate_key = auto_regenerate_key + self.regeneration_period = regeneration_period + self.storage_account_attributes = storage_account_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_item.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_item.py new file mode 100644 index 00000000000..5c68ea97b2f --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_item.py @@ -0,0 +1,56 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountItem(Model): + """The storage account item containing storage account metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Storage identifier. + :vartype id: str + :ivar resource_id: Storage account resource Id. + :vartype resource_id: str + :ivar attributes: The storage account management attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(StorageAccountItem, self).__init__(**kwargs) + self.id = None + self.resource_id = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_item_paged.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_item_paged.py new file mode 100644 index 00000000000..fd53acb7a08 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_item_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class StorageAccountItemPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccountItem ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccountItem]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountItemPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_item_py3.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_item_py3.py new file mode 100644 index 00000000000..a34fda83339 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_item_py3.py @@ -0,0 +1,56 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountItem(Model): + """The storage account item containing storage account metadata. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Storage identifier. + :vartype id: str + :ivar resource_id: Storage account resource Id. + :vartype resource_id: str + :ivar attributes: The storage account management attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs. + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageAccountItem, self).__init__(**kwargs) + self.id = None + self.resource_id = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters.py new file mode 100644 index 00000000000..1ff0cb428b3 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters.py @@ -0,0 +1,40 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerteKeyParameters(Model): + """The storage account key regenerate parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The storage account key name. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs) + self.key_name = kwargs.get('key_name', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters_py3.py new file mode 100644 index 00000000000..6768e82871b --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_regenerte_key_parameters_py3.py @@ -0,0 +1,40 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountRegenerteKeyParameters(Model): + """The storage account key regenerate parameters. + + All required parameters must be populated in order to send to Azure. + + :param key_name: Required. The storage account key name. + :type key_name: str + """ + + _validation = { + 'key_name': {'required': True}, + } + + _attribute_map = { + 'key_name': {'key': 'keyName', 'type': 'str'}, + } + + def __init__(self, *, key_name: str, **kwargs) -> None: + super(StorageAccountRegenerteKeyParameters, self).__init__(**kwargs) + self.key_name = key_name diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters.py new file mode 100644 index 00000000000..7904b5c6b77 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters.py @@ -0,0 +1,53 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The storage account update parameters. + + :param active_key_name: The current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration specified + in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'storage_account_attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.active_key_name = kwargs.get('active_key_name', None) + self.auto_regenerate_key = kwargs.get('auto_regenerate_key', None) + self.regeneration_period = kwargs.get('regeneration_period', None) + self.storage_account_attributes = kwargs.get('storage_account_attributes', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters_py3.py new file mode 100644 index 00000000000..f5c86e8eed1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_account_update_parameters_py3.py @@ -0,0 +1,53 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageAccountUpdateParameters(Model): + """The storage account update parameters. + + :param active_key_name: The current active storage account key name. + :type active_key_name: str + :param auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :type auto_regenerate_key: bool + :param regeneration_period: The key regeneration time duration specified + in ISO-8601 format. + :type regeneration_period: str + :param storage_account_attributes: The attributes of the storage account. + :type storage_account_attributes: + ~azure.keyvault.models.StorageAccountAttributes + :param tags: Application specific metadata in the form of key-value pairs. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'storage_account_attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, active_key_name: str=None, auto_regenerate_key: bool=None, regeneration_period: str=None, storage_account_attributes=None, tags=None, **kwargs) -> None: + super(StorageAccountUpdateParameters, self).__init__(**kwargs) + self.active_key_name = active_key_name + self.auto_regenerate_key = auto_regenerate_key + self.regeneration_period = regeneration_period + self.storage_account_attributes = storage_account_attributes + self.tags = tags diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_bundle.py b/src/keyvault/azext_keyvault/keyvault/models/storage_bundle.py new file mode 100644 index 00000000000..5c5db024cea --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_bundle.py @@ -0,0 +1,74 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageBundle(Model): + """A Storage account bundle consists of key vault storage account details plus + its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage account id. + :vartype id: str + :ivar resource_id: The storage account resource id. + :vartype resource_id: str + :ivar active_key_name: The current active storage account key name. + :vartype active_key_name: str + :ivar auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :vartype auto_regenerate_key: bool + :ivar regeneration_period: The key regeneration time duration specified in + ISO-8601 format. + :vartype regeneration_period: str + :ivar attributes: The storage account attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'active_key_name': {'readonly': True}, + 'auto_regenerate_key': {'readonly': True}, + 'regeneration_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(StorageBundle, self).__init__(**kwargs) + self.id = None + self.resource_id = None + self.active_key_name = None + self.auto_regenerate_key = None + self.regeneration_period = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_bundle_py3.py b/src/keyvault/azext_keyvault/keyvault/models/storage_bundle_py3.py new file mode 100644 index 00000000000..0a0e483c043 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_bundle_py3.py @@ -0,0 +1,74 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageBundle(Model): + """A Storage account bundle consists of key vault storage account details plus + its attributes. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The storage account id. + :vartype id: str + :ivar resource_id: The storage account resource id. + :vartype resource_id: str + :ivar active_key_name: The current active storage account key name. + :vartype active_key_name: str + :ivar auto_regenerate_key: whether keyvault should manage the storage + account for the user. + :vartype auto_regenerate_key: bool + :ivar regeneration_period: The key regeneration time duration specified in + ISO-8601 format. + :vartype regeneration_period: str + :ivar attributes: The storage account attributes. + :vartype attributes: ~azure.keyvault.models.StorageAccountAttributes + :ivar tags: Application specific metadata in the form of key-value pairs + :vartype tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'resource_id': {'readonly': True}, + 'active_key_name': {'readonly': True}, + 'auto_regenerate_key': {'readonly': True}, + 'regeneration_period': {'readonly': True}, + 'attributes': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'active_key_name': {'key': 'activeKeyName', 'type': 'str'}, + 'auto_regenerate_key': {'key': 'autoRegenerateKey', 'type': 'bool'}, + 'regeneration_period': {'key': 'regenerationPeriod', 'type': 'str'}, + 'attributes': {'key': 'attributes', 'type': 'StorageAccountAttributes'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(StorageBundle, self).__init__(**kwargs) + self.id = None + self.resource_id = None + self.active_key_name = None + self.auto_regenerate_key = None + self.regeneration_period = None + self.attributes = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters.py b/src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters.py new file mode 100644 index 00000000000..91defac97b9 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageRestoreParameters(Model): + """The secret restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param storage_bundle_backup: Required. The backup blob associated with a + storage account. + :type storage_bundle_backup: bytes + """ + + _validation = { + 'storage_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'storage_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, **kwargs): + super(StorageRestoreParameters, self).__init__(**kwargs) + self.storage_bundle_backup = kwargs.get('storage_bundle_backup', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters_py3.py b/src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters_py3.py new file mode 100644 index 00000000000..9db9bc21ede --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/storage_restore_parameters_py3.py @@ -0,0 +1,41 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class StorageRestoreParameters(Model): + """The secret restore parameters. + + All required parameters must be populated in order to send to Azure. + + :param storage_bundle_backup: Required. The backup blob associated with a + storage account. + :type storage_bundle_backup: bytes + """ + + _validation = { + 'storage_bundle_backup': {'required': True}, + } + + _attribute_map = { + 'storage_bundle_backup': {'key': 'value', 'type': 'base64'}, + } + + def __init__(self, *, storage_bundle_backup: bytes, **kwargs) -> None: + super(StorageRestoreParameters, self).__init__(**kwargs) + self.storage_bundle_backup = storage_bundle_backup diff --git a/src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names.py b/src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names.py new file mode 100644 index 00000000000..d94902fe02b --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubjectAlternativeNames(Model): + """The subject alternate names of a X509 object. + + :param emails: Email addresses. + :type emails: list[str] + :param dns_names: Domain names. + :type dns_names: list[str] + :param upns: User principal names. + :type upns: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + 'dns_names': {'key': 'dns_names', 'type': '[str]'}, + 'upns': {'key': 'upns', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SubjectAlternativeNames, self).__init__(**kwargs) + self.emails = kwargs.get('emails', None) + self.dns_names = kwargs.get('dns_names', None) + self.upns = kwargs.get('upns', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names_py3.py b/src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names_py3.py new file mode 100644 index 00000000000..ad3ff6461d0 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/subject_alternative_names_py3.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class SubjectAlternativeNames(Model): + """The subject alternate names of a X509 object. + + :param emails: Email addresses. + :type emails: list[str] + :param dns_names: Domain names. + :type dns_names: list[str] + :param upns: User principal names. + :type upns: list[str] + """ + + _attribute_map = { + 'emails': {'key': 'emails', 'type': '[str]'}, + 'dns_names': {'key': 'dns_names', 'type': '[str]'}, + 'upns': {'key': 'upns', 'type': '[str]'}, + } + + def __init__(self, *, emails=None, dns_names=None, upns=None, **kwargs) -> None: + super(SubjectAlternativeNames, self).__init__(**kwargs) + self.emails = emails + self.dns_names = dns_names + self.upns = upns diff --git a/src/keyvault/azext_keyvault/keyvault/models/trigger.py b/src/keyvault/azext_keyvault/keyvault/models/trigger.py new file mode 100644 index 00000000000..7221468d534 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/trigger.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Trigger(Model): + """A condition to be satisfied for an action to be executed. + + :param lifetime_percentage: Percentage of lifetime at which to trigger. + Value should be between 1 and 99. + :type lifetime_percentage: int + :param days_before_expiry: Days before expiry to attempt renewal. Value + should be between 1 and validity_in_months multiplied by 27. If + validity_in_months is 36, then value should be between 1 and 972 (36 * + 27). + :type days_before_expiry: int + """ + + _validation = { + 'lifetime_percentage': {'maximum': 99, 'minimum': 1}, + } + + _attribute_map = { + 'lifetime_percentage': {'key': 'lifetime_percentage', 'type': 'int'}, + 'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Trigger, self).__init__(**kwargs) + self.lifetime_percentage = kwargs.get('lifetime_percentage', None) + self.days_before_expiry = kwargs.get('days_before_expiry', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/trigger_py3.py b/src/keyvault/azext_keyvault/keyvault/models/trigger_py3.py new file mode 100644 index 00000000000..4bd76cfb7e3 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/trigger_py3.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Trigger(Model): + """A condition to be satisfied for an action to be executed. + + :param lifetime_percentage: Percentage of lifetime at which to trigger. + Value should be between 1 and 99. + :type lifetime_percentage: int + :param days_before_expiry: Days before expiry to attempt renewal. Value + should be between 1 and validity_in_months multiplied by 27. If + validity_in_months is 36, then value should be between 1 and 972 (36 * + 27). + :type days_before_expiry: int + """ + + _validation = { + 'lifetime_percentage': {'maximum': 99, 'minimum': 1}, + } + + _attribute_map = { + 'lifetime_percentage': {'key': 'lifetime_percentage', 'type': 'int'}, + 'days_before_expiry': {'key': 'days_before_expiry', 'type': 'int'}, + } + + def __init__(self, *, lifetime_percentage: int=None, days_before_expiry: int=None, **kwargs) -> None: + super(Trigger, self).__init__(**kwargs) + self.lifetime_percentage = lifetime_percentage + self.days_before_expiry = days_before_expiry diff --git a/src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties.py b/src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties.py new file mode 100644 index 00000000000..7c48e0d55c1 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties.py @@ -0,0 +1,57 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class X509CertificateProperties(Model): + """Properties of the X509 component of a certificate. + + :param subject: The subject name. Should be a valid X509 distinguished + Name. + :type subject: str + :param ekus: The enhanced key usage. + :type ekus: list[str] + :param subject_alternative_names: The subject alternative names. + :type subject_alternative_names: + ~azure.keyvault.models.SubjectAlternativeNames + :param key_usage: List of key usages. + :type key_usage: list[str or ~azure.keyvault.models.KeyUsageType] + :param validity_in_months: The duration that the ceritifcate is valid in + months. + :type validity_in_months: int + """ + + _validation = { + 'validity_in_months': {'minimum': 0}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'ekus': {'key': 'ekus', 'type': '[str]'}, + 'subject_alternative_names': {'key': 'sans', 'type': 'SubjectAlternativeNames'}, + 'key_usage': {'key': 'key_usage', 'type': '[str]'}, + 'validity_in_months': {'key': 'validity_months', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(X509CertificateProperties, self).__init__(**kwargs) + self.subject = kwargs.get('subject', None) + self.ekus = kwargs.get('ekus', None) + self.subject_alternative_names = kwargs.get('subject_alternative_names', None) + self.key_usage = kwargs.get('key_usage', None) + self.validity_in_months = kwargs.get('validity_in_months', None) diff --git a/src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties_py3.py b/src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties_py3.py new file mode 100644 index 00000000000..86696f5a751 --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/models/x509_certificate_properties_py3.py @@ -0,0 +1,57 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class X509CertificateProperties(Model): + """Properties of the X509 component of a certificate. + + :param subject: The subject name. Should be a valid X509 distinguished + Name. + :type subject: str + :param ekus: The enhanced key usage. + :type ekus: list[str] + :param subject_alternative_names: The subject alternative names. + :type subject_alternative_names: + ~azure.keyvault.models.SubjectAlternativeNames + :param key_usage: List of key usages. + :type key_usage: list[str or ~azure.keyvault.models.KeyUsageType] + :param validity_in_months: The duration that the ceritifcate is valid in + months. + :type validity_in_months: int + """ + + _validation = { + 'validity_in_months': {'minimum': 0}, + } + + _attribute_map = { + 'subject': {'key': 'subject', 'type': 'str'}, + 'ekus': {'key': 'ekus', 'type': '[str]'}, + 'subject_alternative_names': {'key': 'sans', 'type': 'SubjectAlternativeNames'}, + 'key_usage': {'key': 'key_usage', 'type': '[str]'}, + 'validity_in_months': {'key': 'validity_months', 'type': 'int'}, + } + + def __init__(self, *, subject: str=None, ekus=None, subject_alternative_names=None, key_usage=None, validity_in_months: int=None, **kwargs) -> None: + super(X509CertificateProperties, self).__init__(**kwargs) + self.subject = subject + self.ekus = ekus + self.subject_alternative_names = subject_alternative_names + self.key_usage = key_usage + self.validity_in_months = validity_in_months diff --git a/src/keyvault/azext_keyvault/keyvault/version.py b/src/keyvault/azext_keyvault/keyvault/version.py new file mode 100644 index 00000000000..382eba7481e --- /dev/null +++ b/src/keyvault/azext_keyvault/keyvault/version.py @@ -0,0 +1,19 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" + diff --git a/src/keyvault/azext_keyvault/mgmt/__init__.py b/src/keyvault/azext_keyvault/mgmt/__init__.py new file mode 100644 index 00000000000..dc20c81b47b --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/__init__.py @@ -0,0 +1,7 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +__import__('pkg_resources').declare_namespace(__name__) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/__init__.py b/src/keyvault/azext_keyvault/mgmt/keyvault/__init__.py new file mode 100644 index 00000000000..95a6781034d --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/__init__.py @@ -0,0 +1,24 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .key_vault_management_client import KeyVaultManagementClient +from .version import VERSION + +__all__ = ['KeyVaultManagementClient'] + +__version__ = VERSION + diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/key_vault_management_client.py b/src/keyvault/azext_keyvault/mgmt/keyvault/key_vault_management_client.py new file mode 100644 index 00000000000..43f49ec2a67 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/key_vault_management_client.py @@ -0,0 +1,96 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.service_client import ServiceClient +from msrest import Serializer, Deserializer +from msrestazure import AzureConfiguration +from .version import VERSION +from .operations.vaults_operations import VaultsOperations +from .operations.operations import Operations +from . import models + + +class KeyVaultManagementClientConfiguration(AzureConfiguration): + """Configuration for KeyVaultManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(KeyVaultManagementClientConfiguration, self).__init__(base_url) + + self.add_user_agent('azure-mgmt-keyvault/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id + + +class KeyVaultManagementClient(object): + """The Azure management API provides a RESTful set of web services that interact with Azure Key Vault. + + :ivar config: Configuration for client. + :vartype config: KeyVaultManagementClientConfiguration + + :ivar vaults: Vaults operations + :vartype vaults: azure.mgmt.keyvault.operations.VaultsOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.keyvault.operations.Operations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: Subscription credentials which uniquely identify + Microsoft Azure subscription. The subscription ID forms part of the URI + for every service call. + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = KeyVaultManagementClientConfiguration(credentials, subscription_id, base_url) + self._client = ServiceClient(self.config.credentials, self.config) + + client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2018-02-14-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.vaults = VaultsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/__init__.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/__init__.py new file mode 100644 index 00000000000..c3b6d8f0f1a --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/__init__.py @@ -0,0 +1,118 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +try: + from .sku_py3 import Sku + from .permissions_py3 import Permissions + from .access_policy_entry_py3 import AccessPolicyEntry + from .ip_rule_py3 import IPRule + from .virtual_network_rule_py3 import VirtualNetworkRule + from .network_rule_set_py3 import NetworkRuleSet + from .vault_properties_py3 import VaultProperties + from .vault_patch_properties_py3 import VaultPatchProperties + from .vault_access_policy_properties_py3 import VaultAccessPolicyProperties + from .deleted_vault_properties_py3 import DeletedVaultProperties + from .vault_create_or_update_parameters_py3 import VaultCreateOrUpdateParameters + from .vault_patch_parameters_py3 import VaultPatchParameters + from .vault_access_policy_parameters_py3 import VaultAccessPolicyParameters + from .vault_py3 import Vault + from .deleted_vault_py3 import DeletedVault + from .resource_py3 import Resource + from .vault_check_name_availability_parameters_py3 import VaultCheckNameAvailabilityParameters + from .check_name_availability_result_py3 import CheckNameAvailabilityResult + from .operation_display_py3 import OperationDisplay + from .log_specification_py3 import LogSpecification + from .service_specification_py3 import ServiceSpecification + from .operation_py3 import Operation +except (SyntaxError, ImportError): + from .sku import Sku + from .permissions import Permissions + from .access_policy_entry import AccessPolicyEntry + from .ip_rule import IPRule + from .virtual_network_rule import VirtualNetworkRule + from .network_rule_set import NetworkRuleSet + from .vault_properties import VaultProperties + from .vault_patch_properties import VaultPatchProperties + from .vault_access_policy_properties import VaultAccessPolicyProperties + from .deleted_vault_properties import DeletedVaultProperties + from .vault_create_or_update_parameters import VaultCreateOrUpdateParameters + from .vault_patch_parameters import VaultPatchParameters + from .vault_access_policy_parameters import VaultAccessPolicyParameters + from .vault import Vault + from .deleted_vault import DeletedVault + from .resource import Resource + from .vault_check_name_availability_parameters import VaultCheckNameAvailabilityParameters + from .check_name_availability_result import CheckNameAvailabilityResult + from .operation_display import OperationDisplay + from .log_specification import LogSpecification + from .service_specification import ServiceSpecification + from .operation import Operation +from .vault_paged import VaultPaged +from .deleted_vault_paged import DeletedVaultPaged +from .resource_paged import ResourcePaged +from .operation_paged import OperationPaged +from .key_vault_management_client_enums import ( + SkuName, + KeyPermissions, + SecretPermissions, + CertificatePermissions, + StoragePermissions, + CreateMode, + NetworkRuleBypassOptions, + NetworkRuleAction, + Reason, + AccessPolicyUpdateKind, +) + +__all__ = [ + 'Sku', + 'Permissions', + 'AccessPolicyEntry', + 'IPRule', + 'VirtualNetworkRule', + 'NetworkRuleSet', + 'VaultProperties', + 'VaultPatchProperties', + 'VaultAccessPolicyProperties', + 'DeletedVaultProperties', + 'VaultCreateOrUpdateParameters', + 'VaultPatchParameters', + 'VaultAccessPolicyParameters', + 'Vault', + 'DeletedVault', + 'Resource', + 'VaultCheckNameAvailabilityParameters', + 'CheckNameAvailabilityResult', + 'OperationDisplay', + 'LogSpecification', + 'ServiceSpecification', + 'Operation', + 'VaultPaged', + 'DeletedVaultPaged', + 'ResourcePaged', + 'OperationPaged', + 'SkuName', + 'KeyPermissions', + 'SecretPermissions', + 'CertificatePermissions', + 'StoragePermissions', + 'CreateMode', + 'NetworkRuleBypassOptions', + 'NetworkRuleAction', + 'Reason', + 'AccessPolicyUpdateKind', +] diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry.py new file mode 100644 index 00000000000..e1b461bb56d --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry.py @@ -0,0 +1,60 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccessPolicyEntry(Model): + """An identity that have access to the key vault. All identities in the array + must use the same tenant ID as the key vault's tenant ID. + + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. + :type tenant_id: str + :param object_id: Required. The object ID of a user, service principal or + security group in the Azure Active Directory tenant for the vault. The + object ID must be unique for the list of access policies. + :type object_id: str + :param application_id: Application ID of the client making request on + behalf of a principal + :type application_id: str + :param permissions: Required. Permissions the identity has for keys, + secrets and certificates. + :type permissions: ~azure.mgmt.keyvault.models.Permissions + """ + + _validation = { + 'tenant_id': {'required': True}, + 'object_id': {'required': True}, + 'permissions': {'required': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'Permissions'}, + } + + def __init__(self, **kwargs): + super(AccessPolicyEntry, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.object_id = kwargs.get('object_id', None) + self.application_id = kwargs.get('application_id', None) + self.permissions = kwargs.get('permissions', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry_py3.py new file mode 100644 index 00000000000..5fd7d3ffdce --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/access_policy_entry_py3.py @@ -0,0 +1,60 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AccessPolicyEntry(Model): + """An identity that have access to the key vault. All identities in the array + must use the same tenant ID as the key vault's tenant ID. + + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. + :type tenant_id: str + :param object_id: Required. The object ID of a user, service principal or + security group in the Azure Active Directory tenant for the vault. The + object ID must be unique for the list of access policies. + :type object_id: str + :param application_id: Application ID of the client making request on + behalf of a principal + :type application_id: str + :param permissions: Required. Permissions the identity has for keys, + secrets and certificates. + :type permissions: ~azure.mgmt.keyvault.models.Permissions + """ + + _validation = { + 'tenant_id': {'required': True}, + 'object_id': {'required': True}, + 'permissions': {'required': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'object_id': {'key': 'objectId', 'type': 'str'}, + 'application_id': {'key': 'applicationId', 'type': 'str'}, + 'permissions': {'key': 'permissions', 'type': 'Permissions'}, + } + + def __init__(self, *, tenant_id: str, object_id: str, permissions, application_id: str=None, **kwargs) -> None: + super(AccessPolicyEntry, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.object_id = object_id + self.application_id = application_id + self.permissions = permissions diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result.py new file mode 100644 index 00000000000..7c64892ca4b --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result.py @@ -0,0 +1,56 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: A boolean value that indicates whether the name is + available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: The reason that a vault name could not be used. The Reason + element is only returned if NameAvailable is false. Possible values + include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.keyvault.models.Reason + :ivar message: An error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result_py3.py new file mode 100644 index 00000000000..c382f9b4e5e --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/check_name_availability_result_py3.py @@ -0,0 +1,56 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CheckNameAvailabilityResult(Model): + """The CheckNameAvailability operation response. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name_available: A boolean value that indicates whether the name is + available for you to use. If true, the name is available. If false, the + name has already been taken or is invalid and cannot be used. + :vartype name_available: bool + :ivar reason: The reason that a vault name could not be used. The Reason + element is only returned if NameAvailable is false. Possible values + include: 'AccountNameInvalid', 'AlreadyExists' + :vartype reason: str or ~azure.mgmt.keyvault.models.Reason + :ivar message: An error message explaining the Reason value in more + detail. + :vartype message: str + """ + + _validation = { + 'name_available': {'readonly': True}, + 'reason': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'name_available': {'key': 'nameAvailable', 'type': 'bool'}, + 'reason': {'key': 'reason', 'type': 'Reason'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(CheckNameAvailabilityResult, self).__init__(**kwargs) + self.name_available = None + self.reason = None + self.message = None diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault.py new file mode 100644 index 00000000000..a262ed66d11 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault.py @@ -0,0 +1,55 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeletedVault(Model): + """Deleted vault information with extended details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID for the deleted key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.DeletedVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeletedVaultProperties'}, + } + + def __init__(self, **kwargs): + super(DeletedVault, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_paged.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_paged.py new file mode 100644 index 00000000000..e0c3388d9bf --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class DeletedVaultPaged(Paged): + """ + A paging container for iterating over a list of :class:`DeletedVault ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DeletedVault]'} + } + + def __init__(self, *args, **kwargs): + + super(DeletedVaultPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties.py new file mode 100644 index 00000000000..b357b314994 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties.py @@ -0,0 +1,61 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeletedVaultProperties(Model): + """Properties of the deleted vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar vault_id: The resource id of the original vault. + :vartype vault_id: str + :ivar location: The location of the original vault. + :vartype location: str + :ivar deletion_date: The deleted date. + :vartype deletion_date: datetime + :ivar scheduled_purge_date: The scheduled purged date. + :vartype scheduled_purge_date: datetime + :ivar tags: Tags of the original vault. + :vartype tags: dict[str, str] + """ + + _validation = { + 'vault_id': {'readonly': True}, + 'location': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DeletedVaultProperties, self).__init__(**kwargs) + self.vault_id = None + self.location = None + self.deletion_date = None + self.scheduled_purge_date = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties_py3.py new file mode 100644 index 00000000000..31713b63c4a --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_properties_py3.py @@ -0,0 +1,61 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeletedVaultProperties(Model): + """Properties of the deleted vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar vault_id: The resource id of the original vault. + :vartype vault_id: str + :ivar location: The location of the original vault. + :vartype location: str + :ivar deletion_date: The deleted date. + :vartype deletion_date: datetime + :ivar scheduled_purge_date: The scheduled purged date. + :vartype scheduled_purge_date: datetime + :ivar tags: Tags of the original vault. + :vartype tags: dict[str, str] + """ + + _validation = { + 'vault_id': {'readonly': True}, + 'location': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'scheduled_purge_date': {'readonly': True}, + 'tags': {'readonly': True}, + } + + _attribute_map = { + 'vault_id': {'key': 'vaultId', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'deletion_date': {'key': 'deletionDate', 'type': 'iso-8601'}, + 'scheduled_purge_date': {'key': 'scheduledPurgeDate', 'type': 'iso-8601'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs) -> None: + super(DeletedVaultProperties, self).__init__(**kwargs) + self.vault_id = None + self.location = None + self.deletion_date = None + self.scheduled_purge_date = None + self.tags = None diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_py3.py new file mode 100644 index 00000000000..14e166d0e90 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/deleted_vault_py3.py @@ -0,0 +1,55 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class DeletedVault(Model): + """Deleted vault information with extended details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID for the deleted key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.DeletedVaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DeletedVaultProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(DeletedVault, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule.py new file mode 100644 index 00000000000..e5f9c356b55 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPRule(Model): + """A rule governing the accesibility of a vault from a specific ip address or + ip range. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as + '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that + start with 124.56.78). + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(IPRule, self).__init__(**kwargs) + self.value = kwargs.get('value', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule_py3.py new file mode 100644 index 00000000000..b832e4ade4d --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/ip_rule_py3.py @@ -0,0 +1,43 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class IPRule(Model): + """A rule governing the accesibility of a vault from a specific ip address or + ip range. + + All required parameters must be populated in order to send to Azure. + + :param value: Required. An IPv4 address range in CIDR notation, such as + '124.56.78.91' (simple IP address) or '124.56.78.0/24' (all addresses that + start with 124.56.78). + :type value: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': 'str'}, + } + + def __init__(self, *, value: str, **kwargs) -> None: + super(IPRule, self).__init__(**kwargs) + self.value = value diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/key_vault_management_client_enums.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/key_vault_management_client_enums.py new file mode 100644 index 00000000000..1cf041eb31a --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/key_vault_management_client_enums.py @@ -0,0 +1,125 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class SkuName(str, Enum): + + standard = "standard" + premium = "premium" + + +class KeyPermissions(str, Enum): + + encrypt = "encrypt" + decrypt = "decrypt" + wrap_key = "wrapKey" + unwrap_key = "unwrapKey" + sign = "sign" + verify = "verify" + get = "get" + list = "list" + create = "create" + update = "update" + import_enum = "import" + delete = "delete" + backup = "backup" + restore = "restore" + recover = "recover" + purge = "purge" + + +class SecretPermissions(str, Enum): + + get = "get" + list = "list" + set = "set" + delete = "delete" + backup = "backup" + restore = "restore" + recover = "recover" + purge = "purge" + + +class CertificatePermissions(str, Enum): + + get = "get" + list = "list" + delete = "delete" + create = "create" + import_enum = "import" + update = "update" + managecontacts = "managecontacts" + getissuers = "getissuers" + listissuers = "listissuers" + setissuers = "setissuers" + deleteissuers = "deleteissuers" + manageissuers = "manageissuers" + recover = "recover" + purge = "purge" + backup = "backup" + restore = "restore" + + +class StoragePermissions(str, Enum): + + get = "get" + list = "list" + delete = "delete" + set = "set" + update = "update" + regeneratekey = "regeneratekey" + recover = "recover" + purge = "purge" + backup = "backup" + restore = "restore" + setsas = "setsas" + listsas = "listsas" + getsas = "getsas" + deletesas = "deletesas" + + +class CreateMode(str, Enum): + + recover = "recover" + default = "default" + + +class NetworkRuleBypassOptions(str, Enum): + + azure_services = "AzureServices" + none = "None" + + +class NetworkRuleAction(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class Reason(str, Enum): + + account_name_invalid = "AccountNameInvalid" + already_exists = "AlreadyExists" + + +class AccessPolicyUpdateKind(str, Enum): + + add = "add" + replace = "replace" + remove = "remove" diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification.py new file mode 100644 index 00000000000..4811dfbfdd7 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogSpecification(Model): + """Log specification of operation. + + :param name: Name of log specification. + :type name: str + :param display_name: Display name of log specification. + :type display_name: str + :param blob_duration: Blob duration of specification. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LogSpecification, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display_name = kwargs.get('display_name', None) + self.blob_duration = kwargs.get('blob_duration', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification_py3.py new file mode 100644 index 00000000000..b519d30e4bb --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/log_specification_py3.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class LogSpecification(Model): + """Log specification of operation. + + :param name: Name of log specification. + :type name: str + :param display_name: Display name of log specification. + :type display_name: str + :param blob_duration: Blob duration of specification. + :type blob_duration: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'blob_duration': {'key': 'blobDuration', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, display_name: str=None, blob_duration: str=None, **kwargs) -> None: + super(LogSpecification, self).__init__(**kwargs) + self.name = name + self.display_name = display_name + self.blob_duration = blob_duration diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set.py new file mode 100644 index 00000000000..5c881660cb4 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set.py @@ -0,0 +1,51 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkRuleSet(Model): + """A set of rules governing the network accessibility of a vault. + + :param bypass: Tells what traffic can bypass network rules. This can be + 'AzureServices' or 'None'. If not specified the default is + 'AzureServices'. Possible values include: 'AzureServices', 'None' + :type bypass: str or ~azure.mgmt.keyvault.models.NetworkRuleBypassOptions + :param default_action: The default action when no rule from ipRules and + from virtualNetworkRules match. This is only used after the bypass + property has been evaluated. Possible values include: 'Allow', 'Deny' + :type default_action: str or ~azure.mgmt.keyvault.models.NetworkRuleAction + :param ip_rules: The list of IP address rules. + :type ip_rules: list[~azure.mgmt.keyvault.models.IPRule] + :param virtual_network_rules: The list of virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.keyvault.models.VirtualNetworkRule] + """ + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = kwargs.get('bypass', None) + self.default_action = kwargs.get('default_action', None) + self.ip_rules = kwargs.get('ip_rules', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set_py3.py new file mode 100644 index 00000000000..bc426381c6d --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/network_rule_set_py3.py @@ -0,0 +1,51 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class NetworkRuleSet(Model): + """A set of rules governing the network accessibility of a vault. + + :param bypass: Tells what traffic can bypass network rules. This can be + 'AzureServices' or 'None'. If not specified the default is + 'AzureServices'. Possible values include: 'AzureServices', 'None' + :type bypass: str or ~azure.mgmt.keyvault.models.NetworkRuleBypassOptions + :param default_action: The default action when no rule from ipRules and + from virtualNetworkRules match. This is only used after the bypass + property has been evaluated. Possible values include: 'Allow', 'Deny' + :type default_action: str or ~azure.mgmt.keyvault.models.NetworkRuleAction + :param ip_rules: The list of IP address rules. + :type ip_rules: list[~azure.mgmt.keyvault.models.IPRule] + :param virtual_network_rules: The list of virtual network rules. + :type virtual_network_rules: + list[~azure.mgmt.keyvault.models.VirtualNetworkRule] + """ + + _attribute_map = { + 'bypass': {'key': 'bypass', 'type': 'str'}, + 'default_action': {'key': 'defaultAction', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IPRule]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + } + + def __init__(self, *, bypass=None, default_action=None, ip_rules=None, virtual_network_rules=None, **kwargs) -> None: + super(NetworkRuleSet, self).__init__(**kwargs) + self.bypass = bypass + self.default_action = default_action + self.ip_rules = ip_rules + self.virtual_network_rules = virtual_network_rules diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation.py new file mode 100644 index 00000000000..270a7795d42 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation.py @@ -0,0 +1,48 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Key Vault REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.keyvault.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.keyvault.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, **kwargs): + super(Operation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.service_specification = kwargs.get('service_specification', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display.py new file mode 100644 index 00000000000..d035bf58b64 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Key Vault. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Decription of operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display_py3.py new file mode 100644 index 00000000000..aac1e7a1755 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_display_py3.py @@ -0,0 +1,46 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class OperationDisplay(Model): + """Display metadata associated with the operation. + + :param provider: Service provider: Microsoft Key Vault. + :type provider: str + :param resource: Resource on which the operation is performed etc. + :type resource: str + :param operation: Type of operation: get, read, delete, etc. + :type operation: str + :param description: Decription of operation. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(OperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_paged.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_paged.py new file mode 100644 index 00000000000..eac9d934148 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class OperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`Operation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Operation]'} + } + + def __init__(self, *args, **kwargs): + + super(OperationPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_py3.py new file mode 100644 index 00000000000..21490193940 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/operation_py3.py @@ -0,0 +1,48 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Operation(Model): + """Key Vault REST API operation definition. + + :param name: Operation name: {provider}/{resource}/{operation} + :type name: str + :param display: Display metadata associated with the operation. + :type display: ~azure.mgmt.keyvault.models.OperationDisplay + :param origin: The origin of operations. + :type origin: str + :param service_specification: One property of operation, include metric + specifications. + :type service_specification: + ~azure.mgmt.keyvault.models.ServiceSpecification + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'service_specification': {'key': 'properties.serviceSpecification', 'type': 'ServiceSpecification'}, + } + + def __init__(self, *, name: str=None, display=None, origin: str=None, service_specification=None, **kwargs) -> None: + super(Operation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.service_specification = service_specification diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions.py new file mode 100644 index 00000000000..07d7a5374d2 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Permissions(Model): + """Permissions the identity has for keys, secrets, certificates and storage. + + :param keys: Permissions to keys + :type keys: list[str or ~azure.mgmt.keyvault.models.KeyPermissions] + :param secrets: Permissions to secrets + :type secrets: list[str or ~azure.mgmt.keyvault.models.SecretPermissions] + :param certificates: Permissions to certificates + :type certificates: list[str or + ~azure.mgmt.keyvault.models.CertificatePermissions] + :param storage: Permissions to storage accounts + :type storage: list[str or ~azure.mgmt.keyvault.models.StoragePermissions] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[str]'}, + 'secrets': {'key': 'secrets', 'type': '[str]'}, + 'certificates': {'key': 'certificates', 'type': '[str]'}, + 'storage': {'key': 'storage', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(Permissions, self).__init__(**kwargs) + self.keys = kwargs.get('keys', None) + self.secrets = kwargs.get('secrets', None) + self.certificates = kwargs.get('certificates', None) + self.storage = kwargs.get('storage', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions_py3.py new file mode 100644 index 00000000000..ad1db40b39d --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/permissions_py3.py @@ -0,0 +1,47 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Permissions(Model): + """Permissions the identity has for keys, secrets, certificates and storage. + + :param keys: Permissions to keys + :type keys: list[str or ~azure.mgmt.keyvault.models.KeyPermissions] + :param secrets: Permissions to secrets + :type secrets: list[str or ~azure.mgmt.keyvault.models.SecretPermissions] + :param certificates: Permissions to certificates + :type certificates: list[str or + ~azure.mgmt.keyvault.models.CertificatePermissions] + :param storage: Permissions to storage accounts + :type storage: list[str or ~azure.mgmt.keyvault.models.StoragePermissions] + """ + + _attribute_map = { + 'keys': {'key': 'keys', 'type': '[str]'}, + 'secrets': {'key': 'secrets', 'type': '[str]'}, + 'certificates': {'key': 'certificates', 'type': '[str]'}, + 'storage': {'key': 'storage', 'type': '[str]'}, + } + + def __init__(self, *, keys=None, secrets=None, certificates=None, storage=None, **kwargs) -> None: + super(Permissions, self).__init__(**kwargs) + self.keys = keys + self.secrets = secrets + self.certificates = certificates + self.storage = storage diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource.py new file mode 100644 index 00000000000..f11a03d4d8b --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Key Vault resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_paged.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_paged.py new file mode 100644 index 00000000000..90acee799c1 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`Resource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Resource]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourcePaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_py3.py new file mode 100644 index 00000000000..758a82e7603 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/resource_py3.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Resource(Model): + """Key Vault resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification.py new file mode 100644 index 00000000000..19a8b6e19f9 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification.py @@ -0,0 +1,35 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include log specifications. + + :param log_specifications: Log specifications of operation. + :type log_specifications: + list[~azure.mgmt.keyvault.models.LogSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, **kwargs): + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = kwargs.get('log_specifications', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification_py3.py new file mode 100644 index 00000000000..19f30aa5422 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/service_specification_py3.py @@ -0,0 +1,35 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ServiceSpecification(Model): + """One property of operation, include log specifications. + + :param log_specifications: Log specifications of operation. + :type log_specifications: + list[~azure.mgmt.keyvault.models.LogSpecification] + """ + + _attribute_map = { + 'log_specifications': {'key': 'logSpecifications', 'type': '[LogSpecification]'}, + } + + def __init__(self, *, log_specifications=None, **kwargs) -> None: + super(ServiceSpecification, self).__init__(**kwargs) + self.log_specifications = log_specifications diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/sku.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/sku.py new file mode 100644 index 00000000000..ce01c99d6d4 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/sku.py @@ -0,0 +1,51 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar family: Required. SKU family name. Default value: "A" . + :vartype family: str + :param name: Required. SKU name to specify whether the key vault is a + standard vault or a premium vault. Possible values include: 'standard', + 'premium' + :type name: str or ~azure.mgmt.keyvault.models.SkuName + """ + + _validation = { + 'family': {'required': True, 'constant': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'SkuName'}, + } + + family = "A" + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/sku_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/sku_py3.py new file mode 100644 index 00000000000..a3dea94c6bc --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/sku_py3.py @@ -0,0 +1,51 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class Sku(Model): + """SKU details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar family: Required. SKU family name. Default value: "A" . + :vartype family: str + :param name: Required. SKU name to specify whether the key vault is a + standard vault or a premium vault. Possible values include: 'standard', + 'premium' + :type name: str or ~azure.mgmt.keyvault.models.SkuName + """ + + _validation = { + 'family': {'required': True, 'constant': True}, + 'name': {'required': True}, + } + + _attribute_map = { + 'family': {'key': 'family', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'SkuName'}, + } + + family = "A" + + def __init__(self, *, name, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault.py new file mode 100644 index 00000000000..9d007f87dd4 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Vault(Resource): + """Resource information with extended details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, **kwargs): + super(Vault, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters.py new file mode 100644 index 00000000000..60c3cb76a27 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultAccessPolicyParameters(Model): + """Parameters for updating the access policy in a vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the access policy. + :vartype id: str + :ivar name: The resource name of the access policy. + :vartype name: str + :ivar type: The resource name of the access policy. + :vartype type: str + :ivar location: The resource type of the the access policy. + :vartype location: str + :param properties: Required. Properties of the access policy + :type properties: ~azure.mgmt.keyvault.models.VaultAccessPolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VaultAccessPolicyProperties'}, + } + + def __init__(self, **kwargs): + super(VaultAccessPolicyParameters, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.properties = kwargs.get('properties', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters_py3.py new file mode 100644 index 00000000000..a7d41ca975b --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_parameters_py3.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultAccessPolicyParameters(Model): + """Parameters for updating the access policy in a vault. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The resource id of the access policy. + :vartype id: str + :ivar name: The resource name of the access policy. + :vartype name: str + :ivar type: The resource name of the access policy. + :vartype type: str + :ivar location: The resource type of the the access policy. + :vartype location: str + :param properties: Required. Properties of the access policy + :type properties: ~azure.mgmt.keyvault.models.VaultAccessPolicyProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'VaultAccessPolicyProperties'}, + } + + def __init__(self, *, properties, **kwargs) -> None: + super(VaultAccessPolicyParameters, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = None + self.properties = properties diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties.py new file mode 100644 index 00000000000..adfebc298b0 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultAccessPolicyProperties(Model): + """Properties of the vault access policy. + + All required parameters must be populated in order to send to Azure. + + :param access_policies: Required. An array of 0 to 16 identities that have + access to the key vault. All identities in the array must use the same + tenant ID as the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + """ + + _validation = { + 'access_policies': {'required': True}, + } + + _attribute_map = { + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + } + + def __init__(self, **kwargs): + super(VaultAccessPolicyProperties, self).__init__(**kwargs) + self.access_policies = kwargs.get('access_policies', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties_py3.py new file mode 100644 index 00000000000..76193d25e83 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_access_policy_properties_py3.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultAccessPolicyProperties(Model): + """Properties of the vault access policy. + + All required parameters must be populated in order to send to Azure. + + :param access_policies: Required. An array of 0 to 16 identities that have + access to the key vault. All identities in the array must use the same + tenant ID as the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + """ + + _validation = { + 'access_policies': {'required': True}, + } + + _attribute_map = { + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + } + + def __init__(self, *, access_policies, **kwargs) -> None: + super(VaultAccessPolicyProperties, self).__init__(**kwargs) + self.access_policies = access_policies diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters.py new file mode 100644 index 00000000000..db7989f4871 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the vault name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The vault name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.KeyVault/vaults. + Default value: "Microsoft.KeyVault/vaults" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.KeyVault/vaults" + + def __init__(self, **kwargs): + super(VaultCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = kwargs.get('name', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py new file mode 100644 index 00000000000..dfb47095953 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_check_name_availability_parameters_py3.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultCheckNameAvailabilityParameters(Model): + """The parameters used to check the availabity of the vault name. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. The vault name. + :type name: str + :ivar type: Required. The type of resource, Microsoft.KeyVault/vaults. + Default value: "Microsoft.KeyVault/vaults" . + :vartype type: str + """ + + _validation = { + 'name': {'required': True}, + 'type': {'required': True, 'constant': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + type = "Microsoft.KeyVault/vaults" + + def __init__(self, *, name: str, **kwargs) -> None: + super(VaultCheckNameAvailabilityParameters, self).__init__(**kwargs) + self.name = name diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters.py new file mode 100644 index 00000000000..73959daf485 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultCreateOrUpdateParameters(Model): + """Parameters for creating or updating a vault. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, **kwargs): + super(VaultCreateOrUpdateParameters, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py new file mode 100644 index 00000000000..259aa450ead --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_create_or_update_parameters_py3.py @@ -0,0 +1,50 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultCreateOrUpdateParameters(Model): + """Parameters for creating or updating a vault. + + All required parameters must be populated in order to send to Azure. + + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(VaultCreateOrUpdateParameters, self).__init__(**kwargs) + self.location = location + self.tags = tags + self.properties = properties diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_paged.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_paged.py new file mode 100644 index 00000000000..562f197b8b8 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_paged.py @@ -0,0 +1,33 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class VaultPaged(Paged): + """ + A paging container for iterating over a list of :class:`Vault ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Vault]'} + } + + def __init__(self, *args, **kwargs): + + super(VaultPaged, self).__init__(*args, **kwargs) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters.py new file mode 100644 index 00000000000..10f5b741e45 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultPatchParameters(Model): + """Parameters for creating or updating a vault. + + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultPatchProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultPatchProperties'}, + } + + def __init__(self, **kwargs): + super(VaultPatchParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters_py3.py new file mode 100644 index 00000000000..262cf3549c3 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_parameters_py3.py @@ -0,0 +1,38 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultPatchParameters(Model): + """Parameters for creating or updating a vault. + + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultPatchProperties + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultPatchProperties'}, + } + + def __init__(self, *, tags=None, properties=None, **kwargs) -> None: + super(VaultPatchParameters, self).__init__(**kwargs) + self.tags = tags + self.properties = properties diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties.py new file mode 100644 index 00000000000..41b6607bb5a --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties.py @@ -0,0 +1,88 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultPatchProperties(Model): + """Properties of the vault. + + :param tenant_id: The Azure Active Directory tenant ID that should be used + for authenticating requests to the key vault. + :type tenant_id: str + :param sku: SKU details + :type sku: ~azure.mgmt.keyvault.models.Sku + :param access_policies: An array of 0 to 16 identities that have access to + the key vault. All identities in the array must use the same tenant ID as + the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, **kwargs): + super(VaultPatchProperties, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.sku = kwargs.get('sku', None) + self.access_policies = kwargs.get('access_policies', None) + self.enabled_for_deployment = kwargs.get('enabled_for_deployment', None) + self.enabled_for_disk_encryption = kwargs.get('enabled_for_disk_encryption', None) + self.enabled_for_template_deployment = kwargs.get('enabled_for_template_deployment', None) + self.enable_soft_delete = kwargs.get('enable_soft_delete', None) + self.create_mode = kwargs.get('create_mode', None) + self.enable_purge_protection = kwargs.get('enable_purge_protection', None) + self.network_acls = kwargs.get('network_acls', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties_py3.py new file mode 100644 index 00000000000..3b0e0bac6e9 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_patch_properties_py3.py @@ -0,0 +1,88 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultPatchProperties(Model): + """Properties of the vault. + + :param tenant_id: The Azure Active Directory tenant ID that should be used + for authenticating requests to the key vault. + :type tenant_id: str + :param sku: SKU details + :type sku: ~azure.mgmt.keyvault.models.Sku + :param access_policies: An array of 0 to 16 identities that have access to + the key vault. All identities in the array must use the same tenant ID as + the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tenant_id: str=None, sku=None, access_policies=None, enabled_for_deployment: bool=None, enabled_for_disk_encryption: bool=None, enabled_for_template_deployment: bool=None, enable_soft_delete: bool=None, create_mode=None, enable_purge_protection: bool=None, network_acls=None, **kwargs) -> None: + super(VaultPatchProperties, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.sku = sku + self.access_policies = access_policies + self.enabled_for_deployment = enabled_for_deployment + self.enabled_for_disk_encryption = enabled_for_disk_encryption + self.enabled_for_template_deployment = enabled_for_template_deployment + self.enable_soft_delete = enable_soft_delete + self.create_mode = create_mode + self.enable_purge_protection = enable_purge_protection + self.network_acls = network_acls diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties.py new file mode 100644 index 00000000000..25f414e98b4 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties.py @@ -0,0 +1,100 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultProperties(Model): + """Properties of the vault. + + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. + :type tenant_id: str + :param sku: Required. SKU details + :type sku: ~azure.mgmt.keyvault.models.Sku + :param access_policies: An array of 0 to 16 identities that have access to + the key vault. All identities in the array must use the same tenant ID as + the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param vault_uri: The URI of the vault for performing operations on keys + and secrets. + :type vault_uri: str + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _validation = { + 'tenant_id': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, **kwargs): + super(VaultProperties, self).__init__(**kwargs) + self.tenant_id = kwargs.get('tenant_id', None) + self.sku = kwargs.get('sku', None) + self.access_policies = kwargs.get('access_policies', None) + self.vault_uri = kwargs.get('vault_uri', None) + self.enabled_for_deployment = kwargs.get('enabled_for_deployment', None) + self.enabled_for_disk_encryption = kwargs.get('enabled_for_disk_encryption', None) + self.enabled_for_template_deployment = kwargs.get('enabled_for_template_deployment', None) + self.enable_soft_delete = kwargs.get('enable_soft_delete', None) + self.create_mode = kwargs.get('create_mode', None) + self.enable_purge_protection = kwargs.get('enable_purge_protection', None) + self.network_acls = kwargs.get('network_acls', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties_py3.py new file mode 100644 index 00000000000..55e45f8e930 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_properties_py3.py @@ -0,0 +1,100 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VaultProperties(Model): + """Properties of the vault. + + All required parameters must be populated in order to send to Azure. + + :param tenant_id: Required. The Azure Active Directory tenant ID that + should be used for authenticating requests to the key vault. + :type tenant_id: str + :param sku: Required. SKU details + :type sku: ~azure.mgmt.keyvault.models.Sku + :param access_policies: An array of 0 to 16 identities that have access to + the key vault. All identities in the array must use the same tenant ID as + the key vault's tenant ID. + :type access_policies: list[~azure.mgmt.keyvault.models.AccessPolicyEntry] + :param vault_uri: The URI of the vault for performing operations on keys + and secrets. + :type vault_uri: str + :param enabled_for_deployment: Property to specify whether Azure Virtual + Machines are permitted to retrieve certificates stored as secrets from the + key vault. + :type enabled_for_deployment: bool + :param enabled_for_disk_encryption: Property to specify whether Azure Disk + Encryption is permitted to retrieve secrets from the vault and unwrap + keys. + :type enabled_for_disk_encryption: bool + :param enabled_for_template_deployment: Property to specify whether Azure + Resource Manager is permitted to retrieve secrets from the key vault. + :type enabled_for_template_deployment: bool + :param enable_soft_delete: Property to specify whether the 'soft delete' + functionality is enabled for this key vault. It does not accept false + value. + :type enable_soft_delete: bool + :param create_mode: The vault's create mode to indicate whether the vault + need to be recovered or not. Possible values include: 'recover', 'default' + :type create_mode: str or ~azure.mgmt.keyvault.models.CreateMode + :param enable_purge_protection: Property specifying whether protection + against purge is enabled for this vault. Setting this property to true + activates protection against purge for this vault and its content - only + the Key Vault service may initiate a hard, irrecoverable deletion. The + setting is effective only if soft delete is also enabled. Enabling this + functionality is irreversible - that is, the property does not accept + false as its value. + :type enable_purge_protection: bool + :param network_acls: A collection of rules governing the accessibility of + the vault from specific network locations. + :type network_acls: ~azure.mgmt.keyvault.models.NetworkRuleSet + """ + + _validation = { + 'tenant_id': {'required': True}, + 'sku': {'required': True}, + } + + _attribute_map = { + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'access_policies': {'key': 'accessPolicies', 'type': '[AccessPolicyEntry]'}, + 'vault_uri': {'key': 'vaultUri', 'type': 'str'}, + 'enabled_for_deployment': {'key': 'enabledForDeployment', 'type': 'bool'}, + 'enabled_for_disk_encryption': {'key': 'enabledForDiskEncryption', 'type': 'bool'}, + 'enabled_for_template_deployment': {'key': 'enabledForTemplateDeployment', 'type': 'bool'}, + 'enable_soft_delete': {'key': 'enableSoftDelete', 'type': 'bool'}, + 'create_mode': {'key': 'createMode', 'type': 'CreateMode'}, + 'enable_purge_protection': {'key': 'enablePurgeProtection', 'type': 'bool'}, + 'network_acls': {'key': 'networkAcls', 'type': 'NetworkRuleSet'}, + } + + def __init__(self, *, tenant_id: str, sku, access_policies=None, vault_uri: str=None, enabled_for_deployment: bool=None, enabled_for_disk_encryption: bool=None, enabled_for_template_deployment: bool=None, enable_soft_delete: bool=None, create_mode=None, enable_purge_protection: bool=None, network_acls=None, **kwargs) -> None: + super(VaultProperties, self).__init__(**kwargs) + self.tenant_id = tenant_id + self.sku = sku + self.access_policies = access_policies + self.vault_uri = vault_uri + self.enabled_for_deployment = enabled_for_deployment + self.enabled_for_disk_encryption = enabled_for_disk_encryption + self.enabled_for_template_deployment = enabled_for_template_deployment + self.enable_soft_delete = enable_soft_delete + self.create_mode = create_mode + self.enable_purge_protection = enable_purge_protection + self.network_acls = network_acls diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_py3.py new file mode 100644 index 00000000000..cc95a001f99 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/vault_py3.py @@ -0,0 +1,63 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .resource import Resource + + +class Vault(Resource): + """Resource information with extended details. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The Azure Resource Manager resource ID for the key vault. + :vartype id: str + :ivar name: The name of the key vault. + :vartype name: str + :ivar type: The resource type of the key vault. + :vartype type: str + :param location: Required. The supported Azure location where the key + vault should be created. + :type location: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Required. Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': 'VaultProperties'}, + } + + def __init__(self, *, location: str, properties, tags=None, **kwargs) -> None: + super(Vault, self).__init__(location=location, tags=tags, **kwargs) + self.properties = properties diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule.py new file mode 100644 index 00000000000..a89d3778ecb --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """A rule governing the accesibility of a vault from a specific virtual + network. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as + '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule_py3.py b/src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule_py3.py new file mode 100644 index 00000000000..acf96858035 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/models/virtual_network_rule_py3.py @@ -0,0 +1,42 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """A rule governing the accesibility of a vault from a specific virtual + network. + + All required parameters must be populated in order to send to Azure. + + :param id: Required. Full resource id of a vnet subnet, such as + '/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/subnet1'. + :type id: str + """ + + _validation = { + 'id': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = id diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/operations/__init__.py b/src/keyvault/azext_keyvault/mgmt/keyvault/operations/__init__.py new file mode 100644 index 00000000000..aa73b29435a --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/operations/__init__.py @@ -0,0 +1,24 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .vaults_operations import VaultsOperations +from .operations import Operations + +__all__ = [ + 'VaultsOperations', + 'Operations', +] diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/operations/operations.py b/src/keyvault/azext_keyvault/mgmt/keyvault/operations/operations.py new file mode 100644 index 00000000000..d2e0d8a3c26 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/operations/operations.py @@ -0,0 +1,105 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class Operations(object): + """Operations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2018-02-14-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-02-14-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all of the available Key Vault Rest API operations. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Operation + :rtype: + ~azure.mgmt.keyvault.models.OperationPaged[~azure.mgmt.keyvault.models.Operation] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.OperationPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.OperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/providers/Microsoft.KeyVault/operations'} diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/operations/vaults_operations.py b/src/keyvault/azext_keyvault/mgmt/keyvault/operations/vaults_operations.py new file mode 100644 index 00000000000..1162d0e8994 --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/operations/vaults_operations.py @@ -0,0 +1,933 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class VaultsOperations(object): + """VaultsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar filter: The filter to apply on the operation. Constant value: "resourceType eq 'Microsoft.KeyVault/vaults'". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.filter = "resourceType eq 'Microsoft.KeyVault/vaults'" + + self.config = config + + + def _create_or_update_initial( + self, resource_group_name, vault_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2018-02-14-preview" + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VaultCreateOrUpdateParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Vault', response) + if response.status_code == 201: + deserialized = self._deserialize('Vault', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, vault_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or update a key vault in the specified subscription. + + :param resource_group_name: The name of the Resource Group to which + the server belongs. + :type resource_group_name: str + :param vault_name: Name of the vault + :type vault_name: str + :param parameters: Parameters to create or update the vault + :type parameters: + ~azure.mgmt.keyvault.models.VaultCreateOrUpdateParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Vault or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.keyvault.models.Vault] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.keyvault.models.Vault]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + vault_name=vault_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Vault', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'} + + def update( + self, resource_group_name, vault_name, tags=None, properties=None, custom_headers=None, raw=False, **operation_config): + """Update a key vault in the specified subscription. + + :param resource_group_name: The name of the Resource Group to which + the server belongs. + :type resource_group_name: str + :param vault_name: Name of the vault + :type vault_name: str + :param tags: The tags that will be assigned to the key vault. + :type tags: dict[str, str] + :param properties: Properties of the vault + :type properties: ~azure.mgmt.keyvault.models.VaultPatchProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Vault or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.keyvault.models.Vault or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.VaultPatchParameters(tags=tags, properties=properties) + + api_version = "2018-02-14-preview" + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VaultPatchParameters') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Vault', response) + if response.status_code == 201: + deserialized = self._deserialize('Vault', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'} + + def delete( + self, resource_group_name, vault_name, custom_headers=None, raw=False, **operation_config): + """Deletes the specified Azure key vault. + + :param resource_group_name: The name of the Resource Group to which + the vault belongs. + :type resource_group_name: str + :param vault_name: The name of the vault to delete + :type vault_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-02-14-preview" + + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'} + + def get( + self, resource_group_name, vault_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified Azure key vault. + + :param resource_group_name: The name of the Resource Group to which + the vault belongs. + :type resource_group_name: str + :param vault_name: The name of the vault. + :type vault_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Vault or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.keyvault.models.Vault or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-02-14-preview" + + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Vault', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}'} + + def update_access_policy( + self, resource_group_name, vault_name, operation_kind, properties, custom_headers=None, raw=False, **operation_config): + """Update access policies in a key vault in the specified subscription. + + :param resource_group_name: The name of the Resource Group to which + the vault belongs. + :type resource_group_name: str + :param vault_name: Name of the vault + :type vault_name: str + :param operation_kind: Name of the operation. Possible values include: + 'add', 'replace', 'remove' + :type operation_kind: str or + ~azure.mgmt.keyvault.models.AccessPolicyUpdateKind + :param properties: Properties of the access policy + :type properties: + ~azure.mgmt.keyvault.models.VaultAccessPolicyProperties + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VaultAccessPolicyParameters or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.keyvault.models.VaultAccessPolicyParameters or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.VaultAccessPolicyParameters(properties=properties) + + api_version = "2018-02-14-preview" + + # Construct URL + url = self.update_access_policy.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'vaultName': self._serialize.url("vault_name", vault_name, 'str', pattern=r'^[a-zA-Z0-9-]{3,24}$'), + 'operationKind': self._serialize.url("operation_kind", operation_kind, 'AccessPolicyUpdateKind'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'VaultAccessPolicyParameters') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('VaultAccessPolicyParameters', response) + if response.status_code == 201: + deserialized = self._deserialize('VaultAccessPolicyParameters', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_access_policy.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}/accessPolicies/{operationKind}'} + + def list_by_resource_group( + self, resource_group_name, top=None, custom_headers=None, raw=False, **operation_config): + """The List operation gets information about the vaults associated with + the subscription and within the specified resource group. + + :param resource_group_name: The name of the Resource Group to which + the vault belongs. + :type resource_group_name: str + :param top: Maximum number of results to return. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Vault + :rtype: + ~azure.mgmt.keyvault.models.VaultPaged[~azure.mgmt.keyvault.models.Vault] + :raises: :class:`CloudError` + """ + api_version = "2018-02-14-preview" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VaultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VaultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults'} + + def list_by_subscription( + self, top=None, custom_headers=None, raw=False, **operation_config): + """The List operation gets information about the vaults associated with + the subscription. + + :param top: Maximum number of results to return. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Vault + :rtype: + ~azure.mgmt.keyvault.models.VaultPaged[~azure.mgmt.keyvault.models.Vault] + :raises: :class:`CloudError` + """ + api_version = "2018-02-14-preview" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_subscription.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.VaultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.VaultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/vaults'} + + def list_deleted( + self, custom_headers=None, raw=False, **operation_config): + """Gets information about the deleted vaults in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedVault + :rtype: + ~azure.mgmt.keyvault.models.DeletedVaultPaged[~azure.mgmt.keyvault.models.DeletedVault] + :raises: :class:`CloudError` + """ + api_version = "2018-02-14-preview" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_deleted.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.DeletedVaultPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.DeletedVaultPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults'} + + def get_deleted( + self, vault_name, location, custom_headers=None, raw=False, **operation_config): + """Gets the deleted Azure key vault. + + :param vault_name: The name of the vault. + :type vault_name: str + :param location: The location of the deleted vault. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedVault or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.keyvault.models.DeletedVault or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2018-02-14-preview" + + # Construct URL + url = self.get_deleted.metadata['url'] + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedVault', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}'} + + + def _purge_deleted_initial( + self, vault_name, location, custom_headers=None, raw=False, **operation_config): + api_version = "2018-02-14-preview" + + # Construct URL + url = self.purge_deleted.metadata['url'] + path_format_arguments = { + 'vaultName': self._serialize.url("vault_name", vault_name, 'str'), + 'location': self._serialize.url("location", location, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def purge_deleted( + self, vault_name, location, custom_headers=None, raw=False, polling=True, **operation_config): + """Permanently deletes the specified vault. aka Purges the deleted Azure + key vault. + + :param vault_name: The name of the soft-deleted vault. + :type vault_name: str + :param location: The location of the soft-deleted vault. + :type location: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._purge_deleted_initial( + vault_name=vault_name, + location=location, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + purge_deleted.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge'} + + def list( + self, top=None, custom_headers=None, raw=False, **operation_config): + """The List operation gets information about the vaults associated with + the subscription. + + :param top: Maximum number of results to return. + :type top: int + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Resource + :rtype: + ~azure.mgmt.keyvault.models.ResourcePaged[~azure.mgmt.keyvault.models.Resource] + :raises: :class:`CloudError` + """ + api_version = "2015-11-01" + + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['$filter'] = self._serialize.query("self.filter", self.filter, 'str') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send( + request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.ResourcePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resources'} + + def check_name_availability( + self, name, custom_headers=None, raw=False, **operation_config): + """Checks that the vault name is valid and is not already in use. + + :param name: The vault name. + :type name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: CheckNameAvailabilityResult or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.keyvault.models.CheckNameAvailabilityResult or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + vault_name = models.VaultCheckNameAvailabilityParameters(name=name) + + api_version = "2018-02-14-preview" + + # Construct URL + url = self.check_name_availability.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(vault_name, 'VaultCheckNameAvailabilityParameters') + + # Construct and send request + request = self._client.post(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('CheckNameAvailabilityResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability'} diff --git a/src/keyvault/azext_keyvault/mgmt/keyvault/version.py b/src/keyvault/azext_keyvault/mgmt/keyvault/version.py new file mode 100644 index 00000000000..382eba7481e --- /dev/null +++ b/src/keyvault/azext_keyvault/mgmt/keyvault/version.py @@ -0,0 +1,19 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-sdk-for-python repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +VERSION = "1.0.0b1" + diff --git a/src/keyvault/azext_keyvault/source.md b/src/keyvault/azext_keyvault/source.md new file mode 100644 index 00000000000..926941046a6 --- /dev/null +++ b/src/keyvault/azext_keyvault/source.md @@ -0,0 +1,3 @@ +### Source Origin: + azure-sdk-for-python/keyvault_1.0_preview af6753148b266e85b8047d192dc8a70450035b80 + azure-cli/keyvault-preview 8c971b50fc9489e1ae6b4eb07228a8b4be6a30e8 diff --git a/src/keyvault/azext_keyvault/tests/__init__.py b/src/keyvault/azext_keyvault/tests/__init__.py new file mode 100644 index 00000000000..407b07bca5f --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/__init__.py @@ -0,0 +1,10 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/keyvault/azext_keyvault/tests/latest/TestBYOK-EU.byok b/src/keyvault/azext_keyvault/tests/latest/TestBYOK-EU.byok new file mode 100644 index 0000000000000000000000000000000000000000..f1250dc452b474785e12c654255bc5b61ee92397 GIT binary patch literal 5486 zcmeHLc{r5syB}l=S+Z{_OT?Jvos}@wM1_!~Fv~lPWiYlRv{)ud)BENU)>$=YGobS2LIoI#^=XvM)T=zWp^St+SKg)eT&-)=MIDt$uGh_$I z1X<(|kY)=;Sb!m9hF`ES4@1X0BqY!Pfd~%|*AEBu16W=NG!ltI?BBi1k?IZlli>_z za0r=61xaFm6#GC{Fe89@ikBq%$FNyoK=4jlwi?n5Wrf4wQ7AJjB*wzR)YQ@(FgGKj z@n|a~5lcjp1ox3c{X%xqj*|o-AI$s$DEUt$Ng`&hcD8?&|8EY7LT@<*_<~HQh(It~ znrR-u0wI+>DdJT644j}6^*B3i8wqKi=>h9Ae9OtNkVI$3xcy@VI?& zqR^qiJ)y|Z68+d+AnoqpH^-4rvm4lx4>__s!&0IMHHXCKc6?KOt@n9_K;N=gwnC<4 zTl4@~#7WNTG$Qi7RX7+~3ddE3Zok@`VI_x)F24HY;aSxQmBHnJ4`Btkv+CMsBtNy) zyIymbG`531>Ghx_uTE6-^AHTT3hvq)=uAB@qg|H{EBkQb{Dr)z?ji4?f&Ni;-v+N| zyN#(>>$Z-QUrX&hG|2^~8Vc^iwg$G=DL{qZ&W5KL6RZ7nP|^GSmG44JOY&yx0yV6o zt}8He4fV6Wa-tA^DifGM@5+;#h3`j|c&-}=AInM3M+hG5$~$!{;vV_l<7%sW5?e(h zR&_Zm=!NC#>~-aWez(O3{Twh$+PA++-jOLiEao?lH2Xqa=A85)rObZ~|6JhO7|7Tg z5`E<9YiTn%|5s_I2a3Ov+GRb1(8GHU$8VWQw#zNDO;y|_bd4{4G(53M;ac;o)Xkt@ zGbbxdMYOHwY3j&b-U?beZqsMS+h%~$8+J3hda`Isc`}%r1IADD5pLTMo$N>c?3R`} zk(ivgqD$auQ2cyr6^8w&!qB0Kp~9-N)1GoQD5x6O1vXv@*q7Kp8Hq}2NthKgN)3sq zD0fJX{^&dtJG&x&vrsL6NlB^&$x%yt(eB#0&AL=TgUuf+QWxOC9_GPJ`1c>{NLwOm zy8Xz%uyFyqfp13I&quvS=PkMtnUq()T zy`EW5zL#!FY-lB=&*fMW!KU^~OLLR=8PPAa<9l4f=KD0J+blQVn~!v{ota8#O@4yV zj2Z)S*K3F_N$2fnQ)0_mpf-J551*d-G5jbX)pmfh$ZttaPm@?hy%;qvQGQ*Qy<8_` z#vF;{ce+ok4Na0i{ps{(3p1qV$Jnbf>bGq~%{H79NEu5osMSAdI?>0G=-8=LINP>b zFvm6-iO|;4uP0+SF=|By-3J*X8W*}cppEkOh?Mujs$SiKn{Tt0@1()L=c9G_ggvsDIx+Qk)~Ehr}!1dKUBYd(w;Q3SQ9jm#pK#k*2lbj1H4@xPVK#z^ZWyOC3*X{R6ANL8{xJ^U8jv#J65c3RmQE$8; z{kffbXt3Zqnl{@MmRkMsjA%)SPq)wMJ#$t-_5Ijb{h+I>2kl8CCf5K*s0xok_7w80;7v%1!kU_@Oj)7?N2KJhRc;KQNs=39Xw9 zV@B2&^)0_U?B8@d)2sdAj&-koe#Z6^KJJYh(5HnTb@kFIvh5z&Bt49^sk!;xg{_a4 zyyd8UYv{PObG5t3Oc0C(V`#2mCFLa)Q6+fm{sV6GXQRDvj>80CQQ=4y(le`Y{2Ap~$o)l@Ee$TE!$$+y zNL>qATg?*%JaVAbXaqbwzUUp!ae3- zx_AC)*2?R}1oROHT`!y{;dz@sl%ut0M4V@>j%!O0!gc*8*dFs&Z#>`Mtv+OU#z}WB z(46m&85mb`+efMW>02H8zg7qRh3VO6`p;J+*EN5=rw?RGM){^#|KjS``sj1AJ1r4( zR2g7(8t;F!YNo(%Gn@((rfZdo9#<0|axN zB^r*j0suG;10bP03uM#@8W1;*Bp``|u!&=MM&5PvbUbo3SCn7kNxz#}v0Wjb9TGA0e9zpg7fKa>_KFrTB>SBudgZiCFXrrX^RfQP)0mj4vDhZqk|I=i zq5~85`s9iGeBW|`uoKjdj?u+;s@Fg9oViH-F%((Yrxz}gC1NRM)AS|$rr@t7|4aLt zvk}JIwdPtnf7)g;R4$Lljoss58oMlx`od3Mlk4{cy(07puKL=09maG&_5L`vHQ*lh z%V$rQvTnXo)8>YSo3ThSssKs&oO=mVZ?LuI&gZdCfjVM>`;zf8%|q~v?#K5lkTf*bB7`+$9| zv;_YL!&?c zh9BC#!}DE&(+FAb2S!no%2IeIU~*$nn7|Gh|7O`0eo;P~I7JiQEIdIqG`g~PeZi1t zdEFt!tJ9i49;ONk4=p8dT)}m6`_oc?MI7XZ%2)q|@+habvEb`V{yv|PJ~F-64 zmCgW$he`(?sTA5o-1_h0`#H3yoFQ=I8%MxWkN_5qg6_8&W805lvDMFFTZI-X9! zU~p(U4GL#96cS4T@N_Z;2~q$g6#xln93G(H33L=4if$x`f@-j6B4if_?cFu|cru8D zG6#SH2t+i2MnlqY02YHrQ87^Bz*Dd^3LQ_RW9e!D1xdx@2xKCKh@&9MNHRb}Q!oSy z76pAC0BAahr-5iHnE=_xL-sYGWU-bnxG}L` zHO9P)o#E<_K@f@050AdxDxOLDdQ_w=oH<@#^R6QL*NB|Jwat@*4E@BHKgceG3Fj=I z0cB5XiDCUBd%?(PXY`x^-r8-#>C;jQj-7O+3@hi5IMd5h-PC(M9arNrH#vOou(x+( z{_$V~!SV5`QHTAj3rQX=OMIS=g!4zrSDV{^ZPYz4#T?__`|oDl;QyY*I8-$Lu+?^MUmt2H2~CZpZVxJHNs;SAZPb~iJcTj?&}8T9)H{PM zu`h1{zT=5@^U0;wQcZ=zs)E`(j1fGlcN76ax8?D??6Fiq?BN35ZC;+yaaj~^)4_-0m7P4QZ!KyCR|cI`JFmo<3^$0^v`lH49a7oEG zEIbA2cS88PTow!IH6i@ndH>gYc|0(Z#2S5I1(5}N$o^oqqc0fY!DR?M{(aN{NgnFP z@-Wq#%=F^&Bs*yk4Z@%^KvuRQx2td#IWUmH^wRSMec^!+IRXbm;V6>SKfh&74)(qz z^jcyP%<~Ovw*nFwPRuw)YUGwA- zZ_R6q&c2Z~0{I0ib?TRR-(EIpOnbCjASgL?VyU6w>7MCH`=Ti;mP^6Y@$(O=FHv!Y z+m)MFRXe^LZnSi?Pu6Qr%krKJsV*Nz|MLlDTx26T=@o zpXl^Hb8w}HO%jKu%!aVI)tV&i$nav4Lqb{LrB&11=bPf69Sd?w-_#sDm7=n3 z%juzzY10<^+r0}a1xY#*H(qViM{@Q&?rlAgQ}1kKJ!yJ{_G{-v({7;(k9Tbodk4Qp z7`JYW+TvNSQ1k7J6@8kNVKOeQ*MAg0?>lRj53fpOJBt}j$3HQ0m$${1?3a0!qj#f9 z{Us*cWE)xV$3iNDQ9LorYtr(#veZUD)NFmm9U<2PHqxh*FE=?Q0`iSmc1l!se5W}W zloNK5De@pZrD(vT*=6O71o__$lo9;0H literal 0 HcmV?d00001 diff --git a/src/keyvault/azext_keyvault/tests/latest/TestBYOK-NA.byok b/src/keyvault/azext_keyvault/tests/latest/TestBYOK-NA.byok new file mode 100644 index 0000000000000000000000000000000000000000..d7ccde1aad0a27b206e8b5b53d4e53f32fe1eebb GIT binary patch literal 5486 zcmeHLc{o+yyFZ7_bPy%8Ld0=~ea18#^HiCW63(y>CmbBdRD?>TkouZRhEhr>l#tA2 zDj7nCL}mD*L6Q*t_NlMuxxahA_qq2zzu%vC@8|Qpd%bJzcfD(^{l07M4`s6h$fmNn zW*{5nP`Mz(3Jf&{xm1>SfC!wW?aAf(?LeV|gM;;g0X<)i2MUWuV^9b8?X{ z(4mv93mOn_T&E$)0}Kv>aU;ep7wgw#eJ-jd${{@b)&ypq}wxU zQNECPXsz53r@lH*k)(O>(Sc3sqm)el@^SS+-_qb)@D*meFLzTsn&@0tS349sS$0T&Xg!+9JnFM_a$4csa7aIKFqBrJXRw>K;*#X_$rR-Fdz_ewUUeNcFHQ-ag%_J^1{e2xyt-5) zsPyDoP5Uq_ihKX-Kw6xCY9z9tf52Z`%+;>zQuzL1RAMc%07+zNqD zWnT{{EWT|(0bGL8PgWP7#($1%hXyMQsn$-$lBg=J)YF!6jGF8}*w$M_-kLgLoPag9WF(onEGQ zhQ8il(ep{+$J2JX>E&5gou8M1SYB;rnH#_yaXwdi2-nsq&%aG~^_1?Nu8i9KPM7>P z4j;+c-Tr<@pmrSFZ~MieeviT;pw+oEUQO^_>!R`pmXhpxq)c-CuFYDJVg{tw(UE#GN)oyxYZUn0rKs=SG&=(#}nv4ylSc!<=T7UJ)uuGHuzC zoa9H1g~Pjcz}NNHS$0i#G=_dm{FwZ0nWp$ z_-RkAF0l*>AZ#h=Ay3>3Z|o=ij5gYS;UcA=*Cy_)ifR3q)meIjw75{)_*UWFP|iyLV|f7boBJwfy( z>_vt}nVYzP~h! z5bd$qo?t-+IG#Ha3lvPaWXvvseQKjV8zQ+CktBwH`nGw8Y#oYy` zSUs#%vAtIDP?WjJ1LKq5r=2@uP$L;4;s+J^W4P{$v67KB3j7K7UgY#mK0WU@W`&k4 zob!KNVDNa?C6k9^dc%kIz8FxQ8VNlkoJzwZB2`Ot#RZ!yT%WaP-cOrWE6yL?5;?ho z8o!M%8Htjm+@9W)wz9D{>X@Im&38_;XJ>WUzOIhl3xAZjr`;TXL5t)*{?4&tAf>hW z89*#r$9SWa#>t#+cC#r(Ot4GyMcb=V=ZQTi)?)US_Sf!<@f~VKlvwEw5PUa(R<`DTLk4jF+3i{-r!DYm``uM%=Mb+G_Y`qM!aU>i7GKi`q zCV-{VZ~&H!qcdq39D__o<3KEii9=(dW+W;I(y0U{7P2i2f!7c3T9Ytnv*vAWYZugn zx6Q$H9{kp~4^-wO(S5D@`-((M6*4#gefUni@YzaZQrS}})ZS-o`{r$tTBl__U zIc#_vXT=jR~TcPK*I_MFmYm@9VcQ4^l{nv6mAXzHh>w@_zPruejpM&)| zN&hfK*d6hJSp5qvZ#qt%U8`HOod&f($2~o}T)VQPy>k!Vu@KoW2O8alH;MjfC5@#07ll4uAjo%-=|&T2Df&_6T81thQg_V;vnM`vu5 zx_thY{4)c58~3wq9FCdoo{@W{Kz_MbJclLK?3Nz>r!URe{LiI?_dRlh2V>%ytmm;_M zmgB#Cc6Tc5;4d(!ub#hq8ZAK=q==-r=CgGN8!H}s9%~hRM2>M?-2H>~Toumo+!XT3 zW7Bl+nGHi>t}@MZGp9K1{#WkgrlO^hmEGoafyAA%u`b(#H2k5R~g<`KpRrgqGZB=ErJRPUdJ92KJAY=Oz4R{ zWK$_4DexBE6j0ePQg{`-9r!h9mtD?eox9D@^VZViC|3v1whox{)&NwMu*+W6*t}ZX zS|5S+OIltdb8SL1sEwXAyTboelqNa=e{S#(5;T+bso%IFAkJ?YEx(5^jYv`sJWx7gBO!lLtO-*a_+xSe%IMsoAb3tpzr8t-zF!; znT5P(3h{vck%EC1rJI(a#s6J=cR}BjBLrT26G(U(8o*;Q(D@dm)1V&-fI&cGXaJqT zBr>6sI04IKK;f*4LE~uvkx9j&K^lOj10V@YAObWZiHTuC(TxT%Pz@eShU^lcZ+Fc; zkqV-r%mH8k5*bTkFwhJFfX87mbR3j8h%`Kd#w3!Nc%~{qL(_=_5|vCN6KH5EnhNlK z1V}VI1`E&uEE6O$KrEd~g6tC^`|41#Sj!i@7~#b}0>XceBVJ4k1gFo|= z%g~Y9h_|Od^7N4q#Li>~pSa(MNTz%Z6Dtg6kLOsvy?0`Dbd%r>wLb@0dT~8VR43A; zW7^RHMR#+_5xqPcq2nhUv9p3i^TU%49~LhVV$WYM#BZ{V``8OFtLwdWiBRD*`{zh` zh^J?5c2vL)q4Dw3ceV$A&YyQ{SmbxNC#4=M`dQz!xqy@C z)53C11wVe@rDx8S*~CZL#_9)xRHG*}Pb`K_f!keB0%z9T!)` z!D2*ri)v}cij$+SgT~JKd&V}dnxB`&RwpWGF?F?+4mUbwQJ&{RWqABz*5<+;;2w+D zNe>1aPWKc8UgL4ra|s3J(segQl!dg+cBA0R59H_bCgv7A&%Wez$`|(@Xlgu?EWG89 zbIN-wz~~@_!#~Ee(#Mj7@F6*T+dbS*M5oa_4F;bgN?PH{Z;UI2Rt6oFTdzm&8L388 zG)#W!YS`6|4m4Fa9~Omt;H~qdR7_5(uP((T|5?h|?Gat|0h@#WzlQ(2HSBxf(%j-Z zcy@lcU*c+3&)`ylESy~I#fK6(;C^2I!*YaCd-tV@3|5GIt2%Yh z=|Z;t&9ji+0>aY1&2{2*XRRNh%DGo^#RlEy}(d69z)>v@1q7N za!@xWA#_hF+k?lGSTGrpC60uq3Z>DA^jk71j(i%F%;>4e#@L1 z;F&4?Uk}$=d=@cqI7Q41qIIa=zs#pwLeBpWq!7W_1aAx&6OD`r#=m$C14EKA-o((5 z$7>i8O~_;uzyNP#KoPMCq5J*_68W* zq%d-&N#gnAmB1lZMM+@j_ib^3+SOM|j&C)Hk=Kr;r~9G0GQ)2j9zj02Zx-Y&Tpf}k z81e_dno{KTMLRIq;dbra9d*~f>?*uK{8?J`q~wKIn}*TW+nuRKcQid>`IE?vO8mQY zj1opYHEw)&^g3Q4n4PooXlo|ln`?V&FShIx^iN2dT&%8c-#_!GP2RLA$0?_MJhi4Q zlTNs~Q?dT1a`VD&H8}(AaP8h*qRm26)|)tui@Ax7hBxx}Q#(r%roLKh`Ct8(e2=4v zlB-!YmI^x6-+tRPSA!OJF27p-<%HyDYVJIrfLVEjv7U$WwyO8X!*VF%MjVjJqq7`X zK45ARCPOFcV8_EtsyXov`g@m6o^LAr|!rqbbaFX2;4&MZ(7p*y1Fo_#@fWAHr}cH(1> zy;-MXcdDe$iP@5*T+huG&HjXRTf2sRmR~;(oEly?r`ukosdH5qq5$>78~U@3y%l-s znkHbgTvRVz?bf1OD<0;gL^QefICgJ_+ow-zrSf_hy?eFFDXwGRWt$9HTSzX8YD#W) qXQsg1fIXF=gDL|8^ZUM;;g`-Xgny6=H~uVD0drawwatQ0!2bb$?(iZ2 literal 0 HcmV?d00001 diff --git a/src/keyvault/azext_keyvault/tests/latest/__init__.py b/src/keyvault/azext_keyvault/tests/latest/__init__.py new file mode 100644 index 00000000000..407b07bca5f --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/__init__.py @@ -0,0 +1,10 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- diff --git a/src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_123.pem b/src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_123.pem new file mode 100644 index 00000000000..5c242265246 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_123.pem @@ -0,0 +1,50 @@ +-----BEGIN CERTIFICATE----- +MIIDgTCCAmmgAwIBAgIJANgbVX3Upe0RMA0GCSqGSIb3DQEBCwUAMFcxCzAJBgNV +BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX +aWRnaXRzIFB0eSBMdGQxEDAOBgNVBAMMB1Rlc3QxMjMwHhcNMTYwOTIxMjAwNjUx +WhcNMjIwMzE0MjAwNjUxWjBXMQswCQYDVQQGEwJBVTETMBEGA1UECAwKU29tZS1T +dGF0ZTEhMB8GA1UECgwYSW50ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMRAwDgYDVQQD +DAdUZXN0MTIzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA287d7CB9 +TM2s1jWiQ8aSNdIXzCrVDRzzaRymJj5TtSWhmGE5mLRaKOiRIxjsxn0BgPtboOwm +nBvr8lCLJORYUvN/dEialBiPdINwJjFyN1hK1TRh9JpQaN+GufMhAbZtF8aEDy7w +Fx1DvS0IkBjLLNW5x2WHCWfhiR6Ep1viD8yIRvp8pQMPu8+cGgfCkdsvCiFAI420 +1ss2pxUXf7eaPWesTB35mig/ie1eSZbyy5HvvzgDgU4aAIMcT9et4O4VQpRZr7y6 +PlwfzZJ32fsZCDjj3xW5DfFmWb0LpHWmW4Cqr+1zX+oT15TekEMqSh+ncAGT4uh5 +u2qbSYWQxVoSeQIDAQABo1AwTjAdBgNVHQ4EFgQUe9iqdT21Y3MbMy4Y7B34znOi +0vMwHwYDVR0jBBgwFoAUe9iqdT21Y3MbMy4Y7B34znOi0vMwDAYDVR0TBAUwAwEB +/zANBgkqhkiG9w0BAQsFAAOCAQEARaNsf3kUqdHcuI4X1aH3jz7i6duUsMzzWv25 +H2mxUaC24A+4BExlP2Dt3Ms9ONOhkj37Rf007VD2J+PbiAheg3Y6hrCD+JOdobRC +ZDeiwmMYYYEUFhFNyFrlbTrR8DLHqjeibyO5nytAH5je4EsnqEFg5UU341HRah7p +SC5bubr2CwD4R8VTGi+BsmURFi0Vp+CfhScOPPm+MB7BDCPPAO3iyW2bUY0YId7D +mFd6pSlsfaYNTu8u402NUt5zEaBj1mV2BR8D6LUpGNZlfu/vLJIBIe51/FqVa11S +GssltPCXgZs/ecR0BWTftipALvUTZ4wFIMXlQjPi+RwGt17ANA== +-----END CERTIFICATE----- +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIE6jAcBgoqhkiG9w0BDAEDMA4ECKlznX02QG7DAgIIAASCBMi704PgTVP6LSee +1UArVjr+/1lApOuKiesNMy+/N+Mf7DNW/J31W83WtTiN+RVbOlf6CX2+XId5FJou ++nzK9ECqOmlULtEnXnFpihL60TzpAfNBajheh3KXAfl/V9wPvh4jjOqHDFbPZxsd +TENKxSbmlUPG2qDVMeXAQatrUeSTcbH2mamPOrAUknXh7HSgwlXosfqQBEfr06Kb +liboaMpQva1ae9PSaLbiewfeSIlDgf5pAt9WamaV8NRlfF9n0G0NiHFfaKKPxKop +Wv5FyDJz1kbHUCjL15W1roaQ0AK/wFQ7KTPu2PLwV1uLi+VrenM9yf/uepHKI2P3 +BaFDxSGrAlgagsL1a63DG5a7xIJk5s7Xgwlp5kS+VEujx1lQjgDgD/BTHY+KrBTq +2eAbmYPDru2ZJRksvYmUrKCOKaR+fD9WrRnl40wdHJeLnG/lYTq2bEz/YwgAPsgn +MD43KoE4cRhljv3doP0uupADmhMRVlIWEbSLDVc5jvNuaM9EnHX+vbXqFiVdk3WS +GVgONMG/eCywPJYRBOzhL3e0WKSpGuiqF05bUIflldft5d7KnX2S9ASyVw2C2pAY +25DYK5hSNkvue6qCUk7d4arbsDpBU/i8o9sZouee5nmqPjufAd+SyKunslc9/VYo +JDb+HfvZGzPaGiELc9wg5Df47IDiS5Nk3l3UxFfK5U9IKtVdHBpHZXsSJQxin7rk +yWrGmcA6GjaPEZ+bJengXY8qJCjGF9JtTtXKxGQ6i+bjtWnRIETTFUZ+U3AJqICE +TTYPhf7BKd2bx+AWQF7oP7UMPv6JvnncKSDdzfk4CPuLRa3CW+SZk3cJrS0/TYWO +wsuMl7FnClAyp552zBwmmzQ/u5DxIVXky9beGTiOltdrSwSnn27Cu33UX6qb0sSz +65cqcN2NCw6NlUN2wexe3Va8UgMBtVmc+ALMy/+tTciGLhniy0fyG98p0waG2FS7 +oCEVE22pZVnlwmSAFxVjLFKzHJfP+1cdoQ5OKXxEbtNUZVNEEdxl/bX0/i6snilI +N/MxIkuENBDLUQ5CDb04YB7MaWMUJ0U+sMWEZd/8wwVUTnt3A5QJeDth9AfxnmtC +uzdBl/02o6wlCG1uO728yIvpTsEvSXR+6ZHR+PCCvQUz4uGwxfK/wsSJMeLI3VN8 +dj9iPpWACxGbvawCrScpTGqF6GJlpVMH/CVTbJ5q+xpcQ7+yz9kmL2FtMlbQ3Hmc +Cg6QjY27rBonxo/vAcBQkIyd0E7pV/qEBI3c6nK7aU+i+WseMTyiGboL30Lycvnw +GJ84YCRAF7lZphXiPuvycwysvh2Ynu3se5c4VdT1pptEHX07PfIeJ8wgeK+LqpAc +gqOCmmGJ6mTZUbj70vj94mBd2QI9n1kdIqR4WoPMuoZj9DOSxbP3Hs8V36fSVamE +00Xvoz+HcML3S1DmA6myUnZugTwdnBn4SdIVerrwYo1U4kDkb5VVYZW7ys8EQbzT +KAp1A+AWRsrO1G9OToavX/IjZW5zdyMeDENsemjo5K8+XXGUchwbxSDVrZV+cZLN +Ga7ZNdF+gN8NmNsSv8X3T9zTESz2aVAxIccN3+8LzY6SEiq4akedZM+iTKnkb6+s +aGR7zDmbyvBJWXPbJO4= +-----END ENCRYPTED PRIVATE KEY----- \ No newline at end of file diff --git a/src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_1234.pem b/src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_1234.pem new file mode 100644 index 00000000000..4d15c0379e7 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/import_pem_encrypted_pwd_1234.pem @@ -0,0 +1,48 @@ +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIE6jAcBgoqhkiG9w0BDAEDMA4ECCjvf3YN4n2nAgIIAASCBMh4+w8SWa/eaqgi +ZDktL7eZOLYlfNLtbiCUlKi5R/EEfS60lR5hlkW8ytL7c+lQ0d5LI+CFhzHr5AU3 +H6IiEi3e2wrJ1QlnEQOEAu9uHooAHJEiaYBjI9Kt5egW6IAhzXEpXVFp0crgV6WQ +CHiXtFD8vkg3fWyKTGiBtGyTujnRr7lgELU5LO9DQzjIjZ/gOcA2B0V0XY/6mzNl +HLM8gcfjn5+lpJg8LNhnvGarfi9TB+M2syAzYQIhST/SwDnBV0L+fc9xPXfLVtLX +bIw45rY7cXZ6wN2Qhjcq4hABZYzL4EVOIXVqSdRJ+4hy+5kCW3KKtvvoj5Ste6ut +m2TABDaIRgsFZmrrfVDxhpMMa3zIwfCEO55yhn97KTTRYtWUe4UT38ST094vhIPX +jkr87njrDxowHCodZ/vSWgvaaFw1QWukpcUGTPN0KoMmPIyJ7caEkd2/lI0Hrikz +hrJfl9r3JejMK0IBOqpxIl2ur9MxPGEetTwowiYXWPkw5q41dX3hbh29TOtC7ufX +xgfK8JypYa270r5bAm0oIHg6VPMgqX+5z3lBciSbPRpjj1/eeys0+Hn2F2iffim8 +tGiBl82onumrOPpCfi5ajQ2rKq2AzecwJA1+GLI1knRUMfSn1ei+qSNzNRpHmeuN +NFHHyvDr+1gk2ok4NfcdWSWtXIU1WJCSY933nSbZPhngQlHIDEQuCqQ8RElENDOo +WvT6AMZhW1UYj/0mHiI1UZklHBEfZlRTxH9vCpt76u1APv432hby5eerI6pbcz5z +znAIa++mWKngtpB2zuLMp+QSmSYFKP8ydzsxcA5cMsIFuosP/p5Y5OtDsXzcHuYi +7iZNn+AAcTz5AQwhTrq8AEp8VvRWEtXrrdKFW8wDZPKeJawgBm1OxGO7IWoOdO2X +mgoWONmCEzSi997j7NkQhhrAf9N8jzohKj94cjZthtz6KlHUde0J+unGh9Z9sGb5 +4LQO64gS4uaHscPfWcFFcKZ/INNw7266sDFotDC14QzWmV/efPnq2UutXeaQRGPg +6tCYrl/h1eGdgkKTp9lANA7vA3cfGQA8bhd3hzvBz0CH7gS79DARGQtPm0DHcIys +g0yRt+M+lcl8P8WPSg/jRDSzsPkPUDOBXWAeJ9XSn3XZBNUgMOmhsWJCH8vlntxh +1v2cCb8WwtIa5SkAeLaY//j15plniYEe418mmiHpmYoiRqRoBDHJYfgKpN7I/tXv +uY1mH7w3eh/ePEUwZn8EvaK2XPMCc8f3PsZHozeuM7qMGsO/poiaklREA34IOa/r +M4zPLaZYl2GMSN2zemtMWiaeV1jNDrj5MiNFM5U34c1LSnXzCBur1Hz8bUwR0BCB +oNpp7ShKsAlMo6+SWtySOG8ir/0aA2GQQinmNmHkIpAQD+B3dKwAwzuXq6wTdHGk +D1QOg+c3qdmLyHCnhwNVM9CMVZeG6iNRcC4xZwAsrr80+Az3Doca8GnXi6Qd40tV +qk4BHvskWuLd7nnQQ+tXzJE8q6ZYeNJgDMRdkWjZ0bLR3zw7IqQFrtOj1MMHOwx0 +VIHK/ssmMiqTibhAY1jqc69k6+hgLfsr8n2/AQOzcVgZ7mFF42lP3Q1tuvNEl2Bd +g2m+upvNm6lkvh1w2I4= +-----END ENCRYPTED PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIC/TCCAeWgAwIBAgIJAK6SDJlMl7sKMA0GCSqGSIb3DQEBCwUAMBUxEzARBgNV +BAMMCm15c2l0ZS5jb20wHhcNMTgwNDExMTAwMTA3WhcNMjgwNDA4MTAwMTA3WjAV +MRMwEQYDVQQDDApteXNpdGUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA1HLDuPvtbbIjF92dvEI5Hy7kJVthtYc7qFQp2NxMIl5W+WVi9QwdIrcB +Fw2Ma4M+pjil+4Wsc8V0Av7/emRPv1BXJKVQdWUu46pm7IT+FID4GYbaOHKkJBNd +LCVLsuKlTtNGGlAUUtVeGiAQE6m535XcLHcMJAaqgmsYEuaRzH5HGVUtLC1evtZT +jiDXljiEGFKunYvaQCLG+EcsRrL4CcSZYzR76qc7AkQlqLOVRh6TmMv2uRYT0ZcI +7FAJb2RRVD/nEJUjpzile37AlyyoJhMioAdrHdWeQRNxImZ168En+wVzgYHKh/+l +AhzuCoqq5y4XUg8pBAx6/x6N8VSGQQIDAQABo1AwTjAdBgNVHQ4EFgQUbjWs+Yc7 +V1jbZXWTYAoRO5knPHswHwYDVR0jBBgwFoAUbjWs+Yc7V1jbZXWTYAoRO5knPHsw +DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAbGTpf62T+isSKEoZh1Zr +EbhGUEZ7JUyfWvGJnbzYfxrHBX7J+HUziWtkjazdwKR9mUKkRmFrnFLp1stOBxtq +7CzA8A7jTdVqT57+lwxiyQVScDF2DD+iZ90CfADvemgVGCpGkgD5b3eiqFEcApG4 +H210PTWPLA+h0U8ElpRwqwJtXEaQonCI7XOWKHiBifYy9In2a2FV+jv9vHgan5RC +hEgDW+rVLYNKGtLVii06Hbr5XnhkWOsBOSH8/qBQRR/UGE8y47m8FiGt+K0lhTxn +DdDZZxmdFDC49GAnf0wNAbui8DmhrVBX94Q+myO8NLAneXmjR4TAiMuM0lHvugpc +Ow== +-----END CERTIFICATE----- \ No newline at end of file diff --git a/src/keyvault/azext_keyvault/tests/latest/import_pem_plain.pem b/src/keyvault/azext_keyvault/tests/latest/import_pem_plain.pem new file mode 100644 index 00000000000..c0e58ebd9aa --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/import_pem_plain.pem @@ -0,0 +1,47 @@ +-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDB30HkFMtU6Yzx +TExpK0XZJVq1cTKNSiuESSvYCuOLXfdD43K7B+uvmjsVUYtiA+LXcdFL22GToNmR +VUqCKuuIyVS4Mq89LiAd7EpFsR+fXAg4L5zPhBoVOo8mJBRg6OKoSkVNiHkfrUuo +Gp3yx9O+44L6a0m4EbYJQtAoZuo2tEMfwuLm9bz5aZgtKiO08KU4oXx0FcuFW8wT +wDElsBwSeEZx3OjYCChmGPQv1UuhQ2PwLNfSpB9XRxxx2smEHptxzQPgG53hpdTL +1wlsNCEYX9m+7fv/7ePK6nQEYMxAcJp9hfH4BJJbSIpnYMYNhaVZlFinsGzhnD3k +rYSqqmsLAgMBAAECggEANCZ3FgBV9cBhTmNExqGCR3gZ32bUv1btP8djCNlc/hdH +tTZQnWjzCCiHriNiR/pdobCXKT2ZENoazFJSGZOsCf6GUIopw15N+16dWAPeSsK5 +30tHdjbFwWIgMZVQ+gSLO9PGsqV8V34JNO38ANup5NZUXEJR8TaqbfFQBx4v8Iiy +85qhZ+/TvF1uaqgsxqSqRklmrcaJUoOeMK9jVadGA6FSvnhVAotDuWGD0QhqkoaE +FAtlR0p6ySYR7AVxuI/Gmr2dIDS9z5lw92aIUIkxphYB9CXKuunARgadbedJ90gW +3BQZkKS9KDc3EsxxbvuhNLResDOM4t6M4pUIZ0tn0QKBgQDoXu0DamHDt3Mqzrap +ZepPhSRvuOf56GkxP+AHy0ftiFTtipoYEM19M3Mm3+7LoaXz0uEPPbsOn6wgX9gv +GFUlroEMoNwQeJ9cnP3+23AOsSMKmyNBLArJFPvqRdkFmBYDWwHgN+dEddulZbiw +JghmiffdSqMUDNz5BikWlPXYSQKBgQDVliI6HywTrx5V5qAYnEmSFRPtzDlgY1O+ +W3+QZbXcvcHYJNw2x3yQQ/ufEU8pkTTfypbMCtfe5jUDciqZZ4oZpTR4z4zzrjAJ +UD12NmuLxSc6xWfawBKhbhwkwQg8PqLn0GH6XCiL/avBCVS6h1OnKGbruQcskDa2 +TzhWYYKwswKBgQDK2nOWU7xdGz0S1bpoT2wpV1XjokwAwn9yWwy8QR3dovJhHGpB +MAnzjoKsITlZ0xgIrsOChqVRstqUuJcFJfzPFHPcDmGOj36vXu3tGqvMZ57rl1tD +fas8t3Djp245j/dHnp8YmjTucuT4ksCUJd+XhEI5kPqkekY9rr8X05p64QKBgGtT +efeC2n85rCC2NxSm1EFX3h/MU7ifsOEi0UMaGPzHTbTzMMVGEM3dm38fD4xvrwYV +oxj9CeS0AUeuAsH7SWYBohBjGw0IJpNHgtr4FaqyczgRIlLF2ZbM4c+GQEElqG6c +Q9+ul6Fg4wGpUq44ekyw/KbO31ABV7zcqg6eCTIJAoGBAMjQW4W2UjvxLgnXdbgJ +b7M4iNvUtHoWgbVRAfkf1Q8AkI7eP3PckwUBB0i6G5ZtcKrzXwKUKdxQ2aYq9/9k +loKmrjq70W3+AnHDdiZ93TbozLOUuD5G/7Lh5FRIv4chwD4SJ/akin7tfLAJmIYa +Yc2EjWPKqvDoT45OopgLBD1u +-----END PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIC/TCCAeWgAwIBAgIJALVWZFpMwJKFMA0GCSqGSIb3DQEBCwUAMBUxEzARBgNV +BAMMCm15c2l0ZS5jb20wHhcNMTgwNDExMTAwNTEwWhcNMjgwNDA4MTAwNTEwWjAV +MRMwEQYDVQQDDApteXNpdGUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAwd9B5BTLVOmM8UxMaStF2SVatXEyjUorhEkr2Arji133Q+Nyuwfrr5o7 +FVGLYgPi13HRS9thk6DZkVVKgirriMlUuDKvPS4gHexKRbEfn1wIOC+cz4QaFTqP +JiQUYOjiqEpFTYh5H61LqBqd8sfTvuOC+mtJuBG2CULQKGbqNrRDH8Li5vW8+WmY +LSojtPClOKF8dBXLhVvME8AxJbAcEnhGcdzo2AgoZhj0L9VLoUNj8CzX0qQfV0cc +cdrJhB6bcc0D4Bud4aXUy9cJbDQhGF/Zvu37/+3jyup0BGDMQHCafYXx+ASSW0iK +Z2DGDYWlWZRYp7Bs4Zw95K2EqqprCwIDAQABo1AwTjAdBgNVHQ4EFgQUgobJeTWm +hSKSfVhid2H8lLL1UhowHwYDVR0jBBgwFoAUgobJeTWmhSKSfVhid2H8lLL1Uhow +DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAr3cTJLL2yVv8SZyXPyCv +YrWUrhKt8JV4jLs7hVsN55hVXfNFA0s0hiRNTOLhPHR7vz/CEG5ZqJMRRVZY3SXi +y/FiGHJQFMRKmmpnIxaBJKebUtSMIXuutXJd4HVr/Wi6gPfjAu4VB0sia/ELE9H9 +qF5OCIj5V8U1N5+yDwlarF0/R1gUrGSqYu5X2Vq611tyL+SBHaOCwDd3j9cJyMK8 +z2+wqBMzTFTq15Le09QKSDNu9RBdL8M+uSxoaN1/ufRaHmCnizPC/P2wZcApkOgi +VsrRGkXZPaSS/1s2edv7erB/PFqbEfJtigycuHGw0tWP30logstdBCdX1jtbwmJU +qg== +-----END CERTIFICATE----- diff --git a/src/keyvault/azext_keyvault/tests/latest/import_pfx.pfx b/src/keyvault/azext_keyvault/tests/latest/import_pfx.pfx new file mode 100644 index 0000000000000000000000000000000000000000..1b7db2f4492ad21819749486f1b5015adc6e845b GIT binary patch literal 2701 zcmV;83Uc)@f(nTO0Ru3C3QqvcJTQU^I52_)?*<7fhDe6@ z4FLxRpn?S8FoFc!0s#Opf&|qD2`Yw2hW8Bt2LUh~1_~;MNQUj2be;;Y$kd{T=ED% zpfRe&>3o_VBUb2O-Cb@m%g3^R&qI4Chncq|aRQiSZ8dVD&BA4}->6z#kC9vE0T5%S zbQrRE0U}-jKuaLgsq_1GY=nE#b&tYmk-4M0yFnDhQN#yEKs=AJ#HJ<^Z>+=Cq_UBQ$FxvEOl2SVHFodKi z{b4WNYyf$?6!FG+V`|!=?Ch#>-jndQyISZo(MRs-*JHYfU%S!=NB|1btLr=9062+t z_Mfmj9T8Q#S#p|4Aq%a2{T)tk?l|4yjG{Mi z9TuA&-DOA|;|*psKY+ywe2TIdPsCq`UYcSL;6LB$@<(|TFeyGmod=vGA*-DNyIr&j zJdR>>KOj}A)>w3)Jn>=;si1B3%~3Ik6O~S_E?I1NlTilIhiPpjb#E#M5*u5?IOBQa zimPikE>K0*7oe?n!<5hwFKe`ICq%PmXdM=hOC3zipXT~jouDwOgoFo+krmNQO}2$J z<3h@PTwx>UdI-*b`{zq<%2{%@J1M|unfvYhym)IYGV9fczHe`pz2`BZR?+DjgMOY8 zXw6jUx%Lkab$t=U=Q&2FOpb1e>HZIp=*zxEG)FnG^)sr$wsB(b4F^uC^H1d9_=cHuqU! zC3aHRUU+K617ZMx^GRxHlz+nK1HlO{=JVNP;CrcyeiC?Gh6bNED_Rxymta?EG;O`! zgsjAKip5(sFoFd^1_>&LNQU2ml0v1jxw){W#UU5IOYAK_Gisw4tqUq66Zz<=J-w|a0bQ5^hg-4{! z()d~@m$q6#QgM%*MQj)ZZAAB9g-XiVSh%&w3oCyoUCYWG3C6uV{|tb^N)PSFFwq2DCL!S0?HBG3|yR<;BSh42YJlHDxx;`ozw#Wf41h2t(r=&iCzfAQr?E|MKHeBA6Z-QmsV zGC(jaaE_oUN~!`W#8Cy9k5Ma9$TRNmDijC1WRVKBQ;%5c#t`Yube`CG9$lXwR$uEp zQ!T!LQdKx=)}N&i&p-b7GmO{)`k-Er4+>M~SLI7EP31^Sm(MP_yI`ZTLF=?hq!74y zo{WxoeDVuKpVIGXMJe*7Y+yjED}%+}N5*bR?%OSj{aAYa8lD**~$V%X0L;08!laI7`VSI7&efxRYWU=2&o6%be2o9h5LmzY(XK%83uJ zI>W48t%5>_SBbphl8=4hu>e7=Qf~)=H34YEzh_L5=iqyxr#s1;p+p;Aa4~Fy@Dn1AJ-iGPrqMyRuJZCxR3yAL%3CFeFwE)B5`(lFG9I&ASasQ%UmppV^mI9+Sc({FXa!m26;~0oCoZ3vX=zaE*+G^ziD-oRCpSD=N0OBZOhJB zk4$!zbUJD;>Cpo79ehS-@mh!B0941nJzt29=E(LDbPRBZ8l}#E?;O&;4Fx1c-ZP^B?T6ZIX9Xdz`-_XWBf?JwVBB+vd!^GN z)q;sVC4Kveuaz51Mt5GPnz4EZT&6TwdI<=Xc?2?X!ol|q}JdXZ`#km9sUl@=rC(f)Z H0s;sC-G~ut literal 0 HcmV?d00001 diff --git a/src/keyvault/azext_keyvault/tests/latest/mydomain.test.encrypted.pem b/src/keyvault/azext_keyvault/tests/latest/mydomain.test.encrypted.pem new file mode 100644 index 00000000000..e7602804404 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/mydomain.test.encrypted.pem @@ -0,0 +1,53 @@ +-----BEGIN RSA PRIVATE KEY----- +Proc-Type: 4,ENCRYPTED +DEK-Info: DES-EDE3-CBC,0F2D269149D56431 + +9HIOY2Nh7BRcE5i525LwBEYVRB+XvoWK/HG7X/Pw2rGgBn5wGq1/HHVda4Nc4wL/ +GjLEkvBIP1IxkMjSvInCCZvUUKI7EZjaUpKAub8Yc39QEWYFSGbvExMpEHe72Rz0 +RTmea3ZoYHN2UlHc5mC9qCznS686q5NrjLDy9/QrEwSjDDD317vI4mNcKtcx0FfY +UCCYGhJFsSElas5+i/zfMsUnPWHxBoxME66QgPptk+q+vwI96ocZeWEfirvkoRgF +oQD/+iMlmELNqgGxDBNI+1UCEj59DYmJFGTsL7n0p6e5wMJB28nH0O7MhzOOL7mV +r9CVltiLRPTlVVQkfhcOkJFCrB5RNGKCPwjVxQXzv1KyakT6Wb71CXBFesQ+0svc +Y/40inDHKKMTUxpoi5MZTi99AIlHe3mTwxaD1Wu6I0ncCil8cEGekyIb1xUE6tjE +Nnun+hBDWYr5x7BIrtdTo3sfANsy7G4z/Ie7bWqahcdBaU7eKOcMyeKzXM1zcsOV +cuT5qMY5yvUp3xnhKek3/+zMVHs3/IwKsue1dHDwjJYIwzA2bTSqRn/hCJzuj4Np +m6eXh9LbkCFEUrV3A0sbStS0gbcCz5OKq5L23ZbuTkW0Ok1WJ8iMHkLf7v2TSAwV +AF9DQePiw3yq1p+xQOeo6q1b4z9A/yXoHKeMrSYfDKawP0kflzqO1qFedV4zPxXy +zmWfxm++rZQsRje2dfFT3cngDDY/bPU5BtGA6s/0icJh9dhbSYeIhlq8/7foAQXS +AlJVVqrBAU/R/xajxoFK5G2f6fu0vP+e3ukBkbU8wsdrVHLhf1MOW4GMs/EfR5FM +zVsFtVDtyr+ehpNxNQClxIld1aa7EJto5v5qflR8+88DI4gvbI5kNnlhLLqtZrxg +KR7Vqjdlc5KUpnwQSWoE7WKvrB5fI4VCe9KtOgy8zv60XtVI2II9UovG3p5lBEYn +iHc5tVEi6qsbgQSrZ09kiUAqb3J4+zRfbmZF+LzeDvtHmG+h6B+0adx3l0AMM5tb +AxmF7TxfFFhaXNPhGVEXb/6unaSUtDBwFRABb9jgPNfm8cwHIdtzfbirXPc+PxBe +QNG+ZNdbM7kic5xayS3vPbYQzzzDDdwRz+EEbgtDy34xlcax5pcVAgrM72bWdolB +9Zj22Zcn8NGq52Qu9GobErw8hZWH1S4MY70Bj9ATaJDVaDQIyyDPK+SLOdRqGa9U +Klp6szHuARZYJrxBWVOmYxW6+oAPXuwL8JLgQTbSOZLVkrXjeQskaxvXQp/hltfb +0fBizVUe3MpltMZN4cgfqR7VfmB48/FonPSagEFkU1FA9oiagDFYYlqO7VIU6b1E +1lZ1n8YFoKv8J8FIoEi7jTZMaBl0fmXaiLwIc81JIZ916mZrK9mtRGKr0iu3GE5l +bvkhW0bs1ejbPDLvnx1IMP1ThWGtpgIZa9MRQO/6mBJlmwYsNgR1A6HlQXlgD6IX +WVkG0MrNXIG+poXJBoJSE6WrIx+gaeX8Iwkp+jPySo+0aBx4UFYlgz6JXB0TQqsp +FolS7ksQVV5Uhuo+bZXe0MHaqxtJ9Tgprbhydnln7DmwxRo5BbvehM0B7H4OYM8S +-----END RSA PRIVATE KEY----- +-----BEGIN CERTIFICATE----- +MIIDgjCCAmoCCQD56NLDrVRYGDANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMC +VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdSZW1kb25kMRMwEQYDVQQKEwpUZXN0 +IFdvcmxkMRAwDgYDVQQLEwdzZWN0aW9uMQ8wDQYDVQQDEwZUZXN0ZXIxHDAaBgkq +hkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wHhcNMTYxMDI2MTY0MjU2WhcNMTcxMDI2 +MTY0MjU2WjCBgjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdS +ZW1kb25kMRMwEQYDVQQKEwpUZXN0IFdvcmxkMRAwDgYDVQQLEwdzZWN0aW9uMQ8w +DQYDVQQDEwZUZXN0ZXIxHDAaBgkqhkiG9w0BCQEWDXRlc3RAdGVzdC5jb20wggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqQe89IyI+hTlGcsja/sRbky98 +dw5sv9AmjzeqZaAoJtpoUbfNA0uskoJYJBS0/ai8HVmvX+CmXuY741dj5bgt/MAy +34+upHWgAMrUtdkNmuxW+FM3dZChRQOcbC7q1FqPARL644wa62QJ6ZbveNcpAOER +LHtsROUPxhvEp8e0jpiTHxgHCFOy4UtaZy+fgS94sZAHAxdl/BCKXWo0wtxmxUZm +Wk2S5+ksbQE7nswROjr3XQrerYIizzeaHKVjp4KOoB5W1f1CLmW3gzPyB9dXlywM +zazvDzgvS3Pz9WloLytCqDIHXq3vPQsw48gISQ4OZDxYidJ8ByrsnDZCg7mhAgMB +AAEwDQYJKoZIhvcNAQEFBQADggEBAES4MYE0dQMJwNw8uDL51qpHibJvZiwXVTBc +f23h12tdZAMPW8sgiCNdZHKRH/NQ0LGvV61iD2IXlHnRfPT880wDGUJGn9PPcusx +mKAfwlZogVX/KdX4zrIlxIBBHwiYnqJHLldTYQFqCO8uQqNHjkgmSfZ6IRbcamcR +OqewlEWAK6Jc6ZPSGzkjTrntGKDoiBtH2g9+VrD8hibqC2K+4cyrkt+SGubh3jtW +1emPqajxmcw99SYmyZcjZZ25K6x/zaR905ACAzmFwsrnBjSwAHXzsWWZP8Y6nRjs +YmDigry7A/JhVfckoS1jw5YFjKkpZyzI97YXRSAaWr5F9jqFO8s= +-----END CERTIFICATE----- + +openssl genrsa 2048 | openssl pkcs8 topk8 -v2 \ No newline at end of file diff --git a/src/keyvault/azext_keyvault/tests/latest/mydomain.test.pem b/src/keyvault/azext_keyvault/tests/latest/mydomain.test.pem new file mode 100644 index 00000000000..7e267735a14 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/mydomain.test.pem @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIICfzCCAegCCQD1giVgxjPtiTANBgkqhkiG9w0BAQUFADCBgzELMAkGA1UEBhMC +VVMxCzAJBgNVBAgTAldBMRAwDgYDVQQHEwdSZWRtb25kMQ4wDAYDVQQKEwVBenVy +ZTEPMA0GA1UECxMGRGV2RGl2MRUwEwYDVQQDEwxBenVyZSBEZXZEaXYxHTAbBgkq +hkiG9w0BCQEWDnRlc3RAYXp1cmUuY29tMB4XDTE2MDkyOTE5MTcxNVoXDTE3MDky +OTE5MTcxNVowgYMxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJXQTEQMA4GA1UEBxMH +UmVkbW9uZDEOMAwGA1UEChMFQXp1cmUxDzANBgNVBAsTBkRldkRpdjEVMBMGA1UE +AxMMQXp1cmUgRGV2RGl2MR0wGwYJKoZIhvcNAQkBFg50ZXN0QGF6dXJlLmNvbTCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAzU0BesajA0+OXjH/bMo9dKMf74QM +LYQO0UlhQoiuv15GUE+HvaeKXNLeOeuDmNSq2o+VDTsI6Ayr43c3vI/Jd0fcU5gV +amLekxDmgdk4yZkBZHOlUFaCdRew7ClTIKTfeW9EoVeCfu+zlkpGoOPksotSqc9m +WtS2GbnO2mvBL7UCAwEAATANBgkqhkiG9w0BAQUFAAOBgQB8sdHw1zLju4yNIW/x +JGC5YBe9WS+JTxdqxKqx/wLCq/nv+UlKaF4cICul4SYNSmM0brBxXr9tofdL+UlW +4ZUuFGh3z+uSu/7S/EWQJ8BjHBcMO3ypw11FnNpfhTMi2/rXF0NxgiRJyY38ROB5 +aJqvrwKv8Gku9DLkj5H0bbjqgg== +-----END CERTIFICATE----- +-----BEGIN RSA PRIVATE KEY----- +MIICXQIBAAKBgQDNTQF6xqMDT45eMf9syj10ox/vhAwthA7RSWFCiK6/XkZQT4e9 +p4pc0t4564OY1Kraj5UNOwjoDKvjdze8j8l3R9xTmBVqYt6TEOaB2TjJmQFkc6VQ +VoJ1F7DsKVMgpN95b0ShV4J+77OWSkag4+Syi1Kpz2Za1LYZuc7aa8EvtQIDAQAB +AoGAaY2BCD3ejBI4MWflWmq0pCZGgh/THwe5kpL2xX1+0vdGkX4CXVkpg0YLaZ4T +/9y/pzWRPccvchcpvP6LkpAe1R/jsmfP8QedT2yDTf4T+mE1hyl4D5zyObHjQ+g6 +uUMT6FpeTgoSkcU90PK+lF31igCitfVgeSNIC7Fq+9ZywWECQQDy7/13vNOfvNP7 +bAF+IxWB+g4/kaapXp46tZxEejTIbSaRhuu36HF2+gN3J7UeP1kYpx3n3Qam7ydU +sMm+5XA9AkEA2Fbzajbs4F1bTH6bmvkShrqRbx+XIW/qnbOtGs7ds2VIcqQIwM5c +8Y1YvqBKn6LP5nd/qBAmvVjSAMdh73382QJAOWxWym28y/4zUTOnaqxaUh3MLmR8 +M36lAhWZeWo1fcanHjD5GMB9yXSxSwH8wsiQg85EuGC7SMwwzMj49wF+tQJBALrL +oROF51P2590NuLe/9fIk52xGn4y8gJy4RnBOS/kZK8vovLIVvQTIYeb+qlBaGR7K +8YugnoKBTZpkjbhnVUkCQQDOQ8xVFCB3Jq93ovCv2aG97O+2gVr0AEhhLMbkjQX9 +BLoda2hBGCyuX2QaC80S9kg9oUYJqbXJbS3GSe87OfYT +-----END RSA PRIVATE KEY----- diff --git a/src/keyvault/azext_keyvault/tests/latest/policy.json b/src/keyvault/azext_keyvault/tests/latest/policy.json new file mode 100644 index 00000000000..31df89fa2bb --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/policy.json @@ -0,0 +1,42 @@ +{ + "attributes": { + "enabled": true, + "expires": null, + "not_before": null + }, + "issuer_parameters": { + "name": "Self" + }, + "key_properties": { + "exportable": true, + "key_size": 2048, + "key_type": "RSA", + "reuse_key": false + }, + "lifetime_actions": [ + { + "action": { + "action_type": "AutoRenew" + }, + "trigger": { + "lifetime_percentage": 90 + } + } + ], + "secret_properties": { + "content_type": "application/x-pkcs12" + }, + "x509_certificate_properties": { + "ekus": null, + "key_usage": [ + "digitalSignature", + "nonRepudiation", + "keyEncipherment", + "keyAgreement", + "keyCertSign" + ], + "subject": "C=US, ST=WA, L=Redmon, O=Test Noodle, OU=TestNugget, CN=www.mytestdomain.com", + "subject_alternative_names": null, + "validity_in_months": 60 + } +} diff --git a/src/keyvault/azext_keyvault/tests/latest/policy2.json b/src/keyvault/azext_keyvault/tests/latest/policy2.json new file mode 100644 index 00000000000..110d98261c9 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/policy2.json @@ -0,0 +1,42 @@ +{ + "attributes": { + "enabled": true, + "expires": null, + "not_before": null + }, + "issuer_parameters": { + "name": "Self" + }, + "key_properties": { + "exportable": true, + "key_size": 2048, + "key_type": "RSA", + "reuse_key": false + }, + "lifetime_actions": [ + { + "action": { + "action_type": "AutoRenew" + }, + "trigger": { + "lifetime_percentage": 90 + } + } + ], + "secret_properties": { + "content_type": "application/x-pkcs12" + }, + "x509_certificate_properties": { + "ekus": null, + "key_usage": [ + "digitalSignature", + "nonRepudiation", + "keyEncipherment", + "keyAgreement", + "keyCertSign" + ], + "subject": "C=US, ST=WA, L=Redmond, O=TestO, OU=TestOU, CN=www.mytestdomain.com", + "subject_alternative_names": null, + "validity_in_months": 50 + } +} diff --git a/src/keyvault/azext_keyvault/tests/latest/policy_import_pem.json b/src/keyvault/azext_keyvault/tests/latest/policy_import_pem.json new file mode 100644 index 00000000000..60297b609ec --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/policy_import_pem.json @@ -0,0 +1,14 @@ +{ + "issuer_parameters": { + "name": "Self" + }, + "key_properties": { + "exportable": true, + "key_size": 2048, + "key_type": "RSA", + "reuse_key": false + }, + "secret_properties": { + "content_type": "application/x-pem-file" + } +} diff --git a/src/keyvault/azext_keyvault/tests/latest/policy_import_pfx.json b/src/keyvault/azext_keyvault/tests/latest/policy_import_pfx.json new file mode 100644 index 00000000000..78e88150b97 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/policy_import_pfx.json @@ -0,0 +1,14 @@ +{ + "issuer_parameters": { + "name": "Self" + }, + "key_properties": { + "exportable": true, + "key_size": 2048, + "key_type": "RSA", + "reuse_key": false + }, + "secret_properties": { + "content_type": "application/x-pkcs12" + } +} diff --git a/src/keyvault/azext_keyvault/tests/latest/policy_pending.json b/src/keyvault/azext_keyvault/tests/latest/policy_pending.json new file mode 100644 index 00000000000..a5743033998 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/policy_pending.json @@ -0,0 +1,32 @@ +{ + "attributes": { + "enabled": true, + "expires": null, + "not_before": null + }, + "issuer_parameters": { + "name": "Unknown" + }, + "key_properties": { + "exportable": true, + "key_size": 2048, + "key_type": "RSA", + "reuse_key": false + }, + "secret_properties": { + "content_type": "application/x-pkcs12" + }, + "x509_certificate_properties": { + "ekus": null, + "key_usage": [ + "digitalSignature", + "nonRepudiation", + "keyEncipherment", + "keyAgreement", + "keyCertSign" + ], + "subject": "C=US, ST=WA, L=Redmond, O=TestO, OU=TestOU, CN=www.mytestdomain.com", + "subject_alternative_names": null, + "validity_in_months": 50 + } +} diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate.yaml new file mode 100644 index 00000000000..06ef40d9dd3 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate.yaml @@ -0,0 +1,227 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 + msrest_azure/0.4.17 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.22] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_cert000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001","name":"cli_test_keyvault_cert000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 07 Dec 2017 22:27:59 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 + msrest_azure/0.4.17 graphrbacmanagementclient/0.31.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","deletionTimestamp":null,"accountEnabled":true,"assignedLicenses":[],"assignedPlans":[],"city":null,"companyName":null,"country":null,"creationType":null,"department":null,"dirSyncEnabled":null,"displayName":"Admin2","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Admin2","immutableId":null,"isCompromised":null,"jobTitle":null,"lastDirSyncTime":null,"legalAgeGroupClassification":null,"mail":null,"mailNickname":"admin2","mobile":null,"onPremisesDistinguishedName":null,"onPremisesSecurityIdentifier":null,"otherMails":["destanko@microsoft.com"],"passwordPolicies":"None","passwordProfile":null,"physicalDeliveryOfficeName":null,"postalCode":null,"preferredLanguage":"en-US","provisionedPlans":[],"provisioningErrors":[],"proxyAddresses":[],"refreshTokensValidFromDateTime":"2017-12-05T17:57:50Z","showInAddressList":null,"signInNames":[],"sipProxyAddress":null,"state":null,"streetAddress":null,"surname":"Admin2","telephoneNumber":null,"usageLocation":null,"userIdentities":[],"userPrincipalName":"admin2@AzureSDKTeam.onmicrosoft.com","userType":"Member"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1344'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Thu, 07 Dec 2017 22:28:00 GMT'] + duration: ['503234'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [yt6nptJbg5NcMoRd8olQmRyf1xoaQrW5AVjlweyozdM=] + ocp-aad-session-key: [7_WUS0NRbm6zcyJsx6RPJKck_nqTmXhDTiGxslDaXR-kR5jTLyHPaYPGPD6zT_AOPYfiYJyYfvT3L2Mj-l3mwunVzaRVOS-Yyn77s6WAFxU85zNuIsRoF5KnGYMmZ2r3.89Ln2mfoWS6qENq5PBwnt0H0UDMPoRbLtuAlueqXLns] + pragma: [no-cache] + request-id: [f1112baa-de07-4e6a-946c-888aa24a437a] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET, ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"accessPolicies": [{"objectId": "5963f50c-7c43-405c-af7e-53294de76abd", + "permissions": {"secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "keys": ["get", "create", "delete", "list", "update", "import", + "backup", "restore", "recover"], "storage": ["get", "list", "delete", "set", + "update", "regeneratekey", "setsas", "listsas", "getsas", "deletesas"], "certificates": + ["get", "list", "delete", "create", "import", "update", "managecontacts", "getissuers", + "listissuers", "setissuers", "deleteissuers", "manageissuers", "recover"]}, + "tenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}], "sku": {"name": "premium", + "family": "A"}, "tenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 + msrest_azure/0.4.17 keyvaultmanagementclient/0.40.0 Azure-SDK-For-Python + AZURECLI/2.0.22] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2016-10-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","accessPolicies":[{"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","permissions":{"secrets":["get","list","set","delete","backup","restore","recover"],"keys":["get","create","delete","list","update","import","backup","restore","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net"}}'} + headers: + cache-control: [no-cache] + content-length: ['1068'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 07 Dec 2017 22:28:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.189] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 + msrest_azure/0.4.17 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 07 Dec 2017 22:28:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.828] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 + msrest_azure/0.4.17 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 07 Dec 2017 22:28:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.828] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"policy": {"issuer": {"name": "Self"}, "key_props": {"exportable": true, + "reuse_key": false, "key_size": 2048, "kty": "RSA"}, "secret_props": {"contentType": + "application/x-pem-file"}}, "value": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCRUPFgOvovNJ0e\nXSHlcm2V9w/ECwzMc31BaN2xBmWjegmqixv9GN3GWMgUQ9zC9k9bxd491Awa55Sq\nht86TL8Q3Fcn8fXuhWbX/gNAO8h5tfuQVA1zB5bVxEQsCNmmLrpgNhLYO+excyCJ\nocqidQostSQfcXU7qJtifpgmRt5oW3WhmpVsnAugS8y8vbCGJXdKqLCZXjL/H0aa\n+r/Z3BzQ+BglULKYshSBinxbYe+1GJ/028/50y/MPf9iFiiS9xtspOtSzd1e+NA5\nG+pCMppJHars9D/FavTewI1zJa9jPxtrwr8L3nEmy9gv6v1474XNYaagtQNjdU0b\nAV3EDfn9AgMBAAECggEADJtGjXAgYzb/yHIQ7jxamG96DSpePmBoheOok+J3r9J3\nAzYVRARDvSDXnrZycPF4WgBU8u0x7aWYhqCzvfWJf9d1si/yA3LMRMGzG3/0OOba\nP5+jGQ8X/UyNE3rjEuEr5wvZ36t2wrS3pmkEUMqxisZeL2Ii5v2OGWHdJjjws4HW\nP9pBGjcgxUP7UKPLQExHb9oUswh66Z+K9o10ZwArPYhnhc546vPlbHqO5bTS/Rza\nPd+c/h7PrrqwSBavm5mdjcHwqr5JjhE4OzbS4HkiYVnpx4OPRcgR0vWE6cG+0zg5\n4AROSM9kvrGflIqn2EAojRAz5S6wHMk7pImk4kAdSwKBgQC/wVsEruzUj3p7DvXc\nXRo8juRrWztrmOvp0GwhsVIVaF0Fr2lqCEGgOqqj5IEfue0UaCNCW3I73rRSYaNe\nnJ7PGZMYmLkzwcvGTEeV9CRqOgvKvbf3RiCpkKeLz3dil8AGdyVlwAJmq8Fn+IMT\nrwGaw3/UHTRMnse6JPoQ+k4KMwKBgQDCAI4Mlq5K7WSH1zNKSLgII9KnfHHkusNU\n88hpaVReXmxU7uQIC02nbtYl2oM3I/Lz9Otk/nPIbh4g9LKmju5Gi1S2wchInDfP\nKwgPoClM6/VM4e6CS9qq/FvJdLu2228AxcdSoIwGmrkbiTtGNedO4CdBa3/vacac\nuD0iD/gbDwKBgQC+mXzVHOJ/LdZ6txYe4dQQWaAmLdrUSn5EPE0e+Fg0uzWrTv4i\nzO4eS/INUjYeyPokjJZvgOH9LJJkSHTQuDEKfcs+aZ+9GGZqRqvpG3GOvP+3l/hi\nKyyQHx7K039BWsEeLBPaHY7FavelVtlDGXMo2CYZOqYfervgBJ0jfwlPDQKBgCuC\nSFlWadxwBT3Z66zbRjq9Hf9mD30Gzcv9qJLLhpprfsxFj2qmblIAr5JpwUfajiBc\na3aJApqO577oYjCsmY/Eq8kZCLwQHQwfUH2ApAKWYLtPaFhcfrweQM+bmIXYDLsV\noDBNxVmt1ZnxWxPR/wBXkTZAz7538I0xXLSI9FHNAoGBAJ/2ck5G+pKVHJA9sFoO\nwpB1jimZNmZjw2Fiu7u33IQSq1oMijD/M8qLFlnquetBrjniW55ViR89HMe+5Bwt\nnZ+Pq6xDKnzxRyyFWGM8lp+JDMMj1xOHIYil+aFgZyWm6/VzN24vdp2eYRYWBdMT\nP8mukpnNhytmI1/4ozaU+wai\n-----END + PRIVATE KEY-----\n-----BEGIN CERTIFICATE-----\nMIIDJDCCAgygAwIBAgIQc/Rvc7SNT/iJre6II78vpTANBgkqhkiG9w0BAQsFADAP\nMQ0wCwYDVQQDEwRUZXN0MB4XDTE2MTAyNzE4NDM1NloXDTE3MTAyNzE4NTM1Nlow\nDzENMAsGA1UEAxMEVGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAJFQ8WA6+i80nR5dIeVybZX3D8QLDMxzfUFo3bEGZaN6CaqLG/0Y3cZYyBRD3ML2\nT1vF3j3UDBrnlKqG3zpMvxDcVyfx9e6FZtf+A0A7yHm1+5BUDXMHltXERCwI2aYu\numA2Etg757FzIImhyqJ1Ciy1JB9xdTuom2J+mCZG3mhbdaGalWycC6BLzLy9sIYl\nd0qosJleMv8fRpr6v9ncHND4GCVQspiyFIGKfFth77UYn/Tbz/nTL8w9/2IWKJL3\nG2yk61LN3V740Dkb6kIymkkdquz0P8Vq9N7AjXMlr2M/G2vCvwvecSbL2C/q/Xjv\nhc1hpqC1A2N1TRsBXcQN+f0CAwEAAaN8MHowDgYDVR0PAQH/BAQDAgWgMAkGA1Ud\nEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaA\nFJh9TmNuesqccgmdVu7WD6bYiurmMB0GA1UdDgQWBBSYfU5jbnrKnHIJnVbu1g+m\n2Irq5jANBgkqhkiG9w0BAQsFAAOCAQEAj0vTtSCjSQIZagzOvjTtZvnKH6E0q0zX\n+MAtJnS8Cb/XVPEW0FqN5TLXvvaktjKCDHSPmYwneTjV3hjNe+jB03R1Z2auxnsc\njSfLT4+tthrCiHTLX+WrR+F3SwOX/cVFGiU0z1IcJe5m49qiUJ6kemHaa6umgfGX\nHbnCqzR76WkhDJWFz9MXFFvFTRGE+267sliQf8PrKr65oOEVZV/E+SInQdm+H1LY\nWAbig4UxHN8UQ54G9mdW1e/uRumAT73uty+C0O8VQvNvsco2HAiPOtDce4CJleZx\niAv6z0Y6PKRYb4xw+xnmqpC8ks1T93JFaniHl53cqRNbXy5t9t9Cag==\n-----END + CERTIFICATE-----", "attributes": {"exp": 1509130436, "enabled": true, "nbf": + 1477593836}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['3170'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 + msrest_azure/0.4.17 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pem-cert1/import?api-version=2016-10-01 + response: + body: {string: '{"error":{"code":"BadParameter","message":"X509 Certificate is + already expired"}}'} + headers: + cache-control: [no-cache] + content-length: ['81'] + content-type: [application/json; charset=utf-8] + date: ['Thu, 07 Dec 2017 22:28:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.828] + x-powered-by: [ASP.NET] + status: {code: 400, message: Bad Request} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.19 + msrest_azure/0.4.17 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.22] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_cert000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Thu, 07 Dec 2017 22:28:15 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS0VZVkFVTFQ6NUZDRVJUMzdMRU9NVVlHM0tUWEJZVDIyUnwxNzhGREVCNzM3ODZDN0JGLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_contacts.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_contacts.yaml new file mode 100644 index 00000000000..16e491af0e6 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_contacts.yaml @@ -0,0 +1,524 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-11T10:09:53Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_contacts000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_contacts000001","name":"cli_test_kv_cert_contacts000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-11T10:09:53Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:55 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:09:55 GMT'] + duration: ['660892'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [OQLywiI52PNERwXzjFjjauDsq3Wqe1LaqVZPFAotG7Q=] + ocp-aad-session-key: [fax3asi6Dzn3xrV85-JwsUvaZ15yPSP8ClSLkKU2b0Yojtf1xpYdc85UPI20b4jq4U-E2FxdIyhGF3bti4L_mLssNTuv1B4H8NUJj-gIiEgWtiKK8umiGGoo1TRVltMz.aiJuonYL1NkeGkqku3jGs5yqo2KvfpUNb_tn0kLJHM8] + pragma: [no-cache] + request-id: [2757e858-e86c-491e-8ad1-ce3ac2ef36ac] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_contacts000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_contacts000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1105'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_contacts000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_contacts000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:39 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:39 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"error":{"code":"ContactsNotFound","message":"Contacts not found"}}'} + headers: + cache-control: [no-cache] + content-length: ['68'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:40 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 404, message: Not Found} +- request: + body: '{"contacts": [{"email": "admin@contoso.com", "name": "John Doe", "phone": + "123-456-7890"}]}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['91'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"admin@contoso.com","name":"John + Doe","phone":"123-456-7890"}]}'} + headers: + cache-control: [no-cache] + content-length: ['163'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:40 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"admin@contoso.com","name":"John + Doe","phone":"123-456-7890"}]}'} + headers: + cache-control: [no-cache] + content-length: ['163'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:40 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"contacts": [{"email": "admin@contoso.com", "name": "John Doe", "phone": + "123-456-7890"}, {"email": "other@contoso.com"}]}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['123'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"admin@contoso.com","name":"John + Doe","phone":"123-456-7890"},{"email":"other@contoso.com"}]}'} + headers: + cache-control: [no-cache] + content-length: ['193'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:41 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"admin@contoso.com","name":"John + Doe","phone":"123-456-7890"},{"email":"other@contoso.com"}]}'} + headers: + cache-control: [no-cache] + content-length: ['193'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:41 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"admin@contoso.com","name":"John + Doe","phone":"123-456-7890"},{"email":"other@contoso.com"}]}'} + headers: + cache-control: [no-cache] + content-length: ['193'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"admin@contoso.com","name":"John + Doe","phone":"123-456-7890"},{"email":"other@contoso.com"}]}'} + headers: + cache-control: [no-cache] + content-length: ['193'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"contacts": [{"email": "other@contoso.com"}]}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['46'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"other@contoso.com"}]}'} + headers: + cache-control: [no-cache] + content-length: ['122'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/contacts","contacts":[{"email":"other@contoso.com"}]}'} + headers: + cache-control: [no-cache] + content-length: ['122'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_contacts000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:45 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS1Y6NUZDRVJUOjVGQ09OVEFDVFNMSDNINzdDSUlPU0dCUXxCMEU4NjM5NzdDRDIwODUxLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_crud.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_crud.yaml new file mode 100644 index 00000000000..cb4f2d76486 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_crud.yaml @@ -0,0 +1,734 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-11T10:09:56Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_cert000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001","name":"cli_test_keyvault_cert000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-11T10:09:56Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:56 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:09:58 GMT'] + duration: ['671289'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [s5K/P2xKeCZaZ6FdSGG0Z9eYryzDiYVRewZeoHCyeCQ=] + ocp-aad-session-key: [tbCElebnbyAYSiEgq5Yu5pDoY16_Qj9R8D5IBAW8cY5fV3R98qVQAwo2XKR9T8O_9h5wVRmuXyZshuXuUMgIJnsLqwxvFHAXFPtqyF3cQTUX4bUDvS9uNORsdM-x-uJu.dGrg-eUsKB6yFdkkc2rxd5Wd9uX2oKlAn-KE_IS6gjA] + pragma: [no-cache] + request-id: [9e0af0aa-5c81-4643-bb64-7d4ae0a09f39] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1105'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:59 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_cert000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:40 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:40 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"policy": {"key_props": {"exportable": true, "kty": "RSA", "key_size": + 2048, "reuse_key": false}, "secret_props": {"contentType": "application/x-pkcs12"}, + "x509_props": {"subject": "C=US, ST=WA, L=Redmon, O=Test Noodle, OU=TestNugget, + CN=www.mytestdomain.com", "key_usage": ["digitalSignature", "nonRepudiation", + "keyEncipherment", "keyAgreement", "keyCertSign"], "validity_months": 60}, "lifetime_actions": + [{"trigger": {"lifetime_percentage": 90}, "action": {"action_type": "AutoRenew"}}], + "issuer": {"name": "Self"}, "attributes": {"enabled": true}}, "attributes": + {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['587'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/create?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIDBTCCAe0CAQAwdTEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xEzARBgNVBAsTClRlc3ROdWdnZXQxFDASBgNVBAoTC1Rlc3QgTm9vZGxlMQ8wDQYDVQQHEwZSZWRtb24xCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+Lkza1ORv578cu68QpiPDSJYrY4d96PIZUokgzIbqGbB5eVRH3mrbTVf02965gg8MCbssP849aULq06nXRpd39hH/NfbySaRFvW7dLis3l37ipt/kgNUgMb8FxliTFtuQhfDd+guCOe/zAtggYxaW6MoWi8bogxEwQcDI8Ra5jmLfmBIX0XC17smxWUzX9hyffmVPICsFhsPKX9JjCkAgM/Eo+QC3DW58+9MN4QklupvokCdGkB/bPQVVHKbsJ0xKn1uZQG4HGFkLDJQ1uBwNaqhynQ+cP5V+A4mGAMVEQcUayS0W/0ZwChmMpJGhlSBRvCxG7Faa25BUmTaNl78cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQATmmX05Be5rEcRe91N9WQcDcYk+9atcQ33NWnMNvZGNpM4GfeGaxmkyRuWTiF187xevZBE/48HITdg8B/+8BtN4AVGA37ilfJxUABpZ9b+4FzkXbWttkb/JXQlXa8l0drUsxzaZsQbJ4AioDWrTcPcEd7FEn0xixkX4fvkWFzyPy9rh5JKv48VZhJ6yKuBEnSAb0gjfj/MPnpzrFAoBuuzaXeIm5dIHpmE/q4ZjH/FfA0fvPnK3qcaIcVoaJdaD9t9suKCnfmiH8xH4U3DaOtC9PC+V3C6whPw3S7gzwdzsmHEv0mwIh/6qY8ODnJ/Z/GXWKybtpMh774C1OM1jcOl","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Certificate request is in progress. This may take some + time based on the issuer provider. Please check again later.","request_id":"37991cf2ca0a4cf49e60875761a5e3f7"}'} + headers: + cache-control: [no-cache] + content-length: ['1419'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:42 GMT'] + expires: ['-1'] + location: ['https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview&request_id=37991cf2ca0a4cf49e60875761a5e3f7'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIDBTCCAe0CAQAwdTEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xEzARBgNVBAsTClRlc3ROdWdnZXQxFDASBgNVBAoTC1Rlc3QgTm9vZGxlMQ8wDQYDVQQHEwZSZWRtb24xCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+Lkza1ORv578cu68QpiPDSJYrY4d96PIZUokgzIbqGbB5eVRH3mrbTVf02965gg8MCbssP849aULq06nXRpd39hH/NfbySaRFvW7dLis3l37ipt/kgNUgMb8FxliTFtuQhfDd+guCOe/zAtggYxaW6MoWi8bogxEwQcDI8Ra5jmLfmBIX0XC17smxWUzX9hyffmVPICsFhsPKX9JjCkAgM/Eo+QC3DW58+9MN4QklupvokCdGkB/bPQVVHKbsJ0xKn1uZQG4HGFkLDJQ1uBwNaqhynQ+cP5V+A4mGAMVEQcUayS0W/0ZwChmMpJGhlSBRvCxG7Faa25BUmTaNl78cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQATmmX05Be5rEcRe91N9WQcDcYk+9atcQ33NWnMNvZGNpM4GfeGaxmkyRuWTiF187xevZBE/48HITdg8B/+8BtN4AVGA37ilfJxUABpZ9b+4FzkXbWttkb/JXQlXa8l0drUsxzaZsQbJ4AioDWrTcPcEd7FEn0xixkX4fvkWFzyPy9rh5JKv48VZhJ6yKuBEnSAb0gjfj/MPnpzrFAoBuuzaXeIm5dIHpmE/q4ZjH/FfA0fvPnK3qcaIcVoaJdaD9t9suKCnfmiH8xH4U3DaOtC9PC+V3C6whPw3S7gzwdzsmHEv0mwIh/6qY8ODnJ/Z/GXWKybtpMh774C1OM1jcOl","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Certificate request is in progress. This may take some + time based on the issuer provider. Please check again later.","request_id":"37991cf2ca0a4cf49e60875761a5e3f7"}'} + headers: + cache-control: [no-cache] + content-length: ['1419'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIDBTCCAe0CAQAwdTEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xEzARBgNVBAsTClRlc3ROdWdnZXQxFDASBgNVBAoTC1Rlc3QgTm9vZGxlMQ8wDQYDVQQHEwZSZWRtb24xCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+Lkza1ORv578cu68QpiPDSJYrY4d96PIZUokgzIbqGbB5eVRH3mrbTVf02965gg8MCbssP849aULq06nXRpd39hH/NfbySaRFvW7dLis3l37ipt/kgNUgMb8FxliTFtuQhfDd+guCOe/zAtggYxaW6MoWi8bogxEwQcDI8Ra5jmLfmBIX0XC17smxWUzX9hyffmVPICsFhsPKX9JjCkAgM/Eo+QC3DW58+9MN4QklupvokCdGkB/bPQVVHKbsJ0xKn1uZQG4HGFkLDJQ1uBwNaqhynQ+cP5V+A4mGAMVEQcUayS0W/0ZwChmMpJGhlSBRvCxG7Faa25BUmTaNl78cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQATmmX05Be5rEcRe91N9WQcDcYk+9atcQ33NWnMNvZGNpM4GfeGaxmkyRuWTiF187xevZBE/48HITdg8B/+8BtN4AVGA37ilfJxUABpZ9b+4FzkXbWttkb/JXQlXa8l0drUsxzaZsQbJ4AioDWrTcPcEd7FEn0xixkX4fvkWFzyPy9rh5JKv48VZhJ6yKuBEnSAb0gjfj/MPnpzrFAoBuuzaXeIm5dIHpmE/q4ZjH/FfA0fvPnK3qcaIcVoaJdaD9t9suKCnfmiH8xH4U3DaOtC9PC+V3C6whPw3S7gzwdzsmHEv0mwIh/6qY8ODnJ/Z/GXWKybtpMh774C1OM1jcOl","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Certificate request is in progress. This may take some + time based on the issuer provider. Please check again later.","request_id":"37991cf2ca0a4cf49e60875761a5e3f7"}'} + headers: + cache-control: [no-cache] + content-length: ['1419'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:54 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIDBTCCAe0CAQAwdTEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xEzARBgNVBAsTClRlc3ROdWdnZXQxFDASBgNVBAoTC1Rlc3QgTm9vZGxlMQ8wDQYDVQQHEwZSZWRtb24xCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+Lkza1ORv578cu68QpiPDSJYrY4d96PIZUokgzIbqGbB5eVRH3mrbTVf02965gg8MCbssP849aULq06nXRpd39hH/NfbySaRFvW7dLis3l37ipt/kgNUgMb8FxliTFtuQhfDd+guCOe/zAtggYxaW6MoWi8bogxEwQcDI8Ra5jmLfmBIX0XC17smxWUzX9hyffmVPICsFhsPKX9JjCkAgM/Eo+QC3DW58+9MN4QklupvokCdGkB/bPQVVHKbsJ0xKn1uZQG4HGFkLDJQ1uBwNaqhynQ+cP5V+A4mGAMVEQcUayS0W/0ZwChmMpJGhlSBRvCxG7Faa25BUmTaNl78cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQATmmX05Be5rEcRe91N9WQcDcYk+9atcQ33NWnMNvZGNpM4GfeGaxmkyRuWTiF187xevZBE/48HITdg8B/+8BtN4AVGA37ilfJxUABpZ9b+4FzkXbWttkb/JXQlXa8l0drUsxzaZsQbJ4AioDWrTcPcEd7FEn0xixkX4fvkWFzyPy9rh5JKv48VZhJ6yKuBEnSAb0gjfj/MPnpzrFAoBuuzaXeIm5dIHpmE/q4ZjH/FfA0fvPnK3qcaIcVoaJdaD9t9suKCnfmiH8xH4U3DaOtC9PC+V3C6whPw3S7gzwdzsmHEv0mwIh/6qY8ODnJ/Z/GXWKybtpMh774C1OM1jcOl","cancellation_requested":false,"status":"completed","target":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1","request_id":"37991cf2ca0a4cf49e60875761a5e3f7"}'} + headers: + cache-control: [no-cache] + content-length: ['1333'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:04 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates?api-version=7.0-preview + response: + body: {string: '{"value":[{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1","x5t":"YaHmVktLlGUWWiMm52pfMGtstC8","attributes":{"enabled":true,"nbf":1523440855,"exp":1681207855,"created":1523441455,"updated":1523441455}}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['246'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:04 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"policy": {"key_props": {"exportable": true, "kty": "RSA", "key_size": + 2048, "reuse_key": false}, "secret_props": {"contentType": "application/x-pkcs12"}, + "x509_props": {"subject": "C=US, ST=WA, L=Redmond, O=TestO, OU=TestOU, CN=www.mytestdomain.com", + "key_usage": ["digitalSignature", "nonRepudiation", "keyEncipherment", "keyAgreement", + "keyCertSign"], "validity_months": 50}, "lifetime_actions": [{"trigger": {"lifetime_percentage": + 90}, "action": {"action_type": "AutoRenew"}}], "issuer": {"name": "Self"}, "attributes": + {"enabled": true}}, "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['578'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/create?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTfuFiKn0qlIHT5xLp4OmnRSnINZ2G0WUr3krTFXJjZo11TYMjBqy2LdNNZXU91lyVRraX376QEarjYH3hxy5o9SIk3u3yIDYJi5GvYpT3UkPaNkpR3JbV/1i+8ooAiG8kNcb6CwAx9tLy14dEQh9868HbxtxedG+J1LCE4Q9L0Ps5H2CmJMQvqTYKBJ4WxsvOrXzxth70tu3hXNAcEWbXPhWp2qID1I4lDxEMewLSQJubBFcGG0cj/pxVXOPlAvywXxnWw4/uHPQdPLabJbIM0/6Nmm3O5C/TAwZt54SXBUxYBkVwcGsPAhSVfTIvDO41tSqruoiR78GhIT7KncXkCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCL8Cx5mhQMfXNxte/71KzwEHvksdzJDOWowf3ABp8SU6p2uURqIxtomYPZxNQeabCZbeUxuockraQcd3c8q2wf8MOb+ZarrqPiem2R4hnC33j0f/4bHbQwGhlqJK45czcHZ9NnTmnXgTI9wyhwJX/vkO/AkbHFsX1KTOcsWZVCJOlAQ3YDqHD7UIWGevWpfNi6z0h0r9LfJpwoex3uNGt2JZUTATZgdPB/lUeTTFL3l8DN6+gQszsWbR/r2GlG5ZoZh8Cb0c4xhabYHyQmfH6aXvyGBxEKwCRRb5VezJyqpDY6kqQiHycmX3EONVCAzSKBJI9O3Ly6L8RFzse4ukgr","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Certificate request is in progress. This may take some + time based on the issuer provider. Please check again later.","request_id":"dd1d796f74974d229ea8af583c6fc35f"}'} + headers: + cache-control: [no-cache] + content-length: ['1407'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:05 GMT'] + expires: ['-1'] + location: ['https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview&request_id=dd1d796f74974d229ea8af583c6fc35f'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTfuFiKn0qlIHT5xLp4OmnRSnINZ2G0WUr3krTFXJjZo11TYMjBqy2LdNNZXU91lyVRraX376QEarjYH3hxy5o9SIk3u3yIDYJi5GvYpT3UkPaNkpR3JbV/1i+8ooAiG8kNcb6CwAx9tLy14dEQh9868HbxtxedG+J1LCE4Q9L0Ps5H2CmJMQvqTYKBJ4WxsvOrXzxth70tu3hXNAcEWbXPhWp2qID1I4lDxEMewLSQJubBFcGG0cj/pxVXOPlAvywXxnWw4/uHPQdPLabJbIM0/6Nmm3O5C/TAwZt54SXBUxYBkVwcGsPAhSVfTIvDO41tSqruoiR78GhIT7KncXkCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCL8Cx5mhQMfXNxte/71KzwEHvksdzJDOWowf3ABp8SU6p2uURqIxtomYPZxNQeabCZbeUxuockraQcd3c8q2wf8MOb+ZarrqPiem2R4hnC33j0f/4bHbQwGhlqJK45czcHZ9NnTmnXgTI9wyhwJX/vkO/AkbHFsX1KTOcsWZVCJOlAQ3YDqHD7UIWGevWpfNi6z0h0r9LfJpwoex3uNGt2JZUTATZgdPB/lUeTTFL3l8DN6+gQszsWbR/r2GlG5ZoZh8Cb0c4xhabYHyQmfH6aXvyGBxEKwCRRb5VezJyqpDY6kqQiHycmX3EONVCAzSKBJI9O3Ly6L8RFzse4ukgr","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Certificate request is in progress. This may take some + time based on the issuer provider. Please check again later.","request_id":"dd1d796f74974d229ea8af583c6fc35f"}'} + headers: + cache-control: [no-cache] + content-length: ['1407'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:06 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTfuFiKn0qlIHT5xLp4OmnRSnINZ2G0WUr3krTFXJjZo11TYMjBqy2LdNNZXU91lyVRraX376QEarjYH3hxy5o9SIk3u3yIDYJi5GvYpT3UkPaNkpR3JbV/1i+8ooAiG8kNcb6CwAx9tLy14dEQh9868HbxtxedG+J1LCE4Q9L0Ps5H2CmJMQvqTYKBJ4WxsvOrXzxth70tu3hXNAcEWbXPhWp2qID1I4lDxEMewLSQJubBFcGG0cj/pxVXOPlAvywXxnWw4/uHPQdPLabJbIM0/6Nmm3O5C/TAwZt54SXBUxYBkVwcGsPAhSVfTIvDO41tSqruoiR78GhIT7KncXkCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCL8Cx5mhQMfXNxte/71KzwEHvksdzJDOWowf3ABp8SU6p2uURqIxtomYPZxNQeabCZbeUxuockraQcd3c8q2wf8MOb+ZarrqPiem2R4hnC33j0f/4bHbQwGhlqJK45czcHZ9NnTmnXgTI9wyhwJX/vkO/AkbHFsX1KTOcsWZVCJOlAQ3YDqHD7UIWGevWpfNi6z0h0r9LfJpwoex3uNGt2JZUTATZgdPB/lUeTTFL3l8DN6+gQszsWbR/r2GlG5ZoZh8Cb0c4xhabYHyQmfH6aXvyGBxEKwCRRb5VezJyqpDY6kqQiHycmX3EONVCAzSKBJI9O3Ly6L8RFzse4ukgr","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Certificate request is in progress. This may take some + time based on the issuer provider. Please check again later.","request_id":"dd1d796f74974d229ea8af583c6fc35f"}'} + headers: + cache-control: [no-cache] + content-length: ['1407'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending","issuer":{"name":"Self"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTfuFiKn0qlIHT5xLp4OmnRSnINZ2G0WUr3krTFXJjZo11TYMjBqy2LdNNZXU91lyVRraX376QEarjYH3hxy5o9SIk3u3yIDYJi5GvYpT3UkPaNkpR3JbV/1i+8ooAiG8kNcb6CwAx9tLy14dEQh9868HbxtxedG+J1LCE4Q9L0Ps5H2CmJMQvqTYKBJ4WxsvOrXzxth70tu3hXNAcEWbXPhWp2qID1I4lDxEMewLSQJubBFcGG0cj/pxVXOPlAvywXxnWw4/uHPQdPLabJbIM0/6Nmm3O5C/TAwZt54SXBUxYBkVwcGsPAhSVfTIvDO41tSqruoiR78GhIT7KncXkCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCL8Cx5mhQMfXNxte/71KzwEHvksdzJDOWowf3ABp8SU6p2uURqIxtomYPZxNQeabCZbeUxuockraQcd3c8q2wf8MOb+ZarrqPiem2R4hnC33j0f/4bHbQwGhlqJK45czcHZ9NnTmnXgTI9wyhwJX/vkO/AkbHFsX1KTOcsWZVCJOlAQ3YDqHD7UIWGevWpfNi6z0h0r9LfJpwoex3uNGt2JZUTATZgdPB/lUeTTFL3l8DN6+gQszsWbR/r2GlG5ZoZh8Cb0c4xhabYHyQmfH6aXvyGBxEKwCRRb5VezJyqpDY6kqQiHycmX3EONVCAzSKBJI9O3Ly6L8RFzse4ukgr","cancellation_requested":false,"status":"completed","target":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1","request_id":"dd1d796f74974d229ea8af583c6fc35f"}'} + headers: + cache-control: [no-cache] + content-length: ['1321'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:27 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/versions?api-version=7.0-preview + response: + body: {string: '{"value":[{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/03fe6d37c1f247dd88c9b30620685a02","x5t":"eiH45_cUQ7DroOAJoSH2vRLBJI0","attributes":{"enabled":true,"nbf":1523440885,"exp":1654942285,"created":1523441486,"updated":1523441486}},{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/46b3933d843f40c0823e4686ff55ff1c","x5t":"YaHmVktLlGUWWiMm52pfMGtstC8","attributes":{"enabled":true,"nbf":1523440855,"exp":1681207855,"created":1523441455,"updated":1523441455}}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['531'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:28 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/03fe6d37c1f247dd88c9b30620685a02","kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/cert1/03fe6d37c1f247dd88c9b30620685a02","sid":"https://cli-test-keyvault-000002.vault.azure.net/secrets/cert1/03fe6d37c1f247dd88c9b30620685a02","x5t":"eiH45_cUQ7DroOAJoSH2vRLBJI0","cer":"MIID3jCCAsagAwIBAgIQEDXfjonWSFqWJNHVgvswGTANBgkqhkiG9w0BAQsFADBsMR0wGwYDVQQDExR3d3cubXl0ZXN0ZG9tYWluLmNvbTEPMA0GA1UECxMGVGVzdE9VMQ4wDAYDVQQKEwVUZXN0TzEQMA4GA1UEBxMHUmVkbW9uZDELMAkGA1UECBMCV0ExCzAJBgNVBAYTAlVTMB4XDTE4MDQxMTEwMDEyNVoXDTIyMDYxMTEwMTEyNVowbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTfuFiKn0qlIHT5xLp4OmnRSnINZ2G0WUr3krTFXJjZo11TYMjBqy2LdNNZXU91lyVRraX376QEarjYH3hxy5o9SIk3u3yIDYJi5GvYpT3UkPaNkpR3JbV/1i+8ooAiG8kNcb6CwAx9tLy14dEQh9868HbxtxedG+J1LCE4Q9L0Ps5H2CmJMQvqTYKBJ4WxsvOrXzxth70tu3hXNAcEWbXPhWp2qID1I4lDxEMewLSQJubBFcGG0cj/pxVXOPlAvywXxnWw4/uHPQdPLabJbIM0/6Nmm3O5C/TAwZt54SXBUxYBkVwcGsPAhSVfTIvDO41tSqruoiR78GhIT7KncXkCAwEAAaN8MHowDgYDVR0PAQH/BAQDAgLsMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFELZNfYDtOo2WoZ9yYMU7vSyBa7yMB0GA1UdDgQWBBRC2TX2A7TqNlqGfcmDFO70sgWu8jANBgkqhkiG9w0BAQsFAAOCAQEAh866Fhnvp+GA363JgaI8sFg4QsvrDE8Dpfy32EygK2wY9r+UndKBgXaHx5xdBlTZXRzJTzMdc2L4RNxNoQdCLz3kepJlVlE2rKbEXKhAvOnP4xmGN9IGPrAH2jvCLUOUjuUgtqhqOfSeHU8N354pUdDeZRQV4VxddPCtQ+aTWsatSH9LSQiOHYLyEN0TxKErMNvLXhwBaTWXs34oip3/VwJjkWTCuukF+NLrDQDKkcfs/N4nDctMOuXVWzKpLTVhozrdkaFUzFLo1Zxp8zovoWX5/xgGvadISL58CZ3iWdudkCen9/HUhklqPxeVVsT8sndt9juH2kyGldjxq/9vxg==","attributes":{"enabled":true,"nbf":1523440885,"exp":1654942285,"created":1523441486,"updated":1523441486,"recoveryLevel":"Purgeable"},"policy":{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/policy","key_props":{"exportable":true,"kty":"RSA","key_size":2048,"reuse_key":false},"secret_props":{"contentType":"application/x-pkcs12"},"x509_props":{"subject":"C=US, + ST=WA, L=Redmond, O=TestO, OU=TestOU, CN=www.mytestdomain.com","ekus":["1.3.6.1.5.5.7.3.1","1.3.6.1.5.5.7.3.2"],"key_usage":["digitalSignature","keyAgreement","keyCertSign","keyEncipherment","nonRepudiation"],"validity_months":50,"basic_constraints":{"ca":false}},"lifetime_actions":[{"trigger":{"lifetime_percentage":90},"action":{"action_type":"AutoRenew"}}],"issuer":{"name":"Self"},"attributes":{"enabled":true,"created":1523441442,"updated":1523441465}},"pending":{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending"}}'} + headers: + cache-control: [no-cache] + content-length: ['2630'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:28 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/46b3933d843f40c0823e4686ff55ff1c?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/46b3933d843f40c0823e4686ff55ff1c","kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/cert1/46b3933d843f40c0823e4686ff55ff1c","sid":"https://cli-test-keyvault-000002.vault.azure.net/secrets/cert1/46b3933d843f40c0823e4686ff55ff1c","x5t":"YaHmVktLlGUWWiMm52pfMGtstC8","cer":"MIID8DCCAtigAwIBAgIQUE9ccucBTmSAA8UfqTHnxjANBgkqhkiG9w0BAQsFADB1MR0wGwYDVQQDExR3d3cubXl0ZXN0ZG9tYWluLmNvbTETMBEGA1UECxMKVGVzdE51Z2dldDEUMBIGA1UEChMLVGVzdCBOb29kbGUxDzANBgNVBAcTBlJlZG1vbjELMAkGA1UECBMCV0ExCzAJBgNVBAYTAlVTMB4XDTE4MDQxMTEwMDA1NVoXDTIzMDQxMTEwMTA1NVowdTEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xEzARBgNVBAsTClRlc3ROdWdnZXQxFDASBgNVBAoTC1Rlc3QgTm9vZGxlMQ8wDQYDVQQHEwZSZWRtb24xCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK+Lkza1ORv578cu68QpiPDSJYrY4d96PIZUokgzIbqGbB5eVRH3mrbTVf02965gg8MCbssP849aULq06nXRpd39hH/NfbySaRFvW7dLis3l37ipt/kgNUgMb8FxliTFtuQhfDd+guCOe/zAtggYxaW6MoWi8bogxEwQcDI8Ra5jmLfmBIX0XC17smxWUzX9hyffmVPICsFhsPKX9JjCkAgM/Eo+QC3DW58+9MN4QklupvokCdGkB/bPQVVHKbsJ0xKn1uZQG4HGFkLDJQ1uBwNaqhynQ+cP5V+A4mGAMVEQcUayS0W/0ZwChmMpJGhlSBRvCxG7Faa25BUmTaNl78cCAwEAAaN8MHowDgYDVR0PAQH/BAQDAgLsMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFOyaEAWIc5DOIBXIEFZ8TYgvSI7TMB0GA1UdDgQWBBTsmhAFiHOQziAVyBBWfE2IL0iO0zANBgkqhkiG9w0BAQsFAAOCAQEAMQXOsOFc33N3Q2tGFfdFEl3fMdfOijso/iytsvVFW9z9d5RV4n8jb4QY7Jwm5HyG0jAjsN0nl/cDEodCg8bCLSXYR9Co5auvwMTnvVBauijGFTQzCPt+18+CJo69PwytwAUcbaknRthueBjhoQBg9sOvzseLBdWaQGESqvGmNY4jRzGXUuU1bA/uX3dusuCH2dTYADLi7rTn19i1WkfZjBaalqYNFAq+EpIvWaBF2zueQ9IJ7Ro9x8Sj086pLDcNU9pR2R3foNxp90lfc8slpYEZyTW5Le3ePgrhyuaIsALgQmtEG7yGU9YlsIKQEwGKe8WG2gKCpFMLnYSpKGJbYw==","attributes":{"enabled":true,"nbf":1523440855,"exp":1681207855,"created":1523441455,"updated":1523441455,"recoveryLevel":"Purgeable"}}'} + headers: + cache-control: [no-cache] + content-length: ['1845'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:28 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"policy": {"key_props": {"exportable": true, "kty": "RSA", "key_size": + 2048, "reuse_key": false}, "secret_props": {"contentType": "application/x-pkcs12"}, + "x509_props": {"subject": "C=US, ST=WA, L=Redmon, O=Test Noodle, OU=TestNugget, + CN=www.mytestdomain.com", "key_usage": ["digitalSignature", "nonRepudiation", + "keyEncipherment", "keyAgreement", "keyCertSign"], "validity_months": 60}, "lifetime_actions": + [{"trigger": {"lifetime_percentage": 90}, "action": {"action_type": "AutoRenew"}}], + "issuer": {"name": "Self"}, "attributes": {"enabled": true}}, "attributes": + {"enabled": false}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['588'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PATCH + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/03fe6d37c1f247dd88c9b30620685a02","kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/cert1/03fe6d37c1f247dd88c9b30620685a02","sid":"https://cli-test-keyvault-000002.vault.azure.net/secrets/cert1/03fe6d37c1f247dd88c9b30620685a02","x5t":"eiH45_cUQ7DroOAJoSH2vRLBJI0","cer":"MIID3jCCAsagAwIBAgIQEDXfjonWSFqWJNHVgvswGTANBgkqhkiG9w0BAQsFADBsMR0wGwYDVQQDExR3d3cubXl0ZXN0ZG9tYWluLmNvbTEPMA0GA1UECxMGVGVzdE9VMQ4wDAYDVQQKEwVUZXN0TzEQMA4GA1UEBxMHUmVkbW9uZDELMAkGA1UECBMCV0ExCzAJBgNVBAYTAlVTMB4XDTE4MDQxMTEwMDEyNVoXDTIyMDYxMTEwMTEyNVowbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTfuFiKn0qlIHT5xLp4OmnRSnINZ2G0WUr3krTFXJjZo11TYMjBqy2LdNNZXU91lyVRraX376QEarjYH3hxy5o9SIk3u3yIDYJi5GvYpT3UkPaNkpR3JbV/1i+8ooAiG8kNcb6CwAx9tLy14dEQh9868HbxtxedG+J1LCE4Q9L0Ps5H2CmJMQvqTYKBJ4WxsvOrXzxth70tu3hXNAcEWbXPhWp2qID1I4lDxEMewLSQJubBFcGG0cj/pxVXOPlAvywXxnWw4/uHPQdPLabJbIM0/6Nmm3O5C/TAwZt54SXBUxYBkVwcGsPAhSVfTIvDO41tSqruoiR78GhIT7KncXkCAwEAAaN8MHowDgYDVR0PAQH/BAQDAgLsMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFELZNfYDtOo2WoZ9yYMU7vSyBa7yMB0GA1UdDgQWBBRC2TX2A7TqNlqGfcmDFO70sgWu8jANBgkqhkiG9w0BAQsFAAOCAQEAh866Fhnvp+GA363JgaI8sFg4QsvrDE8Dpfy32EygK2wY9r+UndKBgXaHx5xdBlTZXRzJTzMdc2L4RNxNoQdCLz3kepJlVlE2rKbEXKhAvOnP4xmGN9IGPrAH2jvCLUOUjuUgtqhqOfSeHU8N354pUdDeZRQV4VxddPCtQ+aTWsatSH9LSQiOHYLyEN0TxKErMNvLXhwBaTWXs34oip3/VwJjkWTCuukF+NLrDQDKkcfs/N4nDctMOuXVWzKpLTVhozrdkaFUzFLo1Zxp8zovoWX5/xgGvadISL58CZ3iWdudkCen9/HUhklqPxeVVsT8sndt9juH2kyGldjxq/9vxg==","attributes":{"enabled":false,"nbf":1523440885,"exp":1654942285,"created":1523441486,"updated":1523441489,"recoveryLevel":"Purgeable"},"policy":{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/policy","key_props":{"exportable":true,"kty":"RSA","key_size":2048,"reuse_key":false},"secret_props":{"contentType":"application/x-pkcs12"},"x509_props":{"subject":"C=US, + ST=WA, L=Redmon, O=Test Noodle, OU=TestNugget, CN=www.mytestdomain.com","ekus":["1.3.6.1.5.5.7.3.1","1.3.6.1.5.5.7.3.2"],"key_usage":["digitalSignature","keyAgreement","keyCertSign","keyEncipherment","nonRepudiation"],"validity_months":60,"basic_constraints":{"ca":false}},"lifetime_actions":[{"trigger":{"lifetime_percentage":90},"action":{"action_type":"AutoRenew"}}],"issuer":{"name":"Self"},"attributes":{"enabled":true,"created":1523441442,"updated":1523441489}},"pending":{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending"}}'} + headers: + cache-control: [no-cache] + content-length: ['2640'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:29 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: DELETE + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/03fe6d37c1f247dd88c9b30620685a02","kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/cert1/03fe6d37c1f247dd88c9b30620685a02","sid":"https://cli-test-keyvault-000002.vault.azure.net/secrets/cert1/03fe6d37c1f247dd88c9b30620685a02","x5t":"eiH45_cUQ7DroOAJoSH2vRLBJI0","cer":"MIID3jCCAsagAwIBAgIQEDXfjonWSFqWJNHVgvswGTANBgkqhkiG9w0BAQsFADBsMR0wGwYDVQQDExR3d3cubXl0ZXN0ZG9tYWluLmNvbTEPMA0GA1UECxMGVGVzdE9VMQ4wDAYDVQQKEwVUZXN0TzEQMA4GA1UEBxMHUmVkbW9uZDELMAkGA1UECBMCV0ExCzAJBgNVBAYTAlVTMB4XDTE4MDQxMTEwMDEyNVoXDTIyMDYxMTEwMTEyNVowbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALTfuFiKn0qlIHT5xLp4OmnRSnINZ2G0WUr3krTFXJjZo11TYMjBqy2LdNNZXU91lyVRraX376QEarjYH3hxy5o9SIk3u3yIDYJi5GvYpT3UkPaNkpR3JbV/1i+8ooAiG8kNcb6CwAx9tLy14dEQh9868HbxtxedG+J1LCE4Q9L0Ps5H2CmJMQvqTYKBJ4WxsvOrXzxth70tu3hXNAcEWbXPhWp2qID1I4lDxEMewLSQJubBFcGG0cj/pxVXOPlAvywXxnWw4/uHPQdPLabJbIM0/6Nmm3O5C/TAwZt54SXBUxYBkVwcGsPAhSVfTIvDO41tSqruoiR78GhIT7KncXkCAwEAAaN8MHowDgYDVR0PAQH/BAQDAgLsMAkGA1UdEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaAFELZNfYDtOo2WoZ9yYMU7vSyBa7yMB0GA1UdDgQWBBRC2TX2A7TqNlqGfcmDFO70sgWu8jANBgkqhkiG9w0BAQsFAAOCAQEAh866Fhnvp+GA363JgaI8sFg4QsvrDE8Dpfy32EygK2wY9r+UndKBgXaHx5xdBlTZXRzJTzMdc2L4RNxNoQdCLz3kepJlVlE2rKbEXKhAvOnP4xmGN9IGPrAH2jvCLUOUjuUgtqhqOfSeHU8N354pUdDeZRQV4VxddPCtQ+aTWsatSH9LSQiOHYLyEN0TxKErMNvLXhwBaTWXs34oip3/VwJjkWTCuukF+NLrDQDKkcfs/N4nDctMOuXVWzKpLTVhozrdkaFUzFLo1Zxp8zovoWX5/xgGvadISL58CZ3iWdudkCen9/HUhklqPxeVVsT8sndt9juH2kyGldjxq/9vxg==","attributes":{"enabled":false,"nbf":1523440885,"exp":1654942285,"created":1523441486,"updated":1523441489,"recoveryLevel":"Purgeable"},"policy":{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/policy","key_props":{"exportable":true,"kty":"RSA","key_size":2048,"reuse_key":false},"secret_props":{"contentType":"application/x-pkcs12"},"x509_props":{"subject":"C=US, + ST=WA, L=Redmon, O=Test Noodle, OU=TestNugget, CN=www.mytestdomain.com","ekus":["1.3.6.1.5.5.7.3.1","1.3.6.1.5.5.7.3.2"],"key_usage":["digitalSignature","keyAgreement","keyCertSign","keyEncipherment","nonRepudiation"],"validity_months":60,"basic_constraints":{"ca":false}},"lifetime_actions":[{"trigger":{"lifetime_percentage":90},"action":{"action_type":"AutoRenew"}}],"issuer":{"name":"Self"},"attributes":{"enabled":true,"created":1523441442,"updated":1523441489}},"pending":{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/cert1/pending"}}'} + headers: + cache-control: [no-cache] + content-length: ['2640'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates?api-version=7.0-preview + response: + body: {string: '{"value":[],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['28'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_cert000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:11:31 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS0VZVkFVTFQ6NUZDRVJUUlRKTkFWT0VQRlFJQko1RllJMnwzNkY3RTY3OEIwMTM4MjQ5LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_download.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_download.yaml new file mode 100644 index 00000000000..a0bbbae6f84 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_download.yaml @@ -0,0 +1,227 @@ +interactions: +- request: + body: '{"tags": {"use": "az-test"}, "location": "westus"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_download000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_download000001","name":"cli_test_kv_cert_download000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:04 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1194'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 graphrbacmanagementclient/0.31.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","deletionTimestamp":null,"accountEnabled":true,"assignedLicenses":[{"disabledPlans":[],"skuId":"a403ebcc-fae0-4ca2-8c8c-7a907fd6c235"}],"assignedPlans":[{"assignedTimestamp":"2017-12-07T23:01:21Z","capabilityStatus":"Enabled","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"}],"city":null,"companyName":null,"country":null,"creationType":null,"department":null,"dirSyncEnabled":null,"displayName":"Admin2","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Admin2","immutableId":null,"isCompromised":null,"jobTitle":null,"lastDirSyncTime":null,"legalAgeGroupClassification":null,"mail":null,"mailNickname":"admin2","mobile":null,"onPremisesDistinguishedName":null,"onPremisesSecurityIdentifier":null,"otherMails":["destanko@microsoft.com"],"passwordPolicies":"None","passwordProfile":null,"physicalDeliveryOfficeName":null,"postalCode":null,"preferredLanguage":"en-US","provisionedPlans":[],"provisioningErrors":[],"proxyAddresses":[],"refreshTokensValidFromDateTime":"2017-12-05T17:57:50Z","showInAddressList":null,"signInNames":[],"sipProxyAddress":null,"state":null,"streetAddress":null,"surname":"Admin2","telephoneNumber":null,"usageLocation":"US","userIdentities":[],"userPrincipalName":"admin2@AzureSDKTeam.onmicrosoft.com","userType":"Member"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1565'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 20 Dec 2017 00:27:08 GMT'] + duration: ['583476'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [B2xtiv2K5IgQFGC/nGmvRhzAlzhH3jWJuI9eil0hCCk=] + ocp-aad-session-key: [Zf4tXs0xywYCfne2l083QfsmR2GPIJHIij2bzHR9TjAxEMZc6NkifXTntHIvJP0RFWM7DgCEgnxBS1aLbmmR5VtNZ8H14FOGq4hubftePjZF2eNSTGMCjq0vELCL9Xya.wey8qhgevVFW2UgTIemhHBkQRYkneQCfmoEkpTxN4r4] + pragma: [no-cache] + request-id: [3dd97a0c-276b-4240-87ff-a13b360a0ed2] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET, ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"properties": {"tenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "accessPolicies": + [{"permissions": {"storage": ["get", "list", "delete", "set", "update", "regeneratekey", + "setsas", "listsas", "getsas", "deletesas"], "certificates": ["get", "list", + "delete", "create", "import", "update", "managecontacts", "getissuers", "listissuers", + "setissuers", "deleteissuers", "manageissuers", "recover"], "secrets": ["get", + "list", "set", "delete", "backup", "restore", "recover"], "keys": ["get", "create", + "delete", "list", "update", "import", "backup", "restore", "recover"]}, "tenantId": + "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "objectId": "5963f50c-7c43-405c-af7e-53294de76abd"}], + "sku": {"name": "premium", "family": "A"}}, "location": "westus"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultmanagementclient/0.40.0 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_download000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2016-10-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_download000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","accessPolicies":[{"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","permissions":{"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"keys":["get","create","delete","list","update","import","backup","restore","recover"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net"}}'} + headers: + cache-control: [no-cache] + content-length: ['1068'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:08 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.197] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 20 Dec 2017 00:27:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:21 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"attributes": {"enabled": true, "nbf": 1477593836, "exp": 1509130436}, + "policy": {"secret_props": {"contentType": "application/x-pem-file"}, "key_props": + {"reuse_key": false, "kty": "RSA", "key_size": 2048, "exportable": true}, "issuer": + {"name": "Self"}}, "value": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCRUPFgOvovNJ0e\nXSHlcm2V9w/ECwzMc31BaN2xBmWjegmqixv9GN3GWMgUQ9zC9k9bxd491Awa55Sq\nht86TL8Q3Fcn8fXuhWbX/gNAO8h5tfuQVA1zB5bVxEQsCNmmLrpgNhLYO+excyCJ\nocqidQostSQfcXU7qJtifpgmRt5oW3WhmpVsnAugS8y8vbCGJXdKqLCZXjL/H0aa\n+r/Z3BzQ+BglULKYshSBinxbYe+1GJ/028/50y/MPf9iFiiS9xtspOtSzd1e+NA5\nG+pCMppJHars9D/FavTewI1zJa9jPxtrwr8L3nEmy9gv6v1474XNYaagtQNjdU0b\nAV3EDfn9AgMBAAECggEADJtGjXAgYzb/yHIQ7jxamG96DSpePmBoheOok+J3r9J3\nAzYVRARDvSDXnrZycPF4WgBU8u0x7aWYhqCzvfWJf9d1si/yA3LMRMGzG3/0OOba\nP5+jGQ8X/UyNE3rjEuEr5wvZ36t2wrS3pmkEUMqxisZeL2Ii5v2OGWHdJjjws4HW\nP9pBGjcgxUP7UKPLQExHb9oUswh66Z+K9o10ZwArPYhnhc546vPlbHqO5bTS/Rza\nPd+c/h7PrrqwSBavm5mdjcHwqr5JjhE4OzbS4HkiYVnpx4OPRcgR0vWE6cG+0zg5\n4AROSM9kvrGflIqn2EAojRAz5S6wHMk7pImk4kAdSwKBgQC/wVsEruzUj3p7DvXc\nXRo8juRrWztrmOvp0GwhsVIVaF0Fr2lqCEGgOqqj5IEfue0UaCNCW3I73rRSYaNe\nnJ7PGZMYmLkzwcvGTEeV9CRqOgvKvbf3RiCpkKeLz3dil8AGdyVlwAJmq8Fn+IMT\nrwGaw3/UHTRMnse6JPoQ+k4KMwKBgQDCAI4Mlq5K7WSH1zNKSLgII9KnfHHkusNU\n88hpaVReXmxU7uQIC02nbtYl2oM3I/Lz9Otk/nPIbh4g9LKmju5Gi1S2wchInDfP\nKwgPoClM6/VM4e6CS9qq/FvJdLu2228AxcdSoIwGmrkbiTtGNedO4CdBa3/vacac\nuD0iD/gbDwKBgQC+mXzVHOJ/LdZ6txYe4dQQWaAmLdrUSn5EPE0e+Fg0uzWrTv4i\nzO4eS/INUjYeyPokjJZvgOH9LJJkSHTQuDEKfcs+aZ+9GGZqRqvpG3GOvP+3l/hi\nKyyQHx7K039BWsEeLBPaHY7FavelVtlDGXMo2CYZOqYfervgBJ0jfwlPDQKBgCuC\nSFlWadxwBT3Z66zbRjq9Hf9mD30Gzcv9qJLLhpprfsxFj2qmblIAr5JpwUfajiBc\na3aJApqO577oYjCsmY/Eq8kZCLwQHQwfUH2ApAKWYLtPaFhcfrweQM+bmIXYDLsV\noDBNxVmt1ZnxWxPR/wBXkTZAz7538I0xXLSI9FHNAoGBAJ/2ck5G+pKVHJA9sFoO\nwpB1jimZNmZjw2Fiu7u33IQSq1oMijD/M8qLFlnquetBrjniW55ViR89HMe+5Bwt\nnZ+Pq6xDKnzxRyyFWGM8lp+JDMMj1xOHIYil+aFgZyWm6/VzN24vdp2eYRYWBdMT\nP8mukpnNhytmI1/4ozaU+wai\n-----END + PRIVATE KEY-----\n-----BEGIN CERTIFICATE-----\nMIIDJDCCAgygAwIBAgIQc/Rvc7SNT/iJre6II78vpTANBgkqhkiG9w0BAQsFADAP\nMQ0wCwYDVQQDEwRUZXN0MB4XDTE2MTAyNzE4NDM1NloXDTE3MTAyNzE4NTM1Nlow\nDzENMAsGA1UEAxMEVGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAJFQ8WA6+i80nR5dIeVybZX3D8QLDMxzfUFo3bEGZaN6CaqLG/0Y3cZYyBRD3ML2\nT1vF3j3UDBrnlKqG3zpMvxDcVyfx9e6FZtf+A0A7yHm1+5BUDXMHltXERCwI2aYu\numA2Etg757FzIImhyqJ1Ciy1JB9xdTuom2J+mCZG3mhbdaGalWycC6BLzLy9sIYl\nd0qosJleMv8fRpr6v9ncHND4GCVQspiyFIGKfFth77UYn/Tbz/nTL8w9/2IWKJL3\nG2yk61LN3V740Dkb6kIymkkdquz0P8Vq9N7AjXMlr2M/G2vCvwvecSbL2C/q/Xjv\nhc1hpqC1A2N1TRsBXcQN+f0CAwEAAaN8MHowDgYDVR0PAQH/BAQDAgWgMAkGA1Ud\nEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaA\nFJh9TmNuesqccgmdVu7WD6bYiurmMB0GA1UdDgQWBBSYfU5jbnrKnHIJnVbu1g+m\n2Irq5jANBgkqhkiG9w0BAQsFAAOCAQEAj0vTtSCjSQIZagzOvjTtZvnKH6E0q0zX\n+MAtJnS8Cb/XVPEW0FqN5TLXvvaktjKCDHSPmYwneTjV3hjNe+jB03R1Z2auxnsc\njSfLT4+tthrCiHTLX+WrR+F3SwOX/cVFGiU0z1IcJe5m49qiUJ6kemHaa6umgfGX\nHbnCqzR76WkhDJWFz9MXFFvFTRGE+267sliQf8PrKr65oOEVZV/E+SInQdm+H1LY\nWAbig4UxHN8UQ54G9mdW1e/uRumAT73uty+C0O8VQvNvsco2HAiPOtDce4CJleZx\niAv6z0Y6PKRYb4xw+xnmqpC8ks1T93JFaniHl53cqRNbXy5t9t9Cag==\n-----END + CERTIFICATE-----"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['3170'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pem-cert1/import?api-version=2016-10-01 + response: + body: {string: '{"error":{"code":"BadParameter","message":"X509 Certificate is + already expired"}}'} + headers: + cache-control: [no-cache] + content-length: ['81'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:23 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 400, message: Bad Request} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_download000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 20 Dec 2017 00:27:27 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS1Y6NUZDRVJUOjVGRE9XTkxPQURCWUlRNVhSNEoyVjNBUnw2OTQyMkUzOUYwRUE1NUQ1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1193'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_get_default_policy.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_get_default_policy.yaml new file mode 100644 index 00000000000..fc644c16b7e --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_get_default_policy.yaml @@ -0,0 +1,59 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-11T10:09:54Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_default_policy000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_default_policy000001","name":"cli_test_kv_cert_default_policy000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-11T10:09:54Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:55 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_default_policy000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:09:56 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS1Y6NUZDRVJUOjVGREVGQVVMVDo1RlBPTElDWU9HRzJDRHwxNDREMzkyNEEzRUI5QUNBLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_import.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_import.yaml new file mode 100644 index 00000000000..40bf0f007d4 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_import.yaml @@ -0,0 +1,227 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_sd000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd000001","name":"cli_test_keyvault_sd000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:03 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1194'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 graphrbacmanagementclient/0.31.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","deletionTimestamp":null,"accountEnabled":true,"assignedLicenses":[{"disabledPlans":[],"skuId":"a403ebcc-fae0-4ca2-8c8c-7a907fd6c235"}],"assignedPlans":[{"assignedTimestamp":"2017-12-07T23:01:21Z","capabilityStatus":"Enabled","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"}],"city":null,"companyName":null,"country":null,"creationType":null,"department":null,"dirSyncEnabled":null,"displayName":"Admin2","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Admin2","immutableId":null,"isCompromised":null,"jobTitle":null,"lastDirSyncTime":null,"legalAgeGroupClassification":null,"mail":null,"mailNickname":"admin2","mobile":null,"onPremisesDistinguishedName":null,"onPremisesSecurityIdentifier":null,"otherMails":["destanko@microsoft.com"],"passwordPolicies":"None","passwordProfile":null,"physicalDeliveryOfficeName":null,"postalCode":null,"preferredLanguage":"en-US","provisionedPlans":[],"provisioningErrors":[],"proxyAddresses":[],"refreshTokensValidFromDateTime":"2017-12-05T17:57:50Z","showInAddressList":null,"signInNames":[],"sipProxyAddress":null,"state":null,"streetAddress":null,"surname":"Admin2","telephoneNumber":null,"usageLocation":"US","userIdentities":[],"userPrincipalName":"admin2@AzureSDKTeam.onmicrosoft.com","userType":"Member"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1565'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 20 Dec 2017 00:27:05 GMT'] + duration: ['532224'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [tloBiTzV9KbgWyL0nGvOfolvuIjvoIkswnX3WD63Y1k=] + ocp-aad-session-key: [Lbbg_SmqhkIVN8ptvhBNtEzlRF78HBWRmpLQeL2aryM3BWlAEYnOzMsrZ4O7dsohGE1q2aRagiCZlLjtFk7kcT3Inav-6AVE7GaScMPT-msNgfAAMXKQ0eXMR_EUVhRz.1LV4S7lGJszvibl6ssy5gtn456Vz8Ao0edd0j4MJ6Jk] + pragma: [no-cache] + request-id: [a8f5da7b-0888-48a7-91dc-0f0fcedfe67a] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET, ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"sku": {"family": "A", "name": "premium"}, + "tenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "accessPolicies": [{"tenantId": + "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "permissions": {"keys": ["get", "create", + "delete", "list", "update", "import", "backup", "restore", "recover"], "certificates": + ["get", "list", "delete", "create", "import", "update", "managecontacts", "getissuers", + "listissuers", "setissuers", "deleteissuers", "manageissuers", "recover"], "secrets": + ["get", "list", "set", "delete", "backup", "restore", "recover"], "storage": + ["get", "list", "delete", "set", "update", "regeneratekey", "setsas", "listsas", + "getsas", "deletesas"]}, "objectId": "5963f50c-7c43-405c-af7e-53294de76abd"}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultmanagementclient/0.40.0 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2016-10-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","accessPolicies":[{"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net"}}'} + headers: + cache-control: [no-cache] + content-length: ['1068'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:08 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.197] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 20 Dec 2017 00:27:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"attributes": {"exp": 1509130436, "enabled": true, "nbf": 1477593836}, + "value": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCRUPFgOvovNJ0e\nXSHlcm2V9w/ECwzMc31BaN2xBmWjegmqixv9GN3GWMgUQ9zC9k9bxd491Awa55Sq\nht86TL8Q3Fcn8fXuhWbX/gNAO8h5tfuQVA1zB5bVxEQsCNmmLrpgNhLYO+excyCJ\nocqidQostSQfcXU7qJtifpgmRt5oW3WhmpVsnAugS8y8vbCGJXdKqLCZXjL/H0aa\n+r/Z3BzQ+BglULKYshSBinxbYe+1GJ/028/50y/MPf9iFiiS9xtspOtSzd1e+NA5\nG+pCMppJHars9D/FavTewI1zJa9jPxtrwr8L3nEmy9gv6v1474XNYaagtQNjdU0b\nAV3EDfn9AgMBAAECggEADJtGjXAgYzb/yHIQ7jxamG96DSpePmBoheOok+J3r9J3\nAzYVRARDvSDXnrZycPF4WgBU8u0x7aWYhqCzvfWJf9d1si/yA3LMRMGzG3/0OOba\nP5+jGQ8X/UyNE3rjEuEr5wvZ36t2wrS3pmkEUMqxisZeL2Ii5v2OGWHdJjjws4HW\nP9pBGjcgxUP7UKPLQExHb9oUswh66Z+K9o10ZwArPYhnhc546vPlbHqO5bTS/Rza\nPd+c/h7PrrqwSBavm5mdjcHwqr5JjhE4OzbS4HkiYVnpx4OPRcgR0vWE6cG+0zg5\n4AROSM9kvrGflIqn2EAojRAz5S6wHMk7pImk4kAdSwKBgQC/wVsEruzUj3p7DvXc\nXRo8juRrWztrmOvp0GwhsVIVaF0Fr2lqCEGgOqqj5IEfue0UaCNCW3I73rRSYaNe\nnJ7PGZMYmLkzwcvGTEeV9CRqOgvKvbf3RiCpkKeLz3dil8AGdyVlwAJmq8Fn+IMT\nrwGaw3/UHTRMnse6JPoQ+k4KMwKBgQDCAI4Mlq5K7WSH1zNKSLgII9KnfHHkusNU\n88hpaVReXmxU7uQIC02nbtYl2oM3I/Lz9Otk/nPIbh4g9LKmju5Gi1S2wchInDfP\nKwgPoClM6/VM4e6CS9qq/FvJdLu2228AxcdSoIwGmrkbiTtGNedO4CdBa3/vacac\nuD0iD/gbDwKBgQC+mXzVHOJ/LdZ6txYe4dQQWaAmLdrUSn5EPE0e+Fg0uzWrTv4i\nzO4eS/INUjYeyPokjJZvgOH9LJJkSHTQuDEKfcs+aZ+9GGZqRqvpG3GOvP+3l/hi\nKyyQHx7K039BWsEeLBPaHY7FavelVtlDGXMo2CYZOqYfervgBJ0jfwlPDQKBgCuC\nSFlWadxwBT3Z66zbRjq9Hf9mD30Gzcv9qJLLhpprfsxFj2qmblIAr5JpwUfajiBc\na3aJApqO577oYjCsmY/Eq8kZCLwQHQwfUH2ApAKWYLtPaFhcfrweQM+bmIXYDLsV\noDBNxVmt1ZnxWxPR/wBXkTZAz7538I0xXLSI9FHNAoGBAJ/2ck5G+pKVHJA9sFoO\nwpB1jimZNmZjw2Fiu7u33IQSq1oMijD/M8qLFlnquetBrjniW55ViR89HMe+5Bwt\nnZ+Pq6xDKnzxRyyFWGM8lp+JDMMj1xOHIYil+aFgZyWm6/VzN24vdp2eYRYWBdMT\nP8mukpnNhytmI1/4ozaU+wai\n-----END + PRIVATE KEY-----\n-----BEGIN CERTIFICATE-----\nMIIDJDCCAgygAwIBAgIQc/Rvc7SNT/iJre6II78vpTANBgkqhkiG9w0BAQsFADAP\nMQ0wCwYDVQQDEwRUZXN0MB4XDTE2MTAyNzE4NDM1NloXDTE3MTAyNzE4NTM1Nlow\nDzENMAsGA1UEAxMEVGVzdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB\nAJFQ8WA6+i80nR5dIeVybZX3D8QLDMxzfUFo3bEGZaN6CaqLG/0Y3cZYyBRD3ML2\nT1vF3j3UDBrnlKqG3zpMvxDcVyfx9e6FZtf+A0A7yHm1+5BUDXMHltXERCwI2aYu\numA2Etg757FzIImhyqJ1Ciy1JB9xdTuom2J+mCZG3mhbdaGalWycC6BLzLy9sIYl\nd0qosJleMv8fRpr6v9ncHND4GCVQspiyFIGKfFth77UYn/Tbz/nTL8w9/2IWKJL3\nG2yk61LN3V740Dkb6kIymkkdquz0P8Vq9N7AjXMlr2M/G2vCvwvecSbL2C/q/Xjv\nhc1hpqC1A2N1TRsBXcQN+f0CAwEAAaN8MHowDgYDVR0PAQH/BAQDAgWgMAkGA1Ud\nEwQCMAAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMB8GA1UdIwQYMBaA\nFJh9TmNuesqccgmdVu7WD6bYiurmMB0GA1UdDgQWBBSYfU5jbnrKnHIJnVbu1g+m\n2Irq5jANBgkqhkiG9w0BAQsFAAOCAQEAj0vTtSCjSQIZagzOvjTtZvnKH6E0q0zX\n+MAtJnS8Cb/XVPEW0FqN5TLXvvaktjKCDHSPmYwneTjV3hjNe+jB03R1Z2auxnsc\njSfLT4+tthrCiHTLX+WrR+F3SwOX/cVFGiU0z1IcJe5m49qiUJ6kemHaa6umgfGX\nHbnCqzR76WkhDJWFz9MXFFvFTRGE+267sliQf8PrKr65oOEVZV/E+SInQdm+H1LY\nWAbig4UxHN8UQ54G9mdW1e/uRumAT73uty+C0O8VQvNvsco2HAiPOtDce4CJleZx\niAv6z0Y6PKRYb4xw+xnmqpC8ks1T93JFaniHl53cqRNbXy5t9t9Cag==\n-----END + CERTIFICATE-----", "policy": {"secret_props": {"contentType": "application/x-pem-file"}, + "key_props": {"key_size": 2048, "reuse_key": false, "kty": "RSA", "exportable": + true}, "issuer": {"name": "Self"}}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['3170'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pem-cert1/import?api-version=2016-10-01 + response: + body: {string: '{"error":{"code":"BadParameter","message":"X509 Certificate is + already expired"}}'} + headers: + cache-control: [no-cache] + content-length: ['81'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 00:27:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 400, message: Bad Request} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_sd000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 20 Dec 2017 00:27:25 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS0VZVkFVTFQ6NUZTREZFUTJDNzRETEs1NUFJNVNNTlozRXw0QUEyODk5RDI2NkU1QjczLVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_issuers.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_issuers.yaml new file mode 100644 index 00000000000..2817156359d --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_certificate_issuers.yaml @@ -0,0 +1,830 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-11T10:09:56Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_issuer000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_issuer000001","name":"cli_test_kv_cert_issuer000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-11T10:09:56Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:09:57 GMT'] + duration: ['667297'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [7G98t5jXPmdc39u36x9DSb0cC/ny+jmdWuhB0dVG1QM=] + ocp-aad-session-key: [3WHHKkpsxkMaFbevxzT8pDNqnjEpNc3mL06g8VFZ3r4A9UTY1JsYajoVq7e5jJDsOr5oa1yWGcyJmGZUTrlrN68YxtgwyoxF1SNu7dxz_0UF4O1J_Q4YpsnOcq4ZKaY6.CnOxuNCSsi-9DPQrE3e82v7rCJCVwh65anFo9KVWPks] + pragma: [no-cache] + request-id: [b5e0f383-7a3a-46f1-bde3-5ebcf5badc3f] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_issuer000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_issuer000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1105'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_issuer000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_issuer000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:30 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:41 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:41 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"provider": "Test", "credentials": {}, "org_details": {"admin_details": + []}, "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"zip":0,"admin_details":[]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441442}}'} + headers: + cache-control: [no-cache] + content-length: ['236'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:42 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"zip":0,"admin_details":[]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441442}}'} + headers: + cache-control: [no-cache] + content-length: ['236'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"zip":0,"admin_details":[]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441442}}'} + headers: + cache-control: [no-cache] + content-length: ['236'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"provider": "Test", "credentials": {"account_id": "test_account"}, "org_details": + {"id": "TestOrg", "admin_details": []}, "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['155'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{"account_id":"test_account"},"org_details":{"id":"TestOrg","zip":0,"admin_details":[]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441443}}'} + headers: + cache-control: [no-cache] + content-length: ['278'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:42 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/notexist?api-version=7.0-preview + response: + body: {string: '{"error":{"code":"CertificateIssuerNotFound","message":"Issuer + not found"}}'} + headers: + cache-control: [no-cache] + content-length: ['75'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{"account_id":"test_account"},"org_details":{"id":"TestOrg","zip":0,"admin_details":[]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441443}}'} + headers: + cache-control: [no-cache] + content-length: ['278'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"provider": "Test", "credentials": {}, "org_details": {"id": "TestOrg", + "admin_details": []}, "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['127'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441444}}'} + headers: + cache-control: [no-cache] + content-length: ['251'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers?api-version=7.0-preview + response: + body: {string: '{"value":[{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test"}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['132'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441444}}'} + headers: + cache-control: [no-cache] + content-length: ['251'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"provider": "Test", "credentials": {}, "org_details": {"id": "TestOrg", + "admin_details": [{"first_name": "Test", "last_name": "Admin", "email": "test@test.com", + "phone": "123-456-7890"}]}, "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['222'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"first_name":"Test","last_name":"Admin","email":"test@test.com","phone":"123-456-7890"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441445}}'} + headers: + cache-control: [no-cache] + content-length: ['339'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"first_name":"Test","last_name":"Admin","email":"test@test.com","phone":"123-456-7890"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441445}}'} + headers: + cache-control: [no-cache] + content-length: ['339'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"first_name":"Test","last_name":"Admin","email":"test@test.com","phone":"123-456-7890"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441445}}'} + headers: + cache-control: [no-cache] + content-length: ['339'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"provider": "Test", "credentials": {}, "org_details": {"id": "TestOrg", + "admin_details": [{"first_name": "Test", "last_name": "Admin", "email": "test@test.com", + "phone": "123-456-7890"}, {"email": "test2@test.com"}]}, "attributes": {"enabled": + true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['251'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"first_name":"Test","last_name":"Admin","email":"test@test.com","phone":"123-456-7890"},{"email":"test2@test.com"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441446}}'} + headers: + cache-control: [no-cache] + content-length: ['366'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"first_name":"Test","last_name":"Admin","email":"test@test.com","phone":"123-456-7890"},{"email":"test2@test.com"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441446}}'} + headers: + cache-control: [no-cache] + content-length: ['366'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"first_name":"Test","last_name":"Admin","email":"test@test.com","phone":"123-456-7890"},{"email":"test2@test.com"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441446}}'} + headers: + cache-control: [no-cache] + content-length: ['366'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"provider": "Test", "credentials": {}, "org_details": {"id": "TestOrg", + "admin_details": [{"email": "test2@test.com"}]}, "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['154'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"email":"test2@test.com"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441447}}'} + headers: + cache-control: [no-cache] + content-length: ['277'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"email":"test2@test.com"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441447}}'} + headers: + cache-control: [no-cache] + content-length: ['277'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: DELETE + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers/issuer1","provider":"Test","credentials":{},"org_details":{"id":"TestOrg","zip":0,"admin_details":[{"email":"test2@test.com"}]},"attributes":{"enabled":true,"created":1523441442,"updated":1523441447}}'} + headers: + cache-control: [no-cache] + content-length: ['277'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/issuers?api-version=7.0-preview + response: + body: {string: '{"value":[],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['28'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_issuer000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:48 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS1Y6NUZDRVJUOjVGSVNTVUVSUlFETUFSUUVVVTdLWEdJNXxGMUZFQjMwQTM4MTU4RTg5LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_key.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_key.yaml new file mode 100644 index 00000000000..0fc012d9565 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_key.yaml @@ -0,0 +1,686 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-11T10:09:57Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_key000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_key000001","name":"cli_test_keyvault_key000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-11T10:09:57Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:09:58 GMT'] + duration: ['542915'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [IPBOae931bn+bJPBnT4uNOWiCrRKetFJ3jeGeHc0YHk=] + ocp-aad-session-key: [qR7ZiP5hSO1Qju8MvWPmvZVO8mDCTdsPfhiJH-L1q7nracLyfyjXqDfoDl8Ts0X613oExOHStA5vjz8RNRggUG1rHjesJJVbWAdx9X96u1hkzy3Bn_uJAyZgF8P9B3bX.qGSdtdeqbgnC1BM9SMpBw4nvriIvnK83Ij2ughG-A7s] + pragma: [no-cache] + request-id: [c3586af2-79f4-4416-be69-a2f817c476ad] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_key000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_key000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1105'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1197'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_key000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_key000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:42 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:42 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"kty": "RSA", "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['47'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/create?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/a1871d8bb5804215a4f3c7cfce21e166","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"pLlw6iE0XAe0YSzx7ZhosU_ZHcgvOv_AwGxLLGaGvfuFjgt4NeSIAIJ70M3HL-Ol3zIJWblYICgYj0gjawaA4CWP9Eem-XcJXtbbr65PpXzWa7qrlDFWwk-al0CLts9XebFQK6Dd2D0umqVKI04Lbr5mV2YRdA8WhNpT41M_6szyMwW3EuWngOZOZQaaWPbcZVPEnd8ilO_YtIUngYpLubE0AzZK4SLE52Wsk_ao_ugZjjw-uBKGXwVfAuUDrvMb-sDmB-sdwu-4C0ss3clrUFAZePmryhD_mZn3flswh_11MADwcBK4MpsWYrBUUnrpTgg1aDk6F3ZW2Jl3pMwFQQ","e":"AQAB"},"attributes":{"enabled":true,"created":1523441443,"updated":1523441443,"recoveryLevel":"Purgeable"}}'} + headers: + cache-control: [no-cache] + content-length: ['651'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":[{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1","attributes":{"enabled":true,"created":1523441443,"updated":1523441443,"recoveryLevel":"Purgeable"}}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['196'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"kty": "RSA", "key_ops": ["encrypt", "decrypt"], "attributes": {"enabled": + false}, "tags": {"test": "foo"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['108'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/create?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/c9e702dfcb8c49b4ae6bc7ccbde373e3","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"qhXr6bSYllAL_6HG3YJVvhSRHHmSgFdk-DU6G3M-rVN7MIwo4YZnp9abyK06TXhDOUmv4iLldZ8gEbxnKpHm4VywQkpoBrxQGZGbstaPwvsOluJHnEIj_GbzpSV7l024fg27qT4rezyu6JhR8J-utEbb_9X_5LOWSB8DFYb9ALJwFTFawfuSKX-JCCi8LVwmg3MYF2f07MDeV-JLm57Sy56z2FnaH5lQrl2pWRlplRt1Qq-408BvG68LjaZLQg_eiYJU6LPYCX_aBoNaQK36NXwji5sLedTP-_E8we5LZtowD3IyLvWWKcFSNI0ypPq-hpOl9aLFPm1fOKqNaow5Lw","e":"AQAB"},"attributes":{"enabled":false,"created":1523441444,"updated":1523441444,"recoveryLevel":"Purgeable"},"tags":{"test":"foo"}}'} + headers: + cache-control: [no-cache] + content-length: ['636'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/versions?api-version=7.0-preview + response: + body: {string: '{"value":[{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/a1871d8bb5804215a4f3c7cfce21e166","attributes":{"enabled":true,"created":1523441443,"updated":1523441443,"recoveryLevel":"Purgeable"}},{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/c9e702dfcb8c49b4ae6bc7ccbde373e3","attributes":{"enabled":false,"created":1523441444,"updated":1523441444,"recoveryLevel":"Purgeable"},"tags":{"test":"foo"}}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['454'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/c9e702dfcb8c49b4ae6bc7ccbde373e3","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"qhXr6bSYllAL_6HG3YJVvhSRHHmSgFdk-DU6G3M-rVN7MIwo4YZnp9abyK06TXhDOUmv4iLldZ8gEbxnKpHm4VywQkpoBrxQGZGbstaPwvsOluJHnEIj_GbzpSV7l024fg27qT4rezyu6JhR8J-utEbb_9X_5LOWSB8DFYb9ALJwFTFawfuSKX-JCCi8LVwmg3MYF2f07MDeV-JLm57Sy56z2FnaH5lQrl2pWRlplRt1Qq-408BvG68LjaZLQg_eiYJU6LPYCX_aBoNaQK36NXwji5sLedTP-_E8we5LZtowD3IyLvWWKcFSNI0ypPq-hpOl9aLFPm1fOKqNaow5Lw","e":"AQAB"},"attributes":{"enabled":false,"created":1523441444,"updated":1523441444,"recoveryLevel":"Purgeable"},"tags":{"test":"foo"}}'} + headers: + cache-control: [no-cache] + content-length: ['636'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/a1871d8bb5804215a4f3c7cfce21e166?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/a1871d8bb5804215a4f3c7cfce21e166","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"pLlw6iE0XAe0YSzx7ZhosU_ZHcgvOv_AwGxLLGaGvfuFjgt4NeSIAIJ70M3HL-Ol3zIJWblYICgYj0gjawaA4CWP9Eem-XcJXtbbr65PpXzWa7qrlDFWwk-al0CLts9XebFQK6Dd2D0umqVKI04Lbr5mV2YRdA8WhNpT41M_6szyMwW3EuWngOZOZQaaWPbcZVPEnd8ilO_YtIUngYpLubE0AzZK4SLE52Wsk_ao_ugZjjw-uBKGXwVfAuUDrvMb-sDmB-sdwu-4C0ss3clrUFAZePmryhD_mZn3flswh_11MADwcBK4MpsWYrBUUnrpTgg1aDk6F3ZW2Jl3pMwFQQ","e":"AQAB"},"attributes":{"enabled":true,"created":1523441443,"updated":1523441443,"recoveryLevel":"Purgeable"}}'} + headers: + cache-control: [no-cache] + content-length: ['651'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['33'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PATCH + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/c9e702dfcb8c49b4ae6bc7ccbde373e3","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"qhXr6bSYllAL_6HG3YJVvhSRHHmSgFdk-DU6G3M-rVN7MIwo4YZnp9abyK06TXhDOUmv4iLldZ8gEbxnKpHm4VywQkpoBrxQGZGbstaPwvsOluJHnEIj_GbzpSV7l024fg27qT4rezyu6JhR8J-utEbb_9X_5LOWSB8DFYb9ALJwFTFawfuSKX-JCCi8LVwmg3MYF2f07MDeV-JLm57Sy56z2FnaH5lQrl2pWRlplRt1Qq-408BvG68LjaZLQg_eiYJU6LPYCX_aBoNaQK36NXwji5sLedTP-_E8we5LZtowD3IyLvWWKcFSNI0ypPq-hpOl9aLFPm1fOKqNaow5Lw","e":"AQAB"},"attributes":{"enabled":true,"created":1523441444,"updated":1523441447,"recoveryLevel":"Purgeable"},"tags":{"test":"foo"}}'} + headers: + cache-control: [no-cache] + content-length: ['635'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/backup?api-version=7.0-preview + response: + body: {string: '{"value":"JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLmw3NU1JdVVVYmV6Z3JheFBON3l1YUNDZUNETmp2WG9FTDBwZy1JOFVjUVlUWnhoZTdMUmFXajdGVFF3UVhLQzlFQnpPZ2lrTGdHNThhU25vaVI2QmU1cHVIWmtGSFNIMXFHYndabnNiZzdXRno2WUhub2Q2RzBGVkM2czRhTXFZMHliLW9EMFVyakZndjU0U2d3QmRka1ZrRVgxN18td3dhak1jUHFkbVU5Rl9CQktvUUhzUlNjT0U3SmROWjNWaHpsQm5FS1N3UU5qc0phMU1XdXJzdU9JNHlFUlVETEZDQmhSakhxVG5idW9mOE02bzJrVGdoS1pOX3ByU0I4YkJFS2FLQklkdmkzVWs4Zy1MbzdCUmtITmpsSDNIT202NXFtR0JLMDNKYm9XV2V2NFNNbkZreHlFMXg2ZTNqbC04TzhKRlBOem9xcDhLS0N1QXFkTVA3US41Nm1OaTdIWUY4cTgtdjJSRVFtbzVRLmtfMzdPaGc2UWRBamlFMGloSEo0WFlmYTQ1YkRZVmtVbU1mTE0wWG5iVDB6RjNqOWNQT2o4ZFFIZGxiQnFXb1FJN21faWxCZTY1eUxLM1V0clpKTFhoa2JUNWFsZzFOYzdJWW1fOEt6czRfMVVlbWczaW5NY01MX3R6ejVfY1ZFVExhSzdHRnFDVG82eXVYVGRJX3c3bUtSX285dVh2MUhzQkttRVh1QXU2a29RdE1CMXNJbk8yOGprLVA2YXpRdE41aFlNSTFtbHFCd3IzcmZNNzhRRFRtY1RXOHl5UlE0XzBTNFlUcnBncDFEbnI3bzdSQ0tGQVN4Q1ptcmhmN2dLOWJ6cko5M3Bsb1lEOUNfYkJoSUNPR2drOVR6WW5TelFhaWw2WmVwSF9oaEZiOEJPZm9NN1p6Wi00UXNVREpwOUxvYmJDcll3ODRUOEVneWdMZHo2eE1HZk83Ri1JMThleWNZMk5MZ1MzOGJvTklOQkx2bkhnaXBsVUt6Tk8zSDRNM19KT2FDT2pVRzhQMmVtdTQ1cWgyVTRjX1NmcUg1VEJnM2lXQ2RhNW5hMVZXaWZtdGZCOWJEanFzS2wtVlRZdGlGbVhnZ2xkR3VlN1lBYVdZc19DZ3A0aERSR0VOajBxcEQ4Y251UVdBS0dzQ2V4em1abHFjUzNIMHhWeVc0Z1hkWXh0cXpWN3k0X2duZk9wZFlULVRrX3A4Z1FDR2dsUkZVTnRjQWxiT0c1YWpTUFFvejFkNFRXNU9RalhiM1JSRWI3dVJuUTZDTUN3QnJrMFB0aEltRlk4bk8tZzVxVTZzck13VGM5YVZpTjRFVktHRUQwdnhxNmpRbEdPck44c3d1dGY1ajQyOExDdkc1NFRtYWstaUdoRmpjWTJvdElEVGFBWk5CbmhvcXY1NTVPRGtPSktLaGdfTDcwWmRmaVR6RFBMM3ZDWUt6cElnWFEwRzhUV3hScnZMUHM3TjF0NU8zQmREanYtbHpteV90dDJiWHpKb3J1LWlvQnBTWWdQU1BtTXpEbDd6VXdvYlcwUmV4NHlLME1jUEpra3pYRzU3RnE2OGdjcV9FTVBJTDh4ZmtQUk85aXJvdmo1YjkzTk1aMk5Pdi0tRTBsWE1fM1dxZlFUYWdMSlU4WndjTkR6ZTZzcEJ3NDQwNHF0ZnRfbmNLV3kwc0NHQTl3SDVudF8xZWRPVVdlSnl6d0U2bFl6T1lkY0VFamxzUThLSTJ4UHVtaDczbmo0VGNKdjZ1X2N4VDRlSnVRVkFEWHc4ejJZaGxWTVU0c1d4VW9sMkc3amJVNGJFRTRaMXBDU1BVNzdGSVFfQW13SjhTVFl6dkVsdEF5Mzk3enAtWFdMUHJVaHpSUmhOc2s0WkU0UW52MmFseldRRnZZQ2REMW1ySmIyaERBbUZpa09VNkFFMzFmMTh3ZENRV1ZoUlluaWJUQUczT3Z6VkNmRmRIckN1Y0tTaFpESDFlRERlVjNCeks1Z0g3TDdJNVU4QS15RlVERHRkZnY2OXNBR3hNcXdPQWhvWktJZ0tXNjRka3NEVnJxbjIxQlhHay03dFpWOUtxWHFMajFGUWVEX1k2Q2dSbHMxckdfa2xNMHNlbTlJS0tsbHJfcHhDUXNDVmlTQzZQa2c4LTVrN0NueVhHendwS0I3aXE1Y3BtUkQ2dGlkZnRmUWdjTGNJNUlnZFRxM0dhMGQzYmJrem9LWmhmTjJZbTljb1l5Z3VSSUNBQWc5UjhQQy1jZDZYaW5pclVOYkl2aXBwUVE2b2NQWTh0blNrS21tLVpPNm9laTJBc25sSDU2STRhSUdGZ1h1ODFMLXFrWmFKeEZfUkFSUlZfUVVJc0NGQUJSZVVCLUJIMHpWMFRRVUdMdkZrNkVwZ3JJQnh0eWhucFhNRHdzblZ0UTMtM0lmeVkzUmRNcHEtMGo5dXdjN0VQR19CcEtjdHQtek9wMDNtR213SFZ3X3pRbWJOMmZQcTZQTlJBSk9oc01zSTM0bnlVczc2eER2R0w0dTQ5Sk0ydElTMnN4ZzNsSzk1QnpMMjQtQkNjTGxDcHpYMVd5d0NiV2JwYXFYTFBFLVBWRnUxV1Z1dmI0UW94djdRZl9XZmpqTTNjUUExeVVPYWlhc0x3Y1VXeW9hR3NPblR6UkNsZmhPenpGajFqaEU0cjJBdDFqeGhTVEdLNkFOdGFlcmR3QnhBSUZWcjluUTdnY09YM2ZQb2RNdmpqTXZoVmdzY2xULW9uNV80WnNDSzNRZ1VPS2pPX1R6UXl4STlyQVNKeERZbmk5NkVXN3Zzem90VTh4NTduLVB3QnBFV25vT013eXZVb0cwNExyaGhjYVo4SWgwQVJ6c2JyTGVnR0dhY1VZbU9MWTVkN2o0Rnp5NG5iZzF0VjFqTzZNbmkyUURnUU5FYTBQOXNLb0VDeS1VVTQzd3ByUE5lQ0ZxaHhyTzBDRkFFT2E3dHlpQzhNdXppY0lldk9CcDRpV3g3N2NjcXRFNm9wem9mRFA3VndySWNYRGpEaHhjSTIyVEgzcVE3NWNuV2lnT0dfRVNoempYNlhhWURuSlpQT0FwdGdIZU9LWlpndFdmYkFFZ210NzM3MnhtOFBkY3dBallUbG9MMVFRejVmVEg4eVZuVng0RWhnVHJVcFNhUEJEYnhXWVBLaGMwY20xdXRIM05LdWJ5d2RHSkM2NHc1cGhIZ1Nrby1xUmVPX3VIWmkwdUlSZ1ZSSkoyTFFxR3dVNWtrdE9QRDhaakpJOUdST3ZjZG9WaDB1czhBMkt2NTRLVENfWjZkNUVjUU1VNFpZR2ljQkVyWE53TzlDUkt3ZW5LdkRpcnh4V0hlR1BJVmZtWWVDdS1qZVVDaWJleFRVeHpwYzU4ODJqZm10NWJGT2NjYmF1U0hQdmVweklfLThaOHpBaWVoNjl4RW9STkh3REprTlkzTjBwUXhVVHZvTENycnp3ZmVqNGhoaWJTTG1HU3pqUURlUzlldG5lSmlaU2dpM0hxLThaV2JZeTFRdHhieTZVVFNPSlBBOHAxeTNqaTZTd1RUSW9vbzdzbHJCY3ZsSUwzaHNfaGxLZ2pId2FlNDdvVmU4U3B3Q3cwdEQ5U2xjaDE1RWRYdFpJNzNGZHhlU1BlX20xMUoxNUxNQ09GOGg4Y1pXMFlkdTh4LWptUmhMamlXcGh5elBFZ3lVd0FPbFlBSWV2TzAxcE9JdGhQU2FXS3BWX1RieElxclNSNnRwTElKVklEcVQ0eWRkb1VZMVJ3N1VBekhwMTZ5WHVqWkVreHJjMldHTHFNQ2JIb3Bna3FOd2FIdjV2ZFJXZXV4M1hPS0hGT1U0bDcwWmhHbzZzVnd2d1ZOVVB1cmtJUkY0bjlwd0ZQUHljSXRKRWhWcUNzWUl5NkJOMl90YXBmQzUzZ3I1bnUtZjFmNnpXZVh0bEY3YnZxWjIzV1hGa3pVQWd3ZEhyQjdHcnpDSE1ISEtjQXJfZ3RjWVpha2RqWTlpdU9ldDdwX0Mybll6RzFkZ01vc1JvUVNfYlFQcXRockNVeklhZVdESTVnSHZ5NDFUOFVVNG5lN0xad3lGMXlQeFUwVmpscHBFWWxMeW5RUGwxLVJpaUhXaEN6UmdJaVZUSElmVVFrRE90dGJFRzhSSUsyNEdUbDdfTThkZmdWTEppTVg0VlJnLU1zY19mZHloa1ZVRV8zNE40WXBIZEtkQnNzTHFRRlhfcnNRNDJXU1VrVHBSZXphOWlvUFNTY2p2ZENsUktndDY4NllienRXcnAtb0ZBTE1FLXZnbjhQOVVqNVFyRktlbFYtbFhsU0p3LWE0akF1aXRmZWJQWFVzb1hCeVZpWVl3TFktZThXT3RMRndlOEwwZ0pPOU9jYzVvVXRwNU5BOEdLREhPVFpITnc1OUNqS3JVZ2Q5eHBQb0kzMEVjUXJlTUVLNHVXM1ptR3hiNWpSZzU0ZkgwQzdmdmRsQXZvRzQ4QmxVOHlkX09EMTRCVnJZa1B1b2g4YXhzRXFxclh5TnlpdHQ4WFF6bW9tMEF4VmVGbWcwYTJhUjFhOXcxSFRiLW9GR3NHNThpbmpUTEhyZDhDYjEtTXNrRVZFTFlDN0xDcl84NEpSVTRVNWhVaEtYaEVlVlB1MUZsalY2dF8tTlRSZzhndkpDdWlkMURNNjE0djFJdDNtUzM1eWlrTDE0eDRNNnhON2pQWEdWZGNrU3ZLbWxDVTZfVzFIRTE1akY2dGh6NWFUMTkzR3U4Y3V4aFNtc0l4UkJzU0ROQjFGZ2d4MXRHZXdaN0RxT1BGODEzRVJNMkh4M2dacG9wTldQRUJwVXBkbGhzaDBTOGFpZlhlU1JFMXFzQ3lhLXhQQ2NOUzRGeXg2ckdtODA5NVBwSGl6S0ZmYUlvVldCdEZrRjBrbzZRcE5JV082WUdIbGdOWl9rNnViSlVFM09YRVBxUm5nVy1tclpXaEptSHE1SmJRYWdDMzBrQlBBTDVUQm9oUi16bk1fdnpnOFFobDJoMV9IUkdDc2l6dzU0NXFjVzVGUkE0VFdFZVZCR3puSHZQYUJvS3lNRkluekh2blNYLUtfcXpMLWUwSGR3ejlPSDJIQ0tYZGNJTEdrbWpFcm1BVkZFVjNYa3JMdllGQktqSkRqUGdaeXY3YmRIeWVZR0dLS2NpVnlhZnc5WkYwOTdEYnhJNEQwNXBpSTZ4bGFudXV4WTVBSklqSzdfNWpKVmNmNjNxMFdHTFhfaXJPN3BXYlZRNlZKRktZWXF4V1BYd2Nlc2QweUdpMmV0ZGVUcDRkTEgwc0ZWRVVuZENDVl9ycnVySk1Fck5LNmZRczNvOWlVR1FlUHZvTUxERXlmVFVCT1dQcmRGeGhFNzJNVzNLTFBoOWZEMzNqdGRuYlZhQk1ZMEs0V1ZucmFCSTd5cnpHUDBqRVJqdVFOM1pHbEVHWWZNSmRuR1VucWJvSGdhcnNHWUllQkY5MHJ6Z3QwN0xzWUFTMzBmYVdyRjAyUUdEWjJhU3BQVUtPUTZqbzBvRENKanNZRnVLUE9fRGdjWjJGVmFCNk4xeURFMVE3Nk5JTHVId1FvbWlXMzljM0toWTEwTHQ1U2l2TjNmV1dlQnBmRHU2UFB3Mklkb3pZY2l4MkxsLTRPY3R1WmJvS3lRVV82VnE5SlZkOFlTTmZqRld4UmF0dDJXWGtzczBmYkZnU0EtS19tbFYzUlpVcEhRVVhFWVBkQ3hCSmdoV1VKR19URzJVWmUzOUU3am1NckVnUG1WbnFFd05iUTFUOHhqcHpUc1FtcmgzMGluS3RKUkpYUF9VN21tR3VUQ241bUtrdktvWV9RenNaN3BrYUoxNUJCdWNwY1VtRGlLcHB5M19pbmxWWllTdFdSYlRsdEl0cFhfMFVtWWgzX0J2cHN6MXQ2aFZpQ19NTGhDWWEzbWFqMFVENDdvUE9jRFVtTEZtc1k5ZEJYTG9yR0VIa3hJUXE2bGV3Y2NpWHZsVEZkTnl4YVBrVG5pT2pPLVB3cVBaczdIdzF2NVlCdHl2eVRNRkgwZWd3QlhUWkVTMTJCSkpyOHQ2NjM3MmxfZDhneDlDRjRNVXB6ZnpEMm1SNVVIUGlDT1owWnR5Y054em1oUldHRXBMallibVQ5eXZ4ME1ROEExdWlpX0NjN24wcmxYYk1IUWx1Ynpkb2RBOWtIdnBSODBWX09BdFVNcHB2SmlFRUdVRTBwOVBmU3RMRjNMZEZSN0gtVjlkQkRveTVTVFN0a2pfc0xHVy1iWWUtNnlzU3dqMVA1ZnpuWVM5Q1p0VXFobHo3U3d4R3dLcFUyMS1zMXFybmNYR0VVdXJQWEEyTktPbVo4R2xaMzItaHg2Ul9sTUNrdk9VQjE1Qjc5ZXZLWEFMUEQ1Wi11QmYyZTg3dmFjWUJQb2hDYm9jejhjc3VyM2xlcDZHRlYtRjFnWUhHWGhiaUxUUDZJY2F4N0VPUVBta21kVk9OSVhDMXY4a1ljbmpwQzJjZlY2VFdkNHNIRS1weXNvYU9qWldoNGFPRE9lNnhJYjlwVlFmQm1YQmhaaTI2WVkxdF9MQmtlY1lBRXhnZ01vZVZpM3Z4SHIxczdXTnhIZ3Fsb0ZFeldKb2hBVHFZS1FDSWFmMzF3cTlZNWtNRDEwVE1qeTRVcFFyTGJHNWhOalRhNS1LQmp1a3ktVVI5ZHhYMEowMU52ZUhNdTBRUXRQU2Fjc0xZaWFGakdtV3ZfTkxVU3YyYTh0ZzB2amhMVXZkTUtSR3ljOE4yREZnMHplR3RfM1B6MmpLSGpoREdRdVBjYXZDS1FYWnphQlJPLUtTY0QySFpxQjR5VTlHZGY4N2lNUk4tUHRNVVY5Skc5R194UnBTY1Y4Q3U0R1owU1g4NDBMY3FvLU5TM2RVcml6TFJvQUwxNkpJUnYzQ3EwNU9Oc0JlT0lRMDVnNE5jNjNoZXVQXzdlN2FfZkdJSjVpSHFxVjRXNmlhX01zdXRaQ19mTE9zbXhRcUNvaEFpSjRwSWJLQVNGbmVOeGNIVktROFJaeGRTSmZZNXZSV3ZJNk15RWtJLVc2T2w0NmhQMFN0bzd1ZmY0QWZMUDdHT1FQVGc1LTFVLVN1cW0wR1NPNmZWNjg4V1Q3X0pjc2JSVGlpbFNJdmgzbWx1Q21wSFFyYkhyMmNDZ0poTk1hekU2UDJCaUNaSEhTaUJBd09KYTRId0g0T0pzSWtjU1hzaXdVQlM2TmNVYTNRNlpmNUFERWZnQnZwN21lZHZlUV9iMlI3b1V1NmF6ZHFkdmZSZkVBNjl0ZGpFLVRqcFdWUXB4UmhjM3VxelVaZ3RUczNieHBhMTU1MTNhLUhzX3gzbi02dHB6OGdFNEwwcWxOek9oYXI3UWV1VUtHTVhXdnp3V29paVlMc3k0VlFQMW9EYkxibDJFTi10bVYyU3FqRFRNXzBUNXdkellfWHhLZWw1MEYxaEEtbHRqZU9KV2JCOUZ2TFZrQnNNRHhtZWo1SDJ3NWJXZUd2OFpBclUxU2tEeEZuSHJCS2w1N3p4bElMeF9sTVFldGxCRlREVXQyVWJkb2xxOUcxaWJfZGVFaVZlRkhpbkhoall3bDljT21fVHhOeWgyeU03RXBaNEFnYkhNRVNxMFlxSGlIajhNdnFoWE82QkE5UmZ1RkNXc2dmR2s0SGdIX2EwZFcxOUdLV1cyM3VzOTZ6WkpTTTdtYVM3VWdMajNQNFlCMkhHTlJhTVg3MGNiT1VxMU5WaFdhRVhHRFlDQTBZdGR5aW9HUGdHWDBpdUFFNkFBbEU2LUhWNlQ2TDJYMFhwa3NScllmc0poRDBrTnJCWVY5d1M2bTRDSXhyazVTREFydWc1cHBrWXVMZnhKemUwRHB6VlA2Nl92bG9LaXM4SFJjTDJsdU5qeUE4c25iajZCWTRadUQ3OG1IR2kzX18tTkQ4bGtEcW1IcHllLThBaVhoME5mcHpwZmhza1dydEV3SC1BdzNDajA0Y08xWUppeVVMeEhfY3R4Z2c3NmJHVHBiYk9sa3YzS0ZBUEhteDhKbmdEVnFzcW5PYjUzQmZzNGJiR29sUVdlVUc1ZFJ4U0Z5RElTUkpEVkIxMnNKbkllSjFBeGVIRF85U2pUZHdOSF9qNnhEaGNseS1uUDlTMzZrcWJ0UEtMeGVXcDlVMFhIenJ0MGx6WGpSSVBYNFRkdldyX0Qza2pjel9UU3FqMTJxWUNOMXJMbGpfVW9HMHRCcGNvaGI4aklZQWhwVmhFUGNyN3JkaXRQeTR3TXBQSDZrQ3hyaGstbFpwc25sR3NmZ3RnaE42dmpBMm5sdjRaMDFIWGVIak5wN0FUUE1RQngzV3ctRlptcFI1SV8zZlFqRXRhclFUenJQVTVCMzJUcFdGdGsxNHB6Um1nQ0p3TWJyNEZqa0NWQ1VCbzBTa0FxOGx1RTdtc1g5Rm43aGlNTTNpT2I5ZGpINjZQWFNMUUJPZkFnMVdtNjB6LUZmYnprOUZwbHVTN2dreDIwRXFnWjFOYXF2WjdDd0pCdzE2SlR3Mm5zdGNSWnZLcFRMRTVjWUM3TmxkcHc5OHk5V1czdHFEdkw0OFZJdEJRQzktXzZVV0podW5NVHhGbkFPWWJqXzdReUtVczRiWlpjd29PLVZLclpldGMxS0NMdm5iMFdfaXZPSGRFNkp4QVl0Um54RmQwTUEwSjBXX0FFRE9ONElfQ0xxb1paMEhVLUxwSm83SU5WcWpfbjMxWVNSR3VMbU1LNjdWTy0tLTc1cGJmX2pBclRSREw3aDU4eGJhYVZFRmJ6empMeXRoQzM3aEtlUGprMGZnRmJtVngtZnY3YW1qQ24zYnVDRWxwWGRXdlhubFpyRWROQ1FGdmdFUFlaMnBOZWlHVm9GOGQwQWRwTmNVZmhoZXdlYTlnSmE2S215T2stQkprUkZ1blNoeTBTYUhKZTc2M0N6Ung0dEdVZ0lHeEVjNnRLM3ZEcFIzX3YwNTBxME45SE1xaDVBZ0pDRE1TZUJPWlZteXM5WTZVTU9SMVFyQVk2WDJwLWozbHBLZVhYNEtzczc3T3NoRHg2QXpKX181VEsydTh1NEVFbk1KUGV6TFRwc2NhdmNyTFBObTNfbGVoUUtoWTU0WDNNLUF2MlVFa19DWFVZNzNGSzZjTU5PSUMwMnRKYngyMlQ5cHVlSVhjZmFHUEp5MkN3ejV3RS1laEFhSTlQa2l0dndwdTlxejVXU3NYZDZ6NXJ4SXBTWTVISDFtTTMtS0dNLXBlSU41aVUtdGpoVkxybXAxX0tUcjdRUkdfWTlNVVBsY0FDUkhQckNKUngwMERXcXhvaTBCVGJCSGt6Vlg3a056QnA5SU5DajhSS0hjYzdIbWdab0MtNVlsN2lXeVhnMHQ4Tmo0Qm9VVWlCMGZwbkJhUkVITkg5ZUVkeGNZZWMxYzlpbkF4ckRqeHpqeVdsUUIwQlhPZ3ViT2pLRXJpaDltOEQ0MGFPZFdPaGZCU2FybmNHUzRsakdoQnA2cGdzUGJWc3hRLTh5WWJxMzRJSkw1VmVoTUtEY3piSU1wVWZWWUdQaUZyQ0lfNi1WSTVTeTRNYUhJRDBWWXkxMURZb1NWdW5Qb3FEaHF0ZDZ6ZjZzdGhiZTFQLXV2QnJZYW1LQTY5U3Y1NHljY0p1cGtVaXh1RlAzdkpZUl9pa05KMDBrRlBGcDh0WGhsdGgyZ3lFT2xXZWJJRU90dmRuSUNaSk5nUDFqMHFFQVU5UWpOZUZQRHJPXzRiMjR6b0hiUU5Uc0NCRzdEU0MydWhYNmFGSEVxRk9fUEFjUDlOUmRGS3B6TGxvSDJCaTNRdmZ0US0xSGd5X3RITXg1VV8tSVJRNXZQeHlFTVZfQ0N1bWlVUUtUX0NlUlN1eTMxcG11TEJMaVlRYmRmd2RBUjB2dlNQZXZiMWlMWDFOQVg0eTBKSUVOcHpYZkFfTXk3UGE3R1VlZG1XeDcwZnMxM0p0blAwQ2JMVXZEbTJfNzFxdHU2SGFINW9VZmU2dDdSWW5WdVplRXRycTlXZks2bmJkZWJfTFNSQVJVWV9RZ1FmZnN4QUVrYzA3VWM2c19ucEJLR1Z1bk9mZkp5SXVUQ1dRRGNlTU5ONG9vd2lJWWlGOEwwYjdGZzVWakl3ODlteEdJblFIOXRpb3FFZElyc1hfY3RNZkxkbnV3cUk0NlBfSG9OQ25sTHFwektORWxfM0I5cGhKdWpjTTU4TjRRVHFjSzh3bDdQT09uYXllRkdUY1p4bk9SQUhHQmw3S3ptazVpRVNoZjYwVm1XQWlwSFdmQmVSM2pKWEVKdlNDa3VEV1QwN2luejZyTmUwVGNlY09hWW11NjRrZjlFMXlxZy05OFY5eHJKV3J4YUlELTN2ak9tMF9PNVZOY2VXUFVUUmVwZ2dnd191bnozUDhDN29WY2VMMy16UmNYcWI2WlVWaEFKOVlQME91VThSS0htdWwxWUc4M2xEV0lENWZaVU1nWDdGZzFlMWxFMmpmV3I1OVI2Yzlfazc0eVhtcXEyaThvdElYbXB0ZXhBeTloTExxMVhIbXUzWkJfWGQzZFVJSng1cWxuRGktZzY5djRuaUo4VmJKLVB4bDhXUjhCeTFQZHZ4NjN6RWRRdlZ4V1FGekpyOFpaY1hRSFVuZW9NTG5mbUxWY0RuV0tPaWN1R0JjNloyODlnYnEwaHJoS2ZOV19nQmFmNl9PTWxQNGhTckNhc24yTmRXVW9Say1hbnV4RDgwS200SkkxT2RPY3lZZjFFSGN6S0FBYVI1alBZdDUtR2pJNE9oVjhhTF85WTlBUmVvcnNOZ3l0NThBaUNTZUZZMHY3RGZvV1p2U2R5aW1nQlBIMFAzODI1dWx3TFM5YUxRNlMxSTdkaTJvZTdHeW9QVHFKWktYNUFsWDAtRE1xU09MaW9zbWtoRmNCOVFrNWZabzV0c0haR3JJOXU0REVNOE9LRWNBMl96Y0JWTUViU2dCRFp5X0V0ckxsTlZlY0RhZ1JpNFVyQzBEa0hicWQ4ZHc2MVVuOU11OGlKMWYxcjREbnVzS2NNZGR6WmNJRF84MUtRYW81eUJqZC11TE1hUk1nM0VmcE1JbC1CUzc2Y1V0LW5Sa05TcUFhVGxQY1hNbVU1czJlZkt4SEFOSnFUdUtBOWp6MFpCcnJXRFQ1RWlobXNhY09aRmFsN0p1elQyUVh3QzF5YkpkclpKVWJRbDUzM3o5Y2tUZ2ZjMWNsNjFiWGJWQmZYdmRQbWNXMnFTLW1nS0Y0bmNHYk1MMW5td1NtakNUa19ycXJkZGJiTVBkOVFaS3hPbDZ1VUdJSHphOU9sTHBqMnFIN2JFN3RQMG93Y3dMT3ZpamU4MnRJSEVqUlh5N0pBdERFM0NRY1BmSDVBQkVNaVZENlpaRkR0VkRJcHhZYWx6ZUFrb1pUd25zQlRncE0wN1ZZVXRueEYyT2VOY0tFMjFWbUk5WHZSR0JKS1FlSkVkSjFWVHZoS0k0dExrdUpkVU5LOTBzNnhSREVmR29WLXIxZVFSZzA0cHVhanBnLUZFbHpNTHlaYzRCX254Z1dEX1ZnUVFVbDVxMDEwRDZEWi1jakVGNW84dUlTaDJvR1h5NnAzU3ZRNXJGaXJHUDd0VGw2eko1SmhzSkdOX002eENiWVo2RmpoMzZ6Szk2aXg3QjdlNFVYakVZaDJfZ05OQjdMa3NGSW1VX1JXT2NSR3NvcXQzRTlUaENaUUg2clZ4aEd6RWRfRlVMcVlNeUNrMV9rWlRCUUgwNUZqSzRZRDdhSVhSbE5kbkpPaFhnRk1CaXliUEI1RTV1TlQ0X3Z3N1UzNHEtYkpaTjRzZE1BSVF0ajN5ODl2VXRWM1cwSDItY3hMdWJXbTc1YmNCRzZZUGh2SWxCYUxRdjhmN0ZYLXVYMnBqT1ozTXZzVDZBVVJMaUgycC1sclYtcEdRa01lM3JIOEczWktWdHhmTWJTbDlTV0ZjQmtNMW9ZZVhRWkhJR2tYTW5fUVEtTmpsZWdfRjFfMFk0bWdxOTdleFpEdmNDV2NRTVRSWTBWZG95T0I0bE5ZWU9EUC1kTHdZU0dZZklIV0tXQVdtTTVLR1gtUWJqNHdsMmJVa29QRlc5WDA1aV8yVS1RYWc1bVZNNnJ0X0NiSl96bXRWWlNaV3hkMjM5WUZYblFqeWpuenc0TTVhUE5GT0I4OHhVRjRZWTdmZXRTdzk4Mm5lczlaZktGLUc4b1F2cW1EeVQxenBBdFhGMnJWRFE2TDJPQXNyYldqTE8yVVlPODJseGxuZHBlV1YtYm5EdVBfSW55MkdCTUtsakx0eHVFdVMxbWZHbjFuam5CeExrbWJpR3J2Um5Jci1RWDdYcWZlRnlJQTZUdVE1aUtQeTFTT01XTVJ2SmVvYmFvTnZtRklIdnE2NU5OcWUyR1htbEdNX1ppOTBGNXFaem1ydEEweGY5M3hBN2lFaVRiQzdsZElZSUJwdDFFd1lOWVFNSEpoM2tJOThCZXRDTzM2b28yazVZdmlTWER1djZPekVkVnlrckp6Q1BRdThPcGVvaHF0VW5HN192ZHp3UnltLTJhYnMxUEwyVGhBZENxNmpYSWFONlNLT3lxb2U1emFSQmc0RUZBQWY0UzN1RmJSMjZOTDNHOVVOQUJiUXpVdzFlUDUwVHBEZkgzX1RzaENDWHJudklUYjBTZjdzWnFhQXp2T0lLbmhwUXp0T2dqbkEwM29CaFBYaVhNeV9HTXl5M1VxZTZIZ2s0RGdwTGRDMUxUR0pKSzNjODkzVzV1QmJaQ2ZFdW1oUDczUHMwVjVxQ0NOUWtPUk1NY0luYnQyZnUzUkdESVQxck5rc2xNREJyNnkxTXBhX3FxSnhuaHJvczltQTFOM2ZHU3hPeWZQYzZYRVdqdW1nbFdYbFR2ZUxBdUREaVNqMkdWa0k3VFd2UDJicWctSl8xTXJKS3lvWnowRXNuUkRhdWhmMUNlSzB5VWR0MWdGZDNNZVNibWpPOFo3OHA1MEVsb1VKM1Q5MFoxWGNRbXBMSy1aUnc5ZC5FUlpkY3dRZ0ZiWVpBa2pEMXhKb21n"}'} + headers: + cache-control: [no-cache] + content-length: ['13280'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: DELETE + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/c9e702dfcb8c49b4ae6bc7ccbde373e3","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"qhXr6bSYllAL_6HG3YJVvhSRHHmSgFdk-DU6G3M-rVN7MIwo4YZnp9abyK06TXhDOUmv4iLldZ8gEbxnKpHm4VywQkpoBrxQGZGbstaPwvsOluJHnEIj_GbzpSV7l024fg27qT4rezyu6JhR8J-utEbb_9X_5LOWSB8DFYb9ALJwFTFawfuSKX-JCCi8LVwmg3MYF2f07MDeV-JLm57Sy56z2FnaH5lQrl2pWRlplRt1Qq-408BvG68LjaZLQg_eiYJU6LPYCX_aBoNaQK36NXwji5sLedTP-_E8we5LZtowD3IyLvWWKcFSNI0ypPq-hpOl9aLFPm1fOKqNaow5Lw","e":"AQAB"},"attributes":{"enabled":true,"created":1523441444,"updated":1523441447,"recoveryLevel":"Purgeable"},"tags":{"test":"foo"}}'} + headers: + cache-control: [no-cache] + content-length: ['635'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":[],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['28'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "JkF6dXJlS2V5VmF1bHRLZXlCYWNrdXBWMS5taWNyb3NvZnQuY29tZXlKcmFXUWlPaUkwTXpnMVlqQTNZaTFrTlRRM0xUUXlaVFV0WVdVNVpTMDJNVEJrWXpNNVpHWmhaamdpTENKaGJHY2lPaUpTVTBFdFQwRkZVQ0lzSW1WdVl5STZJa0V4TWpoRFFrTXRTRk15TlRZaWZRLmw3NU1JdVVVYmV6Z3JheFBON3l1YUNDZUNETmp2WG9FTDBwZy1JOFVjUVlUWnhoZTdMUmFXajdGVFF3UVhLQzlFQnpPZ2lrTGdHNThhU25vaVI2QmU1cHVIWmtGSFNIMXFHYndabnNiZzdXRno2WUhub2Q2RzBGVkM2czRhTXFZMHliLW9EMFVyakZndjU0U2d3QmRka1ZrRVgxN18td3dhak1jUHFkbVU5Rl9CQktvUUhzUlNjT0U3SmROWjNWaHpsQm5FS1N3UU5qc0phMU1XdXJzdU9JNHlFUlVETEZDQmhSakhxVG5idW9mOE02bzJrVGdoS1pOX3ByU0I4YkJFS2FLQklkdmkzVWs4Zy1MbzdCUmtITmpsSDNIT202NXFtR0JLMDNKYm9XV2V2NFNNbkZreHlFMXg2ZTNqbC04TzhKRlBOem9xcDhLS0N1QXFkTVA3US41Nm1OaTdIWUY4cTgtdjJSRVFtbzVRLmtfMzdPaGc2UWRBamlFMGloSEo0WFlmYTQ1YkRZVmtVbU1mTE0wWG5iVDB6RjNqOWNQT2o4ZFFIZGxiQnFXb1FJN21faWxCZTY1eUxLM1V0clpKTFhoa2JUNWFsZzFOYzdJWW1fOEt6czRfMVVlbWczaW5NY01MX3R6ejVfY1ZFVExhSzdHRnFDVG82eXVYVGRJX3c3bUtSX285dVh2MUhzQkttRVh1QXU2a29RdE1CMXNJbk8yOGprLVA2YXpRdE41aFlNSTFtbHFCd3IzcmZNNzhRRFRtY1RXOHl5UlE0XzBTNFlUcnBncDFEbnI3bzdSQ0tGQVN4Q1ptcmhmN2dLOWJ6cko5M3Bsb1lEOUNfYkJoSUNPR2drOVR6WW5TelFhaWw2WmVwSF9oaEZiOEJPZm9NN1p6Wi00UXNVREpwOUxvYmJDcll3ODRUOEVneWdMZHo2eE1HZk83Ri1JMThleWNZMk5MZ1MzOGJvTklOQkx2bkhnaXBsVUt6Tk8zSDRNM19KT2FDT2pVRzhQMmVtdTQ1cWgyVTRjX1NmcUg1VEJnM2lXQ2RhNW5hMVZXaWZtdGZCOWJEanFzS2wtVlRZdGlGbVhnZ2xkR3VlN1lBYVdZc19DZ3A0aERSR0VOajBxcEQ4Y251UVdBS0dzQ2V4em1abHFjUzNIMHhWeVc0Z1hkWXh0cXpWN3k0X2duZk9wZFlULVRrX3A4Z1FDR2dsUkZVTnRjQWxiT0c1YWpTUFFvejFkNFRXNU9RalhiM1JSRWI3dVJuUTZDTUN3QnJrMFB0aEltRlk4bk8tZzVxVTZzck13VGM5YVZpTjRFVktHRUQwdnhxNmpRbEdPck44c3d1dGY1ajQyOExDdkc1NFRtYWstaUdoRmpjWTJvdElEVGFBWk5CbmhvcXY1NTVPRGtPSktLaGdfTDcwWmRmaVR6RFBMM3ZDWUt6cElnWFEwRzhUV3hScnZMUHM3TjF0NU8zQmREanYtbHpteV90dDJiWHpKb3J1LWlvQnBTWWdQU1BtTXpEbDd6VXdvYlcwUmV4NHlLME1jUEpra3pYRzU3RnE2OGdjcV9FTVBJTDh4ZmtQUk85aXJvdmo1YjkzTk1aMk5Pdi0tRTBsWE1fM1dxZlFUYWdMSlU4WndjTkR6ZTZzcEJ3NDQwNHF0ZnRfbmNLV3kwc0NHQTl3SDVudF8xZWRPVVdlSnl6d0U2bFl6T1lkY0VFamxzUThLSTJ4UHVtaDczbmo0VGNKdjZ1X2N4VDRlSnVRVkFEWHc4ejJZaGxWTVU0c1d4VW9sMkc3amJVNGJFRTRaMXBDU1BVNzdGSVFfQW13SjhTVFl6dkVsdEF5Mzk3enAtWFdMUHJVaHpSUmhOc2s0WkU0UW52MmFseldRRnZZQ2REMW1ySmIyaERBbUZpa09VNkFFMzFmMTh3ZENRV1ZoUlluaWJUQUczT3Z6VkNmRmRIckN1Y0tTaFpESDFlRERlVjNCeks1Z0g3TDdJNVU4QS15RlVERHRkZnY2OXNBR3hNcXdPQWhvWktJZ0tXNjRka3NEVnJxbjIxQlhHay03dFpWOUtxWHFMajFGUWVEX1k2Q2dSbHMxckdfa2xNMHNlbTlJS0tsbHJfcHhDUXNDVmlTQzZQa2c4LTVrN0NueVhHendwS0I3aXE1Y3BtUkQ2dGlkZnRmUWdjTGNJNUlnZFRxM0dhMGQzYmJrem9LWmhmTjJZbTljb1l5Z3VSSUNBQWc5UjhQQy1jZDZYaW5pclVOYkl2aXBwUVE2b2NQWTh0blNrS21tLVpPNm9laTJBc25sSDU2STRhSUdGZ1h1ODFMLXFrWmFKeEZfUkFSUlZfUVVJc0NGQUJSZVVCLUJIMHpWMFRRVUdMdkZrNkVwZ3JJQnh0eWhucFhNRHdzblZ0UTMtM0lmeVkzUmRNcHEtMGo5dXdjN0VQR19CcEtjdHQtek9wMDNtR213SFZ3X3pRbWJOMmZQcTZQTlJBSk9oc01zSTM0bnlVczc2eER2R0w0dTQ5Sk0ydElTMnN4ZzNsSzk1QnpMMjQtQkNjTGxDcHpYMVd5d0NiV2JwYXFYTFBFLVBWRnUxV1Z1dmI0UW94djdRZl9XZmpqTTNjUUExeVVPYWlhc0x3Y1VXeW9hR3NPblR6UkNsZmhPenpGajFqaEU0cjJBdDFqeGhTVEdLNkFOdGFlcmR3QnhBSUZWcjluUTdnY09YM2ZQb2RNdmpqTXZoVmdzY2xULW9uNV80WnNDSzNRZ1VPS2pPX1R6UXl4STlyQVNKeERZbmk5NkVXN3Zzem90VTh4NTduLVB3QnBFV25vT013eXZVb0cwNExyaGhjYVo4SWgwQVJ6c2JyTGVnR0dhY1VZbU9MWTVkN2o0Rnp5NG5iZzF0VjFqTzZNbmkyUURnUU5FYTBQOXNLb0VDeS1VVTQzd3ByUE5lQ0ZxaHhyTzBDRkFFT2E3dHlpQzhNdXppY0lldk9CcDRpV3g3N2NjcXRFNm9wem9mRFA3VndySWNYRGpEaHhjSTIyVEgzcVE3NWNuV2lnT0dfRVNoempYNlhhWURuSlpQT0FwdGdIZU9LWlpndFdmYkFFZ210NzM3MnhtOFBkY3dBallUbG9MMVFRejVmVEg4eVZuVng0RWhnVHJVcFNhUEJEYnhXWVBLaGMwY20xdXRIM05LdWJ5d2RHSkM2NHc1cGhIZ1Nrby1xUmVPX3VIWmkwdUlSZ1ZSSkoyTFFxR3dVNWtrdE9QRDhaakpJOUdST3ZjZG9WaDB1czhBMkt2NTRLVENfWjZkNUVjUU1VNFpZR2ljQkVyWE53TzlDUkt3ZW5LdkRpcnh4V0hlR1BJVmZtWWVDdS1qZVVDaWJleFRVeHpwYzU4ODJqZm10NWJGT2NjYmF1U0hQdmVweklfLThaOHpBaWVoNjl4RW9STkh3REprTlkzTjBwUXhVVHZvTENycnp3ZmVqNGhoaWJTTG1HU3pqUURlUzlldG5lSmlaU2dpM0hxLThaV2JZeTFRdHhieTZVVFNPSlBBOHAxeTNqaTZTd1RUSW9vbzdzbHJCY3ZsSUwzaHNfaGxLZ2pId2FlNDdvVmU4U3B3Q3cwdEQ5U2xjaDE1RWRYdFpJNzNGZHhlU1BlX20xMUoxNUxNQ09GOGg4Y1pXMFlkdTh4LWptUmhMamlXcGh5elBFZ3lVd0FPbFlBSWV2TzAxcE9JdGhQU2FXS3BWX1RieElxclNSNnRwTElKVklEcVQ0eWRkb1VZMVJ3N1VBekhwMTZ5WHVqWkVreHJjMldHTHFNQ2JIb3Bna3FOd2FIdjV2ZFJXZXV4M1hPS0hGT1U0bDcwWmhHbzZzVnd2d1ZOVVB1cmtJUkY0bjlwd0ZQUHljSXRKRWhWcUNzWUl5NkJOMl90YXBmQzUzZ3I1bnUtZjFmNnpXZVh0bEY3YnZxWjIzV1hGa3pVQWd3ZEhyQjdHcnpDSE1ISEtjQXJfZ3RjWVpha2RqWTlpdU9ldDdwX0Mybll6RzFkZ01vc1JvUVNfYlFQcXRockNVeklhZVdESTVnSHZ5NDFUOFVVNG5lN0xad3lGMXlQeFUwVmpscHBFWWxMeW5RUGwxLVJpaUhXaEN6UmdJaVZUSElmVVFrRE90dGJFRzhSSUsyNEdUbDdfTThkZmdWTEppTVg0VlJnLU1zY19mZHloa1ZVRV8zNE40WXBIZEtkQnNzTHFRRlhfcnNRNDJXU1VrVHBSZXphOWlvUFNTY2p2ZENsUktndDY4NllienRXcnAtb0ZBTE1FLXZnbjhQOVVqNVFyRktlbFYtbFhsU0p3LWE0akF1aXRmZWJQWFVzb1hCeVZpWVl3TFktZThXT3RMRndlOEwwZ0pPOU9jYzVvVXRwNU5BOEdLREhPVFpITnc1OUNqS3JVZ2Q5eHBQb0kzMEVjUXJlTUVLNHVXM1ptR3hiNWpSZzU0ZkgwQzdmdmRsQXZvRzQ4QmxVOHlkX09EMTRCVnJZa1B1b2g4YXhzRXFxclh5TnlpdHQ4WFF6bW9tMEF4VmVGbWcwYTJhUjFhOXcxSFRiLW9GR3NHNThpbmpUTEhyZDhDYjEtTXNrRVZFTFlDN0xDcl84NEpSVTRVNWhVaEtYaEVlVlB1MUZsalY2dF8tTlRSZzhndkpDdWlkMURNNjE0djFJdDNtUzM1eWlrTDE0eDRNNnhON2pQWEdWZGNrU3ZLbWxDVTZfVzFIRTE1akY2dGh6NWFUMTkzR3U4Y3V4aFNtc0l4UkJzU0ROQjFGZ2d4MXRHZXdaN0RxT1BGODEzRVJNMkh4M2dacG9wTldQRUJwVXBkbGhzaDBTOGFpZlhlU1JFMXFzQ3lhLXhQQ2NOUzRGeXg2ckdtODA5NVBwSGl6S0ZmYUlvVldCdEZrRjBrbzZRcE5JV082WUdIbGdOWl9rNnViSlVFM09YRVBxUm5nVy1tclpXaEptSHE1SmJRYWdDMzBrQlBBTDVUQm9oUi16bk1fdnpnOFFobDJoMV9IUkdDc2l6dzU0NXFjVzVGUkE0VFdFZVZCR3puSHZQYUJvS3lNRkluekh2blNYLUtfcXpMLWUwSGR3ejlPSDJIQ0tYZGNJTEdrbWpFcm1BVkZFVjNYa3JMdllGQktqSkRqUGdaeXY3YmRIeWVZR0dLS2NpVnlhZnc5WkYwOTdEYnhJNEQwNXBpSTZ4bGFudXV4WTVBSklqSzdfNWpKVmNmNjNxMFdHTFhfaXJPN3BXYlZRNlZKRktZWXF4V1BYd2Nlc2QweUdpMmV0ZGVUcDRkTEgwc0ZWRVVuZENDVl9ycnVySk1Fck5LNmZRczNvOWlVR1FlUHZvTUxERXlmVFVCT1dQcmRGeGhFNzJNVzNLTFBoOWZEMzNqdGRuYlZhQk1ZMEs0V1ZucmFCSTd5cnpHUDBqRVJqdVFOM1pHbEVHWWZNSmRuR1VucWJvSGdhcnNHWUllQkY5MHJ6Z3QwN0xzWUFTMzBmYVdyRjAyUUdEWjJhU3BQVUtPUTZqbzBvRENKanNZRnVLUE9fRGdjWjJGVmFCNk4xeURFMVE3Nk5JTHVId1FvbWlXMzljM0toWTEwTHQ1U2l2TjNmV1dlQnBmRHU2UFB3Mklkb3pZY2l4MkxsLTRPY3R1WmJvS3lRVV82VnE5SlZkOFlTTmZqRld4UmF0dDJXWGtzczBmYkZnU0EtS19tbFYzUlpVcEhRVVhFWVBkQ3hCSmdoV1VKR19URzJVWmUzOUU3am1NckVnUG1WbnFFd05iUTFUOHhqcHpUc1FtcmgzMGluS3RKUkpYUF9VN21tR3VUQ241bUtrdktvWV9RenNaN3BrYUoxNUJCdWNwY1VtRGlLcHB5M19pbmxWWllTdFdSYlRsdEl0cFhfMFVtWWgzX0J2cHN6MXQ2aFZpQ19NTGhDWWEzbWFqMFVENDdvUE9jRFVtTEZtc1k5ZEJYTG9yR0VIa3hJUXE2bGV3Y2NpWHZsVEZkTnl4YVBrVG5pT2pPLVB3cVBaczdIdzF2NVlCdHl2eVRNRkgwZWd3QlhUWkVTMTJCSkpyOHQ2NjM3MmxfZDhneDlDRjRNVXB6ZnpEMm1SNVVIUGlDT1owWnR5Y054em1oUldHRXBMallibVQ5eXZ4ME1ROEExdWlpX0NjN24wcmxYYk1IUWx1Ynpkb2RBOWtIdnBSODBWX09BdFVNcHB2SmlFRUdVRTBwOVBmU3RMRjNMZEZSN0gtVjlkQkRveTVTVFN0a2pfc0xHVy1iWWUtNnlzU3dqMVA1ZnpuWVM5Q1p0VXFobHo3U3d4R3dLcFUyMS1zMXFybmNYR0VVdXJQWEEyTktPbVo4R2xaMzItaHg2Ul9sTUNrdk9VQjE1Qjc5ZXZLWEFMUEQ1Wi11QmYyZTg3dmFjWUJQb2hDYm9jejhjc3VyM2xlcDZHRlYtRjFnWUhHWGhiaUxUUDZJY2F4N0VPUVBta21kVk9OSVhDMXY4a1ljbmpwQzJjZlY2VFdkNHNIRS1weXNvYU9qWldoNGFPRE9lNnhJYjlwVlFmQm1YQmhaaTI2WVkxdF9MQmtlY1lBRXhnZ01vZVZpM3Z4SHIxczdXTnhIZ3Fsb0ZFeldKb2hBVHFZS1FDSWFmMzF3cTlZNWtNRDEwVE1qeTRVcFFyTGJHNWhOalRhNS1LQmp1a3ktVVI5ZHhYMEowMU52ZUhNdTBRUXRQU2Fjc0xZaWFGakdtV3ZfTkxVU3YyYTh0ZzB2amhMVXZkTUtSR3ljOE4yREZnMHplR3RfM1B6MmpLSGpoREdRdVBjYXZDS1FYWnphQlJPLUtTY0QySFpxQjR5VTlHZGY4N2lNUk4tUHRNVVY5Skc5R194UnBTY1Y4Q3U0R1owU1g4NDBMY3FvLU5TM2RVcml6TFJvQUwxNkpJUnYzQ3EwNU9Oc0JlT0lRMDVnNE5jNjNoZXVQXzdlN2FfZkdJSjVpSHFxVjRXNmlhX01zdXRaQ19mTE9zbXhRcUNvaEFpSjRwSWJLQVNGbmVOeGNIVktROFJaeGRTSmZZNXZSV3ZJNk15RWtJLVc2T2w0NmhQMFN0bzd1ZmY0QWZMUDdHT1FQVGc1LTFVLVN1cW0wR1NPNmZWNjg4V1Q3X0pjc2JSVGlpbFNJdmgzbWx1Q21wSFFyYkhyMmNDZ0poTk1hekU2UDJCaUNaSEhTaUJBd09KYTRId0g0T0pzSWtjU1hzaXdVQlM2TmNVYTNRNlpmNUFERWZnQnZwN21lZHZlUV9iMlI3b1V1NmF6ZHFkdmZSZkVBNjl0ZGpFLVRqcFdWUXB4UmhjM3VxelVaZ3RUczNieHBhMTU1MTNhLUhzX3gzbi02dHB6OGdFNEwwcWxOek9oYXI3UWV1VUtHTVhXdnp3V29paVlMc3k0VlFQMW9EYkxibDJFTi10bVYyU3FqRFRNXzBUNXdkellfWHhLZWw1MEYxaEEtbHRqZU9KV2JCOUZ2TFZrQnNNRHhtZWo1SDJ3NWJXZUd2OFpBclUxU2tEeEZuSHJCS2w1N3p4bElMeF9sTVFldGxCRlREVXQyVWJkb2xxOUcxaWJfZGVFaVZlRkhpbkhoall3bDljT21fVHhOeWgyeU03RXBaNEFnYkhNRVNxMFlxSGlIajhNdnFoWE82QkE5UmZ1RkNXc2dmR2s0SGdIX2EwZFcxOUdLV1cyM3VzOTZ6WkpTTTdtYVM3VWdMajNQNFlCMkhHTlJhTVg3MGNiT1VxMU5WaFdhRVhHRFlDQTBZdGR5aW9HUGdHWDBpdUFFNkFBbEU2LUhWNlQ2TDJYMFhwa3NScllmc0poRDBrTnJCWVY5d1M2bTRDSXhyazVTREFydWc1cHBrWXVMZnhKemUwRHB6VlA2Nl92bG9LaXM4SFJjTDJsdU5qeUE4c25iajZCWTRadUQ3OG1IR2kzX18tTkQ4bGtEcW1IcHllLThBaVhoME5mcHpwZmhza1dydEV3SC1BdzNDajA0Y08xWUppeVVMeEhfY3R4Z2c3NmJHVHBiYk9sa3YzS0ZBUEhteDhKbmdEVnFzcW5PYjUzQmZzNGJiR29sUVdlVUc1ZFJ4U0Z5RElTUkpEVkIxMnNKbkllSjFBeGVIRF85U2pUZHdOSF9qNnhEaGNseS1uUDlTMzZrcWJ0UEtMeGVXcDlVMFhIenJ0MGx6WGpSSVBYNFRkdldyX0Qza2pjel9UU3FqMTJxWUNOMXJMbGpfVW9HMHRCcGNvaGI4aklZQWhwVmhFUGNyN3JkaXRQeTR3TXBQSDZrQ3hyaGstbFpwc25sR3NmZ3RnaE42dmpBMm5sdjRaMDFIWGVIak5wN0FUUE1RQngzV3ctRlptcFI1SV8zZlFqRXRhclFUenJQVTVCMzJUcFdGdGsxNHB6Um1nQ0p3TWJyNEZqa0NWQ1VCbzBTa0FxOGx1RTdtc1g5Rm43aGlNTTNpT2I5ZGpINjZQWFNMUUJPZkFnMVdtNjB6LUZmYnprOUZwbHVTN2dreDIwRXFnWjFOYXF2WjdDd0pCdzE2SlR3Mm5zdGNSWnZLcFRMRTVjWUM3TmxkcHc5OHk5V1czdHFEdkw0OFZJdEJRQzktXzZVV0podW5NVHhGbkFPWWJqXzdReUtVczRiWlpjd29PLVZLclpldGMxS0NMdm5iMFdfaXZPSGRFNkp4QVl0Um54RmQwTUEwSjBXX0FFRE9ONElfQ0xxb1paMEhVLUxwSm83SU5WcWpfbjMxWVNSR3VMbU1LNjdWTy0tLTc1cGJmX2pBclRSREw3aDU4eGJhYVZFRmJ6empMeXRoQzM3aEtlUGprMGZnRmJtVngtZnY3YW1qQ24zYnVDRWxwWGRXdlhubFpyRWROQ1FGdmdFUFlaMnBOZWlHVm9GOGQwQWRwTmNVZmhoZXdlYTlnSmE2S215T2stQkprUkZ1blNoeTBTYUhKZTc2M0N6Ung0dEdVZ0lHeEVjNnRLM3ZEcFIzX3YwNTBxME45SE1xaDVBZ0pDRE1TZUJPWlZteXM5WTZVTU9SMVFyQVk2WDJwLWozbHBLZVhYNEtzczc3T3NoRHg2QXpKX181VEsydTh1NEVFbk1KUGV6TFRwc2NhdmNyTFBObTNfbGVoUUtoWTU0WDNNLUF2MlVFa19DWFVZNzNGSzZjTU5PSUMwMnRKYngyMlQ5cHVlSVhjZmFHUEp5MkN3ejV3RS1laEFhSTlQa2l0dndwdTlxejVXU3NYZDZ6NXJ4SXBTWTVISDFtTTMtS0dNLXBlSU41aVUtdGpoVkxybXAxX0tUcjdRUkdfWTlNVVBsY0FDUkhQckNKUngwMERXcXhvaTBCVGJCSGt6Vlg3a056QnA5SU5DajhSS0hjYzdIbWdab0MtNVlsN2lXeVhnMHQ4Tmo0Qm9VVWlCMGZwbkJhUkVITkg5ZUVkeGNZZWMxYzlpbkF4ckRqeHpqeVdsUUIwQlhPZ3ViT2pLRXJpaDltOEQ0MGFPZFdPaGZCU2FybmNHUzRsakdoQnA2cGdzUGJWc3hRLTh5WWJxMzRJSkw1VmVoTUtEY3piSU1wVWZWWUdQaUZyQ0lfNi1WSTVTeTRNYUhJRDBWWXkxMURZb1NWdW5Qb3FEaHF0ZDZ6ZjZzdGhiZTFQLXV2QnJZYW1LQTY5U3Y1NHljY0p1cGtVaXh1RlAzdkpZUl9pa05KMDBrRlBGcDh0WGhsdGgyZ3lFT2xXZWJJRU90dmRuSUNaSk5nUDFqMHFFQVU5UWpOZUZQRHJPXzRiMjR6b0hiUU5Uc0NCRzdEU0MydWhYNmFGSEVxRk9fUEFjUDlOUmRGS3B6TGxvSDJCaTNRdmZ0US0xSGd5X3RITXg1VV8tSVJRNXZQeHlFTVZfQ0N1bWlVUUtUX0NlUlN1eTMxcG11TEJMaVlRYmRmd2RBUjB2dlNQZXZiMWlMWDFOQVg0eTBKSUVOcHpYZkFfTXk3UGE3R1VlZG1XeDcwZnMxM0p0blAwQ2JMVXZEbTJfNzFxdHU2SGFINW9VZmU2dDdSWW5WdVplRXRycTlXZks2bmJkZWJfTFNSQVJVWV9RZ1FmZnN4QUVrYzA3VWM2c19ucEJLR1Z1bk9mZkp5SXVUQ1dRRGNlTU5ONG9vd2lJWWlGOEwwYjdGZzVWakl3ODlteEdJblFIOXRpb3FFZElyc1hfY3RNZkxkbnV3cUk0NlBfSG9OQ25sTHFwektORWxfM0I5cGhKdWpjTTU4TjRRVHFjSzh3bDdQT09uYXllRkdUY1p4bk9SQUhHQmw3S3ptazVpRVNoZjYwVm1XQWlwSFdmQmVSM2pKWEVKdlNDa3VEV1QwN2luejZyTmUwVGNlY09hWW11NjRrZjlFMXlxZy05OFY5eHJKV3J4YUlELTN2ak9tMF9PNVZOY2VXUFVUUmVwZ2dnd191bnozUDhDN29WY2VMMy16UmNYcWI2WlVWaEFKOVlQME91VThSS0htdWwxWUc4M2xEV0lENWZaVU1nWDdGZzFlMWxFMmpmV3I1OVI2Yzlfazc0eVhtcXEyaThvdElYbXB0ZXhBeTloTExxMVhIbXUzWkJfWGQzZFVJSng1cWxuRGktZzY5djRuaUo4VmJKLVB4bDhXUjhCeTFQZHZ4NjN6RWRRdlZ4V1FGekpyOFpaY1hRSFVuZW9NTG5mbUxWY0RuV0tPaWN1R0JjNloyODlnYnEwaHJoS2ZOV19nQmFmNl9PTWxQNGhTckNhc24yTmRXVW9Say1hbnV4RDgwS200SkkxT2RPY3lZZjFFSGN6S0FBYVI1alBZdDUtR2pJNE9oVjhhTF85WTlBUmVvcnNOZ3l0NThBaUNTZUZZMHY3RGZvV1p2U2R5aW1nQlBIMFAzODI1dWx3TFM5YUxRNlMxSTdkaTJvZTdHeW9QVHFKWktYNUFsWDAtRE1xU09MaW9zbWtoRmNCOVFrNWZabzV0c0haR3JJOXU0REVNOE9LRWNBMl96Y0JWTUViU2dCRFp5X0V0ckxsTlZlY0RhZ1JpNFVyQzBEa0hicWQ4ZHc2MVVuOU11OGlKMWYxcjREbnVzS2NNZGR6WmNJRF84MUtRYW81eUJqZC11TE1hUk1nM0VmcE1JbC1CUzc2Y1V0LW5Sa05TcUFhVGxQY1hNbVU1czJlZkt4SEFOSnFUdUtBOWp6MFpCcnJXRFQ1RWlobXNhY09aRmFsN0p1elQyUVh3QzF5YkpkclpKVWJRbDUzM3o5Y2tUZ2ZjMWNsNjFiWGJWQmZYdmRQbWNXMnFTLW1nS0Y0bmNHYk1MMW5td1NtakNUa19ycXJkZGJiTVBkOVFaS3hPbDZ1VUdJSHphOU9sTHBqMnFIN2JFN3RQMG93Y3dMT3ZpamU4MnRJSEVqUlh5N0pBdERFM0NRY1BmSDVBQkVNaVZENlpaRkR0VkRJcHhZYWx6ZUFrb1pUd25zQlRncE0wN1ZZVXRueEYyT2VOY0tFMjFWbUk5WHZSR0JKS1FlSkVkSjFWVHZoS0k0dExrdUpkVU5LOTBzNnhSREVmR29WLXIxZVFSZzA0cHVhanBnLUZFbHpNTHlaYzRCX254Z1dEX1ZnUVFVbDVxMDEwRDZEWi1jakVGNW84dUlTaDJvR1h5NnAzU3ZRNXJGaXJHUDd0VGw2eko1SmhzSkdOX002eENiWVo2RmpoMzZ6Szk2aXg3QjdlNFVYakVZaDJfZ05OQjdMa3NGSW1VX1JXT2NSR3NvcXQzRTlUaENaUUg2clZ4aEd6RWRfRlVMcVlNeUNrMV9rWlRCUUgwNUZqSzRZRDdhSVhSbE5kbkpPaFhnRk1CaXliUEI1RTV1TlQ0X3Z3N1UzNHEtYkpaTjRzZE1BSVF0ajN5ODl2VXRWM1cwSDItY3hMdWJXbTc1YmNCRzZZUGh2SWxCYUxRdjhmN0ZYLXVYMnBqT1ozTXZzVDZBVVJMaUgycC1sclYtcEdRa01lM3JIOEczWktWdHhmTWJTbDlTV0ZjQmtNMW9ZZVhRWkhJR2tYTW5fUVEtTmpsZWdfRjFfMFk0bWdxOTdleFpEdmNDV2NRTVRSWTBWZG95T0I0bE5ZWU9EUC1kTHdZU0dZZklIV0tXQVdtTTVLR1gtUWJqNHdsMmJVa29QRlc5WDA1aV8yVS1RYWc1bVZNNnJ0X0NiSl96bXRWWlNaV3hkMjM5WUZYblFqeWpuenc0TTVhUE5GT0I4OHhVRjRZWTdmZXRTdzk4Mm5lczlaZktGLUc4b1F2cW1EeVQxenBBdFhGMnJWRFE2TDJPQXNyYldqTE8yVVlPODJseGxuZHBlV1YtYm5EdVBfSW55MkdCTUtsakx0eHVFdVMxbWZHbjFuam5CeExrbWJpR3J2Um5Jci1RWDdYcWZlRnlJQTZUdVE1aUtQeTFTT01XTVJ2SmVvYmFvTnZtRklIdnE2NU5OcWUyR1htbEdNX1ppOTBGNXFaem1ydEEweGY5M3hBN2lFaVRiQzdsZElZSUJwdDFFd1lOWVFNSEpoM2tJOThCZXRDTzM2b28yazVZdmlTWER1djZPekVkVnlrckp6Q1BRdThPcGVvaHF0VW5HN192ZHp3UnltLTJhYnMxUEwyVGhBZENxNmpYSWFONlNLT3lxb2U1emFSQmc0RUZBQWY0UzN1RmJSMjZOTDNHOVVOQUJiUXpVdzFlUDUwVHBEZkgzX1RzaENDWHJudklUYjBTZjdzWnFhQXp2T0lLbmhwUXp0T2dqbkEwM29CaFBYaVhNeV9HTXl5M1VxZTZIZ2s0RGdwTGRDMUxUR0pKSzNjODkzVzV1QmJaQ2ZFdW1oUDczUHMwVjVxQ0NOUWtPUk1NY0luYnQyZnUzUkdESVQxck5rc2xNREJyNnkxTXBhX3FxSnhuaHJvczltQTFOM2ZHU3hPeWZQYzZYRVdqdW1nbFdYbFR2ZUxBdUREaVNqMkdWa0k3VFd2UDJicWctSl8xTXJKS3lvWnowRXNuUkRhdWhmMUNlSzB5VWR0MWdGZDNNZVNibWpPOFo3OHA1MEVsb1VKM1Q5MFoxWGNRbXBMSy1aUnc5ZC5FUlpkY3dRZ0ZiWVpBa2pEMXhKb21n"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['13281'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/restore?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/c9e702dfcb8c49b4ae6bc7ccbde373e3","kty":"RSA","key_ops":["encrypt","decrypt"],"n":"qhXr6bSYllAL_6HG3YJVvhSRHHmSgFdk-DU6G3M-rVN7MIwo4YZnp9abyK06TXhDOUmv4iLldZ8gEbxnKpHm4VywQkpoBrxQGZGbstaPwvsOluJHnEIj_GbzpSV7l024fg27qT4rezyu6JhR8J-utEbb_9X_5LOWSB8DFYb9ALJwFTFawfuSKX-JCCi8LVwmg3MYF2f07MDeV-JLm57Sy56z2FnaH5lQrl2pWRlplRt1Qq-408BvG68LjaZLQg_eiYJU6LPYCX_aBoNaQK36NXwji5sLedTP-_E8we5LZtowD3IyLvWWKcFSNI0ypPq-hpOl9aLFPm1fOKqNaow5Lw","e":"AQAB"},"attributes":{"enabled":true,"created":1523441444,"updated":1523441447,"recoveryLevel":"Purgeable"},"tags":{"test":"foo"}}'} + headers: + cache-control: [no-cache] + content-length: ['635'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/key1/versions?api-version=7.0-preview + response: + body: {string: '{"value":[{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/a1871d8bb5804215a4f3c7cfce21e166","attributes":{"enabled":true,"created":1523441443,"updated":1523441443,"recoveryLevel":"Purgeable"}},{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/key1/c9e702dfcb8c49b4ae6bc7ccbde373e3","attributes":{"enabled":true,"created":1523441444,"updated":1523441447,"recoveryLevel":"Purgeable"},"tags":{"test":"foo"}}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['453'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"Hsm": false, "key": {"kty": "RSA", "n": "AM1NAXrGowNPjl4x_2zKPXSjH--EDC2EDtFJYUKIrr9eRlBPh72nilzS3jnrg5jUqtqPlQ07COgMq-N3N7yPyXdH3FOYFWpi3pMQ5oHZOMmZAWRzpVBWgnUXsOwpUyCk33lvRKFXgn7vs5ZKRqDj5LKLUqnPZlrUthm5ztprwS-1", + "e": "AQAB", "d": "aY2BCD3ejBI4MWflWmq0pCZGgh_THwe5kpL2xX1-0vdGkX4CXVkpg0YLaZ4T_9y_pzWRPccvchcpvP6LkpAe1R_jsmfP8QedT2yDTf4T-mE1hyl4D5zyObHjQ-g6uUMT6FpeTgoSkcU90PK-lF31igCitfVgeSNIC7Fq-9ZywWE", + "dp": "OWxWym28y_4zUTOnaqxaUh3MLmR8M36lAhWZeWo1fcanHjD5GMB9yXSxSwH8wsiQg85EuGC7SMwwzMj49wF-tQ", + "dq": "ALrLoROF51P2590NuLe_9fIk52xGn4y8gJy4RnBOS_kZK8vovLIVvQTIYeb-qlBaGR7K8YugnoKBTZpkjbhnVUk", + "qi": "AM5DzFUUIHcmr3ei8K_Zob3s77aBWvQASGEsxuSNBf0Euh1raEEYLK5fZBoLzRL2SD2hRgmptcltLcZJ7zs59hM", + "p": "APLv_Xe805-80_tsAX4jFYH6Dj-Rpqlenjq1nER6NMhtJpGG67focXb6A3cntR4_WRinHefdBqbvJ1Swyb7lcD0", + "q": "ANhW82o27OBdW0x-m5r5Eoa6kW8flyFv6p2zrRrO3bNlSHKkCMDOXPGNWL6gSp-iz-Z3f6gQJr1Y0gDHYe99_Nk"}, + "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['926'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/import-key-plain?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/import-key-plain/94e3ca212ce443809c7a65c94a4a7349","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"AM1NAXrGowNPjl4x_2zKPXSjH--EDC2EDtFJYUKIrr9eRlBPh72nilzS3jnrg5jUqtqPlQ07COgMq-N3N7yPyXdH3FOYFWpi3pMQ5oHZOMmZAWRzpVBWgnUXsOwpUyCk33lvRKFXgn7vs5ZKRqDj5LKLUqnPZlrUthm5ztprwS-1","e":"AQAB"},"attributes":{"enabled":true,"created":1523441449,"updated":1523441449,"recoveryLevel":"Purgeable"}}'} + headers: + cache-control: [no-cache] + content-length: ['493'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:49 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"Hsm": false, "key": {"kty": "RSA", "n": "AKpB7z0jIj6FOUZyyNr-xFuTL3x3Dmy_0CaPN6ploCgm2mhRt80DS6ySglgkFLT9qLwdWa9f4KZe5jvjV2PluC38wDLfj66kdaAAytS12Q2a7Fb4Uzd1kKFFA5xsLurUWo8BEvrjjBrrZAnplu941ykA4REse2xE5Q_GG8Snx7SOmJMfGAcIU7LhS1pnL5-BL3ixkAcDF2X8EIpdajTC3GbFRmZaTZLn6SxtATuezBE6OvddCt6tgiLPN5ocpWOngo6gHlbV_UIuZbeDM_IH11eXLAzNrO8POC9Lc_P1aWgvK0KoMgdere89CzDjyAhJDg5kPFiJ0nwHKuycNkKDuaE", + "e": "AQAB", "d": "U8ohMChjSPuNpXMGEGjDQAIeo5WAHtsDWIaxMYXUHQ6J_D8DQrz1eBeeWDxhiHUxnmqfYaTAzX_0tNJ8hqheTRuPhzno310GmljpeWeJS53L5D1PzwJnzEZHsaq4KE-bxbcUnS5xHCpuUEaKRo5k7UQGf8oxb6Y0SOAJeG3N5bhdgwQP7CiLFktZ_I1Y18teLBjAQbY53sGwTRTVOTcPRGXHDfxo_MVFNU4J6Lk_rr996-J6eO-m0e8mJDloPJ22lS3rNu50Uz4Bki59HDlrQ2SIuNPTtKK1sNccQ4kpogAw46zjk0mR8Q-Xsu82ocNvWE-z7_-4bRsTnw8sRpQ0xQ", + "dp": "ANsen1THZ3WXk3X6og7pi1nWuFhesWF6LxApnlo2bDA3EIJQ5TjGMLUfUR45-zEkotPQ9865KUA9X73uf4GAXdMEiEzDrvpf7wkqIFx8UYLAEIclPmtyBoS6plzBmum4b4c34MUI9LVBbdjyomEkZUtBc9nudBg875w51lyoPjZz", + "dq": "L2a7wSmjthwVpZODP4P_2a4Fnw0qt31NF25340qmcWcvgVVtyvpzXHkuRFFcsF3C-9bYfMSa8g6locSbW_2FniFVZXuomxnh7IJLEZWdRdsVzjCUdxeBHWRx1ATV0cYfO_QsJBVyYWX3Ckyh7su9Lld6izBlhK6tu_VxKelXREM", + "qi": "AJThs8HPMV2J2NX7UjjkBQJ-ZwK5c_9gQzCFLtCnvjqX4qughFu21Kol8v55qThLcmKlxpjfojQOyisMIJxCcGsY0Il4pH2LCIA5YRgn12wUX_iaR5XBqFDXWYFh22mmZ-2ILwj-advBzZfslC8b7XpWb4Nylfm2AcgYs75BXhCJ", + "p": "AOK-ubu5LtLwQpq3gS40NYwvblm1AmwDDtsw7IdE07BRjo8rcmtMxzF2ro2oHy99gP15DEyHil0VqWP9tbre_DfW4XeLuzH12AL6zc-3K0BDmPy8sVrpy-RXJQLn-e8gIssQ4kgs0341NwsMkHLS4zkCVjdQThauNPsWKlTGH9KL", + "q": "AMA5dNKjhUNVzgBuIw5CrcxLU6vV5FpKrosa7yA-gLi6LFSKTmrdVI5SEOjqE6NW8FPLSaMIcEHLoEQWMdgQX3tNb-1C7Y7Hcw53RecT5L7qqEdyfYwkLucDK-7vMMhqFavQSiNZhcmLpFGbCSGHhBiYVleEtTvNKIO3qGxDPwYD"}, + "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['1693'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-keyvault-000002.vault.azure.net/keys/import-key-encrypted?api-version=7.0-preview + response: + body: {string: '{"key":{"kid":"https://cli-test-keyvault-000002.vault.azure.net/keys/import-key-encrypted/6dc4b353572a4bfcab6380cabc99d46f","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"AKpB7z0jIj6FOUZyyNr-xFuTL3x3Dmy_0CaPN6ploCgm2mhRt80DS6ySglgkFLT9qLwdWa9f4KZe5jvjV2PluC38wDLfj66kdaAAytS12Q2a7Fb4Uzd1kKFFA5xsLurUWo8BEvrjjBrrZAnplu941ykA4REse2xE5Q_GG8Snx7SOmJMfGAcIU7LhS1pnL5-BL3ixkAcDF2X8EIpdajTC3GbFRmZaTZLn6SxtATuezBE6OvddCt6tgiLPN5ocpWOngo6gHlbV_UIuZbeDM_IH11eXLAzNrO8POC9Lc_P1aWgvK0KoMgdere89CzDjyAhJDg5kPFiJ0nwHKuycNkKDuaE","e":"AQAB"},"attributes":{"enabled":true,"created":1523441449,"updated":1523441449,"recoveryLevel":"Purgeable"}}'} + headers: + cache-control: [no-cache] + content-length: ['668'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:48 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_key000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:50 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS0VZVkFVTFQ6NUZLRVlVWVpPMkdOREFRVzJPRUdJR0xFUHw2NEM5NjIzNjIzNjcyQTFELVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_mgmt.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_mgmt.yaml new file mode 100644 index 00000000000..b2058b04b39 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_mgmt.yaml @@ -0,0 +1,899 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-11T10:09:57Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_mgmt000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001","name":"cli_test_keyvault_mgmt000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-11T10:09:57Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:58 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:09:59 GMT'] + duration: ['1623629'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [IzxFlPMFduzqKtZga1KDCE1a7182L8epCq32WdJKL+E=] + ocp-aad-session-key: [FSlaH56b2scLgfyLyg4wFLFgpZT9Fw8MP5JlZcF2tBzNe1p_CSHBf4ni0u2gRZpwh3EPQf_WJTDf6ViytC09IS6dJ1ImtMMe5yn_1eBr2X3u5YWe3la3cOaRjwkSHCnZ.qc5qAXnKwrF4fVVb4cCxMV-x9ATTAkowYm22uzcb28I] + pragma: [no-cache] + request-id: [55fa97db-8a17-487f-b5ec-75343c87869f] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "standard"}, "accessPolicies": [{"tenantId": + "72f988bf-86f1-41af-91ab-2d7cd011db47", "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", + "permissions": {"keys": ["get", "create", "delete", "list", "update", "import", + "backup", "restore", "recover"], "secrets": ["get", "list", "set", "delete", + "backup", "restore", "recover"], "certificates": ["get", "list", "delete", "create", + "import", "update", "managecontacts", "getissuers", "listissuers", "setissuers", + "deleteissuers", "manageissuers", "recover"], "storage": ["get", "list", "delete", + "set", "update", "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['746'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1106'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:00 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1102'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceType%20eq%20%27Microsoft.KeyVault%2Fvaults%27&api-version=2015-11-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azkv-pytest/providers/Microsoft.KeyVault/vaults/pytest-shared-vault","name":"pytest-shared-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-aware-act-57426","name":"vault-aware-act-57426","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-bare-skirt-64797","name":"vault-bare-skirt-64797","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-evil-animal-60765","name":"vault-evil-animal-60765","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-full-look-51145","name":"vault-full-look-51145","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-half-year-33229","name":"vault-half-year-33229","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-ill-yellow-55346","name":"vault-ill-yellow-55346","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-limp-door-07476","name":"vault-limp-door-07476","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-mixed-river-36609","name":"vault-mixed-river-36609","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-old-duty-60336","name":"vault-old-duty-60336","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-pesky-friend-3178","name":"vault-pesky-friend-3178","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-shut-author-28426","name":"vault-shut-author-28426","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-stark-risk-65533","name":"vault-stark-risk-65533","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-testy-blow-85659","name":"vault-testy-blow-85659","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-dirty-hide-23171","name":"vault-dirty-hide-23171","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-flat-match-25435","name":"vault-flat-match-25435","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-lewd-work-07809","name":"vault-lewd-work-07809","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-near-invite-34338","name":"vault-near-invite-34338","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-one-cousin-48966","name":"vault-one-cousin-48966","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-rapid-lay-63059","name":"vault-rapid-lay-63059","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-rowdy-demand-2249","name":"vault-rowdy-demand-2249","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-short-letter-0050","name":"vault-short-letter-0050","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-sweet-one-75007","name":"vault-sweet-one-75007","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-tame-abroad-86697","name":"vault-tame-abroad-86697","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-thick-salad-01675","name":"vault-thick-salad-01675","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-worn-dream-81687","name":"vault-worn-dream-81687","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_certrtjnavoepfqibj5fyi2p4z4bhtaex7tjxux34qaxu24hwc7yiazcq/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-46jpqs","name":"cli-test-keyvault-46jpqs","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_keyuyzo2gndaqw2oegiglepjeoczqyvuy37mywczxtjodprds2d3d4su7/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-z75dus","name":"cli-test-keyvault-z75dus","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd22fevpuz3ypxkuxpvvcmrtwogqstxprurxjmdusqwbz4dljuda62756/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-u5h6kk","name":"cli-test-keyvault-u5h6kk","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd3uutbv2idgi3tg3ldoquxfozcmmc4dpdsi3fbn5m377sg4rfqdmrmkf/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-ehi2wo","name":"cli-test-keyvault-ehi2wo","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_secretsgfi6xzx7u43mzw6ov7jhzgkicnz2hrlty62wwbdfw6mhf76fho/providers/Microsoft.KeyVault/vaults/cli-test-kevault-m2oriwm","name":"cli-test-kevault-m2oriwm","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_contactslh3h77ciiosgbq2xf66vvf6rddvvwzcfqe4tb6r6m4x76wh6u4/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-thcpvf","name":"cli-test-keyvault-thcpvf","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_downloadi2azxrey523esaqfrsfy3l7uzzdbtje4n6pjm7ufg7ilvtj4ou/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-ffdgiy","name":"cli-test-keyvault-ffdgiy","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_issuerrqdmarqeuu7kxgi5e5zpnnzsxo6nocnpowpbwr7pl6dnmuab6ymb/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-23vm7v","name":"cli-test-keyvault-23vm7v","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_pending3egpfqksnufe2y7tqwqyf2vkgr2gpmkxsv7tnoxtkicdmvnhg74/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-vs7thk","name":"cli-test-keyvault-vs7thk","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/cli-contact-test","name":"cli-contact-test","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/cli-vault","name":"cli-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/froyo","name":"froyo","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/jim-test-vault","name":"jim-test-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/jim-test-vault2","name":"jim-test-vault2","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/long-running-test","name":"long-running-test","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/proxy-vault","name":"proxy-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/softserve","name":"softserve","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/ss-devault","name":"ss-devault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/ss-msak-vault","name":"ss-msak-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/ss-premiumvault","name":"ss-premiumvault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/sssp-vault","name":"sssp-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/vault-bent-kind-88801","name":"vault-bent-kind-88801","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/vault-wary-blue-28204","name":"vault-wary-blue-28204","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/wonky-cli-vault","name":"wonky-cli-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}}]}'} + headers: + cache-control: [no-cache] + content-length: ['12953'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault show] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1102'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults?api-version=2018-02-14-preview + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}],"nextLink":"https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults?api-version=2018-02-14-preview&$skiptoken=Y2xpLWtleXZhdWx0LXdvMjM1Z2VqZWp0"}'} + headers: + cache-control: [no-cache] + content-length: ['1409'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:33 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults?api-version=2018-02-14-preview&$skiptoken=Y2xpLWtleXZhdWx0LXdvMjM1Z2VqZWp0 + response: + body: {string: '{"value":[]}'} + headers: + cache-control: [no-cache] + content-length: ['12'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault update] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1102'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: 'b''{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}], "vaultUri": + "https://cli-keyvault-000002.vault.azure.net/", "enabledForDeployment": false}}''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault update] + Connection: [keep-alive] + Content-Length: ['841'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:34 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault set-policy] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:35 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: 'b''{"location": "westus", "tags": {}, "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list"], "storage": ["get", "list", "delete", + "set", "update", "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}], + "vaultUri": "https://cli-keyvault-000002.vault.azure.net/", "enabledForDeployment": + false}}''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault set-policy] + Connection: [keep-alive] + Content-Length: ['707'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['966'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:35 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault delete-policy] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['966'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:35 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: 'b''{"location": "westus", "tags": {}, "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [], "vaultUri": + "https://cli-keyvault-000002.vault.azure.net/", "enabledForDeployment": false}}''' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault delete-policy] + Connection: [keep-alive] + Content-Length: ['263'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['558'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:36 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault delete] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resources?$filter=resourceType%20eq%20%27Microsoft.KeyVault%2Fvaults%27&api-version=2015-11-01 + response: + body: {string: '{"value":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azkv-pytest/providers/Microsoft.KeyVault/vaults/pytest-shared-vault","name":"pytest-shared-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-aware-act-57426","name":"vault-aware-act-57426","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-bare-skirt-64797","name":"vault-bare-skirt-64797","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-evil-animal-60765","name":"vault-evil-animal-60765","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-full-look-51145","name":"vault-full-look-51145","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-half-year-33229","name":"vault-half-year-33229","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-ill-yellow-55346","name":"vault-ill-yellow-55346","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-limp-door-07476","name":"vault-limp-door-07476","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-mixed-river-36609","name":"vault-mixed-river-36609","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-old-duty-60336","name":"vault-old-duty-60336","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-pesky-friend-3178","name":"vault-pesky-friend-3178","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-shut-author-28426","name":"vault-shut-author-28426","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-stark-risk-65533","name":"vault-stark-risk-65533","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sample-group/providers/Microsoft.KeyVault/vaults/vault-testy-blow-85659","name":"vault-testy-blow-85659","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-dirty-hide-23171","name":"vault-dirty-hide-23171","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-flat-match-25435","name":"vault-flat-match-25435","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-lewd-work-07809","name":"vault-lewd-work-07809","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-near-invite-34338","name":"vault-near-invite-34338","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-one-cousin-48966","name":"vault-one-cousin-48966","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-rapid-lay-63059","name":"vault-rapid-lay-63059","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-rowdy-demand-2249","name":"vault-rowdy-demand-2249","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-short-letter-0050","name":"vault-short-letter-0050","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-sweet-one-75007","name":"vault-sweet-one-75007","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-tame-abroad-86697","name":"vault-tame-abroad-86697","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-thick-salad-01675","name":"vault-thick-salad-01675","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/azure-sandbox-group/providers/Microsoft.KeyVault/vaults/vault-worn-dream-81687","name":"vault-worn-dream-81687","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_certrtjnavoepfqibj5fyi2p4z4bhtaex7tjxux34qaxu24hwc7yiazcq/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-46jpqs","name":"cli-test-keyvault-46jpqs","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_keyuyzo2gndaqw2oegiglepjeoczqyvuy37mywczxtjodprds2d3d4su7/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-z75dus","name":"cli-test-keyvault-z75dus","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002","name":"cli-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd22fevpuz3ypxkuxpvvcmrtwogqstxprurxjmdusqwbz4dljuda62756/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-u5h6kk","name":"cli-test-keyvault-u5h6kk","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd3uutbv2idgi3tg3ldoquxfozcmmc4dpdsi3fbn5m377sg4rfqdmrmkf/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-ehi2wo","name":"cli-test-keyvault-ehi2wo","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_secretsgfi6xzx7u43mzw6ov7jhzgkicnz2hrlty62wwbdfw6mhf76fho/providers/Microsoft.KeyVault/vaults/cli-test-kevault-m2oriwm","name":"cli-test-kevault-m2oriwm","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_contactslh3h77ciiosgbq2xf66vvf6rddvvwzcfqe4tb6r6m4x76wh6u4/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-thcpvf","name":"cli-test-keyvault-thcpvf","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_downloadi2azxrey523esaqfrsfy3l7uzzdbtje4n6pjm7ufg7ilvtj4ou/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-ffdgiy","name":"cli-test-keyvault-ffdgiy","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_issuerrqdmarqeuu7kxgi5e5zpnnzsxo6nocnpowpbwr7pl6dnmuab6ymb/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-23vm7v","name":"cli-test-keyvault-23vm7v","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_pending3egpfqksnufe2y7tqwqyf2vkgr2gpmkxsv7tnoxtkicdmvnhg74/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-vs7thk","name":"cli-test-keyvault-vs7thk","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/cli-contact-test","name":"cli-contact-test","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/cli-vault","name":"cli-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/froyo","name":"froyo","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/jim-test-vault","name":"jim-test-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/jim-test-vault2","name":"jim-test-vault2","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/long-running-test","name":"long-running-test","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/proxy-vault","name":"proxy-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/softserve","name":"softserve","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/ss-devault","name":"ss-devault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/ss-msak-vault","name":"ss-msak-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/ss-premiumvault","name":"ss-premiumvault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/sssp-vault","name":"sssp-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/vault-bent-kind-88801","name":"vault-bent-kind-88801","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/vault-wary-blue-28204","name":"vault-wary-blue-28204","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/ssrg/providers/Microsoft.KeyVault/vaults/wonky-cli-vault","name":"wonky-cli-vault","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{}}]}'} + headers: + cache-control: [no-cache] + content-length: ['12953'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:36 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:38 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault list] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults?api-version=2018-02-14-preview + response: + body: {string: '{"value":[]}'} + headers: + cache-control: [no-cache] + content-length: ['12'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:38 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + vary: [Accept-Encoding] + x-content-type-options: [nosniff] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "standard"}, "accessPolicies": []}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['156'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000003?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000003","name":"cli-keyvault-000003","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000003.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['563'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:39 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000003?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000003","name":"cli-keyvault-000003","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000003.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['559'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:09 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:11:11 GMT'] + duration: ['629370'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [bLgwXkOhOVEk3vC8NHPdSIeFqRoOWvrUxR2wO1wjuQ4=] + ocp-aad-session-key: [QeHPGfk38y23eMgZx1C88eHHCTs55j4m1Tqws9aOaDsN3sj_uvF_0Grzs2XmnVGCbfAcEb4vko-EM8oo4M_TehWrFp8YRywNtP0lq0GGX-zkWk8gGzdA5ICgDIAEQCH-.kzxhLnA2VOQbLiiuNFjXusKpxmVbXDZrQoxAlXLExb8] + pragma: [no-cache] + request-id: [27005c3d-a466-4593-bcb2-efeab9aed85f] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET, ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "standard"}, "accessPolicies": [{"tenantId": + "72f988bf-86f1-41af-91ab-2d7cd011db47", "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", + "permissions": {"keys": ["get", "create", "delete", "list", "update", "import", + "backup", "restore", "recover"], "secrets": ["get", "list", "set", "delete", + "backup", "restore", "recover"], "certificates": ["get", "list", "delete", "create", + "import", "update", "managecontacts", "getissuers", "listissuers", "setissuers", + "deleteissuers", "manageissuers", "recover"], "storage": ["get", "list", "delete", + "set", "update", "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}], + "enabledForDeployment": true, "enabledForDiskEncryption": true, "enabledForTemplateDeployment": + true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['848'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000004?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000004","name":"cli-keyvault-000004","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":true,"enabledForDiskEncryption":true,"enabledForTemplateDeployment":true,"vaultUri":"https://cli-keyvault-000004.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1173'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:12 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000004?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000004","name":"cli-keyvault-000004","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":true,"enabledForDiskEncryption":true,"enabledForTemplateDeployment":true,"vaultUri":"https://cli-keyvault-000004.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1169'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:11:44 GMT'] + duration: ['839762'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [fQLJJo2NQKA1MEYhE9K05hCw7w6tp5qp0L6SHCVm0xw=] + ocp-aad-session-key: [bAv6KT8TAY5SRoLxElsx13bh3eJLDdrnmI7nalH9mE9CpRVlVUFJHwSpxSCQnoeu9g46Rg-SdovVK1Vms0OdQGL-4dyEK-tSL-HkGncDzBdPn5qq1QpA0g3aWAqYyMyr.Nnmzc08ph6FpJl5RBu4R0q7yIooIa5JOQIwyb8LsMos] + pragma: [no-cache] + request-id: [f6cd5377-1994-4e74-9b73-253b0a9d6bca] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET, ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000005?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000005","name":"cli-keyvault-000005","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000005.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1105'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:11:45 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1198'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000005?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_mgmt000001/providers/Microsoft.KeyVault/vaults/cli-keyvault-000005","name":"cli-keyvault-000005","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-keyvault-000005.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:12:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_mgmt000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:12:17 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS0VZVkFVTFQ6NUZNR01USUc2UlBET00zVTNRUzVHU04yWnxCMUQwQTY2OUVCMTExRTI0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_pending_certificate.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_pending_certificate.yaml new file mode 100644 index 00000000000..1429038086b --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_pending_certificate.yaml @@ -0,0 +1,439 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-11T10:09:58Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_pending000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_pending000001","name":"cli_test_kv_cert_pending000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-11T10:09:58Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:09:59 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 11 Apr 2018 10:09:59 GMT'] + duration: ['552430'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [USO0vXsiH/WugU0+xVoguNv4Wxgbvvn8Zb8qUwfOkVw=] + ocp-aad-session-key: [3FA4jMsU39ar7p8KQ_65P-xQGZ9GFAQyGRBW5YX-gu0t4qYMuUQ-SHZi4HyDcaXTPZAeR0q05vUW348ZboPDShD-m873vyGgH6g0W8jqZLnLaYdZjGZnK_VmN_lvKzBu.wxKOl9PclQvTN8wrBxxHeomVky00egbAsh0gIpPo1iY] + pragma: [no-cache] + request-id: [46160653-a6b3-4b51-94f7-887d64176af6] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_pending000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_pending000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1105'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:01 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_pending000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_kv_cert_pending000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:32 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"policy": {"key_props": {"exportable": true, "kty": "RSA", "key_size": + 2048, "reuse_key": false}, "secret_props": {"contentType": "application/x-pkcs12"}, + "x509_props": {"subject": "C=US, ST=WA, L=Redmond, O=TestO, OU=TestOU, CN=www.mytestdomain.com", + "key_usage": ["digitalSignature", "nonRepudiation", "keyEncipherment", "keyAgreement", + "keyCertSign"], "validity_months": 50}, "issuer": {"name": "Unknown"}, "attributes": + {"enabled": true}}, "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['477'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/create?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending","issuer":{"name":"Unknown"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMrHvDEWLsJjq+Xopez2rfZWuO6nhzl/OPY9KAfat6v8h4ZYLmgUfJm9w2Eqnvo2QoDlNT2J7/AS/8lqu6NGcyb2dMax6/xIq3cgov3mGyq3cn6ceJUKeoYvs3ShVXPz4T8S04GDCKOaiw1D22Ckf1R7qwnUwW/67jANSA1B3U/EZO95GRCIal8BwQBiU3Zb3cgSb83aVN9WObzq7gl5QUxWC3Rq2+FUiYKlOdEGGZGbkNqyy27/G3B1RrNHaeMW5yrvsOw19JBbVNFp5d1juZ2jMxkD54OjJZBXbtcAiZ1AHg7jQ+AcPNTPwEez4UPl6YvLtkJT/qsFxotSkdfNh9cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCff2Mh272bttFOsJqIRyfDv2gkACCH0VFwSqKOYrqdw30xPpzz8UtI/ltxosDnWiI3ArT0UuDTgVQAgzZe/KtIdIJ6wpKlmpn/yurwjCdVgBjGI2L1udoIxFvgsfMMIRM5l5RipE5m2B/+gDU35HtBPa/dSU9h/t49c+jMoFWh6xaOSt6xZKZ40e0hty8YTZ1wjoQA4sXd6deoTtSNCg/3EF4pWVImChG5xywB0zbwhFRKf45/ksEkiQmFVFC/KDIHr6Tpv3/s3S4GcMKzM+tVVcFk9f1EvFZFREVcFFALrpvrpNZTccG+k+wpWMyE2K2u0hK40KOLsciM4PWwrTcp","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Please Perform Merge to complete the request.","request_id":"3fa269d35ebb4e159d805095760f2ebc"}'} + headers: + cache-control: [no-cache] + content-length: ['1347'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:45 GMT'] + expires: ['-1'] + location: ['https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending?api-version=7.0-preview&request_id=3fa269d35ebb4e159d805095760f2ebc'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 202, message: Accepted} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending","issuer":{"name":"Unknown"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMrHvDEWLsJjq+Xopez2rfZWuO6nhzl/OPY9KAfat6v8h4ZYLmgUfJm9w2Eqnvo2QoDlNT2J7/AS/8lqu6NGcyb2dMax6/xIq3cgov3mGyq3cn6ceJUKeoYvs3ShVXPz4T8S04GDCKOaiw1D22Ckf1R7qwnUwW/67jANSA1B3U/EZO95GRCIal8BwQBiU3Zb3cgSb83aVN9WObzq7gl5QUxWC3Rq2+FUiYKlOdEGGZGbkNqyy27/G3B1RrNHaeMW5yrvsOw19JBbVNFp5d1juZ2jMxkD54OjJZBXbtcAiZ1AHg7jQ+AcPNTPwEez4UPl6YvLtkJT/qsFxotSkdfNh9cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCff2Mh272bttFOsJqIRyfDv2gkACCH0VFwSqKOYrqdw30xPpzz8UtI/ltxosDnWiI3ArT0UuDTgVQAgzZe/KtIdIJ6wpKlmpn/yurwjCdVgBjGI2L1udoIxFvgsfMMIRM5l5RipE5m2B/+gDU35HtBPa/dSU9h/t49c+jMoFWh6xaOSt6xZKZ40e0hty8YTZ1wjoQA4sXd6deoTtSNCg/3EF4pWVImChG5xywB0zbwhFRKf45/ksEkiQmFVFC/KDIHr6Tpv3/s3S4GcMKzM+tVVcFk9f1EvFZFREVcFFALrpvrpNZTccG+k+wpWMyE2K2u0hK40KOLsciM4PWwrTcp","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Please Perform Merge to complete the request.","request_id":"3fa269d35ebb4e159d805095760f2ebc"}'} + headers: + cache-control: [no-cache] + content-length: ['1347'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:44 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending","issuer":{"name":"Unknown"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMrHvDEWLsJjq+Xopez2rfZWuO6nhzl/OPY9KAfat6v8h4ZYLmgUfJm9w2Eqnvo2QoDlNT2J7/AS/8lqu6NGcyb2dMax6/xIq3cgov3mGyq3cn6ceJUKeoYvs3ShVXPz4T8S04GDCKOaiw1D22Ckf1R7qwnUwW/67jANSA1B3U/EZO95GRCIal8BwQBiU3Zb3cgSb83aVN9WObzq7gl5QUxWC3Rq2+FUiYKlOdEGGZGbkNqyy27/G3B1RrNHaeMW5yrvsOw19JBbVNFp5d1juZ2jMxkD54OjJZBXbtcAiZ1AHg7jQ+AcPNTPwEez4UPl6YvLtkJT/qsFxotSkdfNh9cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCff2Mh272bttFOsJqIRyfDv2gkACCH0VFwSqKOYrqdw30xPpzz8UtI/ltxosDnWiI3ArT0UuDTgVQAgzZe/KtIdIJ6wpKlmpn/yurwjCdVgBjGI2L1udoIxFvgsfMMIRM5l5RipE5m2B/+gDU35HtBPa/dSU9h/t49c+jMoFWh6xaOSt6xZKZ40e0hty8YTZ1wjoQA4sXd6deoTtSNCg/3EF4pWVImChG5xywB0zbwhFRKf45/ksEkiQmFVFC/KDIHr6Tpv3/s3S4GcMKzM+tVVcFk9f1EvFZFREVcFFALrpvrpNZTccG+k+wpWMyE2K2u0hK40KOLsciM4PWwrTcp","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Please Perform Merge to complete the request.","request_id":"3fa269d35ebb4e159d805095760f2ebc"}'} + headers: + cache-control: [no-cache] + content-length: ['1347'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"x5c": ["MIIC/TCCAeWgAwIBAgIJALVWZFpMwJKFMA0GCSqGSIb3DQEBCwUAMBUxEzARBgNVBAMMCm15c2l0ZS5jb20wHhcNMTgwNDExMTAwNTEwWhcNMjgwNDA4MTAwNTEwWjAVMRMwEQYDVQQDDApteXNpdGUuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwd9B5BTLVOmM8UxMaStF2SVatXEyjUorhEkr2Arji133Q+Nyuwfrr5o7FVGLYgPi13HRS9thk6DZkVVKgirriMlUuDKvPS4gHexKRbEfn1wIOC+cz4QaFTqPJiQUYOjiqEpFTYh5H61LqBqd8sfTvuOC+mtJuBG2CULQKGbqNrRDH8Li5vW8+WmYLSojtPClOKF8dBXLhVvME8AxJbAcEnhGcdzo2AgoZhj0L9VLoUNj8CzX0qQfV0cccdrJhB6bcc0D4Bud4aXUy9cJbDQhGF/Zvu37/+3jyup0BGDMQHCafYXx+ASSW0iKZ2DGDYWlWZRYp7Bs4Zw95K2EqqprCwIDAQABo1AwTjAdBgNVHQ4EFgQUgobJeTWmhSKSfVhid2H8lLL1UhowHwYDVR0jBBgwFoAUgobJeTWmhSKSfVhid2H8lLL1UhowDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAr3cTJLL2yVv8SZyXPyCvYrWUrhKt8JV4jLs7hVsN55hVXfNFA0s0hiRNTOLhPHR7vz/CEG5ZqJMRRVZY3SXiy/FiGHJQFMRKmmpnIxaBJKebUtSMIXuutXJd4HVr/Wi6gPfjAu4VB0sia/ELE9H9qF5OCIj5V8U1N5+yDwlarF0/R1gUrGSqYu5X2Vq611tyL+SBHaOCwDd3j9cJyMK8z2+wqBMzTFTq15Le09QKSDNu9RBdL8M+uSxoaN1/ufRaHmCnizPC/P2wZcApkOgiVsrRGkXZPaSS/1s2edv7erB/PFqbEfJtigycuHGw0tWP30logstdBCdX1jtbwmJUqg=="], + "attributes": {"enabled": true}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['1074'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: POST + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending/merge?api-version=7.0-preview + response: + body: {string: '{"error":{"code":"BadParameter","message":"Public key from x509 + certificate and key of this instance doesn''t match"}}'} + headers: + cache-control: [no-cache] + content-length: ['117'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 400, message: Bad Request} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: DELETE + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending?api-version=7.0-preview + response: + body: {string: '{"id":"https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending","issuer":{"name":"Unknown"},"csr":"MIIC/DCCAeQCAQAwbDEdMBsGA1UEAxMUd3d3Lm15dGVzdGRvbWFpbi5jb20xDzANBgNVBAsTBlRlc3RPVTEOMAwGA1UEChMFVGVzdE8xEDAOBgNVBAcTB1JlZG1vbmQxCzAJBgNVBAgTAldBMQswCQYDVQQGEwJVUzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMrHvDEWLsJjq+Xopez2rfZWuO6nhzl/OPY9KAfat6v8h4ZYLmgUfJm9w2Eqnvo2QoDlNT2J7/AS/8lqu6NGcyb2dMax6/xIq3cgov3mGyq3cn6ceJUKeoYvs3ShVXPz4T8S04GDCKOaiw1D22Ckf1R7qwnUwW/67jANSA1B3U/EZO95GRCIal8BwQBiU3Zb3cgSb83aVN9WObzq7gl5QUxWC3Rq2+FUiYKlOdEGGZGbkNqyy27/G3B1RrNHaeMW5yrvsOw19JBbVNFp5d1juZ2jMxkD54OjJZBXbtcAiZ1AHg7jQ+AcPNTPwEez4UPl6YvLtkJT/qsFxotSkdfNh9cCAwEAAaBLMEkGCSqGSIb3DQEJDjE8MDowDgYDVR0PAQH/BAQDAgLsMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQCff2Mh272bttFOsJqIRyfDv2gkACCH0VFwSqKOYrqdw30xPpzz8UtI/ltxosDnWiI3ArT0UuDTgVQAgzZe/KtIdIJ6wpKlmpn/yurwjCdVgBjGI2L1udoIxFvgsfMMIRM5l5RipE5m2B/+gDU35HtBPa/dSU9h/t49c+jMoFWh6xaOSt6xZKZ40e0hty8YTZ1wjoQA4sXd6deoTtSNCg/3EF4pWVImChG5xywB0zbwhFRKf45/ksEkiQmFVFC/KDIHr6Tpv3/s3S4GcMKzM+tVVcFk9f1EvFZFREVcFFALrpvrpNZTccG+k+wpWMyE2K2u0hK40KOLsciM4PWwrTcp","cancellation_requested":false,"status":"inProgress","status_details":"Pending + certificate created. Please Perform Merge to complete the request.","request_id":"3fa269d35ebb4e159d805095760f2ebc"}'} + headers: + cache-control: [no-cache] + content-length: ['1347'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/certificates/pending-cert/pending?api-version=7.0-preview + response: + body: {string: '{"error":{"code":"PendingCertificateNotFound","message":"Pending + certificate not found: pending-cert"}}'} + headers: + cache-control: [no-cache] + content-length: ['103'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 11 Apr 2018 10:10:47 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 404, message: Not Found} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_kv_cert_pending000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 11 Apr 2018 10:10:48 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS1Y6NUZDRVJUOjVGUEVORElORzNFR1BGUUtTTlVGRTJZN3w2QTFEMjBDQUI1NUNFMTE0LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_secret.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_secret.yaml new file mode 100644 index 00000000000..a31eec8b16a --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_secret.yaml @@ -0,0 +1,890 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation", + "date": "2018-04-13T07:35:25Z"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['110'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_secret000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_secret000001","name":"cli_test_keyvault_secret000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2018-04-13T07:35:25Z"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['384'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:35:28 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-graphrbac/0.40.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","deletionTimestamp":null,"accountEnabled":true,"ageGroup":null,"assignedLicenses":[{"disabledPlans":[],"skuId":"488ba24a-39a9-4473-8ee5-19291e71b002"},{"disabledPlans":[],"skuId":"b05e124f-c7cc-45a0-a6aa-8cf78c946968"},{"disabledPlans":["0b03f40b-c404-40c3-8651-2aceb74365fa","b650d915-9886-424b-a08d-633cede56f57","e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72","fe71d6c3-a2ea-4499-9778-da042bf08063","fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"],"skuId":"ea126fc5-a19e-42e2-a731-da9d437bffcf"},{"disabledPlans":[],"skuId":"c7df2760-2c81-4ef7-b578-5b5392b571df"},{"disabledPlans":[],"skuId":"c5928f49-12ba-48f7-ada3-0d743a3601d5"},{"disabledPlans":["e95bec33-7c88-4a70-8e19-b10bd9d0c014","5dbe027f-2339-4123-9542-606e4d348a72"],"skuId":"f82a60b8-1ee3-4cfb-a4fe-1c6a53c2656c"},{"disabledPlans":[],"skuId":"d3b4fe1f-9992-4930-8acb-ca6ec609365e"},{"disabledPlans":[],"skuId":"c52ea49f-fe5d-4e95-93ba-1de91d380f89"}],"assignedPlans":[{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"fe71d6c3-a2ea-4499-9778-da042bf08063"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"e95bec33-7c88-4a70-8e19-b10bd9d0c014"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"5dbe027f-2339-4123-9542-606e4d348a72"},{"assignedTimestamp":"2018-03-17T22:50:44Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"fafd7243-e5c1-4a3a-9e40-495efcb1d3c3"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"WindowsDefenderATP","servicePlanId":"871d91ec-ec1a-452b-a83f-bd76c7d770ef"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"AzureAdvancedThreatAnalytics","servicePlanId":"14ab5db5-e6c4-4b20-b4bc-13e36fd2227f"},{"assignedTimestamp":"2018-03-17T05:59:32Z","capabilityStatus":"Enabled","service":"Windows","servicePlanId":"e7c91390-7625-45be-94e0-e16907e03118"},{"assignedTimestamp":"2018-01-09T10:41:20Z","capabilityStatus":"Enabled","service":"ProjectWorkManagement","servicePlanId":"b737dad2-2f6c-4c65-90e3-ca563267e8b9"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"41781fb2-bc02-4b7c-bd55-b576c07bb09d"},{"assignedTimestamp":"2017-12-31T22:19:35Z","capabilityStatus":"Enabled","service":"MultiFactorService","servicePlanId":"8a256a2b-b617-496d-b51b-e76466e88db0"},{"assignedTimestamp":"2017-12-31T05:12:40Z","capabilityStatus":"Deleted","service":"Adallom","servicePlanId":"932ad362-64a8-4783-9106-97849a1a30b9"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"2bdbaf8f-738f-4ac7-9234-3c3ee2ce7d0f"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"SharePoint","servicePlanId":"da792a53-cbc0-4184-a10d-e544dd34b3c1"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"To-Do","servicePlanId":"3fb82609-8c27-4f7b-bd51-30634711ee67"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"5689bec4-755d-4753-8b61-40975025187c"},{"assignedTimestamp":"2017-12-17T05:58:58Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"2e2ddb96-6af9-4b1d-a3f0-d6ecfd22edb2"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"Adallom","servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"Netbreeze","servicePlanId":"03acaee3-9492-4f40-aed4-bcb6b32981b6"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"bea4c11e-220a-4e6d-8eb8-8ea15d019f90"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"RMSOnline","servicePlanId":"6c57d4b6-3b23-47a5-9bc9-69f17b4947b3"},{"assignedTimestamp":"2017-10-07T00:35:04Z","capabilityStatus":"Enabled","service":"CRM","servicePlanId":"d56f3deb-50d8-465a-bedb-f079817ccac1"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"4828c8ec-dc2e-4779-b502-87ac9ce28ab7"},{"assignedTimestamp":"2017-07-06T20:16:37Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"3e26ee1f-8a5f-4d52-aee2-b81ce45c8f40"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"TeamspaceAPI","servicePlanId":"57ff2da0-773e-42df-b2af-ffb7a2317929"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"ProcessSimple","servicePlanId":"76846ad7-7776-4c40-a281-a386362dd1b9"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"PowerAppsService","servicePlanId":"c68f8d98-5534-41c8-bf36-22fa496fa792"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"YammerEnterprise","servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Sway","servicePlanId":"a23b959c-7ce8-4e57-9140-b90eb88a9e97"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"0feaeb32-d00e-4d66-bd5a-43b5b83db82c"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"Deskless","servicePlanId":"8c7d2df8-86f0-4902-b2ed-a0458298f3b3"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"MicrosoftStream","servicePlanId":"9e700747-8b1d-45e5-ab8d-ef187ceec156"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"efb87545-963c-4e0d-99df-69c6916d9eb0"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"43de0ff5-c92c-492b-9116-175376d08c38"},{"assignedTimestamp":"2017-07-06T20:16:36Z","capabilityStatus":"Deleted","service":"OfficeForms","servicePlanId":"2789c901-c14e-48ab-a76a-be334d9d793a"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"e212cbc7-0961-4c40-9825-01117710dcb1"},{"assignedTimestamp":"2017-07-06T20:16:35Z","capabilityStatus":"Enabled","service":"OfficeForms","servicePlanId":"159f4cd6-e380-449f-a816-af1a9ef76344"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"MicrosoftStream","servicePlanId":"6c6042f5-6f01-4d67-b8c1-eb99d36eed3e"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"AADPremiumService","servicePlanId":"eec0eb4f-6444-4f95-aba0-50c24d67f998"},{"assignedTimestamp":"2017-06-12T01:37:17Z","capabilityStatus":"Enabled","service":"SCO","servicePlanId":"c1ec4a95-1f05-45b3-a911-aa3fa01094f5"},{"assignedTimestamp":"2017-05-13T00:29:58Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"8e0c0a52-6a6c-4d40-8370-dd62790dcd70"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"9f431833-0334-42de-a7dc-70aa40db46db"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"PowerBI","servicePlanId":"70d33638-9c74-4d01-bfd3-562de28bd4ba"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"4de31727-a228-4ec3-a5bf-8e45b5ca48cc"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"c4048e79-4474-4c74-ba9b-c31ff225e511"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Deleted","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"},{"assignedTimestamp":"2017-01-26T06:07:42Z","capabilityStatus":"Enabled","service":"exchange","servicePlanId":"34c0d7a0-a70f-4668-9238-47f9fc208882"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"PowerBI","servicePlanId":"fc0a60aa-feee-4746-a0e3-aecfe81a38dd"},{"assignedTimestamp":"2016-12-19T03:37:31Z","capabilityStatus":"Deleted","service":"SharePoint","servicePlanId":"2125cfd7-2110-4567-83c4-c1cd5275163d"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"PowerAppsService","servicePlanId":"9c0dab89-a30c-4117-86e7-97bda240acd2"},{"assignedTimestamp":"2016-11-18T19:22:29Z","capabilityStatus":"Enabled","service":"ProcessSimple","servicePlanId":"07699545-9485-468e-95b6-2fca3738be01"},{"assignedTimestamp":"2012-10-30T00:30:38Z","capabilityStatus":"Enabled","service":"MicrosoftOffice","servicePlanId":"663a804f-1c30-4ff0-9915-9db84f0d1cea"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Enabled","service":"MicrosoftCommunicationsOnline","servicePlanId":"5a10155d-f5c1-411a-a8ec-e99aae125390"},{"assignedTimestamp":"2015-07-30T05:48:04Z","capabilityStatus":"Deleted","service":"MicrosoftCommunicationsOnline","servicePlanId":"27216c54-caf8-4d0d-97e2-517afb5c08f6"}],"city":"REDMOND","companyName":"MICROSOFT","consentProvidedForMinor":null,"country":null,"creationType":null,"department":"Azure + Key Vault ENG","dirSyncEnabled":true,"displayName":"Scott Schaab","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Scott","immutableId":"267213","isCompromised":null,"jobTitle":"SENIOR + SOFTWARE ENGINEER","lastDirSyncTime":"2018-04-07T06:40:55Z","legalAgeGroupClassification":null,"mail":"sschaab@microsoft.com","mailNickname":"sschaab","mobile":null,"onPremisesDistinguishedName":"CN=Scott + Schaab,OU=UserAccounts,DC=redmond,DC=corp,DC=microsoft,DC=com","onPremisesSecurityIdentifier":"S-1-5-21-2127521184-1604012920-1887927527-2412997","otherMails":[],"passwordPolicies":"DisablePasswordExpiration","passwordProfile":null,"physicalDeliveryOfficeName":"27/2560","postalCode":null,"preferredLanguage":null,"provisionedPlans":[{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"Netbreeze"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"CRM"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"exchange"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"SharePoint"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Deleted","provisioningStatus":"Success","service":"MicrosoftCommunicationsOnline"},{"capabilityStatus":"Enabled","provisioningStatus":"Success","service":"MicrosoftOffice"}],"provisioningErrors":[],"proxyAddresses":["X500:/O=Nokia/OU=HUB/cn=Recipients/cn=sschaab","X500:/O=microsoft/ou=External + (FYDIBOHF25SPDLT)/cn=Recipients/cn=944cb790112943169ec88996419db2be","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaabdfa2a918","X500:/o=microsoft/ou=First Administrative Group/cn=Recipients/cn=sschaab","X500:/o=microsoft/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab_microsoft.comd412b5bf","X500:/o=SDF/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sdflabs.com-51490-Scott + Schaab","X500:/o=SDF/ou=Exchange Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=51490-sschaab_73c949efde","X500:/o=MSNBC/ou=Servers/cn=Recipients/cn=sschaab","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=sschaab93f6f89e09","X500:/o=ExchangeLabs/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=microsoft.onmicrosoft.com-55760-Scott + Schaab","X500:/O=microsoft/OU=northamerica/cn=Recipients/cn=sschaab","X500:/o=MMS/ou=Exchange + Administrative Group (FYDIBOHF23SPDLT)/cn=Recipients/cn=Scott Schaab65cf6002-c6c1-4ed7-b2d3-2b2104a6be0f","SMTP:sschaab@microsoft.com","smtp:sschaab@Service.microsoft.com"],"refreshTokensValidFromDateTime":"2018-04-02T20:24:03Z","showInAddressList":true,"signInNames":[],"sipProxyAddress":"sschaab@microsoft.com","state":null,"streetAddress":null,"surname":"Schaab","telephoneNumber":"+1 + (425) 7055948","thumbnailPhoto@odata.mediaContentType":"image/Jpeg","usageLocation":"US","userIdentities":[],"userPrincipalName":"sschaab@microsoft.com","userType":null,"extension_18e31482d3fb4a8ea958aa96b662f508_SupervisorInd":"N","extension_18e31482d3fb4a8ea958aa96b662f508_ProfitCenterCode":"P10161081","extension_18e31482d3fb4a8ea958aa96b662f508_CostCenterCode":"10161081","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToPersonnelNbr":"86712","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToFullName":"Randall, + Richard J.","extension_18e31482d3fb4a8ea958aa96b662f508_ReportsToEmailName":"RRANDALL","extension_18e31482d3fb4a8ea958aa96b662f508_PositionNumber":"91386158","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingName":"27","extension_18e31482d3fb4a8ea958aa96b662f508_BuildingID":"25","extension_18e31482d3fb4a8ea958aa96b662f508_AddressLine1":"1 + Microsoft Way","extension_18e31482d3fb4a8ea958aa96b662f508_CityName":"REDMOND","extension_18e31482d3fb4a8ea958aa96b662f508_CompanyCode":"1010","extension_18e31482d3fb4a8ea958aa96b662f508_CountryShortCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_LocationAreaCode":"US","extension_18e31482d3fb4a8ea958aa96b662f508_PersonnelNumber":"267213","extension_18e31482d3fb4a8ea958aa96b662f508_StateProvinceCode":"WA","extension_18e31482d3fb4a8ea958aa96b662f508_ZipCode":"98052"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['15198'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Fri, 13 Apr 2018 07:35:29 GMT'] + duration: ['1103387'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [zPeOuJeNLZ5N5CAKU8XN6jsJ5sC6cSv6Gh6WpNy3E8g=] + ocp-aad-session-key: [N4DFHgTUJRDBp4hBOYzK5uiAsbNzolWcHzJMxpsZpTA4aRjJtrwqvJcNquCkTPqN86nn3zyJ-uGQaVbSh4_8daNf6GMx23EICRU31GtWEzjm0U7n3jo8VbIUwisFDTPq.B6i2ye07hS4OueL9e5pFy7f1eBASLm3yMz6fh4iSU44] + pragma: [no-cache] + request-id: [0220b63f-1860-400c-8e36-10e8ba06845e] + server: [Microsoft-IIS/10.0] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET, ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "sku": {"family": "A", "name": "premium"}, "accessPolicies": [{"tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", + "objectId": "6ff0a69b-8c04-4618-873e-4a1ee85e5296", "permissions": {"keys": + ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "secrets": ["get", "list", "set", "delete", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"]}}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['745'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_secret000001/providers/Microsoft.KeyVault/vaults/cli-test-kevault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_secret000001/providers/Microsoft.KeyVault/vaults/cli-test-kevault-000002","name":"cli-test-kevault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-kevault-000002.vault.azure.net","provisioningState":"RegisteringDns"}}'} + headers: + cache-control: [no-cache] + content-length: ['1105'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:35:31 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-mgmt-keyvault/1.0.0b1 Azure-SDK-For-Python AZURECLI/2.0.31] + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_secret000001/providers/Microsoft.KeyVault/vaults/cli-test-kevault-000002?api-version=2018-02-14-preview + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_secret000001/providers/Microsoft.KeyVault/vaults/cli-test-kevault-000002","name":"cli-test-kevault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","accessPolicies":[{"tenantId":"72f988bf-86f1-41af-91ab-2d7cd011db47","objectId":"6ff0a69b-8c04-4618-873e-4a1ee85e5296","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"secrets":["get","list","set","delete","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"]}}],"enabledForDeployment":false,"vaultUri":"https://cli-test-kevault-000002.vault.azure.net/","provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['1101'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:02 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.213] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Fri, 13 Apr 2018 07:36:13 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: '' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: [0] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/keys?api-version=7.0-preview + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "ABC123", "tags": {"file-encoding": "utf-8"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['55'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/secret1?api-version=7.0-preview + response: + body: {string: '{"value":"ABC123","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/b641e7099ac941909e21af6f37a6677e","attributes":{"enabled":true,"created":1523604975,"updated":1523604975,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['256'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets?api-version=7.0-preview + response: + body: {string: '{"value":[{"id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1","attributes":{"enabled":true,"created":1523604975,"updated":1523604975,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-8"}}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['234'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:15 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "DEF456", "tags": {"test": "foo", "file-encoding": "utf-8"}, + "contentType": "test type"}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['98'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/secret1?api-version=7.0-preview + response: + body: {string: '{"value":"DEF456","contentType":"test type","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/50fa9ee0e469450692a41914328a341d","attributes":{"enabled":true,"created":1523604976,"updated":1523604976,"recoveryLevel":"Purgeable"},"tags":{"test":"foo","file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['295'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:16 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/versions?api-version=7.0-preview + response: + body: {string: '{"value":[{"contentType":"test type","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/50fa9ee0e469450692a41914328a341d","attributes":{"enabled":true,"created":1523604976,"updated":1523604976,"recoveryLevel":"Purgeable"},"tags":{"test":"foo","file-encoding":"utf-8"}},{"id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/b641e7099ac941909e21af6f37a6677e","attributes":{"enabled":true,"created":1523604975,"updated":1523604975,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-8"}}],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['546'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:16 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/?api-version=7.0-preview + response: + body: {string: '{"value":"DEF456","contentType":"test type","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/50fa9ee0e469450692a41914328a341d","attributes":{"enabled":true,"created":1523604976,"updated":1523604976,"recoveryLevel":"Purgeable"},"tags":{"test":"foo","file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['295'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/b641e7099ac941909e21af6f37a6677e?api-version=7.0-preview + response: + body: {string: '{"value":"ABC123","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/b641e7099ac941909e21af6f37a6677e","attributes":{"enabled":true,"created":1523604975,"updated":1523604975,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['256'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:17 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"attributes": {"enabled": false}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['34'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PATCH + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/?api-version=7.0-preview + response: + body: {string: '{"contentType":"test type","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/50fa9ee0e469450692a41914328a341d","attributes":{"enabled":false,"created":1523604976,"updated":1523604979,"recoveryLevel":"Purgeable"},"tags":{"test":"foo","file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['279'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:18 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: DELETE + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/secret1?api-version=7.0-preview + response: + body: {string: '{"contentType":"test type","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/secret1/50fa9ee0e469450692a41914328a341d","attributes":{"enabled":false,"created":1523604976,"updated":1523604979,"recoveryLevel":"Purgeable"},"tags":{"test":"foo","file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['279'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets?api-version=7.0-preview + response: + body: {string: '{"value":[],"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['28'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "TestSecretTestSecretTestSecretTestSecret\n", "tags": {"file-encoding": + "utf-8"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['91'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-8?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-8/1e703b07e80c4fd1ad78e6c58d930344","attributes":{"enabled":true,"created":1523604980,"updated":1523604980,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['299'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:19 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-8/?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-8/1e703b07e80c4fd1ad78e6c58d930344","attributes":{"enabled":true,"created":1523604980,"updated":1523604980,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-8"}}'} + headers: + cache-control: [no-cache] + content-length: ['299'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "TestSecretTestSecretTestSecretTestSecret\n", "tags": {"file-encoding": + "utf-16le"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['94'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16le?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16le/4bc20a6f43f542f5ac6433df032b76bc","attributes":{"enabled":true,"created":1523604980,"updated":1523604980,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-16le"}}'} + headers: + cache-control: [no-cache] + content-length: ['305'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16le/?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16le/4bc20a6f43f542f5ac6433df032b76bc","attributes":{"enabled":true,"created":1523604980,"updated":1523604980,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-16le"}}'} + headers: + cache-control: [no-cache] + content-length: ['305'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:20 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "TestSecretTestSecretTestSecretTestSecret\n", "tags": {"file-encoding": + "utf-16be"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['94'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16be?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16be/9472f9f59a924d1aa8ea5c7a3ec52f25","attributes":{"enabled":true,"created":1523604981,"updated":1523604981,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-16be"}}'} + headers: + cache-control: [no-cache] + content-length: ['305'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:21 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16be/?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-utf-16be/9472f9f59a924d1aa8ea5c7a3ec52f25","attributes":{"enabled":true,"created":1523604981,"updated":1523604981,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"utf-16be"}}'} + headers: + cache-control: [no-cache] + content-length: ['305'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "TestSecretTestSecretTestSecretTestSecret\n", "tags": {"file-encoding": + "ascii"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['91'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-ascii?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-ascii/8bf6e9996c3247ecbca6387f0d4070b9","attributes":{"enabled":true,"created":1523604982,"updated":1523604982,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"ascii"}}'} + headers: + cache-control: [no-cache] + content-length: ['299'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-ascii/?api-version=7.0-preview + response: + body: {string: '{"value":"TestSecretTestSecretTestSecretTestSecret\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-ascii/8bf6e9996c3247ecbca6387f0d4070b9","attributes":{"enabled":true,"created":1523604982,"updated":1523604982,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"ascii"}}'} + headers: + cache-control: [no-cache] + content-length: ['299'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "VGVzdFNlY3JldFRlc3RTZWNyZXRUZXN0U2VjcmV0VGVzdFNlY3JldAo=\n", + "tags": {"file-encoding": "base64"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['108'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-base64?api-version=7.0-preview + response: + body: {string: '{"value":"VGVzdFNlY3JldFRlc3RTZWNyZXRUZXN0U2VjcmV0VGVzdFNlY3JldAo=\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-base64/cb93452746f04c689fc64808842a0a5d","attributes":{"enabled":true,"created":1523604983,"updated":1523604983,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"base64"}}'} + headers: + cache-control: [no-cache] + content-length: ['317'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:22 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-base64/?api-version=7.0-preview + response: + body: {string: '{"value":"VGVzdFNlY3JldFRlc3RTZWNyZXRUZXN0U2VjcmV0VGVzdFNlY3JldAo=\n","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-base64/cb93452746f04c689fc64808842a0a5d","attributes":{"enabled":true,"created":1523604983,"updated":1523604983,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"base64"}}'} + headers: + cache-control: [no-cache] + content-length: ['317'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:23 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"value": "546573745365637265745465737453656372657454657374536563726574546573745365637265740a", + "tags": {"file-encoding": "hex"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Length: ['129'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: PUT + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-hex?api-version=7.0-preview + response: + body: {string: '{"value":"546573745365637265745465737453656372657454657374536563726574546573745365637265740a","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-hex/86e6b35d09ce40aa8034bfb42dcb28bb","attributes":{"enabled":true,"created":1523604983,"updated":1523604983,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"hex"}}'} + headers: + cache-control: [no-cache] + content-length: ['335'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:23 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 azure-keyvault/1.0.0b1 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-kevault-000002.vault.azure.net/secrets/download-hex/?api-version=7.0-preview + response: + body: {string: '{"value":"546573745365637265745465737453656372657454657374536563726574546573745365637265740a","id":"https://cli-test-kevault-000002.vault.azure.net/secrets/download-hex/86e6b35d09ce40aa8034bfb42dcb28bb","attributes":{"enabled":true,"created":1523604983,"updated":1523604983,"recoveryLevel":"Purgeable"},"tags":{"file-encoding":"hex"}}'} + headers: + cache-control: [no-cache] + content-length: ['335'] + content-type: [application/json; charset=utf-8] + date: ['Fri, 13 Apr 2018 07:36:24 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-network-info: [addr=167.220.0.218;act_addr_fam=InterNetwork;] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.844] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.6.2 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.26 + msrest_azure/0.4.25 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.31] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_secret000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Fri, 13 Apr 2018 07:36:24 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS0VZVkFVTFQ6NUZTRUNSRVRMRkpWRklEUUJDRFBMNklBV3wwRkM2OTFCRDZBOTlBQjM3LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-content-type-options: [nosniff] + x-ms-ratelimit-remaining-subscription-writes: ['1199'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_softdelete.yaml b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_softdelete.yaml new file mode 100644 index 00000000000..7925dbe5e2e --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/recordings/test_keyvault_softdelete.yaml @@ -0,0 +1,191 @@ +interactions: +- request: + body: '{"location": "westus", "tags": {"use": "az-test"}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group create] + Connection: [keep-alive] + Content-Length: ['50'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_sd000001?api-version=2017-05-10 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd000001","name":"cli_test_keyvault_sd000001","location":"westus","tags":{"use":"az-test"},"properties":{"provisioningState":"Succeeded"}}'} + headers: + cache-control: [no-cache] + content-length: ['328'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 07:25:43 GMT'] + expires: ['-1'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1195'] + status: {code: 201, message: Created} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 graphrbacmanagementclient/0.31.0 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://graph.windows.net/00000000-0000-0000-0000-000000000000/me?api-version=1.6 + response: + body: {string: '{"odata.metadata":"https://graph.windows.net/00000000-0000-0000-0000-000000000000/$metadata#directoryObjects/Microsoft.DirectoryServices.User/@Element","odata.type":"Microsoft.DirectoryServices.User","objectType":"User","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","deletionTimestamp":null,"accountEnabled":true,"assignedLicenses":[{"disabledPlans":[],"skuId":"a403ebcc-fae0-4ca2-8c8c-7a907fd6c235"}],"assignedPlans":[{"assignedTimestamp":"2017-12-07T23:01:21Z","capabilityStatus":"Enabled","service":"AzureAnalysis","servicePlanId":"2049e525-b859-401b-b2a0-e0a31c4b1fe4"}],"city":null,"companyName":null,"country":null,"creationType":null,"department":null,"dirSyncEnabled":null,"displayName":"Admin2","employeeId":null,"facsimileTelephoneNumber":null,"givenName":"Admin2","immutableId":null,"isCompromised":null,"jobTitle":null,"lastDirSyncTime":null,"legalAgeGroupClassification":null,"mail":null,"mailNickname":"admin2","mobile":null,"onPremisesDistinguishedName":null,"onPremisesSecurityIdentifier":null,"otherMails":["destanko@microsoft.com"],"passwordPolicies":"None","passwordProfile":null,"physicalDeliveryOfficeName":null,"postalCode":null,"preferredLanguage":"en-US","provisionedPlans":[],"provisioningErrors":[],"proxyAddresses":[],"refreshTokensValidFromDateTime":"2017-12-05T17:57:50Z","showInAddressList":null,"signInNames":[],"sipProxyAddress":null,"state":null,"streetAddress":null,"surname":"Admin2","telephoneNumber":null,"usageLocation":"US","userIdentities":[],"userPrincipalName":"admin2@AzureSDKTeam.onmicrosoft.com","userType":"Member"}'} + headers: + access-control-allow-origin: ['*'] + cache-control: [no-cache] + content-length: ['1565'] + content-type: [application/json; odata=minimalmetadata; streaming=true; charset=utf-8] + dataserviceversion: [3.0;] + date: ['Wed, 20 Dec 2017 07:25:45 GMT'] + duration: ['528705'] + expires: ['-1'] + ocp-aad-diagnostics-server-name: [ICgUT9PQICZWJwyJ2TfLVPihZ1e5QC5sUtJQrEsT2pA=] + ocp-aad-session-key: [ST9y9tmDvppZ5CjC8Ol21AYYLNA5rVuKz-lwDMb6ji0k_khXBRUxlhu7UuFjoPJGE-tsABGrLmeJQn6dBvlLlLFgKwMXGaPTQnZgDBxTrp070muNempaGoicwJFS8yAM.ElNulOh9Kf7Z6dHvhDpxHngtwv9w_sr-qpbpezmM3kQ] + pragma: [no-cache] + request-id: [e553bfc5-18d1-4260-9b26-f51aefea1b6f] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-dirapi-data-contract-version: ['1.6'] + x-powered-by: [ASP.NET, ASP.NET] + status: {code: 200, message: OK} +- request: + body: '{"location": "westus", "properties": {"enableSoftDelete": true, "tenantId": + "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "sku": {"family": "A", "name": "premium"}, + "accessPolicies": [{"tenantId": "54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", "permissions": + {"keys": ["get", "create", "delete", "list", "update", "import", "backup", "restore", + "recover"], "certificates": ["get", "list", "delete", "create", "import", "update", + "managecontacts", "getissuers", "listissuers", "setissuers", "deleteissuers", + "manageissuers", "recover"], "storage": ["get", "list", "delete", "set", "update", + "regeneratekey", "setsas", "listsas", "getsas", "deletesas"], "secrets": ["get", + "list", "set", "delete", "backup", "restore", "recover"]}, "objectId": "5963f50c-7c43-405c-af7e-53294de76abd"}]}}' + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [keyvault create] + Connection: [keep-alive] + Content-Length: ['771'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultmanagementclient/0.40.0 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002?api-version=2016-10-01 + response: + body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_keyvault_sd000001/providers/Microsoft.KeyVault/vaults/cli-test-keyvault-000002","name":"cli-test-keyvault-000002","type":"Microsoft.KeyVault/vaults","location":"westus","tags":{},"properties":{"sku":{"family":"A","name":"premium"},"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","accessPolicies":[{"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","objectId":"5963f50c-7c43-405c-af7e-53294de76abd","permissions":{"keys":["get","create","delete","list","update","import","backup","restore","recover"],"certificates":["get","list","delete","create","import","update","managecontacts","getissuers","listissuers","setissuers","deleteissuers","manageissuers","recover"],"storage":["get","list","delete","set","update","regeneratekey","setsas","listsas","getsas","deletesas"],"secrets":["get","list","set","delete","backup","restore","recover"]}}],"enabledForDeployment":false,"enableSoftDelete":true,"vaultUri":"https://cli-test-keyvault-000002.vault.azure.net"}}'} + headers: + cache-control: [no-cache] + content-length: ['1092'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 07:25:46 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000; includeSubDomains] + transfer-encoding: [chunked] + vary: [Accept-Encoding] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-service-version: [1.0.0.197] + x-ms-ratelimit-remaining-subscription-writes: ['1194'] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 20 Dec 2017 07:25:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + www-authenticate: ['Bearer authorization="https://login.windows.net/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", + resource="https://vault.azure.net"'] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 401, message: Unauthorized} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + Connection: [keep-alive] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 keyvaultclient/0.3.7 Azure-SDK-For-Python] + accept-language: [en-US] + method: GET + uri: https://cli-test-keyvault-000002.vault.azure.net/keys?api-version=2016-10-01 + response: + body: {string: '{"value":null,"nextLink":null}'} + headers: + cache-control: [no-cache] + content-length: ['30'] + content-type: [application/json; charset=utf-8] + date: ['Wed, 20 Dec 2017 07:25:57 GMT'] + expires: ['-1'] + pragma: [no-cache] + server: [Microsoft-IIS/8.5] + strict-transport-security: [max-age=31536000;includeSubDomains] + x-aspnet-version: [4.0.30319] + x-content-type-options: [nosniff] + x-ms-keyvault-region: [westus] + x-ms-keyvault-service-version: [1.0.0.837] + x-powered-by: [ASP.NET] + status: {code: 200, message: OK} +- request: + body: null + headers: + Accept: [application/json] + Accept-Encoding: ['gzip, deflate'] + CommandName: [group delete] + Connection: [keep-alive] + Content-Length: ['0'] + Content-Type: [application/json; charset=utf-8] + User-Agent: [python/3.5.3 (Windows-10-10.0.16299-SP0) requests/2.18.4 msrest/0.4.22 + msrest_azure/0.4.19 resourcemanagementclient/1.2.1 Azure-SDK-For-Python + AZURECLI/2.0.24] + accept-language: [en-US] + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_keyvault_sd000001?api-version=2017-05-10 + response: + body: {string: ''} + headers: + cache-control: [no-cache] + content-length: ['0'] + date: ['Wed, 20 Dec 2017 07:25:58 GMT'] + expires: ['-1'] + location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGS0VZVkFVTFQ6NUZTREQ2WDdaWVpaVElDWFhHTlZPRUg1QnwwRDc2REY4QjhGNzE1MjU2LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2017-05-10'] + pragma: [no-cache] + strict-transport-security: [max-age=31536000; includeSubDomains] + x-ms-ratelimit-remaining-subscription-writes: ['1196'] + status: {code: 202, message: Accepted} +version: 1 diff --git a/src/keyvault/azext_keyvault/tests/latest/test_keyvault_commands.py b/src/keyvault/azext_keyvault/tests/latest/test_keyvault_commands.py new file mode 100644 index 00000000000..b82f51b62b3 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/test_keyvault_commands.py @@ -0,0 +1,789 @@ +# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the azure-cli repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from __future__ import print_function + +import os +import time +import unittest +from datetime import datetime, timedelta +from dateutil import tz + +from azure.cli.testsdk import ResourceGroupPreparer, ScenarioTest, LiveScenarioTest + +from knack.util import CLIError + +secret_text_encoding_values = ['utf-8', 'utf-16le', 'utf-16be', 'ascii'] +secret_binary_encoding_values = ['base64', 'hex'] +secret_encoding_values = secret_text_encoding_values + secret_binary_encoding_values + + +def _asn1_to_iso8601(asn1_date): + import dateutil.parser + if isinstance(asn1_date, bytes): + asn1_date = asn1_date.decode('utf-8') + return dateutil.parser.parse(asn1_date) + + +TEST_DIR = os.path.abspath(os.path.join(os.path.abspath(__file__), '..')) + + +def _create_keyvault(test, kwargs, retry_wait=30, max_retries=10, additional_args=None): + + # need premium KeyVault to store keys in HSM + kwargs['add'] = additional_args or '' + vault = test.cmd('keyvault create -g {rg} -n {kv} -l {loc} --sku premium {add}') + + retries = 0 + while True: + try: + # if you can connect to the keyvault, proceed with test + time.sleep(10) + test.cmd('keyvault key list --vault-name {kv}') + return vault + except CLIError as ex: + # because it can take time for the DNS registration to propagate, periodically retry + # until we can connect to the keyvault. During the wait, you should try to manually + # flush the DNS cache in a separate terminal. Since this is OS dependent, we cannot + # reliably do this programmatically. + if 'Max retries exceeded attempting to connect to vault' in str( + ex) and retries < max_retries: + retries += 1 + print('\tWaiting for DNS changes to propagate. Please try manually flushing your') + print('\tDNS cache. (ex: \'ipconfig /flushdns\' on Windows)') + print( + '\t\tRetrying ({}/{}) in {} seconds\n'.format(retries, max_retries, retry_wait)) + time.sleep(retry_wait) + else: + raise ex + + +class DateTimeParseTest(unittest.TestCase): + def test_parse_asn1_date(self): + expected = datetime(year=2017, + month=4, + day=24, + hour=16, + minute=37, + second=20, + tzinfo=tz.tzutc()) + self.assertEqual(_asn1_to_iso8601("20170424163720Z"), expected) + + +class KeyVaultMgmtScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_keyvault_mgmt') + def test_keyvault_mgmt(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-keyvault-', 24), + 'kv2': self.create_random_name('cli-keyvault-', 24), + 'kv3': self.create_random_name('cli-keyvault-', 24), + 'kv4': self.create_random_name('cli-keyvault-', 24), + 'loc': 'westus' + }) + + # test create keyvault with default access policy set + keyvault = self.cmd('keyvault create -g {rg} -n {kv} -l {loc}', checks=[ + self.check('name', '{kv}'), + self.check('location', '{loc}'), + self.check('resourceGroup', '{rg}'), + self.check('type(properties.accessPolicies)', 'array'), + self.check('length(properties.accessPolicies)', 1), + self.check('properties.sku.name', 'standard') + ]).get_output_in_json() + self.kwargs['policy_id'] = keyvault['properties']['accessPolicies'][0]['objectId'] + self.cmd('keyvault show -n {kv}', checks=[ + self.check('name', '{kv}'), + self.check('location', '{loc}'), + self.check('resourceGroup', '{rg}'), + self.check('type(properties.accessPolicies)', 'array'), + self.check('length(properties.accessPolicies)', 1), + ]) + self.cmd('keyvault list -g {rg}', checks=[ + self.check('type(@)', 'array'), + self.check('length(@)', 1), + self.check('[0].name', '{kv}'), + self.check('[0].location', '{loc}'), + self.check('[0].resourceGroup', '{rg}') + ]) + # test updating keyvault sku name + self.cmd('keyvault update -g {rg} -n {kv} --set properties.sku.name=premium', checks=[ + self.check('name', '{kv}'), + self.check('properties.sku.name', 'premium'), + ]) + # test policy set/delete + self.cmd('keyvault set-policy -g {rg} -n {kv} --object-id {policy_id} --certificate-permissions get list', + checks=self.check('length(properties.accessPolicies[0].permissions.certificates)', 2)) + self.cmd('keyvault delete-policy -g {rg} -n {kv} --object-id {policy_id}', checks=[ + self.check('type(properties.accessPolicies)', 'array'), + self.check('length(properties.accessPolicies)', 0) + ]) + + # test keyvault delete + self.cmd('keyvault delete -n {kv}') + self.cmd('keyvault list -g {rg}', checks=self.is_empty()) + + # test create keyvault further + + self.cmd('keyvault create -g {rg} -n {kv2} -l {loc} --no-self-perms', checks=[ + self.check('type(properties.accessPolicies)', 'array'), + self.check('length(properties.accessPolicies)', 0) + ]) + + self.cmd('keyvault create -g {rg} -n {kv3} -l {loc} --enabled-for-deployment true --enabled-for-disk-encryption true --enabled-for-template-deployment true', checks=[ + self.check('properties.enabledForDeployment', True), + self.check('properties.enabledForDiskEncryption', True), + self.check('properties.enabledForTemplateDeployment', True) + ]) + self.cmd('keyvault create -g {rg} -n {kv4} -l {loc} --sku premium', checks=[ + self.check('properties.sku.name', 'premium') + ]) + + +class KeyVaultKeyScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_keyvault_key') + def test_keyvault_key(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus', + 'key': 'key1' + }) + + _create_keyvault(self, self.kwargs) + + # create a key + key = self.cmd('keyvault key create --vault-name {kv} -n {key} -p software', + checks=self.check('attributes.enabled', True)).get_output_in_json() + first_kid = key['key']['kid'] + first_version = first_kid.rsplit('/', 1)[1] + + # list keys + self.cmd('keyvault key list --vault-name {kv}', + checks=self.check('length(@)', 1)) + + # create a new key version + key = self.cmd('keyvault key create --vault-name {kv} -n {key} -p software --disabled --ops encrypt decrypt --tags test=foo', checks=[ + self.check('attributes.enabled', False), + self.check('length(key.keyOps)', 2), + self.check('tags', {'test': 'foo'}) + ]).get_output_in_json() + second_kid = key['key']['kid'] + # list key versions + self.cmd('keyvault key list-versions --vault-name {kv} -n {key}', + checks=self.check('length(@)', 2)) + + # show key (latest) + self.cmd('keyvault key show --vault-name {kv} -n {key}', + checks=self.check('key.kid', second_kid)) + + # show key (specific version) + self.kwargs.update({ + 'version1': first_version, + 'kid1': first_kid, + 'kid2': second_kid + }) + self.cmd('keyvault key show --vault-name {kv} -n {key} -v {version1}', + checks=self.check('key.kid', '{kid1}')) + + # set key attributes + self.cmd('keyvault key set-attributes --vault-name {kv} -n {key} --enabled true', checks=[ + self.check('key.kid', '{kid2}'), + self.check('attributes.enabled', True) + ]) + + # backup and then delete key + key_file = 'backup.key' + self.kwargs['key_file'] = key_file + self.cmd('keyvault key backup --vault-name {kv} -n {key} --file {key_file}') + self.cmd('keyvault key delete --vault-name {kv} -n {key}') + self.cmd('keyvault key list --vault-name {kv}', + checks=self.is_empty()) + + # restore key from backup + self.cmd('keyvault key restore --vault-name {kv} --file {key_file}') + self.cmd('keyvault key list-versions --vault-name {kv} -n {key}', + checks=self.check('length(@)', 2)) + if os.path.isfile(key_file): + os.remove(key_file) + + # import PEM + self.kwargs.update({ + 'key_enc_file': os.path.join(TEST_DIR, 'mydomain.test.encrypted.pem'), + 'key_enc_password': 'password', + 'key_plain_file': os.path.join(TEST_DIR, 'mydomain.test.pem') + }) + self.cmd('keyvault key import --vault-name {kv} -n import-key-plain --pem-file "{key_plain_file}" -p software') + self.cmd('keyvault key import --vault-name {kv} -n import-key-encrypted --pem-file "{key_enc_file}" --pem-password {key_enc_password} -p hsm') + + +class KeyVaultSecretScenarioTest(ScenarioTest): + + def _test_download_secret(self): + secret_path = os.path.join(TEST_DIR, 'test_secret.txt') + self.kwargs['src_path'] = secret_path + with open(secret_path, 'r') as f: + expected = f.read().replace('\r\n', '\n') + + def _test_set_and_download(encoding): + self.kwargs['enc'] = encoding + self.cmd('keyvault secret set --vault-name {kv} -n download-{enc} --file "{src_path}" --encoding {enc}') + dest_path = os.path.join(TEST_DIR, 'recover-{}'.format(encoding)) + self.kwargs['dest_path'] = dest_path + self.cmd('keyvault secret download --vault-name {kv} -n download-{enc} --file "{dest_path}"') + with open(dest_path, 'r') as f: + actual = f.read().replace('\r\n', '\n') + self.assertEqual(actual, expected) + os.remove(dest_path) + + for encoding in secret_encoding_values: + _test_set_and_download(encoding) + + @ResourceGroupPreparer(name_prefix='cli_test_keyvault_secret') + def test_keyvault_secret(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-kevault-', 24), + 'loc': 'westus', + 'sec': 'secret1' + }) + + _create_keyvault(self, self.kwargs) + + # create a secret + secret = self.cmd('keyvault secret set --vault-name {kv} -n {sec} --value ABC123', + checks=self.check('value', 'ABC123')).get_output_in_json() + first_sid = secret['id'] + first_version = first_sid.rsplit('/', 1)[1] + self.kwargs.update({ + 'sid1': first_sid, + 'ver1': first_version + }) + + # list secrets + self.cmd('keyvault secret list --vault-name {kv}', checks=self.check('length(@)', 1)) + + # create a new secret version + secret = self.cmd('keyvault secret set --vault-name {kv} -n {sec} --value DEF456 --tags test=foo --description "test type"', checks=[ + self.check('value', 'DEF456'), + self.check('tags', {'file-encoding': 'utf-8', 'test': 'foo'}), + self.check('contentType', 'test type') + ]).get_output_in_json() + self.kwargs['sid2'] = secret['id'] + + # list secret versions + self.cmd('keyvault secret list-versions --vault-name {kv} -n {sec}', + checks=self.check('length(@)', 2)) + + # show secret (latest) + self.cmd('keyvault secret show --vault-name {kv} -n {sec}', + checks=self.check('id', '{sid2}')) + + # show secret (specific version) + self.cmd('keyvault secret show --vault-name {kv} -n {sec} -v {ver1}', + checks=self.check('id', '{sid1}')) + + # set secret attributes + self.cmd('keyvault secret set-attributes --vault-name {kv} -n {sec} --enabled false', checks=[ + self.check('id', '{sid2}'), + self.check('attributes.enabled', False) + ]) + + # TODO add backup / restore validation back when service routing bug is fixed + # TODO https://msazure.visualstudio.com/One/_workitems/edit/2330038?src=alerts&src-action=cta + # TODO Secret Backup and Restore REST API calls fail with MethodNotAllowed on 7.0-preview + # backup and then delete secret + # bak_file = 'backup.secret' + # self.kwargs['bak_file'] = bak_file + # self.cmd('keyvault secret backup --vault-name {kv} -n {sec} --file {bak_file}') + # self.cmd('keyvault secret delete --vault-name {kv} -n {sec}') + # self.cmd('keyvault secret list --vault-name {kv}', checks=self.is_empty()) + + # restore key from backup + # self.cmd('keyvault secret restore --vault-name {kv} --file {bak_file}') + # self.cmd('keyvault secret list-versions --vault-name {kv} -n {sec}', + # checks=self.check('length(@)', 2)) + # if os.path.isfile(bak_file): + # os.remove(bak_file) + + # delete secret + self.cmd('keyvault secret delete --vault-name {kv} -n {sec}') + self.cmd('keyvault secret list --vault-name {kv}', + checks=self.is_empty()) + + self._test_download_secret() + + +class KeyVaultCertificateContactsScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_kv_cert_contacts') + def test_keyvault_certificate_contacts(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus' + }) + + _create_keyvault(self, self.kwargs) + + self.cmd('keyvault certificate contact add --vault-name {kv} --email admin@contoso.com --name "John Doe" --phone 123-456-7890') + self.cmd('keyvault certificate contact add --vault-name {kv} --email other@contoso.com ') + self.cmd('keyvault certificate contact list --vault-name {kv}', + checks=self.check('length(contactList)', 2)) + self.cmd('keyvault certificate contact delete --vault-name {kv} --email admin@contoso.com') + self.cmd('keyvault certificate contact list --vault-name {kv}', checks=[ + self.check('length(contactList)', 1), + self.check('contactList[0].emailAddress', 'other@contoso.com') + ]) + + +class KeyVaultCertificateIssuerScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_kv_cert_issuer') + def test_keyvault_certificate_issuers(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus' + }) + + _create_keyvault(self, self.kwargs) + + self.cmd('keyvault certificate issuer create --vault-name {kv} --issuer-name issuer1 --provider Test', checks=[ + self.check('provider', 'Test'), + self.check('attributes.enabled', True) + ]) + self.cmd('keyvault certificate issuer show --vault-name {kv} --issuer-name issuer1', checks=[ + self.check('provider', 'Test'), + self.check('attributes.enabled', True) + ]) + self.cmd('keyvault certificate issuer update --vault-name {kv} --issuer-name issuer1 --organization-id TestOrg --account-id test_account', checks=[ + self.check('provider', 'Test'), + self.check('attributes.enabled', True), + self.check('organizationDetails.id', 'TestOrg'), + self.check('credentials.accountId', 'test_account') + ]) + with self.assertRaises(CLIError): + self.cmd('keyvault certificate issuer update --vault-name {kv} --issuer-name notexist --organization-id TestOrg --account-id test_account') + self.cmd('keyvault certificate issuer update --vault-name {kv} --issuer-name issuer1 --account-id ""', checks=[ + self.check('provider', 'Test'), + self.check('attributes.enabled', True), + self.check('organizationDetails.id', 'TestOrg'), + self.check('credentials.accountId', None) + ]) + self.cmd('keyvault certificate issuer list --vault-name {kv}', + checks=self.check('length(@)', 1)) + + # test admin commands + self.cmd('keyvault certificate issuer admin add --vault-name {kv} --issuer-name issuer1 --email test@test.com --first-name Test --last-name Admin --phone 123-456-7890', checks=[ + self.check('emailAddress', 'test@test.com'), + self.check('firstName', 'Test'), + self.check('lastName', 'Admin'), + self.check('phone', '123-456-7890'), + ]) + self.cmd('keyvault certificate issuer admin add --vault-name {kv} --issuer-name issuer1 --email test@test.com') + self.cmd('keyvault certificate issuer admin add --vault-name {kv} --issuer-name issuer1 --email test2@test.com', checks=[ + self.check('emailAddress', 'test2@test.com'), + self.check('firstName', None), + self.check('lastName', None), + self.check('phone', None), + ]) + self.cmd('keyvault certificate issuer admin list --vault-name {kv} --issuer-name issuer1', + checks=self.check('length(@)', 2)) + self.cmd('keyvault certificate issuer admin delete --vault-name {kv} --issuer-name issuer1 --email test@test.com') + self.cmd('keyvault certificate issuer admin list --vault-name {kv} --issuer-name issuer1', + checks=self.check('length(@)', 1)) + + self.cmd('keyvault certificate issuer delete --vault-name {kv} --issuer-name issuer1') + self.cmd('keyvault certificate issuer list --vault-name {kv}', checks=self.is_empty()) + + +class KeyVaultPendingCertificateScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_kv_cert_pending') + def test_keyvault_pending_certificate(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus', + 'policy_path': os.path.join(TEST_DIR, 'policy_pending.json') + }) + + _create_keyvault(self, self.kwargs) + + self.kwargs['fake_cert_path'] = os.path.join(TEST_DIR, 'import_pem_plain.pem') + self.cmd('keyvault certificate create --vault-name {kv} -n pending-cert -p @"{policy_path}"', checks=[ + self.check('statusDetails', 'Pending certificate created. Please Perform Merge to complete the request.'), + self.check('cancellationRequested', False), + self.check('status', 'inProgress') + ]) + self.cmd('keyvault certificate pending show --vault-name {kv} -n pending-cert', checks=[ + self.check('statusDetails', 'Pending certificate created. Please Perform Merge to complete the request.'), + self.check('cancellationRequested', False), + self.check('status', 'inProgress') + ]) + # we do not have a way of actually getting a certificate that would pass this test so + # we simply ensure that the payload successfully serializes and is received by the server + with self.assertRaises(CLIError): + self.cmd('keyvault certificate pending merge --vault-name {kv} -n pending-cert --file "{fake_cert_path}"') + self.cmd('keyvault certificate pending delete --vault-name {kv} -n pending-cert') + + with self.assertRaises(CLIError): + self.cmd('keyvault certificate pending show --vault-name {kv} -n pending-cert') + + +# TODO: Convert to ScenarioTest and re-record when issue #5146 is fixed. +class KeyVaultCertificateDownloadScenarioTest(LiveScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_kv_cert_download') + def test_keyvault_certificate_download(self, resource_group): + import OpenSSL.crypto + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus' + }) + + _create_keyvault(self, self.kwargs) + + pem_file = os.path.join(TEST_DIR, 'import_pem_plain.pem') + pem_policy_path = os.path.join(TEST_DIR, 'policy_import_pem.json') + self.kwargs.update({ + 'pem_file': pem_file, + 'pem_policy_path': pem_policy_path + }) + pem_cert = self.cmd('keyvault certificate import --vault-name {kv} -n pem-cert1 --file "{pem_file}" -p @"{pem_policy_path}"').get_output_in_json() + cert_data = pem_cert['cer'] + + dest_binary = os.path.join(TEST_DIR, 'download-binary') + dest_string = os.path.join(TEST_DIR, 'download-string') + self.kwargs.update({ + 'dest_binary': dest_binary, + 'dest_string': dest_string + }) + + expected_pem = "-----BEGIN CERTIFICATE-----\n" + \ + cert_data + \ + '-----END CERTIFICATE-----\n' + expected_pem = expected_pem.replace('\n', '') + + try: + self.cmd('keyvault certificate download --vault-name {kv} -n pem-cert1 --file "{dest_binary}" -e DER') + self.cmd('keyvault certificate download --vault-name {kv} -n pem-cert1 --file "{dest_string}" -e PEM') + self.cmd('keyvault certificate delete --vault-name {kv} -n pem-cert1') + + def verify(path, file_type): + with open(path, 'rb') as f: + x509 = OpenSSL.crypto.load_certificate(file_type, f.read()) + actual_pem = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, x509) + if isinstance(actual_pem, bytes): + actual_pem = actual_pem.decode("utf-8") + self.assertIn(expected_pem, actual_pem.replace('\n', '')) + + verify(dest_binary, OpenSSL.crypto.FILETYPE_ASN1) + verify(dest_string, OpenSSL.crypto.FILETYPE_PEM) + finally: + if os.path.exists(dest_binary): + os.remove(dest_binary) + if os.path.exists(dest_string): + os.remove(dest_string) + + +class KeyVaultCertificateDefaultPolicyScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_kv_cert_default_policy') + def test_keyvault_certificate_get_default_policy(self, resource_group): + result = self.cmd('keyvault certificate get-default-policy').get_output_in_json() + self.assertEqual(result['keyProperties']['keyType'], 'RSA') + self.assertEqual(result['issuerParameters']['name'], 'Self') + self.assertEqual(result['secretProperties']['contentType'], 'application/x-pkcs12') + subject = 'CN=CLIGetDefaultPolicy' + self.assertEqual(result['x509CertificateProperties']['subject'], subject) + + result = self.cmd('keyvault certificate get-default-policy --scaffold').get_output_in_json() + self.assertIn('RSA or RSA-HSM', result['keyProperties']['keyType']) + self.assertIn('Self', result['issuerParameters']['name']) + self.assertIn('application/x-pkcs12', result['secretProperties']['contentType']) + self.assertIn('Contoso', result['x509CertificateProperties']['subject']) + + +class KeyVaultCertificateScenarioTest(ScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_keyvault_cert') + def test_keyvault_certificate_crud(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus' + }) + + _create_keyvault(self, self.kwargs) + + policy_path = os.path.join(TEST_DIR, 'policy.json') + policy2_path = os.path.join(TEST_DIR, 'policy2.json') + self.kwargs.update({ + 'policy_path': policy_path, + 'policy2_path': policy2_path + }) + + # create a certificate + self.cmd('keyvault certificate create --vault-name {kv} -n cert1 -p @"{policy_path}"', + checks=self.check('status', 'completed')) + + # list certificates + self.cmd('keyvault certificate list --vault-name {kv}', + checks=self.check('length(@)', 1)) + + # create a new certificate version + self.cmd('keyvault certificate create --vault-name {kv} -n cert1 -p @"{policy2_path}"', checks=[ + self.check('status', 'completed'), + ]) + + # list certificate versions + ver_list = self.cmd('keyvault certificate list-versions --vault-name {kv} -n cert1', + checks=self.check('length(@)', 2)).get_output_in_json() + + ver_list = sorted(ver_list, key=lambda x: x['attributes']['created']) + versions = [x['id'] for x in ver_list] + + # show certificate (latest) + self.cmd('keyvault certificate show --vault-name {kv} -n cert1', checks=[ + self.check('id', versions[1]), + self.check('policy.x509CertificateProperties.validityInMonths', 50) + ]) + + # show certificate (specific version) + cert_version = versions[0].rsplit('/', 1)[1] + self.kwargs['ver1'] = cert_version + self.cmd('keyvault certificate show --vault-name {kv} -n cert1 -v {ver1}', + checks=self.check('id', versions[0])) + + # update certificate attributes + self.cmd('keyvault certificate set-attributes --vault-name {kv} -n cert1 --enabled false -p @"{policy_path}"', checks=[ + self.check('id', versions[1]), + self.check('attributes.enabled', False), + self.check('policy.x509CertificateProperties.validityInMonths', 60) + ]) + + # delete certificate + self.cmd('keyvault certificate delete --vault-name {kv} -n cert1') + self.cmd('keyvault certificate list --vault-name {kv}', + checks=self.is_empty()) + + +def _generate_certificate(path, keyfile=None, password=None): + from cryptography.hazmat.backends import default_backend + from cryptography.hazmat.primitives import serialization + from cryptography.hazmat.primitives.asymmetric import rsa + from cryptography import x509 + from cryptography.x509.oid import NameOID + from cryptography.hazmat.primitives import hashes + + if keyfile: + with open(path, "rb") as kf: + key_bytes = kf.read() + key = serialization.load_pem_private_key(key_bytes, password, default_backend()) + else: + key = rsa.generate_private_key( + public_exponent=65537, + key_size=2048, + backend=default_backend() + ) + key_bytes = key.private_bytes( + encoding=serialization.Encoding.PEM, + format=serialization.PrivateFormat.PKCS8, + encryption_algorithm=serialization.BestAvailableEncryption(password) if password else serialization.NoEncryption(), + ) + + # Various details about who we are. For a self-signed certificate the + # Subject and issuer are always the same. + subject = issuer = x509.Name([ + x509.NameAttribute(NameOID.COUNTRY_NAME, u'US'), + x509.NameAttribute(NameOID.STATE_OR_PROVINCE_NAME, u'WA'), + x509.NameAttribute(NameOID.LOCALITY_NAME, u'Redmond'), + x509.NameAttribute(NameOID.ORGANIZATION_NAME, u"My Company"), + x509.NameAttribute(NameOID.COMMON_NAME, u"mysite.com")]) + + cert = x509.CertificateBuilder().subject_name(subject) \ + .issuer_name(issuer) \ + .public_key(key.public_key()) \ + .serial_number(x509.random_serial_number()) \ + .not_valid_before(datetime.utcnow()) \ + .not_valid_after(datetime.utcnow() + timedelta(days=10)) \ + .sign(key, hashes.SHA256(), default_backend()) + + # Write the cert out to disk + with open(path, "wb") as f: + f.write(key_bytes) + f.write(cert.public_bytes(serialization.Encoding.PEM)) + + +# TODO: Convert to ScenarioTest and re-record when issue #5146 is fixed. +class KeyVaultCertificateImportScenario(LiveScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_keyvault_sd') + def test_keyvault_certificate_import(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus' + }) + + _create_keyvault(self, self.kwargs) + + # test certificate import + self.kwargs.update({ + 'pem_encrypted_file': os.path.join(TEST_DIR, 'import_pem_encrypted_pwd_1234.pem'), + 'pem_encrypted_password': '1234', + 'pem_plain_file': os.path.join(TEST_DIR, 'import_pem_plain.pem'), + 'pem_policy_path': os.path.join(TEST_DIR, 'policy_import_pem.json') + }) + + self.cmd('keyvault certificate import --vault-name {kv} -n pem-cert1 --file "{pem_plain_file}" -p @"{pem_policy_path}"') + self.cmd('keyvault certificate import --vault-name {kv} -n pem-cert2 --file "{pem_encrypted_file}" --password {pem_encrypted_password} -p @"{pem_policy_path}"') + + # self.kwargs.update({ + # 'pfx_plain_file': os.path.join(TEST_DIR, 'import_pfx.pfx'), + # 'pfx_policy_path': os.path.join(TEST_DIR, 'policy_import_pfx.json') + # }) + # self.cmd('keyvault certificate import --vault-name {kv} -n pfx-cert --file "{pfx_plain_file}" -p @"{pfx_policy_path}"') + + +# TODO: Convert to ScenarioTest and re-record when issue #5146 is fixed. +class KeyVaultSoftDeleteScenarioTest(LiveScenarioTest): + + @ResourceGroupPreparer(name_prefix='cli_test_keyvault_sd') + def test_keyvault_softdelete(self, resource_group): + + self.kwargs.update({ + 'kv': self.create_random_name('cli-test-keyvault-', 24), + 'loc': 'westus' + }) + + vault = _create_keyvault(self, self.kwargs, additional_args=' --enable-soft-delete true').get_output_in_json() + + # add all purge permissions to default the access policy + default_policy = vault['properties']['accessPolicies'][0] + cert_perms = default_policy['permissions']['certificates'] + key_perms = default_policy['permissions']['keys'] + secret_perms = default_policy['permissions']['secrets'] + obj_id = default_policy['objectId'] + + for p in [cert_perms, key_perms, secret_perms]: + p.append('purge') + + self.kwargs.update({ + 'obj_id': obj_id, + 'key_perms': ' '.join(key_perms), + 'secret_perms': ' '.join(secret_perms), + 'cert_perms': ' '.join(cert_perms) + }) + + self.cmd('keyvault set-policy -n {kv} --object-id {obj_id} --key-permissions {key_perms} --secret-permissions {secret_perms} --certificate-permissions {cert_perms}') + + # create, delete, restore, and purge a secret + self.cmd('keyvault secret set --vault-name {kv} -n secret1 --value ABC123', + checks=self.check('value', 'ABC123')) + + self._delete_entity('secret', 'secret1') + self._recover_entity('secret', 'secret1') + self._delete_entity('secret', 'secret1') + self._purge_entity('secret', 'secret1') + + # create, delete, restore, and purge a key + self.cmd('keyvault key create --vault-name {kv} -n key1 -p software', + checks=self.check('attributes.enabled', True)) + + self._delete_entity('key', 'key1') + self._recover_entity('key', 'key1') + self._delete_entity('key', 'key1') + self._purge_entity('key', 'key1') + + # create, delete, restore, and purge a certificate + self.kwargs.update({ + 'pem_plain_file': os.path.join(TEST_DIR, 'import_pem_plain.pem'), + 'pem_policy_pat': os.path.join(TEST_DIR, 'policy_import_pem.json') + }) + self.cmd('keyvault certificate import --vault-name {kv} -n cert1 --file "{pem_plain_file}" -p @"{pem_policy_path}"') + self._delete_entity('certificate', 'cert1') + self._purge_entity('certificate', 'cert1') + + self.cmd('keyvault delete -n {kv}') + self.cmd('keyvault purge -n {kv} -l {loc}') + + def _delete_entity(self, entity_type, entity_name, retry_wait=3, max_retries=10): + # delete the specified entity + self.kwargs.update({ + 'ent': entity_type, + 'name': entity_name + }) + self.cmd('keyvault {ent} delete --vault-name {kv} -n {name}') + + for _ in range(max_retries): + try: + self.cmd('keyvault {ent} show --vault-name {kv} -n {name}', expect_failure=True) + break + except AssertionError: + time.sleep(retry_wait) + + def _recover_entity(self, entity_type, entity_name, retry_wait=3, max_retries=10): + + # while getting the deleted entities returns a zero entities + self.kwargs.update({ + 'ent': entity_type, + 'name': entity_name + }) + + for _ in range(max_retries): + try: + self.cmd('keyvault {ent} recover --vault-name {kv} -n {name}') + break + except AssertionError: + time.sleep(retry_wait) + + for _ in range(max_retries): + try: + self.cmd('keyvault {ent} show --vault-name {kv} -n {name}') + return + except AssertionError: + time.sleep(retry_wait) + + self.fail('{} {} not restored'.format(entity_type, entity_name)) + + def _purge_entity(self, entity_type, entity_name, retry_wait=3, max_retries=10): + + # while getting the deleted entities returns a zero entities + self.kwargs.update({ + 'ent': entity_type, + 'name': entity_name + }) + + for _ in range(max_retries): + try: + self.cmd('keyvault {ent} purge --vault-name {kv} -n {name}') + break + except AssertionError as ex: + time.sleep(retry_wait) + + for _ in range(max_retries): + try: + self.cmd('keyvault {ent} show --vault-name {kv} -n {name}', expect_failure=True) + return + except AssertionError as ex: + time.sleep(retry_wait) + + self.fail('{} {} not restored'.format(entity_type, entity_name)) + + +if __name__ == '__main__': + unittest.main() diff --git a/src/keyvault/azext_keyvault/tests/latest/test_secret.txt b/src/keyvault/azext_keyvault/tests/latest/test_secret.txt new file mode 100644 index 00000000000..c586cd2dfb1 --- /dev/null +++ b/src/keyvault/azext_keyvault/tests/latest/test_secret.txt @@ -0,0 +1 @@ +TestSecretTestSecretTestSecretTestSecret diff --git a/src/keyvault/setup.cfg b/src/keyvault/setup.cfg new file mode 100644 index 00000000000..3480374bc2f --- /dev/null +++ b/src/keyvault/setup.cfg @@ -0,0 +1,2 @@ +[bdist_wheel] +universal=1 \ No newline at end of file diff --git a/src/keyvault/setup.py b/src/keyvault/setup.py new file mode 100644 index 00000000000..4ecfabf37ac --- /dev/null +++ b/src/keyvault/setup.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python + +# -------------------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# -------------------------------------------------------------------------------------------- + +from codecs import open +from setuptools import setup, find_packages + +VERSION = "0.0.1" + +CLASSIFIERS = [ + 'Development Status :: 4 - Beta', + 'Intended Audience :: Developers', + 'Intended Audience :: System Administrators', + 'Programming Language :: Python', + 'Programming Language :: Python :: 2', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'License :: OSI Approved :: MIT License', +] +DEPENDENCIES = [ + 'cryptography>=2.1.4', + 'requests>=2.18.4', + 'pyOpenSSL' +] + +setup( + name='keyvault_preview', + version=VERSION, + description='The Azure CLI keyvault extension.', + long_description='An Azure CLI extension adding preview keyvault commands and updates.', + license='MIT', + author='Microsoft', + author_email='azurekeyvault@microsoft.com', + url='https://github.com/azure/azure-cli-extensions', + classifiers=CLASSIFIERS, + packages=find_packages(), + install_requires=DEPENDENCIES +) \ No newline at end of file diff --git a/src/keyvault/update_extension.py b/src/keyvault/update_extension.py new file mode 100644 index 00000000000..8dad7d6576c --- /dev/null +++ b/src/keyvault/update_extension.py @@ -0,0 +1,121 @@ +import os, sys, argparse, shutil +from subprocess import Popen, PIPE +from distutils.dir_util import copy_tree, remove_tree + +_source_md = '### Source Origin:' +_exclude_dirs = ['__pycache__', '.idea', 'dist'] +_exclude_exts = ['.pyc'] +_replacements = { + 'azure.keyvault': 'azext_keyvault.keyvault', + 'azure.mgmt.keyvault': 'azext_keyvault.mgmt.keyvault', + 'azure.cli.command_modules.keyvault': 'azext_keyvault' +} +_code_file_header="""# pylint: skip-file +# --------------------------------------------------------------------------- +# The code for this extension file is pulled from the {} repo. Changes may +# cause incorrect behavior and will be lost if the code is regenerated. +# Please see the readme.md at the base of the keyvault extension for details. +# --------------------------------------------------------------------------- +""" + +def file_in_repo(path, file): + p = Popen('git ls-files --error-unmatch %s' % file,stdout=PIPE, stderr=PIPE, cwd=path) + return p.wait() == 0 + + +def run_process(cmd, cwd): + p = Popen(cmd, stdout=PIPE, stderr=PIPE, cwd=cwd) + stdout, stderr = p.communicate() + p.wait() + if stderr: + print('ERROR: %s' % stderr) + return stdout.decode('utf-8').strip() if not stderr else None + + +def copy_file(src, dst, repo_name, replacements=None): + _, extension = os.path.splitext(src) + if extension.lower() == '.py': + with open(src, mode='r') as s: + with open(dst, mode='w') as d: + d.write(_code_file_header.format(repo_name)) + if replacements: + old = s.readline() + while(old): + new = old + for orig, repl in replacements.items(): + new = new.replace(orig, repl) + + if len(old) != len(new): + print('\n\t-%s\t+%s' % (old, new)) + + d.write(new) + old = s.readline() + else: + d.write(s.read()) + else: + shutil.copyfile(src, dst) + + +def copy_files(src, dst, repo_name, replacements=None): + # copy cli command module files + for path, dirs, files in os.walk(src): + for file in files: + if file_in_repo(path, file): + src_file = os.path.join(path, file) + dst_file = src_file.replace(src, dst) + print(dst_file) + if not os.path.exists(os.path.dirname(dst_file)): + os.makedirs(os.path.dirname(dst_file)) + copy_file(src_file, dst_file, repo_nameg, replacements) + + +def copy_repo_files(src, dst, repo_name, replacements=None): + + branch = run_process('git rev-parse --abbrev-ref HEAD', cwd=src) + head = run_process('git rev-parse HEAD', cwd=src) + + if not (branch and head): + print('unable to obtain branch info from "%s"' % src) + exit(1) + + tag = '%s/%s %s' % (repo_name, branch, head) + + print('copying %s:\n\t %s' % (src, tag)) + + copy_files(src, dst, repo_name, replacements) + + return tag + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument('--sdk', help='the root directory of the local azure-sdk-for-python clone', required=True) + parser.add_argument('--cli', help='the root directory of the local azure-cli clone', required=True) + args = parser.parse_args() + + sdk_root = args.sdk + cli_root = args.cli + ext_root = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'azext_keyvault') + + data_sdk_src = os.path.join(sdk_root, 'azure-keyvault/azure/keyvault') + mgmt_sdk_src = os.path.join(sdk_root, 'azure-mgmt-keyvault/azure/mgmt') + + data_sdk_dst = os.path.join(ext_root, 'keyvault') + mgmt_sdk_dst = os.path.join(ext_root, 'mgmt') + + cli_src = os.path.join(cli_root, 'src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault') + + # delete exiting extension files + if os.path.exists(ext_root): + remove_tree(ext_root) + + # copy sdk files + sdk_tag = copy_repo_files(data_sdk_src, data_sdk_dst, 'azure-sdk-for-python') + sdk_tag = copy_repo_files(mgmt_sdk_src, mgmt_sdk_dst, 'azure-sdk-for-python') + + # copy cli files + cli_tag = copy_repo_files(cli_src, ext_root, 'azure-cli', _replacements) + + # write the sources.md file + with open(os.path.join(ext_root, 'source.md'), 'w') as f: + f.write('\n\t'.join([_source_md, sdk_tag, cli_tag]) + '\n')