diff --git a/azure-mgmt-sql/README.rst b/azure-mgmt-sql/README.rst index be2356da21f0..ba4322ebd16e 100644 --- a/azure-mgmt-sql/README.rst +++ b/azure-mgmt-sql/README.rst @@ -6,7 +6,7 @@ This is the Microsoft Azure SQL Management Client Library. Azure Resource Manager (ARM) is the next generation of management APIs that replace the old Azure Service Management (ASM). -This package has been tested with Python 2.7, 3.4, 3.5 and 3.6. +This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7. For the older Azure Service Management (ASM) libraries, see `azure-servicemanagement-legacy `__ library. diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index f433597e9952..418c82c016ae 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -107,7 +107,6 @@ from .complete_database_restore_definition_py3 import CompleteDatabaseRestoreDefinition from .managed_database_py3 import ManagedDatabase from .managed_database_update_py3 import ManagedDatabaseUpdate - from .sensitivity_label_py3 import SensitivityLabel from .automatic_tuning_server_options_py3 import AutomaticTuningServerOptions from .server_automatic_tuning_py3 import ServerAutomaticTuning from .server_dns_alias_py3 import ServerDnsAlias @@ -250,7 +249,6 @@ from .complete_database_restore_definition import CompleteDatabaseRestoreDefinition from .managed_database import ManagedDatabase from .managed_database_update import ManagedDatabaseUpdate - from .sensitivity_label import SensitivityLabel from .automatic_tuning_server_options import AutomaticTuningServerOptions from .server_automatic_tuning import ServerAutomaticTuning from .server_dns_alias import ServerDnsAlias @@ -340,7 +338,6 @@ from .job_version_paged import JobVersionPaged from .long_term_retention_backup_paged import LongTermRetentionBackupPaged from .managed_database_paged import ManagedDatabasePaged -from .sensitivity_label_paged import SensitivityLabelPaged from .server_dns_alias_paged import ServerDnsAliasPaged from .restore_point_paged import RestorePointPaged from .database_operation_paged import DatabaseOperationPaged @@ -426,7 +423,6 @@ InstanceFailoverGroupReplicationRole, LongTermRetentionDatabaseState, VulnerabilityAssessmentPolicyBaselineName, - SensitivityLabelSource, CapabilityGroup, ) @@ -528,7 +524,6 @@ 'CompleteDatabaseRestoreDefinition', 'ManagedDatabase', 'ManagedDatabaseUpdate', - 'SensitivityLabel', 'AutomaticTuningServerOptions', 'ServerAutomaticTuning', 'ServerDnsAlias', @@ -618,7 +613,6 @@ 'JobVersionPaged', 'LongTermRetentionBackupPaged', 'ManagedDatabasePaged', - 'SensitivityLabelPaged', 'ServerDnsAliasPaged', 'RestorePointPaged', 'DatabaseOperationPaged', @@ -703,6 +697,5 @@ 'InstanceFailoverGroupReplicationRole', 'LongTermRetentionDatabaseState', 'VulnerabilityAssessmentPolicyBaselineName', - 'SensitivityLabelSource', 'CapabilityGroup', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label.py b/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label.py deleted file mode 100644 index 27d34d57c142..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label.py +++ /dev/null @@ -1,50 +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 .proxy_resource import ProxyResource - - -class SensitivityLabel(ProxyResource): - """A sensitivity label. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param label_name: The label name. - :type label_name: str - :param information_type: The information type. - :type information_type: str - """ - - _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'}, - 'label_name': {'key': 'properties.labelName', 'type': 'str'}, - 'information_type': {'key': 'properties.informationType', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SensitivityLabel, self).__init__(**kwargs) - self.label_name = kwargs.get('label_name', None) - self.information_type = kwargs.get('information_type', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_paged.py deleted file mode 100644 index 438bfd86f9be..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_paged.py +++ /dev/null @@ -1,27 +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.paging import Paged - - -class SensitivityLabelPaged(Paged): - """ - A paging container for iterating over a list of :class:`SensitivityLabel ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SensitivityLabel]'} - } - - def __init__(self, *args, **kwargs): - - super(SensitivityLabelPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_py3.py deleted file mode 100644 index adbb7a203e1a..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_py3.py +++ /dev/null @@ -1,50 +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 .proxy_resource_py3 import ProxyResource - - -class SensitivityLabel(ProxyResource): - """A sensitivity label. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param label_name: The label name. - :type label_name: str - :param information_type: The information type. - :type information_type: str - """ - - _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'}, - 'label_name': {'key': 'properties.labelName', 'type': 'str'}, - 'information_type': {'key': 'properties.informationType', 'type': 'str'}, - } - - def __init__(self, *, label_name: str=None, information_type: str=None, **kwargs) -> None: - super(SensitivityLabel, self).__init__(**kwargs) - self.label_name = label_name - self.information_type = information_type diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index 325c2d06c5da..90b01d122079 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -663,12 +663,6 @@ class VulnerabilityAssessmentPolicyBaselineName(str, Enum): default = "default" -class SensitivityLabelSource(str, Enum): - - current = "current" - recommended = "recommended" - - class CapabilityGroup(str, Enum): supported_editions = "supportedEditions" diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index f512225ab333..cdc84cd45c56 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -61,7 +61,6 @@ from .long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations from .managed_databases_operations import ManagedDatabasesOperations -from .sensitivity_labels_operations import SensitivityLabelsOperations from .server_automatic_tuning_operations import ServerAutomaticTuningOperations from .server_dns_aliases_operations import ServerDnsAliasesOperations from .server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations @@ -130,7 +129,6 @@ 'LongTermRetentionBackupsOperations', 'BackupLongTermRetentionPoliciesOperations', 'ManagedDatabasesOperations', - 'SensitivityLabelsOperations', 'ServerAutomaticTuningOperations', 'ServerDnsAliasesOperations', 'ServerSecurityAlertPoliciesOperations', diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/sensitivity_labels_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/sensitivity_labels_operations.py deleted file mode 100644 index a17299fb19d0..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/sensitivity_labels_operations.py +++ /dev/null @@ -1,444 +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. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class SensitivityLabelsOperations(object): - """SensitivityLabelsOperations 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-03-01-preview". - :ivar sensitivity_label_source: The source of the sensitivity label. 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-03-01-preview" - self.sensitivity_label_source = "current" - - self.config = config - - def list_by_database( - self, resource_group_name, server_name, database_name, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets the sensitivity labels of a given database. - - :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 server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_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 SensitivityLabel - :rtype: - ~azure.mgmt.sql.models.SensitivityLabelPaged[~azure.mgmt.sql.models.SensitivityLabel] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_database.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_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.SensitivityLabelPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SensitivityLabelPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels'} - - def list_by_database_with_source( - self, resource_group_name, server_name, database_name, sensitivity_label_source, filter=None, custom_headers=None, raw=False, **operation_config): - """Gets the sensitivity labels of a given database. - - :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 server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param sensitivity_label_source: Optional source of the sensitivity - label. Valid values are current or recommeneded. In not specified both - returned. Possible values include: 'current', 'recommended' - :type sensitivity_label_source: str or - ~azure.mgmt.sql.models.SensitivityLabelSource - :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 SensitivityLabel - :rtype: - ~azure.mgmt.sql.models.SensitivityLabelPaged[~azure.mgmt.sql.models.SensitivityLabel] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_database_with_source.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'sensitivityLabelSource': self._serialize.url("sensitivity_label_source", sensitivity_label_source, 'SensitivityLabelSource'), - '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.SensitivityLabelPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.SensitivityLabelPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_database_with_source.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels/{sensitivityLabelSource}'} - - def get( - self, resource_group_name, server_name, database_name, schema_name, table_name, column_name, sensitivity_label_source, custom_headers=None, raw=False, **operation_config): - """Gets the sensitivity label of a given column. - - :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 server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param schema_name: The name of the schema. - :type schema_name: str - :param table_name: The name of the table. - :type table_name: str - :param column_name: The name of the column. - :type column_name: str - :param sensitivity_label_source: The source of the sensitivity label. - Possible values include: 'current', 'recommended' - :type sensitivity_label_source: str or - ~azure.mgmt.sql.models.SensitivityLabelSource - :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: SensitivityLabel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.SensitivityLabel 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'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), - 'tableName': self._serialize.url("table_name", table_name, 'str'), - 'columnName': self._serialize.url("column_name", column_name, 'str'), - 'sensitivityLabelSource': self._serialize.url("sensitivity_label_source", sensitivity_label_source, 'SensitivityLabelSource'), - '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('SensitivityLabel', 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/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'} - - def create_or_update( - self, resource_group_name, server_name, database_name, schema_name, table_name, column_name, label_name=None, information_type=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates the sensitivity label of a given column. - - :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 server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param schema_name: The name of the schema. - :type schema_name: str - :param table_name: The name of the table. - :type table_name: str - :param column_name: The name of the column. - :type column_name: str - :param label_name: The label name. - :type label_name: str - :param information_type: The information type. - :type information_type: 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: SensitivityLabel or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.SensitivityLabel or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - parameters = models.SensitivityLabel(label_name=label_name, information_type=information_type) - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), - 'tableName': self._serialize.url("table_name", table_name, 'str'), - 'columnName': self._serialize.url("column_name", column_name, 'str'), - 'sensitivityLabelSource': self._serialize.url("self.sensitivity_label_source", self.sensitivity_label_source, '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, 'SensitivityLabel') - - # 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]: - 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('SensitivityLabel', response) - if response.status_code == 201: - deserialized = self._deserialize('SensitivityLabel', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'} - - def delete( - self, resource_group_name, server_name, database_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): - """Deletes the sensitivity label of a given column. - - :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 server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param schema_name: The name of the schema. - :type schema_name: str - :param table_name: The name of the table. - :type table_name: str - :param column_name: The name of the column. - :type column_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` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), - 'tableName': self._serialize.url("table_name", table_name, 'str'), - 'columnName': self._serialize.url("column_name", column_name, 'str'), - 'sensitivityLabelSource': self._serialize.url("self.sensitivity_label_source", self.sensitivity_label_source, '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]: - 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.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'} 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 7e9565401e69..d96e32c1ebaa 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -65,7 +65,6 @@ from .operations.long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .operations.backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations from .operations.managed_databases_operations import ManagedDatabasesOperations -from .operations.sensitivity_labels_operations import SensitivityLabelsOperations from .operations.server_automatic_tuning_operations import ServerAutomaticTuningOperations from .operations.server_dns_aliases_operations import ServerDnsAliasesOperations from .operations.server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations @@ -226,8 +225,6 @@ class SqlManagementClient(SDKClient): :vartype backup_long_term_retention_policies: azure.mgmt.sql.operations.BackupLongTermRetentionPoliciesOperations :ivar managed_databases: ManagedDatabases operations :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations - :ivar sensitivity_labels: SensitivityLabels operations - :vartype sensitivity_labels: azure.mgmt.sql.operations.SensitivityLabelsOperations :ivar server_automatic_tuning: ServerAutomaticTuning operations :vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations :ivar server_dns_aliases: ServerDnsAliases operations @@ -380,8 +377,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.managed_databases = ManagedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.sensitivity_labels = SensitivityLabelsOperations( - self._client, self.config, self._serialize, self._deserialize) self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self.config, self._serialize, self._deserialize) self.server_dns_aliases = ServerDnsAliasesOperations( diff --git a/azure-mgmt-sql/setup.py b/azure-mgmt-sql/setup.py index c4492c11a4a0..bf699f63001d 100644 --- a/azure-mgmt-sql/setup.py +++ b/azure-mgmt-sql/setup.py @@ -72,12 +72,14 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', 'License :: OSI Approved :: MIT License', ], zip_safe=False, packages=find_packages(exclude=["tests"]), install_requires=[ - 'msrestazure>=0.4.27,<2.0.0', + 'msrest>=0.5.0', + 'msrestazure>=0.4.32,<2.0.0', 'azure-common~=1.1', ], cmdclass=cmdclass