diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 0a543180d7e4..837322623c9c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -161,6 +161,8 @@ from .recoverable_managed_database_py3 import RecoverableManagedDatabase from .managed_instance_vulnerability_assessment_py3 import ManagedInstanceVulnerabilityAssessment from .server_vulnerability_assessment_py3 import ServerVulnerabilityAssessment + from .instance_pool_py3 import InstancePool + from .instance_pool_update_py3 import InstancePoolUpdate except (SyntaxError, ImportError): from .recoverable_database import RecoverableDatabase from .restorable_dropped_database import RestorableDroppedDatabase @@ -313,6 +315,8 @@ from .recoverable_managed_database import RecoverableManagedDatabase from .managed_instance_vulnerability_assessment import ManagedInstanceVulnerabilityAssessment from .server_vulnerability_assessment import ServerVulnerabilityAssessment + from .instance_pool import InstancePool + from .instance_pool_update import InstancePoolUpdate from .recoverable_database_paged import RecoverableDatabasePaged from .restorable_dropped_database_paged import RestorableDroppedDatabasePaged from .server_paged import ServerPaged @@ -378,6 +382,7 @@ from .recoverable_managed_database_paged import RecoverableManagedDatabasePaged from .managed_instance_vulnerability_assessment_paged import ManagedInstanceVulnerabilityAssessmentPaged from .server_vulnerability_assessment_paged import ServerVulnerabilityAssessmentPaged +from .instance_pool_paged import InstancePoolPaged from .sql_management_client_enums import ( CheckNameAvailabilityReason, ServerConnectionType, @@ -412,6 +417,8 @@ ReadOnlyEndpointFailoverPolicy, FailoverGroupReplicationRole, IdentityType, + ManagedServerCreateMode, + ManagedInstanceLicenseType, ManagedInstanceProxyOverride, OperationOrigin, SyncAgentState, @@ -453,6 +460,7 @@ VulnerabilityAssessmentScanTriggerType, VulnerabilityAssessmentScanState, InstanceFailoverGroupReplicationRole, + InstancePoolLicenseType, LongTermRetentionDatabaseState, VulnerabilityAssessmentPolicyBaselineName, SensitivityLabelSource, @@ -611,6 +619,8 @@ 'RecoverableManagedDatabase', 'ManagedInstanceVulnerabilityAssessment', 'ServerVulnerabilityAssessment', + 'InstancePool', + 'InstancePoolUpdate', 'RecoverableDatabasePaged', 'RestorableDroppedDatabasePaged', 'ServerPaged', @@ -676,6 +686,7 @@ 'RecoverableManagedDatabasePaged', 'ManagedInstanceVulnerabilityAssessmentPaged', 'ServerVulnerabilityAssessmentPaged', + 'InstancePoolPaged', 'CheckNameAvailabilityReason', 'ServerConnectionType', 'SecurityAlertPolicyState', @@ -709,6 +720,8 @@ 'ReadOnlyEndpointFailoverPolicy', 'FailoverGroupReplicationRole', 'IdentityType', + 'ManagedServerCreateMode', + 'ManagedInstanceLicenseType', 'ManagedInstanceProxyOverride', 'OperationOrigin', 'SyncAgentState', @@ -750,6 +763,7 @@ 'VulnerabilityAssessmentScanTriggerType', 'VulnerabilityAssessmentScanState', 'InstanceFailoverGroupReplicationRole', + 'InstancePoolLicenseType', 'LongTermRetentionDatabaseState', 'VulnerabilityAssessmentPolicyBaselineName', 'SensitivityLabelSource', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database.py index f3f66d024a7a..0cd833b70f46 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database.py @@ -30,7 +30,17 @@ class Database(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param sku: The name and tier of the SKU. + :param sku: The database SKU. + The list of SKUs may vary by region and support offer. To determine the + SKUs (including the SKU name, tier/edition, family, and capacity) that are + available to your subscription in an Azure region, use the + `Capabilities_ListByLocation` REST API or one of the following commands: + ```azurecli + az sql db list-editions -l -o table + ```` + ```powershell + Get-AzSqlServerServiceObjective -Location + ```` :type sku: ~azure.mgmt.sql.models.Sku :ivar kind: Kind of database. This is metadata used for the Azure portal experience. @@ -85,7 +95,8 @@ class Database(TrackedResource): 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling' + 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', + 'OnlineChangingDwPerformanceTiers' :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -146,6 +157,12 @@ class Database(TrackedResource): :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :ivar current_sku: The name and tier of the SKU. :vartype current_sku: ~azure.mgmt.sql.models.Sku + :param auto_pause_delay: Time in minutes after which database is + automatically paused. A value of -1 means that automatic pause is disabled + :type auto_pause_delay: int + :param min_capacity: Minimal capacity that database will always have + allocated, if not paused + :type min_capacity: float """ _validation = { @@ -202,6 +219,8 @@ class Database(TrackedResource): 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, + 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, + 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, } def __init__(self, **kwargs): @@ -235,3 +254,5 @@ def __init__(self, **kwargs): self.earliest_restore_date = None self.read_scale = kwargs.get('read_scale', None) self.current_sku = None + self.auto_pause_delay = kwargs.get('auto_pause_delay', None) + self.min_capacity = kwargs.get('min_capacity', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py index 9cfb4d07a7e6..5c4f3f5868d8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_py3.py @@ -30,7 +30,17 @@ class Database(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param sku: The name and tier of the SKU. + :param sku: The database SKU. + The list of SKUs may vary by region and support offer. To determine the + SKUs (including the SKU name, tier/edition, family, and capacity) that are + available to your subscription in an Azure region, use the + `Capabilities_ListByLocation` REST API or one of the following commands: + ```azurecli + az sql db list-editions -l -o table + ```` + ```powershell + Get-AzSqlServerServiceObjective -Location + ```` :type sku: ~azure.mgmt.sql.models.Sku :ivar kind: Kind of database. This is metadata used for the Azure portal experience. @@ -85,7 +95,8 @@ class Database(TrackedResource): 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling' + 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', + 'OnlineChangingDwPerformanceTiers' :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -146,6 +157,12 @@ class Database(TrackedResource): :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :ivar current_sku: The name and tier of the SKU. :vartype current_sku: ~azure.mgmt.sql.models.Sku + :param auto_pause_delay: Time in minutes after which database is + automatically paused. A value of -1 means that automatic pause is disabled + :type auto_pause_delay: int + :param min_capacity: Minimal capacity that database will always have + allocated, if not paused + :type min_capacity: float """ _validation = { @@ -202,9 +219,11 @@ class Database(TrackedResource): 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, + 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, + 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, } - def __init__(self, *, location: str, tags=None, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, auto_pause_delay: int=None, min_capacity: float=None, **kwargs) -> None: super(Database, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.kind = None @@ -235,3 +254,5 @@ def __init__(self, *, location: str, tags=None, sku=None, create_mode=None, coll self.earliest_restore_date = None self.read_scale = read_scale self.current_sku = None + self.auto_pause_delay = auto_pause_delay + self.min_capacity = min_capacity diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update.py index d4d4cbdf4270..3d9d701da6ca 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update.py @@ -68,7 +68,8 @@ class DatabaseUpdate(Model): 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling' + 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', + 'OnlineChangingDwPerformanceTiers' :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -129,6 +130,12 @@ class DatabaseUpdate(Model): :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :ivar current_sku: The name and tier of the SKU. :vartype current_sku: ~azure.mgmt.sql.models.Sku + :param auto_pause_delay: Time in minutes after which database is + automatically paused. A value of -1 means that automatic pause is disabled + :type auto_pause_delay: int + :param min_capacity: Minimal capacity that database will always have + allocated, if not paused + :type min_capacity: float :param tags: Resource tags. :type tags: dict[str, str] """ @@ -174,6 +181,8 @@ class DatabaseUpdate(Model): 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, + 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, + 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -206,4 +215,6 @@ def __init__(self, **kwargs): self.earliest_restore_date = None self.read_scale = kwargs.get('read_scale', None) self.current_sku = None + self.auto_pause_delay = kwargs.get('auto_pause_delay', None) + self.min_capacity = kwargs.get('min_capacity', None) self.tags = kwargs.get('tags', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update_py3.py index 5a9a6f3b742d..080a1d783c1d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/database_update_py3.py @@ -68,7 +68,8 @@ class DatabaseUpdate(Model): 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling' + 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', + 'OnlineChangingDwPerformanceTiers' :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -129,6 +130,12 @@ class DatabaseUpdate(Model): :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale :ivar current_sku: The name and tier of the SKU. :vartype current_sku: ~azure.mgmt.sql.models.Sku + :param auto_pause_delay: Time in minutes after which database is + automatically paused. A value of -1 means that automatic pause is disabled + :type auto_pause_delay: int + :param min_capacity: Minimal capacity that database will always have + allocated, if not paused + :type min_capacity: float :param tags: Resource tags. :type tags: dict[str, str] """ @@ -174,10 +181,12 @@ class DatabaseUpdate(Model): 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, + 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, + 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, auto_pause_delay: int=None, min_capacity: float=None, tags=None, **kwargs) -> None: super(DatabaseUpdate, self).__init__(**kwargs) self.sku = sku self.create_mode = create_mode @@ -206,4 +215,6 @@ def __init__(self, *, sku=None, create_mode=None, collation: str=None, max_size_ self.earliest_restore_date = None self.read_scale = read_scale self.current_sku = None + self.auto_pause_delay = auto_pause_delay + self.min_capacity = min_capacity self.tags = tags diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py index 10a28ea0f6e3..34926d4a176e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool.py @@ -30,7 +30,14 @@ class ElasticPool(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param sku: + :param sku: The elastic pool SKU. + The list of SKUs may vary by region and support offer. To determine the + SKUs (including the SKU name, tier/edition, family, and capacity) that are + available to your subscription in an Azure region, use the + `Capabilities_ListByLocation` REST API or the following command: + ```azurecli + az sql elastic-pool list-editions -l -o table + ```` :type sku: ~azure.mgmt.sql.models.Sku :ivar kind: Kind of elastic pool. This is metadata used for the Azure portal experience. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py index eb092529ac3b..d487ba2c7e28 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_py3.py @@ -30,7 +30,14 @@ class ElasticPool(TrackedResource): :type location: str :param tags: Resource tags. :type tags: dict[str, str] - :param sku: + :param sku: The elastic pool SKU. + The list of SKUs may vary by region and support offer. To determine the + SKUs (including the SKU name, tier/edition, family, and capacity) that are + available to your subscription in an Azure region, use the + `Capabilities_ListByLocation` REST API or the following command: + ```azurecli + az sql elastic-pool list-editions -l -o table + ```` :type sku: ~azure.mgmt.sql.models.Sku :ivar kind: Kind of elastic pool. This is metadata used for the Azure portal experience. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request.py index a1683ffad9b4..b5598c478e76 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request.py @@ -37,9 +37,19 @@ class ImportRequest(ExportRequest): :param database_name: Required. The name of the database to import. :type database_name: str :param edition: Required. The edition for the database being created. - Possible values include: 'Web', 'Business', 'Basic', 'Standard', + The list of SKUs may vary by region and support offer. To determine the + SKUs (including the SKU name, tier/edition, family, and capacity) that are + available to your subscription in an Azure region, use the + `Capabilities_ListByLocation` REST API or one of the following commands: + ```azurecli + az sql db list-editions -l -o table + ```` + ```powershell + Get-AzSqlServerServiceObjective -Location + ```` + . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - 'System2' + 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' :type edition: str or ~azure.mgmt.sql.models.DatabaseEdition :param service_objective_name: Required. The name of the service objective to assign to the database. Possible values include: 'System', 'System0', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py index 68b97ae814a3..915db6297521 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/import_request_py3.py @@ -37,9 +37,19 @@ class ImportRequest(ExportRequest): :param database_name: Required. The name of the database to import. :type database_name: str :param edition: Required. The edition for the database being created. - Possible values include: 'Web', 'Business', 'Basic', 'Standard', + The list of SKUs may vary by region and support offer. To determine the + SKUs (including the SKU name, tier/edition, family, and capacity) that are + available to your subscription in an Azure region, use the + `Capabilities_ListByLocation` REST API or one of the following commands: + ```azurecli + az sql db list-editions -l -o table + ```` + ```powershell + Get-AzSqlServerServiceObjective -Location + ```` + . Possible values include: 'Web', 'Business', 'Basic', 'Standard', 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - 'System2' + 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' :type edition: str or ~azure.mgmt.sql.models.DatabaseEdition :param service_objective_name: Required. The name of the service objective to assign to the database. Possible values include: 'System', 'System0', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool.py new file mode 100644 index 000000000000..0171e141ba13 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool.py @@ -0,0 +1,74 @@ +# 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 .tracked_resource import TrackedResource + + +class InstancePool(TrackedResource): + """An Azure SQL instance pool. + + 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 + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The name and tier of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku + :param subnet_id: Required. Resource ID of the subnet to place this + instance pool in. + :type subnet_id: str + :param v_cores: Required. Count of vCores belonging to this instance pool. + :type v_cores: int + :param license_type: Required. The license type. Possible values are + 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' + (without SQL license price). Possible values include: 'LicenseIncluded', + 'BasePrice' + :type license_type: str or ~azure.mgmt.sql.models.InstancePoolLicenseType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'subnet_id': {'required': True}, + 'v_cores': {'required': True}, + 'license_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InstancePool, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.v_cores = kwargs.get('v_cores', None) + self.license_type = kwargs.get('license_type', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_paged.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_paged.py new file mode 100644 index 000000000000..e58684226691 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_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 InstancePoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`InstancePool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[InstancePool]'} + } + + def __init__(self, *args, **kwargs): + + super(InstancePoolPaged, self).__init__(*args, **kwargs) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_py3.py new file mode 100644 index 000000000000..9e211f8c118f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_py3.py @@ -0,0 +1,74 @@ +# 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 .tracked_resource_py3 import TrackedResource + + +class InstancePool(TrackedResource): + """An Azure SQL instance pool. + + 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 + :param location: Required. Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param sku: The name and tier of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku + :param subnet_id: Required. Resource ID of the subnet to place this + instance pool in. + :type subnet_id: str + :param v_cores: Required. Count of vCores belonging to this instance pool. + :type v_cores: int + :param license_type: Required. The license type. Possible values are + 'LicenseIncluded' (price for SQL license is included) and 'BasePrice' + (without SQL license price). Possible values include: 'LicenseIncluded', + 'BasePrice' + :type license_type: str or ~azure.mgmt.sql.models.InstancePoolLicenseType + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'subnet_id': {'required': True}, + 'v_cores': {'required': True}, + 'license_type': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + } + + def __init__(self, *, location: str, subnet_id: str, v_cores: int, license_type, tags=None, sku=None, **kwargs) -> None: + super(InstancePool, self).__init__(location=location, tags=tags, **kwargs) + self.sku = sku + self.subnet_id = subnet_id + self.v_cores = v_cores + self.license_type = license_type diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_update.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_update.py new file mode 100644 index 000000000000..39bf79911fd6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_update.py @@ -0,0 +1,28 @@ +# 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 InstancePoolUpdate(Model): + """An update to an Instance pool. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(InstancePoolUpdate, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_update_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_update_py3.py new file mode 100644 index 000000000000..4b4c8c3dd908 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/instance_pool_update_py3.py @@ -0,0 +1,28 @@ +# 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 InstancePoolUpdate(Model): + """An update to an Instance pool. + + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, tags=None, **kwargs) -> None: + super(InstancePoolUpdate, self).__init__(**kwargs) + self.tags = tags diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py index cf680e0ddac0..309df9ce615a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py @@ -33,8 +33,17 @@ class ManagedInstance(TrackedResource): :param identity: The Azure Active Directory identity of the managed instance. :type identity: ~azure.mgmt.sql.models.ResourceIdentity - :param sku: Managed instance sku + :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, + GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -50,11 +59,16 @@ class ManagedInstance(TrackedResource): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -66,6 +80,12 @@ class ManagedInstance(TrackedResource): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime :param proxy_override: Connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default' :type proxy_override: str or @@ -83,6 +103,9 @@ class ManagedInstance(TrackedResource): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str """ _validation = { @@ -103,6 +126,7 @@ class ManagedInstance(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -115,14 +139,18 @@ class ManagedInstance(TrackedResource): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, } def __init__(self, **kwargs): super(ManagedInstance, self).__init__(**kwargs) self.identity = kwargs.get('identity', None) self.sku = kwargs.get('sku', None) + self.managed_instance_create_mode = kwargs.get('managed_instance_create_mode', None) self.fully_qualified_domain_name = None self.administrator_login = kwargs.get('administrator_login', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) @@ -135,5 +163,8 @@ def __init__(self, **kwargs): self.dns_zone = None self.dns_zone_partner = kwargs.get('dns_zone_partner', None) self.public_data_endpoint_enabled = kwargs.get('public_data_endpoint_enabled', None) + self.source_managed_instance_id = kwargs.get('source_managed_instance_id', None) + self.restore_point_in_time = kwargs.get('restore_point_in_time', None) self.proxy_override = kwargs.get('proxy_override', None) self.timezone_id = kwargs.get('timezone_id', None) + self.instance_pool_id = kwargs.get('instance_pool_id', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py index 9233da80dae4..01bfe2801b29 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py @@ -33,8 +33,17 @@ class ManagedInstance(TrackedResource): :param identity: The Azure Active Directory identity of the managed instance. :type identity: ~azure.mgmt.sql.models.ResourceIdentity - :param sku: Managed instance sku + :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, + GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -50,11 +59,16 @@ class ManagedInstance(TrackedResource): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -66,6 +80,12 @@ class ManagedInstance(TrackedResource): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime :param proxy_override: Connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default' :type proxy_override: str or @@ -83,6 +103,9 @@ class ManagedInstance(TrackedResource): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str """ _validation = { @@ -103,6 +126,7 @@ class ManagedInstance(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -115,14 +139,18 @@ class ManagedInstance(TrackedResource): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, identity=None, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, proxy_override=None, timezone_id: str=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, **kwargs) -> None: super(ManagedInstance, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.sku = sku + self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password @@ -135,5 +163,8 @@ def __init__(self, *, location: str, tags=None, identity=None, sku=None, adminis self.dns_zone = None self.dns_zone_partner = dns_zone_partner self.public_data_endpoint_enabled = public_data_endpoint_enabled + self.source_managed_instance_id = source_managed_instance_id + self.restore_point_in_time = restore_point_in_time self.proxy_override = proxy_override self.timezone_id = timezone_id + self.instance_pool_id = instance_pool_id diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py index e3c543f0a6b1..d4d9bf3ba75d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py @@ -20,6 +20,14 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -35,11 +43,16 @@ class ManagedInstanceUpdate(Model): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -51,6 +64,12 @@ class ManagedInstanceUpdate(Model): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime :param proxy_override: Connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default' :type proxy_override: str or @@ -68,6 +87,9 @@ class ManagedInstanceUpdate(Model): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -80,6 +102,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -92,14 +115,18 @@ class ManagedInstanceUpdate(Model): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.managed_instance_create_mode = kwargs.get('managed_instance_create_mode', None) self.fully_qualified_domain_name = None self.administrator_login = kwargs.get('administrator_login', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) @@ -112,6 +139,9 @@ def __init__(self, **kwargs): self.dns_zone = None self.dns_zone_partner = kwargs.get('dns_zone_partner', None) self.public_data_endpoint_enabled = kwargs.get('public_data_endpoint_enabled', None) + self.source_managed_instance_id = kwargs.get('source_managed_instance_id', None) + self.restore_point_in_time = kwargs.get('restore_point_in_time', None) self.proxy_override = kwargs.get('proxy_override', None) self.timezone_id = kwargs.get('timezone_id', None) + self.instance_pool_id = kwargs.get('instance_pool_id', None) self.tags = kwargs.get('tags', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py index 4a2e6aa0bd78..d18fe0b5da00 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py @@ -20,6 +20,14 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific + point in time. RestorePointInTime and SourceManagedInstanceId must be + specified. Possible values include: 'Default', 'PointInTimeRestore' + :type managed_instance_create_mode: str or + ~azure.mgmt.sql.models.ManagedServerCreateMode :ivar fully_qualified_domain_name: The fully qualified domain name of the managed instance. :vartype fully_qualified_domain_name: str @@ -35,11 +43,16 @@ class ManagedInstanceUpdate(Model): :ivar state: The state of the managed instance. :vartype state: str :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. + 'LicenseIncluded' (regular price inclusive of a new SQL license) and + 'BasePrice' (discounted AHB price for bringing your own SQL licenses). + Possible values include: 'LicenseIncluded', 'BasePrice' + :type license_type: str or + ~azure.mgmt.sql.models.ManagedInstanceLicenseType + :param v_cores: The number of vCores. Allowed values: 8, 16, 24, 32, 40, + 64, 80. :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. + :param storage_size_in_gb: Storage size in GB. Minimum value: 32. Maximum + value: 8192. Increments of 32 GB allowed only. :type storage_size_in_gb: int :param collation: Collation of the managed instance. :type collation: str @@ -51,6 +64,12 @@ class ManagedInstanceUpdate(Model): :param public_data_endpoint_enabled: Whether or not the public data endpoint is enabled. :type public_data_endpoint_enabled: bool + :param source_managed_instance_id: The resource identifier of the source + managed instance associated with create operation of this instance. + :type source_managed_instance_id: str + :param restore_point_in_time: Specifies the point in time (ISO8601 format) + of the source database that will be restored to create the new database. + :type restore_point_in_time: datetime :param proxy_override: Connection type used for connecting to the instance. Possible values include: 'Proxy', 'Redirect', 'Default' :type proxy_override: str or @@ -68,6 +87,9 @@ class ManagedInstanceUpdate(Model): An example of valid timezone id is "Pacific Standard Time" or "W. Europe Standard Time". :type timezone_id: str + :param instance_pool_id: The Id of the instance pool this managed server + belongs to. + :type instance_pool_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -80,6 +102,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -92,14 +115,18 @@ class ManagedInstanceUpdate(Model): 'dns_zone': {'key': 'properties.dnsZone', 'type': 'str'}, 'dns_zone_partner': {'key': 'properties.dnsZonePartner', 'type': 'str'}, 'public_data_endpoint_enabled': {'key': 'properties.publicDataEndpointEnabled', 'type': 'bool'}, + 'source_managed_instance_id': {'key': 'properties.sourceManagedInstanceId', 'type': 'str'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, 'proxy_override': {'key': 'properties.proxyOverride', 'type': 'str'}, 'timezone_id': {'key': 'properties.timezoneId', 'type': 'str'}, + 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, proxy_override=None, timezone_id: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, tags=None, **kwargs) -> None: super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = sku + self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password @@ -112,6 +139,9 @@ def __init__(self, *, sku=None, administrator_login: str=None, administrator_log self.dns_zone = None self.dns_zone_partner = dns_zone_partner self.public_data_endpoint_enabled = public_data_endpoint_enabled + self.source_managed_instance_id = source_managed_instance_id + self.restore_point_in_time = restore_point_in_time self.proxy_override = proxy_override self.timezone_id = timezone_id + self.instance_pool_id = instance_pool_id self.tags = tags diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py index 0d80a9a31ac9..e7668f77203f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool.py @@ -26,7 +26,8 @@ class RecommendedElasticPool(ProxyResource): :vartype type: str :ivar database_edition: The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible - values include: 'Basic', 'Standard', 'Premium' + values include: 'Basic', 'Standard', 'Premium', 'GeneralPurpose', + 'BusinessCritical' :vartype database_edition: str or ~azure.mgmt.sql.models.ElasticPoolEdition :param dtu: The DTU for the recommended elastic pool. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py index 2f8a14d6abfa..75250679f962 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py @@ -26,7 +26,8 @@ class RecommendedElasticPool(ProxyResource): :vartype type: str :ivar database_edition: The edition of the recommended elastic pool. The ElasticPoolEdition enumeration contains all the valid editions. Possible - values include: 'Basic', 'Standard', 'Premium' + values include: 'Basic', 'Standard', 'Premium', 'GeneralPurpose', + 'BusinessCritical' :vartype database_edition: str or ~azure.mgmt.sql.models.ElasticPoolEdition :param dtu: The DTU for the recommended elastic pool. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label.py index a076a11634e6..f90c8df70211 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label.py @@ -32,12 +32,17 @@ class SensitivityLabel(ProxyResource): :type information_type: str :param information_type_id: The information type ID. :type information_type_id: str + :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for + recommended sensitivity label only. Specifies whether the sensitivity + recommendation on this column is disabled (dismissed) or not. + :vartype is_disabled: bool """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'is_disabled': {'readonly': True}, } _attribute_map = { @@ -48,6 +53,7 @@ class SensitivityLabel(ProxyResource): 'label_id': {'key': 'properties.labelId', 'type': 'str'}, 'information_type': {'key': 'properties.informationType', 'type': 'str'}, 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -56,3 +62,4 @@ def __init__(self, **kwargs): self.label_id = kwargs.get('label_id', None) self.information_type = kwargs.get('information_type', None) self.information_type_id = kwargs.get('information_type_id', None) + self.is_disabled = None diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_py3.py index f304363d916b..e659d9b977c8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sensitivity_label_py3.py @@ -32,12 +32,17 @@ class SensitivityLabel(ProxyResource): :type information_type: str :param information_type_id: The information type ID. :type information_type_id: str + :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for + recommended sensitivity label only. Specifies whether the sensitivity + recommendation on this column is disabled (dismissed) or not. + :vartype is_disabled: bool """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'is_disabled': {'readonly': True}, } _attribute_map = { @@ -48,6 +53,7 @@ class SensitivityLabel(ProxyResource): 'label_id': {'key': 'properties.labelId', 'type': 'str'}, 'information_type': {'key': 'properties.informationType', 'type': 'str'}, 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, } def __init__(self, *, label_name: str=None, label_id: str=None, information_type: str=None, information_type_id: str=None, **kwargs) -> None: @@ -56,3 +62,4 @@ def __init__(self, *, label_name: str=None, label_id: str=None, information_type self.label_id = label_id self.information_type = information_type self.information_type_id = information_type_id + self.is_disabled = None diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index de1d73caf27c..4cd0679ae1c3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -85,6 +85,9 @@ class DatabaseEdition(str, Enum): data_warehouse = "DataWarehouse" system = "System" system2 = "System2" + general_purpose = "GeneralPurpose" + business_critical = "BusinessCritical" + hyperscale = "Hyperscale" class ServiceObjectiveName(str, Enum): @@ -203,6 +206,8 @@ class ElasticPoolEdition(str, Enum): basic = "Basic" standard = "Standard" premium = "Premium" + general_purpose = "GeneralPurpose" + business_critical = "BusinessCritical" class ReplicationRole(str, Enum): @@ -325,6 +330,18 @@ class IdentityType(str, Enum): system_assigned = "SystemAssigned" +class ManagedServerCreateMode(str, Enum): + + default = "Default" + point_in_time_restore = "PointInTimeRestore" + + +class ManagedInstanceLicenseType(str, Enum): + + license_included = "LicenseIncluded" + base_price = "BasePrice" + + class ManagedInstanceProxyOverride(str, Enum): proxy = "Proxy" @@ -612,6 +629,8 @@ class DatabaseStatus(str, Enum): paused = "Paused" resuming = "Resuming" scaling = "Scaling" + offline_changing_dw_performance_tiers = "OfflineChangingDwPerformanceTiers" + online_changing_dw_performance_tiers = "OnlineChangingDwPerformanceTiers" class DatabaseLicenseType(str, Enum): @@ -659,6 +678,12 @@ class InstanceFailoverGroupReplicationRole(str, Enum): secondary = "Secondary" +class InstancePoolLicenseType(str, Enum): + + license_included = "LicenseIncluded" + base_price = "BasePrice" + + class LongTermRetentionDatabaseState(str, Enum): all = "All" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 3db410ac9cd7..181bcb7694e4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -89,6 +89,7 @@ from .managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations from .server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations from .managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations +from .instance_pools_operations import InstancePoolsOperations __all__ = [ 'RecoverableDatabasesOperations', @@ -171,4 +172,5 @@ 'ManagedInstanceVulnerabilityAssessmentsOperations', 'ServerVulnerabilityAssessmentsOperations', 'ManagedDatabaseSensitivityLabelsOperations', + 'InstancePoolsOperations', ] diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/instance_pools_operations.py new file mode 100644 index 000000000000..3407dcf4ae42 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/instance_pools_operations.py @@ -0,0 +1,529 @@ +# 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 InstancePoolsOperations(object): + """InstancePoolsOperations 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: "2018-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, instance_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets an instance pool. + + :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 instance_pool_name: The name of the instance pool to be + retrieved. + :type instance_pool_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: InstancePool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.InstancePool 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'), + 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_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('InstancePool', 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/instancePools/{instancePoolName}'} + + + def _create_or_update_initial( + self, resource_group_name, instance_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_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, 'InstancePool') + + # 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('InstancePool', response) + if response.status_code == 201: + deserialized = self._deserialize('InstancePool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, instance_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates an instance pool. + + :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 instance_pool_name: The name of the instance pool to be created + or updated. + :type instance_pool_name: str + :param parameters: The requested instance pool resource state. + :type parameters: ~azure.mgmt.sql.models.InstancePool + :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 InstancePool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstancePool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstancePool]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('InstancePool', 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/instancePools/{instancePoolName}'} + + + def _delete_initial( + self, resource_group_name, instance_pool_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'), + 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_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, instance_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an instance pool. + + :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 instance_pool_name: The name of the instance pool to be deleted + :type instance_pool_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, + instance_pool_name=instance_pool_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/instancePools/{instancePoolName}'} + + + def _update_initial( + self, resource_group_name, instance_pool_name, tags=None, custom_headers=None, raw=False, **operation_config): + parameters = models.InstancePoolUpdate(tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_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, 'InstancePoolUpdate') + + # Construct and send request + request = self._client.patch(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('InstancePool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, instance_pool_name, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an instance pool. + + :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 instance_pool_name: The name of the instance pool to be + updated. + :type instance_pool_name: str + :param tags: Resource tags. + :type tags: dict[str, 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 InstancePool or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstancePool] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstancePool]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + instance_pool_name=instance_pool_name, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('InstancePool', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of instance pools in the resource group. + + :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 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 InstancePool + :rtype: + ~azure.mgmt.sql.models.InstancePoolPaged[~azure.mgmt.sql.models.InstancePool] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + 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.InstancePoolPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.InstancePoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all instance pools in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of InstancePool + :rtype: + ~azure.mgmt.sql.models.InstancePoolPaged[~azure.mgmt.sql.models.InstancePool] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['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.InstancePoolPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.InstancePoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/instancePools'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_database_sensitivity_labels_operations.py index 1b03564854f8..1708e44edf86 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_database_sensitivity_labels_operations.py @@ -24,7 +24,6 @@ class ManagedDatabaseSensitivityLabelsOperations(object): :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: "2018-06-01-preview". - :ivar sensitivity_label_source: The source of the sensitivity label. Constant value: "current". """ models = models @@ -35,7 +34,6 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.api_version = "2018-06-01-preview" - self.sensitivity_label_source = "current" self.config = config @@ -150,6 +148,8 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + sensitivity_label_source = "current" + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -159,7 +159,7 @@ def create_or_update( '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'), + 'sensitivityLabelSource': self._serialize.url("sensitivity_label_source", 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) @@ -232,6 +232,8 @@ def delete( :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + sensitivity_label_source = "current" + # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -241,7 +243,7 @@ def delete( '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'), + 'sensitivityLabelSource': self._serialize.url("sensitivity_label_source", 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) @@ -273,6 +275,147 @@ def delete( return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'} + def disable_recommendation( + self, resource_group_name, managed_instance_name, database_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): + """Disables sensitivity recommendations on 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 managed_instance_name: The name of the managed instance. + :type managed_instance_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` + """ + sensitivity_label_source = "recommended" + + # Construct URL + url = self.disable_recommendation.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'), + '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, '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.post(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 + disable_recommendation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable'} + + def enable_recommendation( + self, resource_group_name, managed_instance_name, database_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): + """Enables sensitivity recommendations on a given column (recommendations + are enabled by default on all columns). + + :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 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` + """ + sensitivity_label_source = "recommended" + + # Construct URL + url = self.enable_recommendation.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'), + '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, '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.post(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 + enable_recommendation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable'} + def list_current_by_database( self, resource_group_name, managed_instance_name, database_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets the sensitivity labels of a given database. @@ -354,7 +497,7 @@ def internal_paging(next_link=None, raw=False): list_current_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels'} def list_recommended_by_database( - self, resource_group_name, managed_instance_name, database_name, skip_token=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, managed_instance_name, database_name, include_disabled_recommendations=None, skip_token=None, 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 @@ -365,6 +508,9 @@ def list_recommended_by_database( :type managed_instance_name: str :param database_name: The name of the database. :type database_name: str + :param include_disabled_recommendations: Specifies whether to include + disabled recommendations or not. + :type include_disabled_recommendations: bool :param skip_token: :type skip_token: str :param filter: An OData filter expression that filters elements in the @@ -395,6 +541,8 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} + if include_disabled_recommendations is not None: + query_parameters['includeDisabledRecommendations'] = self._serialize.query("include_disabled_recommendations", include_disabled_recommendations, 'bool') if skip_token is not None: query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') if filter is not None: diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py index 1fee247c7c96..a81663266c9a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py @@ -39,70 +39,6 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of all managed instances in the subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedInstance - :rtype: - ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['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.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} - def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): """Gets a list of managed instances in a resource group. @@ -522,3 +458,139 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} + + def list_by_instance_pool( + self, resource_group_name, instance_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in an instance pool. + + :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 instance_pool_name: The instance pool name. + :type instance_pool_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 ManagedInstance + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_instance_pool.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_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.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_instance_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances'} + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedInstance + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['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.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/sensitivity_labels_operations.py index 5be551f7fd12..0e5b7cae9d25 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/sensitivity_labels_operations.py @@ -24,7 +24,6 @@ class SensitivityLabelsOperations(object): :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 @@ -35,7 +34,6 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.api_version = "2017-03-01-preview" - self.sensitivity_label_source = "current" self.config = config @@ -120,7 +118,7 @@ def internal_paging(next_link=None, raw=False): list_current_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels'} def list_recommended_by_database( - self, resource_group_name, server_name, database_name, skip_token=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, database_name, include_disabled_recommendations=None, skip_token=None, 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 @@ -131,6 +129,9 @@ def list_recommended_by_database( :type server_name: str :param database_name: The name of the database. :type database_name: str + :param include_disabled_recommendations: Specifies whether to include + disabled recommendations or not. + :type include_disabled_recommendations: bool :param skip_token: :type skip_token: str :param filter: An OData filter expression that filters elements in the @@ -161,6 +162,8 @@ def internal_paging(next_link=None, raw=False): # Construct parameters query_parameters = {} + if include_disabled_recommendations is not None: + query_parameters['includeDisabledRecommendations'] = self._serialize.query("include_disabled_recommendations", include_disabled_recommendations, 'bool') if skip_token is not None: query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') if filter is not None: @@ -203,6 +206,147 @@ def internal_paging(next_link=None, raw=False): return deserialized list_recommended_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels'} + def enable_recommendation( + self, resource_group_name, server_name, database_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): + """Enables sensitivity recommendations on a given column (recommendations + are enabled by default on all columns). + + :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` + """ + sensitivity_label_source = "recommended" + + # Construct URL + url = self.enable_recommendation.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, '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.post(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 + enable_recommendation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable'} + + def disable_recommendation( + self, resource_group_name, server_name, database_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): + """Disables sensitivity recommendations on 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` + """ + sensitivity_label_source = "recommended" + + # Construct URL + url = self.disable_recommendation.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, '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.post(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 + disable_recommendation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/disable'} + 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. @@ -314,6 +458,8 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + sensitivity_label_source = "current" + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -323,7 +469,7 @@ def create_or_update( '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'), + 'sensitivityLabelSource': self._serialize.url("sensitivity_label_source", 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) @@ -396,6 +542,8 @@ def delete( :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + sensitivity_label_source = "current" + # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -405,7 +553,7 @@ def delete( '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'), + 'sensitivityLabelSource': self._serialize.url("sensitivity_label_source", 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) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py index aae1ce917e14..02ab955e053d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -93,6 +93,7 @@ from .operations.managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations from .operations.server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations from .operations.managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations +from .operations.instance_pools_operations import InstancePoolsOperations from . import models @@ -295,6 +296,8 @@ class SqlManagementClient(SDKClient): :vartype server_vulnerability_assessments: azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabels operations :vartype managed_database_sensitivity_labels: azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations + :ivar instance_pools: InstancePools operations + :vartype instance_pools: azure.mgmt.sql.operations.InstancePoolsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -475,3 +478,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( self._client, self.config, self._serialize, self._deserialize) + self.instance_pools = InstancePoolsOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/version.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/version.py index 9cb421fb381b..3697d9b71739 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/version.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/version.py @@ -9,4 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.12.0" +VERSION = "0.9.0" +