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 a81a694190f..829b7fdce46 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 @@ -19,12 +19,10 @@ from ._models_py3 import CheckNameAvailabilityResponse from ._models_py3 import CompleteDatabaseRestoreDefinition from ._models_py3 import CreateDatabaseRestorePointDefinition - from ._models_py3 import Database from ._models_py3 import DatabaseAutomaticTuning from ._models_py3 import DatabaseBlobAuditingPolicy from ._models_py3 import DatabaseOperation from ._models_py3 import DatabaseSecurityAlertPolicy - from ._models_py3 import DatabaseUpdate from ._models_py3 import DatabaseUsage from ._models_py3 import DatabaseVulnerabilityAssessment from ._models_py3 import DatabaseVulnerabilityAssessmentRuleBaseline @@ -33,16 +31,13 @@ from ._models_py3 import DataMaskingPolicy from ._models_py3 import DataMaskingRule from ._models_py3 import EditionCapability - from ._models_py3 import ElasticPool from ._models_py3 import ElasticPoolActivity from ._models_py3 import ElasticPoolDatabaseActivity from ._models_py3 import ElasticPoolEditionCapability from ._models_py3 import ElasticPoolOperation from ._models_py3 import ElasticPoolPerDatabaseMaxPerformanceLevelCapability from ._models_py3 import ElasticPoolPerDatabaseMinPerformanceLevelCapability - from ._models_py3 import ElasticPoolPerDatabaseSettings from ._models_py3 import ElasticPoolPerformanceLevelCapability - from ._models_py3 import ElasticPoolUpdate from ._models_py3 import EncryptionProtector from ._models_py3 import ExportDatabaseDefinition from ._models_py3 import ExtendedDatabaseBlobAuditingPolicy @@ -139,7 +134,6 @@ from ._models_py3 import ReplicationLink from ._models_py3 import Resource from ._models_py3 import ResourceIdentity - from ._models_py3 import ResourceMoveDefinition from ._models_py3 import RestorableDroppedDatabase from ._models_py3 import RestorableDroppedManagedDatabase from ._models_py3 import RestorePoint @@ -208,12 +202,10 @@ from ._models import CheckNameAvailabilityResponse from ._models import CompleteDatabaseRestoreDefinition from ._models import CreateDatabaseRestorePointDefinition - from ._models import Database from ._models import DatabaseAutomaticTuning from ._models import DatabaseBlobAuditingPolicy from ._models import DatabaseOperation from ._models import DatabaseSecurityAlertPolicy - from ._models import DatabaseUpdate from ._models import DatabaseUsage from ._models import DatabaseVulnerabilityAssessment from ._models import DatabaseVulnerabilityAssessmentRuleBaseline @@ -222,16 +214,13 @@ from ._models import DataMaskingPolicy from ._models import DataMaskingRule from ._models import EditionCapability - from ._models import ElasticPool from ._models import ElasticPoolActivity from ._models import ElasticPoolDatabaseActivity from ._models import ElasticPoolEditionCapability from ._models import ElasticPoolOperation from ._models import ElasticPoolPerDatabaseMaxPerformanceLevelCapability from ._models import ElasticPoolPerDatabaseMinPerformanceLevelCapability - from ._models import ElasticPoolPerDatabaseSettings from ._models import ElasticPoolPerformanceLevelCapability - from ._models import ElasticPoolUpdate from ._models import EncryptionProtector from ._models import ExportDatabaseDefinition from ._models import ExtendedDatabaseBlobAuditingPolicy @@ -328,7 +317,6 @@ from ._models import ReplicationLink from ._models import Resource from ._models import ResourceIdentity - from ._models import ResourceMoveDefinition from ._models import RestorableDroppedDatabase from ._models import RestorableDroppedManagedDatabase from ._models import RestorePoint @@ -390,14 +378,12 @@ from ._paged_models import BackupShortTermRetentionPolicyPaged from ._paged_models import DatabaseBlobAuditingPolicyPaged from ._paged_models import DatabaseOperationPaged -from ._paged_models import DatabasePaged from ._paged_models import DatabaseUsagePaged from ._paged_models import DatabaseVulnerabilityAssessmentPaged from ._paged_models import DataMaskingRulePaged from ._paged_models import ElasticPoolActivityPaged from ._paged_models import ElasticPoolDatabaseActivityPaged from ._paged_models import ElasticPoolOperationPaged -from ._paged_models import ElasticPoolPaged from ._paged_models import EncryptionProtectorPaged from ._paged_models import ExtendedDatabaseBlobAuditingPolicyPaged from ._paged_models import ExtendedServerBlobAuditingPolicyPaged @@ -545,14 +531,6 @@ ManagedInstanceProxyOverride, StorageAccountType, StorageKeyType, - CreateMode, - SampleName, - DatabaseStatus, - DatabaseLicenseType, - DatabaseReadScale, - SecondaryType, - ElasticPoolState, - ElasticPoolLicenseType, LongTermRetentionDatabaseState, VulnerabilityAssessmentPolicyBaselineName, SensitivityLabelSource, @@ -576,12 +554,10 @@ 'CheckNameAvailabilityResponse', 'CompleteDatabaseRestoreDefinition', 'CreateDatabaseRestorePointDefinition', - 'Database', 'DatabaseAutomaticTuning', 'DatabaseBlobAuditingPolicy', 'DatabaseOperation', 'DatabaseSecurityAlertPolicy', - 'DatabaseUpdate', 'DatabaseUsage', 'DatabaseVulnerabilityAssessment', 'DatabaseVulnerabilityAssessmentRuleBaseline', @@ -590,16 +566,13 @@ 'DataMaskingPolicy', 'DataMaskingRule', 'EditionCapability', - 'ElasticPool', 'ElasticPoolActivity', 'ElasticPoolDatabaseActivity', 'ElasticPoolEditionCapability', 'ElasticPoolOperation', 'ElasticPoolPerDatabaseMaxPerformanceLevelCapability', 'ElasticPoolPerDatabaseMinPerformanceLevelCapability', - 'ElasticPoolPerDatabaseSettings', 'ElasticPoolPerformanceLevelCapability', - 'ElasticPoolUpdate', 'EncryptionProtector', 'ExportDatabaseDefinition', 'ExtendedDatabaseBlobAuditingPolicy', @@ -696,7 +669,6 @@ 'ReplicationLink', 'Resource', 'ResourceIdentity', - 'ResourceMoveDefinition', 'RestorableDroppedDatabase', 'RestorableDroppedManagedDatabase', 'RestorePoint', @@ -762,8 +734,6 @@ 'GeoBackupPolicyPaged', 'MetricPaged', 'MetricDefinitionPaged', - 'DatabasePaged', - 'ElasticPoolPaged', 'RecommendedElasticPoolPaged', 'RecommendedElasticPoolMetricPaged', 'ReplicationLinkPaged', @@ -912,14 +882,6 @@ 'ManagedInstanceProxyOverride', 'StorageAccountType', 'StorageKeyType', - 'CreateMode', - 'SampleName', - 'DatabaseStatus', - 'DatabaseLicenseType', - 'DatabaseReadScale', - 'SecondaryType', - 'ElasticPoolState', - 'ElasticPoolLicenseType', 'LongTermRetentionDatabaseState', 'VulnerabilityAssessmentPolicyBaselineName', 'SensitivityLabelSource', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py index 901af6f62cb..b527cbb1a06 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py @@ -426,331 +426,6 @@ def __init__(self, **kwargs): self.restore_point_label = kwargs.get('restore_point_label', None) -class TrackedResource(Resource): - """ARM tracked top level resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: 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] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(TrackedResource, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.tags = kwargs.get('tags', None) - - -class Database(TrackedResource): - """A database resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: 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 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. - :vartype kind: str - :ivar managed_by: Resource that manages the database. - :vartype managed_by: str - :param create_mode: Specifies the mode of database creation. - Default: regular database creation. - Copy: creates a database as a copy of an existing database. - sourceDatabaseId must be specified as the resource ID of the source - database. - Secondary: creates a database as a secondary replica of an existing - database. sourceDatabaseId must be specified as the resource ID of the - existing primary database. - PointInTimeRestore: Creates a database by restoring a point in time backup - of an existing database. sourceDatabaseId must be specified as the - resource ID of the existing database, and restorePointInTime must be - specified. - Recovery: Creates a database by restoring a geo-replicated backup. - sourceDatabaseId must be specified as the recoverable database resource ID - to restore. - Restore: Creates a database by restoring a backup of a deleted database. - sourceDatabaseId must be specified. If sourceDatabaseId is the database's - original resource ID, then sourceDatabaseDeletionDate must be specified. - Otherwise sourceDatabaseId must be the restorable dropped database - resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime - may also be specified to restore from an earlier point in time. - RestoreLongTermRetentionBackup: Creates a database by restoring from a - long term retention vault. recoveryServicesRecoveryPointResourceId must be - specified as the recovery point resource ID. - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for - DataWarehouse edition. Possible values include: 'Default', 'Copy', - 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', - 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', - 'RestoreLongTermRetentionBackup', 'OnlineSecondary' - :type create_mode: str or ~azure.mgmt.sql.models.CreateMode - :param collation: The collation of the database. - :type collation: str - :param max_size_bytes: The max size of the database expressed in bytes. - :type max_size_bytes: long - :param sample_name: The name of the sample schema to apply when creating - this database. Possible values include: 'AdventureWorksLT', - 'WideWorldImportersStd', 'WideWorldImportersFull' - :type sample_name: str or ~azure.mgmt.sql.models.SampleName - :param elastic_pool_id: The resource identifier of the elastic pool - containing this database. - :type elastic_pool_id: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :ivar status: The status of the database. Possible values include: - 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', - 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', - 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', - 'OnlineChangingDwPerformanceTiers', 'Disabled' - :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus - :ivar database_id: The ID of the database. - :vartype database_id: str - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: datetime - :ivar current_service_objective_name: The current service level objective - name of the database. - :vartype current_service_objective_name: str - :ivar requested_service_objective_name: The requested service level - objective name of the database. - :vartype requested_service_objective_name: str - :ivar default_secondary_location: The default secondary region for this - database. - :vartype default_secondary_location: str - :ivar failover_group_id: Failover Group resource identifier that this - database belongs to. - :vartype failover_group_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 source_database_deletion_date: Specifies the time that the database - was deleted. - :type source_database_deletion_date: datetime - :param recovery_services_recovery_point_id: The resource identifier of the - recovery point associated with create operation of this database. - :type recovery_services_recovery_point_id: str - :param long_term_retention_backup_resource_id: The resource identifier of - the long term retention backup associated with create operation of this - database. - :type long_term_retention_backup_resource_id: str - :param recoverable_database_id: The resource identifier of the recoverable - database associated with create operation of this database. - :type recoverable_database_id: str - :param restorable_dropped_database_id: The resource identifier of the - restorable dropped database associated with create operation of this - database. - :type restorable_dropped_database_id: str - :param catalog_collation: Collation of the metadata catalog. Possible - values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' - :type catalog_collation: str or - ~azure.mgmt.sql.models.CatalogCollationType - :param zone_redundant: Whether or not this database is zone redundant, - which means the replicas of this database will be spread across multiple - availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this database. - `LicenseIncluded` if you need a license, or `BasePrice` if you have a - license and are eligible for the Azure Hybrid Benefit. Possible values - include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :ivar max_log_size_bytes: The max log size for this database. - :vartype max_log_size_bytes: long - :ivar earliest_restore_date: This records the earliest start date and time - that restore is available for this database (ISO8601 format). - :vartype earliest_restore_date: datetime - :param read_scale: The state of read-only routing. If enabled, connections - that have application intent set to readonly in their connection string - may be routed to a readonly secondary replica in the same region. Possible - values include: 'Enabled', 'Disabled' - :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :param high_availability_replica_count: The number of secondary replicas - associated with the database that are used to provide high availability. - :type high_availability_replica_count: int - :param secondary_type: The secondary type of the database if it is a - secondary. Valid values are Geo and Named. Possible values include: - 'Geo', 'Named' - :type secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :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 storage_account_type: The storage account type used to store - backups for this database. Currently the only supported option is GRS - (GeoRedundantStorage). Possible values include: 'GRS', 'LRS', 'ZRS' - :type storage_account_type: str or - ~azure.mgmt.sql.models.StorageAccountType - :param min_capacity: Minimal capacity that database will always have - allocated, if not paused - :type min_capacity: float - :ivar paused_date: The date when database was paused by user configuration - or action(ISO8601 format). Null if the database is ready. - :vartype paused_date: datetime - :ivar resumed_date: The date when database was resumed by user action or - database login (ISO8601 format). Null if the database is paused. - :vartype resumed_date: datetime - :param maintenance_configuration_id: Maintenance configuration id assigned - to the database. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'readonly': True}, - 'managed_by': {'readonly': True}, - 'status': {'readonly': True}, - 'database_id': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'current_service_objective_name': {'readonly': True}, - 'requested_service_objective_name': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - 'max_log_size_bytes': {'readonly': True}, - 'earliest_restore_date': {'readonly': True}, - 'current_sku': {'readonly': True}, - 'paused_date': {'readonly': True}, - 'resumed_date': {'readonly': 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'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'sample_name': {'key': 'properties.sampleName', 'type': 'str'}, - 'elastic_pool_id': {'key': 'properties.elasticPoolId', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'current_service_objective_name': {'key': 'properties.currentServiceObjectiveName', 'type': 'str'}, - 'requested_service_objective_name': {'key': 'properties.requestedServiceObjectiveName', 'type': 'str'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'source_database_deletion_date': {'key': 'properties.sourceDatabaseDeletionDate', 'type': 'iso-8601'}, - 'recovery_services_recovery_point_id': {'key': 'properties.recoveryServicesRecoveryPointId', 'type': 'str'}, - 'long_term_retention_backup_resource_id': {'key': 'properties.longTermRetentionBackupResourceId', 'type': 'str'}, - 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, - 'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'max_log_size_bytes': {'key': 'properties.maxLogSizeBytes', 'type': 'long'}, - 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, - 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, - 'high_availability_replica_count': {'key': 'properties.highAvailabilityReplicaCount', 'type': 'int'}, - 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, - 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, - 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, - 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, - 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, - 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(Database, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = None - self.managed_by = None - self.create_mode = kwargs.get('create_mode', None) - self.collation = kwargs.get('collation', None) - self.max_size_bytes = kwargs.get('max_size_bytes', None) - self.sample_name = kwargs.get('sample_name', None) - self.elastic_pool_id = kwargs.get('elastic_pool_id', None) - self.source_database_id = kwargs.get('source_database_id', None) - self.status = None - self.database_id = None - self.creation_date = None - self.current_service_objective_name = None - self.requested_service_objective_name = None - self.default_secondary_location = None - self.failover_group_id = None - self.restore_point_in_time = kwargs.get('restore_point_in_time', None) - self.source_database_deletion_date = kwargs.get('source_database_deletion_date', None) - self.recovery_services_recovery_point_id = kwargs.get('recovery_services_recovery_point_id', None) - self.long_term_retention_backup_resource_id = kwargs.get('long_term_retention_backup_resource_id', None) - self.recoverable_database_id = kwargs.get('recoverable_database_id', None) - self.restorable_dropped_database_id = kwargs.get('restorable_dropped_database_id', None) - self.catalog_collation = kwargs.get('catalog_collation', None) - self.zone_redundant = kwargs.get('zone_redundant', None) - self.license_type = kwargs.get('license_type', None) - self.max_log_size_bytes = None - self.earliest_restore_date = None - self.read_scale = kwargs.get('read_scale', None) - self.high_availability_replica_count = kwargs.get('high_availability_replica_count', None) - self.secondary_type = kwargs.get('secondary_type', None) - self.current_sku = None - self.auto_pause_delay = kwargs.get('auto_pause_delay', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - self.min_capacity = kwargs.get('min_capacity', None) - self.paused_date = None - self.resumed_date = None - self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) - - class DatabaseAutomaticTuning(ProxyResource): """Database-level Automatic Tuning. @@ -1158,252 +833,6 @@ def __init__(self, **kwargs): self.use_server_default = kwargs.get('use_server_default', None) -class DatabaseUpdate(Model): - """A database resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param sku: The name and tier of the SKU. - :type sku: ~azure.mgmt.sql.models.Sku - :param create_mode: Specifies the mode of database creation. - Default: regular database creation. - Copy: creates a database as a copy of an existing database. - sourceDatabaseId must be specified as the resource ID of the source - database. - Secondary: creates a database as a secondary replica of an existing - database. sourceDatabaseId must be specified as the resource ID of the - existing primary database. - PointInTimeRestore: Creates a database by restoring a point in time backup - of an existing database. sourceDatabaseId must be specified as the - resource ID of the existing database, and restorePointInTime must be - specified. - Recovery: Creates a database by restoring a geo-replicated backup. - sourceDatabaseId must be specified as the recoverable database resource ID - to restore. - Restore: Creates a database by restoring a backup of a deleted database. - sourceDatabaseId must be specified. If sourceDatabaseId is the database's - original resource ID, then sourceDatabaseDeletionDate must be specified. - Otherwise sourceDatabaseId must be the restorable dropped database - resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime - may also be specified to restore from an earlier point in time. - RestoreLongTermRetentionBackup: Creates a database by restoring from a - long term retention vault. recoveryServicesRecoveryPointResourceId must be - specified as the recovery point resource ID. - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for - DataWarehouse edition. Possible values include: 'Default', 'Copy', - 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', - 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', - 'RestoreLongTermRetentionBackup', 'OnlineSecondary' - :type create_mode: str or ~azure.mgmt.sql.models.CreateMode - :param collation: The collation of the database. - :type collation: str - :param max_size_bytes: The max size of the database expressed in bytes. - :type max_size_bytes: long - :param sample_name: The name of the sample schema to apply when creating - this database. Possible values include: 'AdventureWorksLT', - 'WideWorldImportersStd', 'WideWorldImportersFull' - :type sample_name: str or ~azure.mgmt.sql.models.SampleName - :param elastic_pool_id: The resource identifier of the elastic pool - containing this database. - :type elastic_pool_id: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :ivar status: The status of the database. Possible values include: - 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', - 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', - 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', - 'OnlineChangingDwPerformanceTiers', 'Disabled' - :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus - :ivar database_id: The ID of the database. - :vartype database_id: str - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: datetime - :ivar current_service_objective_name: The current service level objective - name of the database. - :vartype current_service_objective_name: str - :ivar requested_service_objective_name: The requested service level - objective name of the database. - :vartype requested_service_objective_name: str - :ivar default_secondary_location: The default secondary region for this - database. - :vartype default_secondary_location: str - :ivar failover_group_id: Failover Group resource identifier that this - database belongs to. - :vartype failover_group_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 source_database_deletion_date: Specifies the time that the database - was deleted. - :type source_database_deletion_date: datetime - :param recovery_services_recovery_point_id: The resource identifier of the - recovery point associated with create operation of this database. - :type recovery_services_recovery_point_id: str - :param long_term_retention_backup_resource_id: The resource identifier of - the long term retention backup associated with create operation of this - database. - :type long_term_retention_backup_resource_id: str - :param recoverable_database_id: The resource identifier of the recoverable - database associated with create operation of this database. - :type recoverable_database_id: str - :param restorable_dropped_database_id: The resource identifier of the - restorable dropped database associated with create operation of this - database. - :type restorable_dropped_database_id: str - :param catalog_collation: Collation of the metadata catalog. Possible - values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' - :type catalog_collation: str or - ~azure.mgmt.sql.models.CatalogCollationType - :param zone_redundant: Whether or not this database is zone redundant, - which means the replicas of this database will be spread across multiple - availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this database. - `LicenseIncluded` if you need a license, or `BasePrice` if you have a - license and are eligible for the Azure Hybrid Benefit. Possible values - include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :ivar max_log_size_bytes: The max log size for this database. - :vartype max_log_size_bytes: long - :ivar earliest_restore_date: This records the earliest start date and time - that restore is available for this database (ISO8601 format). - :vartype earliest_restore_date: datetime - :param read_scale: The state of read-only routing. If enabled, connections - that have application intent set to readonly in their connection string - may be routed to a readonly secondary replica in the same region. Possible - values include: 'Enabled', 'Disabled' - :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :param high_availability_replica_count: The number of secondary replicas - associated with the database that are used to provide high availability. - :type high_availability_replica_count: int - :param secondary_type: The secondary type of the database if it is a - secondary. Valid values are Geo and Named. Possible values include: - 'Geo', 'Named' - :type secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :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 storage_account_type: The storage account type used to store - backups for this database. Currently the only supported option is GRS - (GeoRedundantStorage). Possible values include: 'GRS', 'LRS', 'ZRS' - :type storage_account_type: str or - ~azure.mgmt.sql.models.StorageAccountType - :param min_capacity: Minimal capacity that database will always have - allocated, if not paused - :type min_capacity: float - :ivar paused_date: The date when database was paused by user configuration - or action(ISO8601 format). Null if the database is ready. - :vartype paused_date: datetime - :ivar resumed_date: The date when database was resumed by user action or - database login (ISO8601 format). Null if the database is paused. - :vartype resumed_date: datetime - :param maintenance_configuration_id: Maintenance configuration id assigned - to the database. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'status': {'readonly': True}, - 'database_id': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'current_service_objective_name': {'readonly': True}, - 'requested_service_objective_name': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - 'max_log_size_bytes': {'readonly': True}, - 'earliest_restore_date': {'readonly': True}, - 'current_sku': {'readonly': True}, - 'paused_date': {'readonly': True}, - 'resumed_date': {'readonly': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'sample_name': {'key': 'properties.sampleName', 'type': 'str'}, - 'elastic_pool_id': {'key': 'properties.elasticPoolId', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'current_service_objective_name': {'key': 'properties.currentServiceObjectiveName', 'type': 'str'}, - 'requested_service_objective_name': {'key': 'properties.requestedServiceObjectiveName', 'type': 'str'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'source_database_deletion_date': {'key': 'properties.sourceDatabaseDeletionDate', 'type': 'iso-8601'}, - 'recovery_services_recovery_point_id': {'key': 'properties.recoveryServicesRecoveryPointId', 'type': 'str'}, - 'long_term_retention_backup_resource_id': {'key': 'properties.longTermRetentionBackupResourceId', 'type': 'str'}, - 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, - 'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'max_log_size_bytes': {'key': 'properties.maxLogSizeBytes', 'type': 'long'}, - 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, - 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, - 'high_availability_replica_count': {'key': 'properties.highAvailabilityReplicaCount', 'type': 'int'}, - 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, - 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, - 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, - 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, - 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, - 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(DatabaseUpdate, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.create_mode = kwargs.get('create_mode', None) - self.collation = kwargs.get('collation', None) - self.max_size_bytes = kwargs.get('max_size_bytes', None) - self.sample_name = kwargs.get('sample_name', None) - self.elastic_pool_id = kwargs.get('elastic_pool_id', None) - self.source_database_id = kwargs.get('source_database_id', None) - self.status = None - self.database_id = None - self.creation_date = None - self.current_service_objective_name = None - self.requested_service_objective_name = None - self.default_secondary_location = None - self.failover_group_id = None - self.restore_point_in_time = kwargs.get('restore_point_in_time', None) - self.source_database_deletion_date = kwargs.get('source_database_deletion_date', None) - self.recovery_services_recovery_point_id = kwargs.get('recovery_services_recovery_point_id', None) - self.long_term_retention_backup_resource_id = kwargs.get('long_term_retention_backup_resource_id', None) - self.recoverable_database_id = kwargs.get('recoverable_database_id', None) - self.restorable_dropped_database_id = kwargs.get('restorable_dropped_database_id', None) - self.catalog_collation = kwargs.get('catalog_collation', None) - self.zone_redundant = kwargs.get('zone_redundant', None) - self.license_type = kwargs.get('license_type', None) - self.max_log_size_bytes = None - self.earliest_restore_date = None - self.read_scale = kwargs.get('read_scale', None) - self.high_availability_replica_count = kwargs.get('high_availability_replica_count', None) - self.secondary_type = kwargs.get('secondary_type', None) - self.current_sku = None - self.auto_pause_delay = kwargs.get('auto_pause_delay', None) - self.storage_account_type = kwargs.get('storage_account_type', None) - self.min_capacity = kwargs.get('min_capacity', None) - self.paused_date = None - self.resumed_date = None - self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) - self.tags = kwargs.get('tags', None) - - class DatabaseUsage(Model): """The database usages. @@ -1853,102 +1282,6 @@ def __init__(self, **kwargs): self.reason = kwargs.get('reason', None) -class ElasticPool(TrackedResource): - """An elastic 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 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. - :vartype kind: str - :ivar state: The state of the elastic pool. Possible values include: - 'Creating', 'Ready', 'Disabled' - :vartype state: str or ~azure.mgmt.sql.models.ElasticPoolState - :ivar creation_date: The creation date of the elastic pool (ISO8601 - format). - :vartype creation_date: datetime - :param max_size_bytes: The storage limit for the database elastic pool in - bytes. - :type max_size_bytes: long - :param per_database_settings: The per database settings for the elastic - pool. - :type per_database_settings: - ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :param zone_redundant: Whether or not this elastic pool is zone redundant, - which means the replicas of this elastic pool will be spread across - multiple availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this elastic pool. - Possible values include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :param maintenance_configuration_id: Maintenance configuration id assigned - to the elastic pool. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'readonly': True}, - 'state': {'readonly': True}, - 'creation_date': {'readonly': 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'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'per_database_settings': {'key': 'properties.perDatabaseSettings', 'type': 'ElasticPoolPerDatabaseSettings'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ElasticPool, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.kind = None - self.state = None - self.creation_date = None - self.max_size_bytes = kwargs.get('max_size_bytes', None) - self.per_database_settings = kwargs.get('per_database_settings', None) - self.zone_redundant = kwargs.get('zone_redundant', None) - self.license_type = kwargs.get('license_type', None) - self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) - - class ElasticPoolActivity(ProxyResource): """Represents the activity on an elastic pool. @@ -2434,26 +1767,6 @@ def __init__(self, **kwargs): self.reason = kwargs.get('reason', None) -class ElasticPoolPerDatabaseSettings(Model): - """Per database settings of an elastic pool. - - :param min_capacity: The minimum capacity all databases are guaranteed. - :type min_capacity: float - :param max_capacity: The maximum capacity any one database can consume. - :type max_capacity: float - """ - - _attribute_map = { - 'min_capacity': {'key': 'minCapacity', 'type': 'float'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(ElasticPoolPerDatabaseSettings, self).__init__(**kwargs) - self.min_capacity = kwargs.get('min_capacity', None) - self.max_capacity = kwargs.get('max_capacity', None) - - class ElasticPoolPerformanceLevelCapability(Model): """The Elastic Pool performance level capability. @@ -2536,54 +1849,6 @@ def __init__(self, **kwargs): self.reason = kwargs.get('reason', None) -class ElasticPoolUpdate(Model): - """An elastic pool update. - - :param sku: - :type sku: ~azure.mgmt.sql.models.Sku - :param max_size_bytes: The storage limit for the database elastic pool in - bytes. - :type max_size_bytes: long - :param per_database_settings: The per database settings for the elastic - pool. - :type per_database_settings: - ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :param zone_redundant: Whether or not this elastic pool is zone redundant, - which means the replicas of this elastic pool will be spread across - multiple availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this elastic pool. - Possible values include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :param maintenance_configuration_id: Maintenance configuration id assigned - to the elastic pool. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'per_database_settings': {'key': 'properties.perDatabaseSettings', 'type': 'ElasticPoolPerDatabaseSettings'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(ElasticPoolUpdate, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.max_size_bytes = kwargs.get('max_size_bytes', None) - self.per_database_settings = kwargs.get('per_database_settings', None) - self.zone_redundant = kwargs.get('zone_redundant', None) - self.license_type = kwargs.get('license_type', None) - self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) - self.tags = kwargs.get('tags', None) - - class EncryptionProtector(ProxyResource): """The server encryption protector. @@ -3641,6 +2906,47 @@ def __init__(self, **kwargs): self.failover_with_data_loss_grace_period_minutes = kwargs.get('failover_with_data_loss_grace_period_minutes', None) +class TrackedResource(Resource): + """ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: 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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(TrackedResource, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + + class InstancePool(TrackedResource): """An Azure SQL instance pool. @@ -7606,28 +6912,6 @@ def __init__(self, **kwargs): self.tenant_id = None -class ResourceMoveDefinition(Model): - """Contains the information necessary to perform a resource move (rename). - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The target ID for the resource - :type id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ResourceMoveDefinition, self).__init__(**kwargs) - self.id = kwargs.get('id', None) - - class RestorableDroppedDatabase(ProxyResource): """A restorable dropped database. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py index 573a28a6c64..32406b65266 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py @@ -426,331 +426,6 @@ def __init__(self, *, restore_point_label: str, **kwargs) -> None: self.restore_point_label = restore_point_label -class TrackedResource(Resource): - """ARM tracked top level resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: 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] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(**kwargs) - self.location = location - self.tags = tags - - -class Database(TrackedResource): - """A database resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: 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 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. - :vartype kind: str - :ivar managed_by: Resource that manages the database. - :vartype managed_by: str - :param create_mode: Specifies the mode of database creation. - Default: regular database creation. - Copy: creates a database as a copy of an existing database. - sourceDatabaseId must be specified as the resource ID of the source - database. - Secondary: creates a database as a secondary replica of an existing - database. sourceDatabaseId must be specified as the resource ID of the - existing primary database. - PointInTimeRestore: Creates a database by restoring a point in time backup - of an existing database. sourceDatabaseId must be specified as the - resource ID of the existing database, and restorePointInTime must be - specified. - Recovery: Creates a database by restoring a geo-replicated backup. - sourceDatabaseId must be specified as the recoverable database resource ID - to restore. - Restore: Creates a database by restoring a backup of a deleted database. - sourceDatabaseId must be specified. If sourceDatabaseId is the database's - original resource ID, then sourceDatabaseDeletionDate must be specified. - Otherwise sourceDatabaseId must be the restorable dropped database - resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime - may also be specified to restore from an earlier point in time. - RestoreLongTermRetentionBackup: Creates a database by restoring from a - long term retention vault. recoveryServicesRecoveryPointResourceId must be - specified as the recovery point resource ID. - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for - DataWarehouse edition. Possible values include: 'Default', 'Copy', - 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', - 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', - 'RestoreLongTermRetentionBackup', 'OnlineSecondary' - :type create_mode: str or ~azure.mgmt.sql.models.CreateMode - :param collation: The collation of the database. - :type collation: str - :param max_size_bytes: The max size of the database expressed in bytes. - :type max_size_bytes: long - :param sample_name: The name of the sample schema to apply when creating - this database. Possible values include: 'AdventureWorksLT', - 'WideWorldImportersStd', 'WideWorldImportersFull' - :type sample_name: str or ~azure.mgmt.sql.models.SampleName - :param elastic_pool_id: The resource identifier of the elastic pool - containing this database. - :type elastic_pool_id: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :ivar status: The status of the database. Possible values include: - 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', - 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', - 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', - 'OnlineChangingDwPerformanceTiers', 'Disabled' - :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus - :ivar database_id: The ID of the database. - :vartype database_id: str - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: datetime - :ivar current_service_objective_name: The current service level objective - name of the database. - :vartype current_service_objective_name: str - :ivar requested_service_objective_name: The requested service level - objective name of the database. - :vartype requested_service_objective_name: str - :ivar default_secondary_location: The default secondary region for this - database. - :vartype default_secondary_location: str - :ivar failover_group_id: Failover Group resource identifier that this - database belongs to. - :vartype failover_group_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 source_database_deletion_date: Specifies the time that the database - was deleted. - :type source_database_deletion_date: datetime - :param recovery_services_recovery_point_id: The resource identifier of the - recovery point associated with create operation of this database. - :type recovery_services_recovery_point_id: str - :param long_term_retention_backup_resource_id: The resource identifier of - the long term retention backup associated with create operation of this - database. - :type long_term_retention_backup_resource_id: str - :param recoverable_database_id: The resource identifier of the recoverable - database associated with create operation of this database. - :type recoverable_database_id: str - :param restorable_dropped_database_id: The resource identifier of the - restorable dropped database associated with create operation of this - database. - :type restorable_dropped_database_id: str - :param catalog_collation: Collation of the metadata catalog. Possible - values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' - :type catalog_collation: str or - ~azure.mgmt.sql.models.CatalogCollationType - :param zone_redundant: Whether or not this database is zone redundant, - which means the replicas of this database will be spread across multiple - availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this database. - `LicenseIncluded` if you need a license, or `BasePrice` if you have a - license and are eligible for the Azure Hybrid Benefit. Possible values - include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :ivar max_log_size_bytes: The max log size for this database. - :vartype max_log_size_bytes: long - :ivar earliest_restore_date: This records the earliest start date and time - that restore is available for this database (ISO8601 format). - :vartype earliest_restore_date: datetime - :param read_scale: The state of read-only routing. If enabled, connections - that have application intent set to readonly in their connection string - may be routed to a readonly secondary replica in the same region. Possible - values include: 'Enabled', 'Disabled' - :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :param high_availability_replica_count: The number of secondary replicas - associated with the database that are used to provide high availability. - :type high_availability_replica_count: int - :param secondary_type: The secondary type of the database if it is a - secondary. Valid values are Geo and Named. Possible values include: - 'Geo', 'Named' - :type secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :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 storage_account_type: The storage account type used to store - backups for this database. Currently the only supported option is GRS - (GeoRedundantStorage). Possible values include: 'GRS', 'LRS', 'ZRS' - :type storage_account_type: str or - ~azure.mgmt.sql.models.StorageAccountType - :param min_capacity: Minimal capacity that database will always have - allocated, if not paused - :type min_capacity: float - :ivar paused_date: The date when database was paused by user configuration - or action(ISO8601 format). Null if the database is ready. - :vartype paused_date: datetime - :ivar resumed_date: The date when database was resumed by user action or - database login (ISO8601 format). Null if the database is paused. - :vartype resumed_date: datetime - :param maintenance_configuration_id: Maintenance configuration id assigned - to the database. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'readonly': True}, - 'managed_by': {'readonly': True}, - 'status': {'readonly': True}, - 'database_id': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'current_service_objective_name': {'readonly': True}, - 'requested_service_objective_name': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - 'max_log_size_bytes': {'readonly': True}, - 'earliest_restore_date': {'readonly': True}, - 'current_sku': {'readonly': True}, - 'paused_date': {'readonly': True}, - 'resumed_date': {'readonly': 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'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'managed_by': {'key': 'managedBy', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'sample_name': {'key': 'properties.sampleName', 'type': 'str'}, - 'elastic_pool_id': {'key': 'properties.elasticPoolId', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'current_service_objective_name': {'key': 'properties.currentServiceObjectiveName', 'type': 'str'}, - 'requested_service_objective_name': {'key': 'properties.requestedServiceObjectiveName', 'type': 'str'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'source_database_deletion_date': {'key': 'properties.sourceDatabaseDeletionDate', 'type': 'iso-8601'}, - 'recovery_services_recovery_point_id': {'key': 'properties.recoveryServicesRecoveryPointId', 'type': 'str'}, - 'long_term_retention_backup_resource_id': {'key': 'properties.longTermRetentionBackupResourceId', 'type': 'str'}, - 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, - 'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'max_log_size_bytes': {'key': 'properties.maxLogSizeBytes', 'type': 'long'}, - 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, - 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, - 'high_availability_replica_count': {'key': 'properties.highAvailabilityReplicaCount', 'type': 'int'}, - 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, - 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, - 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, - 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, - 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, - 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - } - - 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, high_availability_replica_count: int=None, secondary_type=None, auto_pause_delay: int=None, storage_account_type=None, min_capacity: float=None, maintenance_configuration_id: str=None, **kwargs) -> None: - super(Database, self).__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.kind = None - self.managed_by = None - self.create_mode = create_mode - self.collation = collation - self.max_size_bytes = max_size_bytes - self.sample_name = sample_name - self.elastic_pool_id = elastic_pool_id - self.source_database_id = source_database_id - self.status = None - self.database_id = None - self.creation_date = None - self.current_service_objective_name = None - self.requested_service_objective_name = None - self.default_secondary_location = None - self.failover_group_id = None - self.restore_point_in_time = restore_point_in_time - self.source_database_deletion_date = source_database_deletion_date - self.recovery_services_recovery_point_id = recovery_services_recovery_point_id - self.long_term_retention_backup_resource_id = long_term_retention_backup_resource_id - self.recoverable_database_id = recoverable_database_id - self.restorable_dropped_database_id = restorable_dropped_database_id - self.catalog_collation = catalog_collation - self.zone_redundant = zone_redundant - self.license_type = license_type - self.max_log_size_bytes = None - self.earliest_restore_date = None - self.read_scale = read_scale - self.high_availability_replica_count = high_availability_replica_count - self.secondary_type = secondary_type - self.current_sku = None - self.auto_pause_delay = auto_pause_delay - self.storage_account_type = storage_account_type - self.min_capacity = min_capacity - self.paused_date = None - self.resumed_date = None - self.maintenance_configuration_id = maintenance_configuration_id - - class DatabaseAutomaticTuning(ProxyResource): """Database-level Automatic Tuning. @@ -1158,252 +833,6 @@ def __init__(self, *, state, location: str=None, disabled_alerts: str=None, emai self.use_server_default = use_server_default -class DatabaseUpdate(Model): - """A database resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param sku: The name and tier of the SKU. - :type sku: ~azure.mgmt.sql.models.Sku - :param create_mode: Specifies the mode of database creation. - Default: regular database creation. - Copy: creates a database as a copy of an existing database. - sourceDatabaseId must be specified as the resource ID of the source - database. - Secondary: creates a database as a secondary replica of an existing - database. sourceDatabaseId must be specified as the resource ID of the - existing primary database. - PointInTimeRestore: Creates a database by restoring a point in time backup - of an existing database. sourceDatabaseId must be specified as the - resource ID of the existing database, and restorePointInTime must be - specified. - Recovery: Creates a database by restoring a geo-replicated backup. - sourceDatabaseId must be specified as the recoverable database resource ID - to restore. - Restore: Creates a database by restoring a backup of a deleted database. - sourceDatabaseId must be specified. If sourceDatabaseId is the database's - original resource ID, then sourceDatabaseDeletionDate must be specified. - Otherwise sourceDatabaseId must be the restorable dropped database - resource ID and sourceDatabaseDeletionDate is ignored. restorePointInTime - may also be specified to restore from an earlier point in time. - RestoreLongTermRetentionBackup: Creates a database by restoring from a - long term retention vault. recoveryServicesRecoveryPointResourceId must be - specified as the recovery point resource ID. - Copy, Secondary, and RestoreLongTermRetentionBackup are not supported for - DataWarehouse edition. Possible values include: 'Default', 'Copy', - 'Secondary', 'PointInTimeRestore', 'Restore', 'Recovery', - 'RestoreExternalBackup', 'RestoreExternalBackupSecondary', - 'RestoreLongTermRetentionBackup', 'OnlineSecondary' - :type create_mode: str or ~azure.mgmt.sql.models.CreateMode - :param collation: The collation of the database. - :type collation: str - :param max_size_bytes: The max size of the database expressed in bytes. - :type max_size_bytes: long - :param sample_name: The name of the sample schema to apply when creating - this database. Possible values include: 'AdventureWorksLT', - 'WideWorldImportersStd', 'WideWorldImportersFull' - :type sample_name: str or ~azure.mgmt.sql.models.SampleName - :param elastic_pool_id: The resource identifier of the elastic pool - containing this database. - :type elastic_pool_id: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :ivar status: The status of the database. Possible values include: - 'Online', 'Restoring', 'RecoveryPending', 'Recovering', 'Suspect', - 'Offline', 'Standby', 'Shutdown', 'EmergencyMode', 'AutoClosed', - 'Copying', 'Creating', 'Inaccessible', 'OfflineSecondary', 'Pausing', - 'Paused', 'Resuming', 'Scaling', 'OfflineChangingDwPerformanceTiers', - 'OnlineChangingDwPerformanceTiers', 'Disabled' - :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus - :ivar database_id: The ID of the database. - :vartype database_id: str - :ivar creation_date: The creation date of the database (ISO8601 format). - :vartype creation_date: datetime - :ivar current_service_objective_name: The current service level objective - name of the database. - :vartype current_service_objective_name: str - :ivar requested_service_objective_name: The requested service level - objective name of the database. - :vartype requested_service_objective_name: str - :ivar default_secondary_location: The default secondary region for this - database. - :vartype default_secondary_location: str - :ivar failover_group_id: Failover Group resource identifier that this - database belongs to. - :vartype failover_group_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 source_database_deletion_date: Specifies the time that the database - was deleted. - :type source_database_deletion_date: datetime - :param recovery_services_recovery_point_id: The resource identifier of the - recovery point associated with create operation of this database. - :type recovery_services_recovery_point_id: str - :param long_term_retention_backup_resource_id: The resource identifier of - the long term retention backup associated with create operation of this - database. - :type long_term_retention_backup_resource_id: str - :param recoverable_database_id: The resource identifier of the recoverable - database associated with create operation of this database. - :type recoverable_database_id: str - :param restorable_dropped_database_id: The resource identifier of the - restorable dropped database associated with create operation of this - database. - :type restorable_dropped_database_id: str - :param catalog_collation: Collation of the metadata catalog. Possible - values include: 'DATABASE_DEFAULT', 'SQL_Latin1_General_CP1_CI_AS' - :type catalog_collation: str or - ~azure.mgmt.sql.models.CatalogCollationType - :param zone_redundant: Whether or not this database is zone redundant, - which means the replicas of this database will be spread across multiple - availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this database. - `LicenseIncluded` if you need a license, or `BasePrice` if you have a - license and are eligible for the Azure Hybrid Benefit. Possible values - include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.DatabaseLicenseType - :ivar max_log_size_bytes: The max log size for this database. - :vartype max_log_size_bytes: long - :ivar earliest_restore_date: This records the earliest start date and time - that restore is available for this database (ISO8601 format). - :vartype earliest_restore_date: datetime - :param read_scale: The state of read-only routing. If enabled, connections - that have application intent set to readonly in their connection string - may be routed to a readonly secondary replica in the same region. Possible - values include: 'Enabled', 'Disabled' - :type read_scale: str or ~azure.mgmt.sql.models.DatabaseReadScale - :param high_availability_replica_count: The number of secondary replicas - associated with the database that are used to provide high availability. - :type high_availability_replica_count: int - :param secondary_type: The secondary type of the database if it is a - secondary. Valid values are Geo and Named. Possible values include: - 'Geo', 'Named' - :type secondary_type: str or ~azure.mgmt.sql.models.SecondaryType - :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 storage_account_type: The storage account type used to store - backups for this database. Currently the only supported option is GRS - (GeoRedundantStorage). Possible values include: 'GRS', 'LRS', 'ZRS' - :type storage_account_type: str or - ~azure.mgmt.sql.models.StorageAccountType - :param min_capacity: Minimal capacity that database will always have - allocated, if not paused - :type min_capacity: float - :ivar paused_date: The date when database was paused by user configuration - or action(ISO8601 format). Null if the database is ready. - :vartype paused_date: datetime - :ivar resumed_date: The date when database was resumed by user action or - database login (ISO8601 format). Null if the database is paused. - :vartype resumed_date: datetime - :param maintenance_configuration_id: Maintenance configuration id assigned - to the database. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'status': {'readonly': True}, - 'database_id': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'current_service_objective_name': {'readonly': True}, - 'requested_service_objective_name': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - 'max_log_size_bytes': {'readonly': True}, - 'earliest_restore_date': {'readonly': True}, - 'current_sku': {'readonly': True}, - 'paused_date': {'readonly': True}, - 'resumed_date': {'readonly': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'sample_name': {'key': 'properties.sampleName', 'type': 'str'}, - 'elastic_pool_id': {'key': 'properties.elasticPoolId', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'database_id': {'key': 'properties.databaseId', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'current_service_objective_name': {'key': 'properties.currentServiceObjectiveName', 'type': 'str'}, - 'requested_service_objective_name': {'key': 'properties.requestedServiceObjectiveName', 'type': 'str'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'source_database_deletion_date': {'key': 'properties.sourceDatabaseDeletionDate', 'type': 'iso-8601'}, - 'recovery_services_recovery_point_id': {'key': 'properties.recoveryServicesRecoveryPointId', 'type': 'str'}, - 'long_term_retention_backup_resource_id': {'key': 'properties.longTermRetentionBackupResourceId', 'type': 'str'}, - 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, - 'restorable_dropped_database_id': {'key': 'properties.restorableDroppedDatabaseId', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'max_log_size_bytes': {'key': 'properties.maxLogSizeBytes', 'type': 'long'}, - 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, - 'read_scale': {'key': 'properties.readScale', 'type': 'str'}, - 'high_availability_replica_count': {'key': 'properties.highAvailabilityReplicaCount', 'type': 'int'}, - 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, - 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, - 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, - 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, - 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, - 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - '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, high_availability_replica_count: int=None, secondary_type=None, auto_pause_delay: int=None, storage_account_type=None, min_capacity: float=None, maintenance_configuration_id: str=None, tags=None, **kwargs) -> None: - super(DatabaseUpdate, self).__init__(**kwargs) - self.sku = sku - self.create_mode = create_mode - self.collation = collation - self.max_size_bytes = max_size_bytes - self.sample_name = sample_name - self.elastic_pool_id = elastic_pool_id - self.source_database_id = source_database_id - self.status = None - self.database_id = None - self.creation_date = None - self.current_service_objective_name = None - self.requested_service_objective_name = None - self.default_secondary_location = None - self.failover_group_id = None - self.restore_point_in_time = restore_point_in_time - self.source_database_deletion_date = source_database_deletion_date - self.recovery_services_recovery_point_id = recovery_services_recovery_point_id - self.long_term_retention_backup_resource_id = long_term_retention_backup_resource_id - self.recoverable_database_id = recoverable_database_id - self.restorable_dropped_database_id = restorable_dropped_database_id - self.catalog_collation = catalog_collation - self.zone_redundant = zone_redundant - self.license_type = license_type - self.max_log_size_bytes = None - self.earliest_restore_date = None - self.read_scale = read_scale - self.high_availability_replica_count = high_availability_replica_count - self.secondary_type = secondary_type - self.current_sku = None - self.auto_pause_delay = auto_pause_delay - self.storage_account_type = storage_account_type - self.min_capacity = min_capacity - self.paused_date = None - self.resumed_date = None - self.maintenance_configuration_id = maintenance_configuration_id - self.tags = tags - - class DatabaseUsage(Model): """The database usages. @@ -1853,102 +1282,6 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: self.reason = reason -class ElasticPool(TrackedResource): - """An elastic 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 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. - :vartype kind: str - :ivar state: The state of the elastic pool. Possible values include: - 'Creating', 'Ready', 'Disabled' - :vartype state: str or ~azure.mgmt.sql.models.ElasticPoolState - :ivar creation_date: The creation date of the elastic pool (ISO8601 - format). - :vartype creation_date: datetime - :param max_size_bytes: The storage limit for the database elastic pool in - bytes. - :type max_size_bytes: long - :param per_database_settings: The per database settings for the elastic - pool. - :type per_database_settings: - ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :param zone_redundant: Whether or not this elastic pool is zone redundant, - which means the replicas of this elastic pool will be spread across - multiple availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this elastic pool. - Possible values include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :param maintenance_configuration_id: Maintenance configuration id assigned - to the elastic pool. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'kind': {'readonly': True}, - 'state': {'readonly': True}, - 'creation_date': {'readonly': 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'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'per_database_settings': {'key': 'properties.perDatabaseSettings', 'type': 'ElasticPoolPerDatabaseSettings'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, sku=None, max_size_bytes: int=None, per_database_settings=None, zone_redundant: bool=None, license_type=None, maintenance_configuration_id: str=None, **kwargs) -> None: - super(ElasticPool, self).__init__(location=location, tags=tags, **kwargs) - self.sku = sku - self.kind = None - self.state = None - self.creation_date = None - self.max_size_bytes = max_size_bytes - self.per_database_settings = per_database_settings - self.zone_redundant = zone_redundant - self.license_type = license_type - self.maintenance_configuration_id = maintenance_configuration_id - - class ElasticPoolActivity(ProxyResource): """Represents the activity on an elastic pool. @@ -2434,26 +1767,6 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: self.reason = reason -class ElasticPoolPerDatabaseSettings(Model): - """Per database settings of an elastic pool. - - :param min_capacity: The minimum capacity all databases are guaranteed. - :type min_capacity: float - :param max_capacity: The maximum capacity any one database can consume. - :type max_capacity: float - """ - - _attribute_map = { - 'min_capacity': {'key': 'minCapacity', 'type': 'float'}, - 'max_capacity': {'key': 'maxCapacity', 'type': 'float'}, - } - - def __init__(self, *, min_capacity: float=None, max_capacity: float=None, **kwargs) -> None: - super(ElasticPoolPerDatabaseSettings, self).__init__(**kwargs) - self.min_capacity = min_capacity - self.max_capacity = max_capacity - - class ElasticPoolPerformanceLevelCapability(Model): """The Elastic Pool performance level capability. @@ -2536,54 +1849,6 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: self.reason = reason -class ElasticPoolUpdate(Model): - """An elastic pool update. - - :param sku: - :type sku: ~azure.mgmt.sql.models.Sku - :param max_size_bytes: The storage limit for the database elastic pool in - bytes. - :type max_size_bytes: long - :param per_database_settings: The per database settings for the elastic - pool. - :type per_database_settings: - ~azure.mgmt.sql.models.ElasticPoolPerDatabaseSettings - :param zone_redundant: Whether or not this elastic pool is zone redundant, - which means the replicas of this elastic pool will be spread across - multiple availability zones. - :type zone_redundant: bool - :param license_type: The license type to apply for this elastic pool. - Possible values include: 'LicenseIncluded', 'BasePrice' - :type license_type: str or ~azure.mgmt.sql.models.ElasticPoolLicenseType - :param maintenance_configuration_id: Maintenance configuration id assigned - to the elastic pool. This configuration defines the period when the - maintenance updates will be rolled out. - :type maintenance_configuration_id: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'per_database_settings': {'key': 'properties.perDatabaseSettings', 'type': 'ElasticPoolPerDatabaseSettings'}, - 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, sku=None, max_size_bytes: int=None, per_database_settings=None, zone_redundant: bool=None, license_type=None, maintenance_configuration_id: str=None, tags=None, **kwargs) -> None: - super(ElasticPoolUpdate, self).__init__(**kwargs) - self.sku = sku - self.max_size_bytes = max_size_bytes - self.per_database_settings = per_database_settings - self.zone_redundant = zone_redundant - self.license_type = license_type - self.maintenance_configuration_id = maintenance_configuration_id - self.tags = tags - - class EncryptionProtector(ProxyResource): """The server encryption protector. @@ -3641,6 +2906,47 @@ def __init__(self, *, failover_policy, failover_with_data_loss_grace_period_minu self.failover_with_data_loss_grace_period_minutes = failover_with_data_loss_grace_period_minutes +class TrackedResource(Resource): + """ARM tracked top level resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: 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] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, location: str, tags=None, **kwargs) -> None: + super(TrackedResource, self).__init__(**kwargs) + self.location = location + self.tags = tags + + class InstancePool(TrackedResource): """An Azure SQL instance pool. @@ -7606,28 +6912,6 @@ def __init__(self, *, type=None, **kwargs) -> None: self.tenant_id = None -class ResourceMoveDefinition(Model): - """Contains the information necessary to perform a resource move (rename). - - All required parameters must be populated in order to send to Azure. - - :param id: Required. The target ID for the resource - :type id: str - """ - - _validation = { - 'id': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - } - - def __init__(self, *, id: str, **kwargs) -> None: - super(ResourceMoveDefinition, self).__init__(**kwargs) - self.id = id - - class RestorableDroppedDatabase(ProxyResource): """A restorable dropped database. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py index 507d1925bde..490b86551ad 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py @@ -103,32 +103,6 @@ class MetricDefinitionPaged(Paged): def __init__(self, *args, **kwargs): super(MetricDefinitionPaged, self).__init__(*args, **kwargs) -class DatabasePaged(Paged): - """ - A paging container for iterating over a list of :class:`Database ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Database]'} - } - - def __init__(self, *args, **kwargs): - - super(DatabasePaged, self).__init__(*args, **kwargs) -class ElasticPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`ElasticPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ElasticPool]'} - } - - def __init__(self, *args, **kwargs): - - super(ElasticPoolPaged, self).__init__(*args, **kwargs) class RecommendedElasticPoolPaged(Paged): """ A paging container for iterating over a list of :class:`RecommendedElasticPool ` object 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 f2c7c9c3111..d108973001a 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 @@ -641,83 +641,6 @@ class StorageKeyType(str, Enum): storage_access_key = "StorageAccessKey" -class CreateMode(str, Enum): - - default = "Default" - copy = "Copy" - secondary = "Secondary" - point_in_time_restore = "PointInTimeRestore" - restore = "Restore" - recovery = "Recovery" - restore_external_backup = "RestoreExternalBackup" - restore_external_backup_secondary = "RestoreExternalBackupSecondary" - restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" - online_secondary = "OnlineSecondary" - - -class SampleName(str, Enum): - - adventure_works_lt = "AdventureWorksLT" - wide_world_importers_std = "WideWorldImportersStd" - wide_world_importers_full = "WideWorldImportersFull" - - -class DatabaseStatus(str, Enum): - - online = "Online" - restoring = "Restoring" - recovery_pending = "RecoveryPending" - recovering = "Recovering" - suspect = "Suspect" - offline = "Offline" - standby = "Standby" - shutdown = "Shutdown" - emergency_mode = "EmergencyMode" - auto_closed = "AutoClosed" - copying = "Copying" - creating = "Creating" - inaccessible = "Inaccessible" - offline_secondary = "OfflineSecondary" - pausing = "Pausing" - paused = "Paused" - resuming = "Resuming" - scaling = "Scaling" - offline_changing_dw_performance_tiers = "OfflineChangingDwPerformanceTiers" - online_changing_dw_performance_tiers = "OnlineChangingDwPerformanceTiers" - disabled = "Disabled" - - -class DatabaseLicenseType(str, Enum): - - license_included = "LicenseIncluded" - base_price = "BasePrice" - - -class DatabaseReadScale(str, Enum): - - enabled = "Enabled" - disabled = "Disabled" - - -class SecondaryType(str, Enum): - - geo = "Geo" - named = "Named" - - -class ElasticPoolState(str, Enum): - - creating = "Creating" - ready = "Ready" - disabled = "Disabled" - - -class ElasticPoolLicenseType(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/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py index 006b378c2ec..333ab483b1b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py @@ -309,981 +309,3 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'} - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of databases. - - :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 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 Database - :rtype: - ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] - :raises: :class:`CloudError` - """ - api_version = "2020-08-01-preview" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_server.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - 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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases'} - - def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param 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: Database or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.Database or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2020-08-01-preview" - - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}'} - - - def _create_or_update_initial( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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, 'Database') - - # 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('Database', response) - if response.status_code == 201: - deserialized = self._deserialize('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a new database or updates an existing database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param parameters: The requested database resource state. - :type parameters: ~azure.mgmt.sql.models.Database - :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 Database or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.Database] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.Database]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Database', 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/servers/{serverName}/databases/{databaseName}'} - - - def _delete_initial( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - 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, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes the database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param 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, - server_name=server_name, - database_name=database_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/servers/{serverName}/databases/{databaseName}'} - - - def _update_initial( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['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, 'DatabaseUpdate') - - # 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('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates an existing database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param parameters: The requested database resource state. - :type parameters: ~azure.mgmt.sql.models.DatabaseUpdate - :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 Database or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.Database] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.Database]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Database', 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/servers/{serverName}/databases/{databaseName}'} - - def list_by_elastic_pool( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of databases in an elastic 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 server_name: The name of the server. - :type server_name: str - :param elastic_pool_name: The name of the elastic pool. - :type elastic_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 Database - :rtype: - ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] - :raises: :class:`CloudError` - """ - api_version = "2020-08-01-preview" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_elastic_pool.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'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_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("api_version", 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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_elastic_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'} - - - def _failover_initial( - self, resource_group_name, server_name, database_name, replica_type=None, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.failover.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if replica_type is not None: - query_parameters['replicaType'] = self._serialize.query("replica_type", replica_type, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", 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, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def failover( - self, resource_group_name, server_name, database_name, replica_type=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Failovers a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database to failover. - :type database_name: str - :param replica_type: The type of replica to be failed over. Possible - values include: 'Primary', 'ReadableSecondary' - :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType - :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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - replica_type=replica_type, - 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) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover'} - - - def _pause_initial( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.pause.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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.post(url, query_parameters, header_parameters) - 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('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def pause( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Pauses a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database to be paused. - :type database_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 Database or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.Database] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.Database]] - :raises: :class:`CloudError` - """ - raw_result = self._pause_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Database', 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) - pause.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'} - - - def _resume_initial( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.resume.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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.post(url, query_parameters, header_parameters) - 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('Database', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def resume( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Resumes a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database to be resumed. - :type database_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 Database or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.Database] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.Database]] - :raises: :class:`CloudError` - """ - raw_result = self._resume_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('Database', 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) - resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'} - - - def _upgrade_data_warehouse_initial( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.upgrade_data_warehouse.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", 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, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def upgrade_data_warehouse( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Upgrades a data warehouse. - - :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 to be upgraded. - :type database_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._upgrade_data_warehouse_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_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) - upgrade_data_warehouse.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/upgradeDataWarehouse'} - - def rename( - self, resource_group_name, server_name, database_name, id, custom_headers=None, raw=False, **operation_config): - """Renames a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database to rename. - :type database_name: str - :param id: The target ID for the resource - :type id: 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` - """ - parameters = models.ResourceMoveDefinition(id=id) - - api_version = "2020-08-01-preview" - - # Construct URL - url = self.rename.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ResourceMoveDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - 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 - rename.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/move'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py index a932f04fb38..a9a0b1cad46 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py @@ -12,8 +12,6 @@ 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 @@ -27,6 +25,7 @@ class ElasticPoolsOperations(object): :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: "2014-04-01". """ models = models @@ -36,6 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2014-04-01" self.config = config @@ -64,8 +64,6 @@ def list_metrics( ~azure.mgmt.sql.models.MetricPaged[~azure.mgmt.sql.models.Metric] :raises: :class:`CloudError` """ - api_version = "2014-04-01" - def prepare_request(next_link=None): if not next_link: # Construct URL @@ -80,7 +78,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') else: @@ -144,8 +142,6 @@ def list_metric_definitions( ~azure.mgmt.sql.models.MetricDefinitionPaged[~azure.mgmt.sql.models.MetricDefinition] :raises: :class:`CloudError` """ - api_version = "2014-04-01" - def prepare_request(next_link=None): if not next_link: # Construct URL @@ -160,7 +156,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -200,543 +196,3 @@ def internal_paging(next_link=None): return deserialized list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'} - - def list_by_server( - self, resource_group_name, server_name, skip=None, custom_headers=None, raw=False, **operation_config): - """Gets all elastic pools in a server. - - :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 skip: The number of elements in the collection to skip. - :type skip: int - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ElasticPool - :rtype: - ~azure.mgmt.sql.models.ElasticPoolPaged[~azure.mgmt.sql.models.ElasticPool] - :raises: :class:`CloudError` - """ - api_version = "2020-08-01-preview" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_server.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['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) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - 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 - header_dict = None - if raw: - header_dict = {} - deserialized = models.ElasticPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools'} - - def get( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - """Gets an elastic 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 server_name: The name of the server. - :type server_name: str - :param elastic_pool_name: The name of the elastic pool. - :type elastic_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: ElasticPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ElasticPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - api_version = "2020-08-01-preview" - - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_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("api_version", 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('ElasticPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}'} - - - def _create_or_update_initial( - self, resource_group_name, server_name, elastic_pool_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_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("api_version", 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, 'ElasticPool') - - # 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('ElasticPool', response) - if response.status_code == 201: - deserialized = self._deserialize('ElasticPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, server_name, elastic_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updates an elastic 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 server_name: The name of the server. - :type server_name: str - :param elastic_pool_name: The name of the elastic pool. - :type elastic_pool_name: str - :param parameters: The elastic pool parameters. - :type parameters: ~azure.mgmt.sql.models.ElasticPool - :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 ElasticPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ElasticPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ElasticPool]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ElasticPool', 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/servers/{serverName}/elasticPools/{elasticPoolName}'} - - - def _delete_initial( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_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("api_version", 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, server_name, elastic_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an elastic 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 server_name: The name of the server. - :type server_name: str - :param elastic_pool_name: The name of the elastic pool. - :type elastic_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, - server_name=server_name, - elastic_pool_name=elastic_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/servers/{serverName}/elasticPools/{elasticPoolName}'} - - - def _update_initial( - self, resource_group_name, server_name, elastic_pool_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_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("api_version", 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, 'ElasticPoolUpdate') - - # 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('ElasticPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, server_name, elastic_pool_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates an elastic 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 server_name: The name of the server. - :type server_name: str - :param elastic_pool_name: The name of the elastic pool. - :type elastic_pool_name: str - :param parameters: The elastic pool update parameters. - :type parameters: ~azure.mgmt.sql.models.ElasticPoolUpdate - :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 ElasticPool or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ElasticPool] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ElasticPool]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_pool_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ElasticPool', 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/servers/{serverName}/elasticPools/{elasticPoolName}'} - - - def _failover_initial( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.failover.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'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_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("api_version", 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, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def failover( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Failovers an elastic 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 server_name: The name of the server. - :type server_name: str - :param elastic_pool_name: The name of the elastic pool to failover. - :type elastic_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._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - elastic_pool_name=elastic_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) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/failover'}