From 42a0feb4dae7a7df37eb62aeb9c0d1daf885ccf1 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 29 Aug 2018 20:30:58 +0000 Subject: [PATCH 1/3] Generated from bdb271f9fc7fa148176e6470e7e5b27cc2450c73 Changes for ManagedInstanceEncryptionProtectors --- .../azure/mgmt/sql/models/__init__.py | 10 + .../managed_instance_encryption_protector.py | 71 ++++ ...ged_instance_encryption_protector_paged.py | 27 ++ ...naged_instance_encryption_protector_py3.py | 71 ++++ .../mgmt/sql/models/managed_instance_key.py | 72 ++++ .../sql/models/managed_instance_key_paged.py | 27 ++ .../sql/models/managed_instance_key_py3.py | 72 ++++ .../azure/mgmt/sql/operations/__init__.py | 4 + ...stance_encryption_protectors_operations.py | 292 +++++++++++++ .../managed_instance_keys_operations.py | 386 ++++++++++++++++++ .../azure/mgmt/sql/sql_management_client.py | 10 + 11 files changed, 1042 insertions(+) create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 921235f71ce5..f433597e9952 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -150,6 +150,8 @@ from .instance_failover_group_py3 import InstanceFailoverGroup from .backup_short_term_retention_policy_py3 import BackupShortTermRetentionPolicy from .tde_certificate_py3 import TdeCertificate + from .managed_instance_key_py3 import ManagedInstanceKey + from .managed_instance_encryption_protector_py3 import ManagedInstanceEncryptionProtector except (SyntaxError, ImportError): from .recoverable_database import RecoverableDatabase from .restorable_dropped_database import RestorableDroppedDatabase @@ -291,6 +293,8 @@ from .instance_failover_group import InstanceFailoverGroup from .backup_short_term_retention_policy import BackupShortTermRetentionPolicy from .tde_certificate import TdeCertificate + from .managed_instance_key import ManagedInstanceKey + from .managed_instance_encryption_protector import ManagedInstanceEncryptionProtector from .recoverable_database_paged import RecoverableDatabasePaged from .restorable_dropped_database_paged import RestorableDroppedDatabasePaged from .server_paged import ServerPaged @@ -344,6 +348,8 @@ from .vulnerability_assessment_scan_record_paged import VulnerabilityAssessmentScanRecordPaged from .instance_failover_group_paged import InstanceFailoverGroupPaged from .backup_short_term_retention_policy_paged import BackupShortTermRetentionPolicyPaged +from .managed_instance_key_paged import ManagedInstanceKeyPaged +from .managed_instance_encryption_protector_paged import ManagedInstanceEncryptionProtectorPaged from .sql_management_client_enums import ( CheckNameAvailabilityReason, ServerConnectionType, @@ -565,6 +571,8 @@ 'InstanceFailoverGroup', 'BackupShortTermRetentionPolicy', 'TdeCertificate', + 'ManagedInstanceKey', + 'ManagedInstanceEncryptionProtector', 'RecoverableDatabasePaged', 'RestorableDroppedDatabasePaged', 'ServerPaged', @@ -618,6 +626,8 @@ 'VulnerabilityAssessmentScanRecordPaged', 'InstanceFailoverGroupPaged', 'BackupShortTermRetentionPolicyPaged', + 'ManagedInstanceKeyPaged', + 'ManagedInstanceEncryptionProtectorPaged', 'CheckNameAvailabilityReason', 'ServerConnectionType', 'SecurityAlertPolicyState', diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector.py new file mode 100644 index 000000000000..87ffcbf35af7 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector.py @@ -0,0 +1,71 @@ +# 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 .proxy_resource import ProxyResource + + +class ManagedInstanceEncryptionProtector(ProxyResource): + """The managed instance encryption protector. + + 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: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar kind: Kind of encryption protector. This is metadata used for the + Azure portal experience. + :vartype kind: str + :param server_key_name: The name of the managed instance key. + :type server_key_name: str + :param server_key_type: Required. The encryption protector type like + 'ServiceManaged', 'AzureKeyVault'. Possible values include: + 'ServiceManaged', 'AzureKeyVault' + :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :ivar uri: The URI of the server key. + :vartype uri: str + :ivar thumbprint: Thumbprint of the server key. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'server_key_type': {'required': True}, + 'uri': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'server_key_name': {'key': 'properties.serverKeyName', 'type': 'str'}, + 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedInstanceEncryptionProtector, self).__init__(**kwargs) + self.kind = None + self.server_key_name = kwargs.get('server_key_name', None) + self.server_key_type = kwargs.get('server_key_type', None) + self.uri = None + self.thumbprint = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_paged.py new file mode 100644 index 000000000000..39ba69c33e17 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_paged.py @@ -0,0 +1,27 @@ +# 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 ManagedInstanceEncryptionProtectorPaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedInstanceEncryptionProtector ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedInstanceEncryptionProtector]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstanceEncryptionProtectorPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_py3.py new file mode 100644 index 000000000000..4d45efcf8c5d --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_encryption_protector_py3.py @@ -0,0 +1,71 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class ManagedInstanceEncryptionProtector(ProxyResource): + """The managed instance encryption protector. + + 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: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar kind: Kind of encryption protector. This is metadata used for the + Azure portal experience. + :vartype kind: str + :param server_key_name: The name of the managed instance key. + :type server_key_name: str + :param server_key_type: Required. The encryption protector type like + 'ServiceManaged', 'AzureKeyVault'. Possible values include: + 'ServiceManaged', 'AzureKeyVault' + :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :ivar uri: The URI of the server key. + :vartype uri: str + :ivar thumbprint: Thumbprint of the server key. + :vartype thumbprint: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'server_key_type': {'required': True}, + 'uri': {'readonly': True}, + 'thumbprint': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'server_key_name': {'key': 'properties.serverKeyName', 'type': 'str'}, + 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + } + + def __init__(self, *, server_key_type, server_key_name: str=None, **kwargs) -> None: + super(ManagedInstanceEncryptionProtector, self).__init__(**kwargs) + self.kind = None + self.server_key_name = server_key_name + self.server_key_type = server_key_type + self.uri = None + self.thumbprint = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key.py new file mode 100644 index 000000000000..5a7ee9724f96 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key.py @@ -0,0 +1,72 @@ +# 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 .proxy_resource import ProxyResource + + +class ManagedInstanceKey(ProxyResource): + """A managed instance key. + + 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: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar kind: Kind of encryption protector. This is metadata used for the + Azure portal experience. + :vartype kind: str + :param server_key_type: Required. The key type like 'ServiceManaged', + 'AzureKeyVault'. Possible values include: 'ServiceManaged', + 'AzureKeyVault' + :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :param uri: The URI of the key. If the ServerKeyType is AzureKeyVault, + then the URI is required. + :type uri: str + :ivar thumbprint: Thumbprint of the key. + :vartype thumbprint: str + :ivar creation_date: The key creation date. + :vartype creation_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'server_key_type': {'required': True}, + 'thumbprint': {'readonly': True}, + 'creation_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ManagedInstanceKey, self).__init__(**kwargs) + self.kind = None + self.server_key_type = kwargs.get('server_key_type', None) + self.uri = kwargs.get('uri', None) + self.thumbprint = None + self.creation_date = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_paged.py new file mode 100644 index 000000000000..8c730f73a383 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_paged.py @@ -0,0 +1,27 @@ +# 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 ManagedInstanceKeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedInstanceKey ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedInstanceKey]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstanceKeyPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_py3.py new file mode 100644 index 000000000000..f00bafa838f2 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_key_py3.py @@ -0,0 +1,72 @@ +# 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 .proxy_resource_py3 import ProxyResource + + +class ManagedInstanceKey(ProxyResource): + """A managed instance key. + + 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: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar kind: Kind of encryption protector. This is metadata used for the + Azure portal experience. + :vartype kind: str + :param server_key_type: Required. The key type like 'ServiceManaged', + 'AzureKeyVault'. Possible values include: 'ServiceManaged', + 'AzureKeyVault' + :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :param uri: The URI of the key. If the ServerKeyType is AzureKeyVault, + then the URI is required. + :type uri: str + :ivar thumbprint: Thumbprint of the key. + :vartype thumbprint: str + :ivar creation_date: The key creation date. + :vartype creation_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'server_key_type': {'required': True}, + 'thumbprint': {'readonly': True}, + 'creation_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, + 'uri': {'key': 'properties.uri', 'type': 'str'}, + 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + } + + def __init__(self, *, server_key_type, uri: str=None, **kwargs) -> None: + super(ManagedInstanceKey, self).__init__(**kwargs) + self.kind = None + self.server_key_type = server_key_type + self.uri = uri + self.thumbprint = None + self.creation_date = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 538af4811eb3..f512225ab333 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -74,6 +74,8 @@ from .backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from .tde_certificates_operations import TdeCertificatesOperations from .managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations +from .managed_instance_keys_operations import ManagedInstanceKeysOperations +from .managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations __all__ = [ 'RecoverableDatabasesOperations', @@ -141,4 +143,6 @@ 'BackupShortTermRetentionPoliciesOperations', 'TdeCertificatesOperations', 'ManagedInstanceTdeCertificatesOperations', + 'ManagedInstanceKeysOperations', + 'ManagedInstanceEncryptionProtectorsOperations', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py new file mode 100644 index 000000000000..5200ef887af0 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py @@ -0,0 +1,292 @@ +# 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 ManagedInstanceEncryptionProtectorsOperations(object): + """ManagedInstanceEncryptionProtectorsOperations 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: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar encryption_protector_name: The name of the encryption protector to be retrieved. Constant value: "current". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01-preview" + self.encryption_protector_name = "current" + + self.config = config + + def list_by_server( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of managed instance encryption protectors. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_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: An iterator like instance of + ManagedInstanceEncryptionProtector + :rtype: + ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtectorPaged[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_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("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.ManagedInstanceEncryptionProtectorPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstanceEncryptionProtectorPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector'} + + def get( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets a managed instance encryption protector. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_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: ManagedInstanceEncryptionProtector or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'encryptionProtectorName': self._serialize.url("self.encryption_protector_name", self.encryption_protector_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ManagedInstanceEncryptionProtector', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}'} + + + def _create_or_update_initial( + self, resource_group_name, managed_instance_name, server_key_type, server_key_name=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ManagedInstanceEncryptionProtector(server_key_name=server_key_name, server_key_type=server_key_type) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'encryptionProtectorName': self._serialize.url("self.encryption_protector_name", self.encryption_protector_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'ManagedInstanceEncryptionProtector') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, 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 + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ManagedInstanceEncryptionProtector', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, managed_instance_name, server_key_type, server_key_name=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an existing encryption protector. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param server_key_type: The encryption protector type like + 'ServiceManaged', 'AzureKeyVault'. Possible values include: + 'ServiceManaged', 'AzureKeyVault' + :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :param server_key_name: The name of the managed instance key. + :type server_key_name: 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 + ManagedInstanceEncryptionProtector or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + server_key_type=server_key_type, + server_key_name=server_key_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ManagedInstanceEncryptionProtector', 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.Sql/managedInstances/{managedInstanceName}/encryptionProtector/{encryptionProtectorName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py new file mode 100644 index 000000000000..b040854b849e --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py @@ -0,0 +1,386 @@ +# 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 ManagedInstanceKeysOperations(object): + """ManagedInstanceKeysOperations 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: The API version to use for the request. Constant value: "2017-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01-preview" + + self.config = config + + def list_by_server( + self, resource_group_name, managed_instance_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of managed instance keys. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: 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: An iterator like instance of ManagedInstanceKey + :rtype: + ~azure.mgmt.sql.models.ManagedInstanceKeyPaged[~azure.mgmt.sql.models.ManagedInstanceKey] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_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 filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + 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['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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.ManagedInstanceKeyPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstanceKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys'} + + def get( + self, resource_group_name, managed_instance_name, key_name, custom_headers=None, raw=False, **operation_config): + """Gets a managed instance key. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be retrieved. + :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: ManagedInstanceKey or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ManagedInstanceKey or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'keyName': self._serialize.url("key_name", key_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, header_parameters) + response = self._client.send(request, 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('ManagedInstanceKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}'} + + + def _create_or_update_initial( + self, resource_group_name, managed_instance_name, key_name, server_key_type, uri=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ManagedInstanceKey(server_key_type=server_key_type, uri=uri) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'keyName': self._serialize.url("key_name", key_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + 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, 'ManagedInstanceKey') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + 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('ManagedInstanceKey', response) + if response.status_code == 201: + deserialized = self._deserialize('ManagedInstanceKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, managed_instance_name, key_name, server_key_type, uri=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a managed instance key. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be operated + on (updated or created). + :type key_name: str + :param server_key_type: The key type like 'ServiceManaged', + 'AzureKeyVault'. Possible values include: 'ServiceManaged', + 'AzureKeyVault' + :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :param uri: The URI of the key. If the ServerKeyType is AzureKeyVault, + then the URI is required. + :type uri: 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 ManagedInstanceKey or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstanceKey] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstanceKey]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + server_key_type=server_key_type, + uri=uri, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ManagedInstanceKey', 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.Sql/managedInstances/{managedInstanceName}/keys/{keyName}'} + + + def _delete_initial( + self, resource_group_name, managed_instance_name, key_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'keyName': self._serialize.url("key_name", key_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("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + 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, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + 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 delete( + self, resource_group_name, managed_instance_name, key_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the managed instance key with the given name. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param key_name: The name of the managed instance key to be deleted. + :type key_name: 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._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + key_name=key_name, + 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys/{keyName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py index b1ff7e733b52..7e9565401e69 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -78,6 +78,8 @@ from .operations.backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from .operations.tde_certificates_operations import TdeCertificatesOperations from .operations.managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations +from .operations.managed_instance_keys_operations import ManagedInstanceKeysOperations +from .operations.managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations from . import models @@ -250,6 +252,10 @@ class SqlManagementClient(SDKClient): :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificates operations :vartype managed_instance_tde_certificates: azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations + :ivar managed_instance_keys: ManagedInstanceKeys operations + :vartype managed_instance_keys: azure.mgmt.sql.operations.ManagedInstanceKeysOperations + :ivar managed_instance_encryption_protectors: ManagedInstanceEncryptionProtectors operations + :vartype managed_instance_encryption_protectors: azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -400,3 +406,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( self._client, self.config, self._serialize, self._deserialize) + self.managed_instance_keys = ManagedInstanceKeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( + self._client, self.config, self._serialize, self._deserialize) From 54f5780ea91d2ccd69d9a844c2b1ff1880578127 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 29 Aug 2018 23:49:59 +0000 Subject: [PATCH 2/3] Generated from 724082f8646ab05191f7eee135fd674fd26d1a94 Changing operation id to ListByInstance as per Jared's recommendation --- .../managed_instance_encryption_protectors_operations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py index 5200ef887af0..61ab8baa5d32 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_encryption_protectors_operations.py @@ -41,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_by_server( + def list_by_instance( self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): """Gets a list of managed instance encryption protectors. @@ -66,7 +66,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_by_server.metadata['url'] + url = self.list_by_instance.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), @@ -112,7 +112,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector'} + list_by_instance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/encryptionProtector'} def get( self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): From 3b825a461b0f67f706564798238f222f86ec1a0b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 30 Aug 2018 22:38:12 +0000 Subject: [PATCH 3/3] Generated from f5321fc054067d1d4e8937cfc92452bf4a6a4950 Addressed comments By @anuchandy - Changed comment to created or updated - changed operation if to listByInstance --- .../mgmt/sql/operations/managed_instance_keys_operations.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py index b040854b849e..adb5c4bfa0f0 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instance_keys_operations.py @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_by_server( + def list_by_instance( self, resource_group_name, managed_instance_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets a list of managed instance keys. @@ -66,7 +66,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = self.list_by_server.metadata['url'] + url = self.list_by_instance.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), @@ -114,7 +114,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys'} + list_by_instance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/keys'} def get( self, resource_group_name, managed_instance_name, key_name, custom_headers=None, raw=False, **operation_config):