diff --git a/azure-keyvault/azure/keyvault/key_vault_client.py b/azure-keyvault/azure/keyvault/key_vault_client.py index 0afc065344bd..53d415b8dc3d 100644 --- a/azure-keyvault/azure/keyvault/key_vault_client.py +++ b/azure-keyvault/azure/keyvault/key_vault_client.py @@ -3934,141 +3934,6 @@ def merge_certificate( 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 @@ -4559,7 +4424,7 @@ def get_deleted_storage_account( return deserialized get_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} - def purge_deleted_storage_account( + def purge_deleted_storge_account( self, vault_base_url, storage_account_name, custom_headers=None, raw=False, **operation_config): """Permanently deletes the specified storage account. @@ -4584,7 +4449,7 @@ def purge_deleted_storage_account( :class:`KeyVaultErrorException` """ # Construct URL - url = self.purge_deleted_storage_account.metadata['url'] + url = self.purge_deleted_storge_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]+$') @@ -4615,7 +4480,7 @@ def purge_deleted_storage_account( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - purge_deleted_storage_account.metadata = {'url': '/deletedstorage/{storage-account-name}'} + purge_deleted_storge_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): diff --git a/azure-keyvault/azure/keyvault/models/__init__.py b/azure-keyvault/azure/keyvault/models/__init__.py index 70233748f308..924067447a25 100644 --- a/azure-keyvault/azure/keyvault/models/__init__.py +++ b/azure-keyvault/azure/keyvault/models/__init__.py @@ -86,8 +86,6 @@ 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 @@ -165,8 +163,6 @@ 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 @@ -267,8 +263,6 @@ 'SasDefinitionCreateParameters', 'SasDefinitionUpdateParameters', 'KeyVaultError', 'KeyVaultErrorException', - 'CertificateRestoreParameters', - 'BackupCertificateResult', 'KeyItemPaged', 'DeletedKeyItemPaged', 'SecretItemPaged', diff --git a/azure-keyvault/azure/keyvault/models/backup_certificate_result.py b/azure-keyvault/azure/keyvault/models/backup_certificate_result.py deleted file mode 100644 index 670034f28a2a..000000000000 --- a/azure-keyvault/azure/keyvault/models/backup_certificate_result.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/azure-keyvault/azure/keyvault/models/backup_certificate_result_py3.py b/azure-keyvault/azure/keyvault/models/backup_certificate_result_py3.py deleted file mode 100644 index 1d65f5dd8cc9..000000000000 --- a/azure-keyvault/azure/keyvault/models/backup_certificate_result_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/azure-keyvault/azure/keyvault/models/certificate_restore_parameters.py b/azure-keyvault/azure/keyvault/models/certificate_restore_parameters.py deleted file mode 100644 index 2a03516d6356..000000000000 --- a/azure-keyvault/azure/keyvault/models/certificate_restore_parameters.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/azure-keyvault/azure/keyvault/models/certificate_restore_parameters_py3.py b/azure-keyvault/azure/keyvault/models/certificate_restore_parameters_py3.py deleted file mode 100644 index 674a1294fed1..000000000000 --- a/azure-keyvault/azure/keyvault/models/certificate_restore_parameters_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# 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/azure-keyvault/build.json b/azure-keyvault/build.json index f04bc9cc781f..1aabde7100af 100644 --- a/azure-keyvault/build.json +++ b/azure-keyvault/build.json @@ -72,13 +72,13 @@ "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" }, "personalLock": { - "name": "_tmp_.autorest.4851.927557838924.personal-lock", + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", "options": { - "port": 20611, - "host": "2130765619", + "port": 46470, + "host": "2130729362", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4851.927557838924.personal-lock:20611" + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" }, "file": "/tmp/_tmp_.autorest.lock" }, @@ -155,13 +155,13 @@ "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" }, "personalLock": { - "name": "_tmp_.autorest.4851.927557838924.personal-lock", + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", "options": { - "port": 20611, - "host": "2130765619", + "port": 46470, + "host": "2130729362", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4851.927557838924.personal-lock:20611" + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" }, "file": "/tmp/_tmp_.autorest.lock" }, @@ -240,13 +240,13 @@ "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" }, "personalLock": { - "name": "_tmp_.autorest.4851.927557838924.personal-lock", + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", "options": { - "port": 20611, - "host": "2130765619", + "port": 46470, + "host": "2130729362", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4851.927557838924.personal-lock:20611" + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" }, "file": "/tmp/_tmp_.autorest.lock" }, @@ -325,13 +325,13 @@ "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" }, "personalLock": { - "name": "_tmp_.autorest.4851.927557838924.personal-lock", + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", "options": { - "port": 20611, - "host": "2130765619", + "port": 46470, + "host": "2130729362", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4851.927557838924.personal-lock:20611" + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" }, "file": "/tmp/_tmp_.autorest.lock" }, @@ -410,13 +410,13 @@ "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" }, "personalLock": { - "name": "_tmp_.autorest.4851.927557838924.personal-lock", + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", "options": { - "port": 20611, - "host": "2130765619", + "port": 46470, + "host": "2130729362", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4851.927557838924.personal-lock:20611" + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" }, "file": "/tmp/_tmp_.autorest.lock" }, @@ -495,13 +495,166 @@ "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" }, "personalLock": { - "name": "_tmp_.autorest.4851.927557838924.personal-lock", + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", "options": { - "port": 20611, - "host": "2130765619", + "port": 46470, + "host": "2130729362", "exclusive": true }, - "pipe": "/tmp/pipe__tmp_.autorest.4851.927557838924.personal-lock:20611" + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" + }, + "file": "/tmp/_tmp_.autorest.lock" + }, + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/tmp/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/classic-openapi-validator", + "version": "1.0.10", + "dependencies": { + "dotnet-2.0.0": "^1.1.0" + }, + "optionalDependencies": {}, + "devDependencies": { + "dotnet-sdk-2.0.0": "^1.1.1" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator", + "_integrity": null, + "_shasum": "473760d3ca5ca1dbf65a735b311622e5f47e6059", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/classic-openapi-validator@1.0.10", + "_from": "file:/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator", + "_requested": { + "type": "directory", + "where": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator", + "raw": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator", + "rawSpec": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator", + "saveSpec": "file:/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator", + "fetchSpec": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator" + }, + "_spec": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator", + "_where": "/tmp/.autorest/@microsoft.azure_classic-openapi-validator@1.0.10/node_modules/@microsoft.azure/classic-openapi-validator" + }, + "extensionManager": { + "installationPath": "/tmp/.autorest", + "sharedLock": { + "name": "/tmp/.autorest", + "exclusiveLock": { + "name": "_tmp_.autorest.exclusive-lock", + "options": { + "port": 5245, + "host": "2130716018", + "exclusive": true + }, + "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + }, + "busyLock": { + "name": "_tmp_.autorest.busy-lock", + "options": { + "port": 46071, + "host": "2130735832", + "exclusive": true + }, + "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + }, + "personalLock": { + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", + "options": { + "port": 46470, + "host": "2130729362", + "exclusive": true + }, + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" + }, + "file": "/tmp/_tmp_.autorest.lock" + }, + "dotnetPath": "/root/.dotnet" + }, + "installationPath": "/tmp/.autorest" + }, + { + "resolvedInfo": null, + "packageMetadata": { + "name": "@microsoft.azure/openapi-validator", + "version": "1.0.2", + "dependencies": { + "fs": "^0.0.1-security", + "js-yaml": "^3.8.4", + "jsonpath": "^0.2.11", + "vscode-jsonrpc": "^3.2.0" + }, + "optionalDependencies": {}, + "devDependencies": { + "@types/js-yaml": "^3.5.30", + "@types/jsonpath": "^0.1.29", + "@types/node": "^7.0.18", + "gulp": "3.9.1", + "gulp-clean": "0.3.2", + "gulp-dotnet-cli": "0.4.0", + "gulp-mocha": "4.3.1", + "gulp-run": "1.7.1", + "mocha": "3.2.0", + "mocha-typescript": "1.0.22", + "typescript": "2.3.3" + }, + "bundleDependencies": false, + "peerDependencies": {}, + "deprecated": false, + "_resolved": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", + "_integrity": null, + "_shasum": "352190e6dbb4a1d16587b39e589b9615d6e4aaaf", + "_shrinkwrap": null, + "bin": null, + "_id": "@microsoft.azure/openapi-validator@1.0.2", + "_from": "file:/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", + "_requested": { + "type": "directory", + "where": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", + "raw": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", + "rawSpec": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", + "saveSpec": "file:/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", + "fetchSpec": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator" + }, + "_spec": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator", + "_where": "/tmp/.autorest/@microsoft.azure_openapi-validator@1.0.2/node_modules/@microsoft.azure/openapi-validator" + }, + "extensionManager": { + "installationPath": "/tmp/.autorest", + "sharedLock": { + "name": "/tmp/.autorest", + "exclusiveLock": { + "name": "_tmp_.autorest.exclusive-lock", + "options": { + "port": 5245, + "host": "2130716018", + "exclusive": true + }, + "pipe": "/tmp/pipe__tmp_.autorest.exclusive-lock:5245" + }, + "busyLock": { + "name": "_tmp_.autorest.busy-lock", + "options": { + "port": 46071, + "host": "2130735832", + "exclusive": true + }, + "pipe": "/tmp/pipe__tmp_.autorest.busy-lock:46071" + }, + "personalLock": { + "name": "_tmp_.autorest.2664.3299708711797.personal-lock", + "options": { + "port": 46470, + "host": "2130729362", + "exclusive": true + }, + "pipe": "/tmp/pipe__tmp_.autorest.2664.3299708711797.personal-lock:46470" }, "file": "/tmp/_tmp_.autorest.lock" },