diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 68a33220325e..a84dc982d5a2 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -122,6 +122,7 @@ from .partner_region_info_py3 import PartnerRegionInfo from .managed_instance_pair_info_py3 import ManagedInstancePairInfo from .instance_failover_group_py3 import InstanceFailoverGroup + from .short_term_retention_policy_py3 import ShortTermRetentionPolicy except (SyntaxError, ImportError): from .resource import Resource from .tracked_resource import TrackedResource @@ -235,6 +236,7 @@ from .partner_region_info import PartnerRegionInfo from .managed_instance_pair_info import ManagedInstancePairInfo from .instance_failover_group import InstanceFailoverGroup + from .short_term_retention_policy import ShortTermRetentionPolicy from .recoverable_database_paged import RecoverableDatabasePaged from .restorable_dropped_database_paged import RestorableDroppedDatabasePaged from .server_paged import ServerPaged @@ -458,6 +460,7 @@ 'PartnerRegionInfo', 'ManagedInstancePairInfo', 'InstanceFailoverGroup', + 'ShortTermRetentionPolicy', 'RecoverableDatabasePaged', 'RestorableDroppedDatabasePaged', 'ServerPaged', diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py index 504004dd9224..1e740145e464 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/backup_long_term_retention_policy_py3.py @@ -55,7 +55,7 @@ class BackupLongTermRetentionPolicy(ProxyResource): } def __init__(self, *, weekly_retention: str=None, monthly_retention: str=None, yearly_retention: str=None, week_of_year: int=None, **kwargs) -> None: - super(BackupLongTermRetentionPolicy, self).__init__(, **kwargs) + super(BackupLongTermRetentionPolicy, self).__init__(**kwargs) self.weekly_retention = weekly_retention self.monthly_retention = monthly_retention self.yearly_retention = yearly_retention diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py index f0dc01c073c8..6c601254aa8b 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_policy_py3.py @@ -71,7 +71,7 @@ class DataMaskingPolicy(ProxyResource): } def __init__(self, *, data_masking_state, exempt_principals: str=None, **kwargs) -> None: - super(DataMaskingPolicy, self).__init__(, **kwargs) + super(DataMaskingPolicy, self).__init__(**kwargs) self.data_masking_state = data_masking_state self.exempt_principals = exempt_principals self.application_principals = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py index 51cea61d8e26..e576d5643c02 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/data_masking_rule_py3.py @@ -112,7 +112,7 @@ class DataMaskingRule(ProxyResource): } def __init__(self, *, schema_name: str, table_name: str, column_name: str, masking_function, alias_name: str=None, rule_state=None, number_from: str=None, number_to: str=None, prefix_size: str=None, suffix_size: str=None, replacement_string: str=None, **kwargs) -> None: - super(DataMaskingRule, self).__init__(, **kwargs) + super(DataMaskingRule, self).__init__(**kwargs) self.data_masking_rule_id = None self.alias_name = alias_name self.rule_state = rule_state diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py index ce568a2154fa..ff274ebc8969 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_automatic_tuning_py3.py @@ -51,7 +51,7 @@ class DatabaseAutomaticTuning(ProxyResource): } def __init__(self, *, desired_state=None, options=None, **kwargs) -> None: - super(DatabaseAutomaticTuning, self).__init__(, **kwargs) + super(DatabaseAutomaticTuning, self).__init__(**kwargs) self.desired_state = desired_state self.actual_state = None self.options = options diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py index 3ec984bdde49..d2dccefb38d9 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_blob_auditing_policy_py3.py @@ -77,7 +77,7 @@ class DatabaseBlobAuditingPolicy(ProxyResource): } def __init__(self, *, state, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, **kwargs) -> None: - super(DatabaseBlobAuditingPolicy, self).__init__(, **kwargs) + super(DatabaseBlobAuditingPolicy, self).__init__(**kwargs) self.kind = None self.state = state self.storage_endpoint = storage_endpoint diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py index 5a5668b45117..51f5690a2308 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_operation_py3.py @@ -98,7 +98,7 @@ class DatabaseOperation(ProxyResource): } def __init__(self, **kwargs) -> None: - super(DatabaseOperation, self).__init__(, **kwargs) + super(DatabaseOperation, self).__init__(**kwargs) self.database_name = None self.operation = None self.operation_friendly_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py index d4ebcaa112e2..85b31a408282 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/database_security_alert_policy_py3.py @@ -88,7 +88,7 @@ class DatabaseSecurityAlertPolicy(ProxyResource): } def __init__(self, *, state, location: str=None, disabled_alerts: str=None, email_addresses: str=None, email_account_admins=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, use_server_default=None, **kwargs) -> None: - super(DatabaseSecurityAlertPolicy, self).__init__(, **kwargs) + super(DatabaseSecurityAlertPolicy, self).__init__(**kwargs) self.location = location self.kind = None self.state = state diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py index 3247123a2924..71f4b850d657 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_activity_py3.py @@ -127,7 +127,7 @@ class ElasticPoolActivity(ProxyResource): } def __init__(self, *, location: str=None, **kwargs) -> None: - super(ElasticPoolActivity, self).__init__(, **kwargs) + super(ElasticPoolActivity, self).__init__(**kwargs) self.location = location self.end_time = None self.error_code = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py index fb595d61b4f0..d650605d6e4c 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity_py3.py @@ -106,7 +106,7 @@ class ElasticPoolDatabaseActivity(ProxyResource): } def __init__(self, *, location: str=None, **kwargs) -> None: - super(ElasticPoolDatabaseActivity, self).__init__(, **kwargs) + super(ElasticPoolDatabaseActivity, self).__init__(**kwargs) self.location = location self.database_name = None self.end_time = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py index 978f440e7e65..13add58062c7 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_operation_py3.py @@ -97,7 +97,7 @@ class ElasticPoolOperation(ProxyResource): } def __init__(self, **kwargs) -> None: - super(ElasticPoolOperation, self).__init__(, **kwargs) + super(ElasticPoolOperation, self).__init__(**kwargs) self.elastic_pool_name = None self.operation = None self.operation_friendly_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py index e562df5eab3e..33e6c18db636 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/encryption_protector_py3.py @@ -70,7 +70,7 @@ class EncryptionProtector(ProxyResource): } def __init__(self, *, server_key_type, kind: str=None, server_key_name: str=None, **kwargs) -> None: - super(EncryptionProtector, self).__init__(, **kwargs) + super(EncryptionProtector, self).__init__(**kwargs) self.kind = kind self.location = None self.subregion = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py index 445b59c81fe6..fdc42b2246c3 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/failover_group_py3.py @@ -77,7 +77,7 @@ class FailoverGroup(ProxyResource): } def __init__(self, *, read_write_endpoint, partner_servers, tags=None, read_only_endpoint=None, databases=None, **kwargs) -> None: - super(FailoverGroup, self).__init__(, **kwargs) + super(FailoverGroup, self).__init__(**kwargs) self.location = None self.tags = tags self.read_write_endpoint = read_write_endpoint diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py index da8cffb9ed8b..c218f1eaebae 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/firewall_rule_py3.py @@ -61,7 +61,7 @@ class FirewallRule(ProxyResource): } def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs) -> None: - super(FirewallRule, self).__init__(, **kwargs) + super(FirewallRule, self).__init__(**kwargs) self.kind = None self.location = None self.start_ip_address = start_ip_address diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py index b0bafcda9c07..12c801a92091 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/geo_backup_policy_py3.py @@ -59,7 +59,7 @@ class GeoBackupPolicy(ProxyResource): } def __init__(self, *, state, **kwargs) -> None: - super(GeoBackupPolicy, self).__init__(, **kwargs) + super(GeoBackupPolicy, self).__init__(**kwargs) self.state = state self.storage_type = None self.kind = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py index 5fe8d4ad7277..8603208ee044 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/import_export_response_py3.py @@ -75,7 +75,7 @@ class ImportExportResponse(ProxyResource): } def __init__(self, **kwargs) -> None: - super(ImportExportResponse, self).__init__(, **kwargs) + super(ImportExportResponse, self).__init__(**kwargs) self.request_type = None self.request_id = None self.server_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py index a3da8a6a7f55..885fd2a8d52e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py @@ -73,7 +73,7 @@ class InstanceFailoverGroup(ProxyResource): } def __init__(self, *, read_write_endpoint, partner_regions, managed_instance_pairs, read_only_endpoint=None, **kwargs) -> None: - super(InstanceFailoverGroup, self).__init__(, **kwargs) + super(InstanceFailoverGroup, self).__init__(**kwargs) self.read_write_endpoint = read_write_endpoint self.read_only_endpoint = read_only_endpoint self.replication_role = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py index f13c13cb96ef..a7d128063b24 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/long_term_retention_backup_py3.py @@ -64,7 +64,7 @@ class LongTermRetentionBackup(ProxyResource): } def __init__(self, **kwargs) -> None: - super(LongTermRetentionBackup, self).__init__(, **kwargs) + super(LongTermRetentionBackup, self).__init__(**kwargs) self.server_name = None self.server_create_time = None self.database_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py index 82b27165466d..322fccf81120 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/proxy_resource_py3.py @@ -39,4 +39,4 @@ class ProxyResource(Resource): } def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(, **kwargs) + super(ProxyResource, self).__init__(**kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py index 1875a621a150..f11b8a1bc507 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_elastic_pool_py3.py @@ -86,7 +86,7 @@ class RecommendedElasticPool(ProxyResource): } def __init__(self, *, dtu: float=None, database_dtu_min: float=None, database_dtu_max: float=None, storage_mb: float=None, **kwargs) -> None: - super(RecommendedElasticPool, self).__init__(, **kwargs) + super(RecommendedElasticPool, self).__init__(**kwargs) self.database_edition = None self.dtu = dtu self.database_dtu_min = database_dtu_min diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py index ea10a0d99ce5..446e1fafd8e0 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recommended_index_py3.py @@ -97,7 +97,7 @@ class RecommendedIndex(ProxyResource): } def __init__(self, **kwargs) -> None: - super(RecommendedIndex, self).__init__(, **kwargs) + super(RecommendedIndex, self).__init__(**kwargs) self.action = None self.state = None self.created = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py index 5d52528f0cdd..5b753144dc76 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/recoverable_database_py3.py @@ -57,7 +57,7 @@ class RecoverableDatabase(ProxyResource): } def __init__(self, **kwargs) -> None: - super(RecoverableDatabase, self).__init__(, **kwargs) + super(RecoverableDatabase, self).__init__(**kwargs) self.edition = None self.service_level_objective = None self.elastic_pool_name = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py index 3aff76905d4b..98ca741b476a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/replication_link_py3.py @@ -90,7 +90,7 @@ class ReplicationLink(ProxyResource): } def __init__(self, **kwargs) -> None: - super(ReplicationLink, self).__init__(, **kwargs) + super(ReplicationLink, self).__init__(**kwargs) self.location = None self.is_termination_allowed = None self.replication_mode = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py index 3c73e1ac8fc2..80b7d9c9b02b 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/restorable_dropped_database_py3.py @@ -77,7 +77,7 @@ class RestorableDroppedDatabase(ProxyResource): } def __init__(self, **kwargs) -> None: - super(RestorableDroppedDatabase, self).__init__(, **kwargs) + super(RestorableDroppedDatabase, self).__init__(**kwargs) self.location = None self.database_name = None self.edition = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py index fde0cc450c27..f86ba3ed37b2 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/restore_point_py3.py @@ -63,7 +63,7 @@ class RestorePoint(ProxyResource): } def __init__(self, **kwargs) -> None: - super(RestorePoint, self).__init__(, **kwargs) + super(RestorePoint, self).__init__(**kwargs) self.location = None self.restore_point_type = None self.earliest_restore_date = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py index 36405340849f..4c31615adcb9 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_automatic_tuning_py3.py @@ -54,7 +54,7 @@ class ServerAutomaticTuning(ProxyResource): } def __init__(self, *, desired_state=None, options=None, **kwargs) -> None: - super(ServerAutomaticTuning, self).__init__(, **kwargs) + super(ServerAutomaticTuning, self).__init__(**kwargs) self.desired_state = desired_state self.actual_state = None self.options = options diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py index 02eb5cc46559..fb5d93d90546 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_azure_ad_administrator_py3.py @@ -61,7 +61,7 @@ class ServerAzureADAdministrator(ProxyResource): administrator_type = "ActiveDirectory" def __init__(self, *, login: str, sid: str, tenant_id: str, **kwargs) -> None: - super(ServerAzureADAdministrator, self).__init__(, **kwargs) + super(ServerAzureADAdministrator, self).__init__(**kwargs) self.login = login self.sid = sid self.tenant_id = tenant_id diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py index f19d796e39f6..58795afad14e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_communication_link_py3.py @@ -58,7 +58,7 @@ class ServerCommunicationLink(ProxyResource): } def __init__(self, *, partner_server: str, **kwargs) -> None: - super(ServerCommunicationLink, self).__init__(, **kwargs) + super(ServerCommunicationLink, self).__init__(**kwargs) self.state = None self.partner_server = partner_server self.location = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py index a7259caba9c2..60164406821b 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_connection_policy_py3.py @@ -54,7 +54,7 @@ class ServerConnectionPolicy(ProxyResource): } def __init__(self, *, connection_type, **kwargs) -> None: - super(ServerConnectionPolicy, self).__init__(, **kwargs) + super(ServerConnectionPolicy, self).__init__(**kwargs) self.kind = None self.location = None self.connection_type = connection_type diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py index 3bc780cfd02a..1a49b635ca8a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_dns_alias_py3.py @@ -43,5 +43,5 @@ class ServerDnsAlias(ProxyResource): } def __init__(self, **kwargs) -> None: - super(ServerDnsAlias, self).__init__(, **kwargs) + super(ServerDnsAlias, self).__init__(**kwargs) self.azure_dns_record = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py index 46f83aeb3c00..5b8569a81ea3 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/server_key_py3.py @@ -68,7 +68,7 @@ class ServerKey(ProxyResource): } def __init__(self, *, server_key_type, kind: str=None, uri: str=None, thumbprint: str=None, creation_date=None, **kwargs) -> None: - super(ServerKey, self).__init__(, **kwargs) + super(ServerKey, self).__init__(**kwargs) self.kind = kind self.location = None self.subregion = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py index 1cff029cbef6..e4e590716ec4 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/service_objective_py3.py @@ -61,7 +61,7 @@ class ServiceObjective(ProxyResource): } def __init__(self, **kwargs) -> None: - super(ServiceObjective, self).__init__(, **kwargs) + super(ServiceObjective, self).__init__(**kwargs) self.service_objective_name = None self.is_default = None self.is_system = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py index 1154175bf10c..0cc77ab82872 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/service_tier_advisor_py3.py @@ -135,7 +135,7 @@ class ServiceTierAdvisor(ProxyResource): } def __init__(self, **kwargs) -> None: - super(ServiceTierAdvisor, self).__init__(, **kwargs) + super(ServiceTierAdvisor, self).__init__(**kwargs) self.observation_period_start = None self.observation_period_end = None self.active_time_ratio = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy.py b/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy.py new file mode 100644 index 000000000000..53c62080f29b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class ShortTermRetentionPolicy(ProxyResource): + """A short term retention policy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param retention_days: The backup retention period in days. This is how + many days Point-in-Time Restore will be supported. + :type retention_days: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ShortTermRetentionPolicy, self).__init__(**kwargs) + self.retention_days = kwargs.get('retention_days', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py new file mode 100644 index 000000000000..49d6849c203e --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py @@ -0,0 +1,47 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .proxy_resource import ProxyResource + + +class ShortTermRetentionPolicy(ProxyResource): + """A short term retention policy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param retention_days: The backup retention period in days. This is how + many days Point-in-Time Restore will be supported. + :type retention_days: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + } + + def __init__(self, *, retention_days: int=None, **kwargs) -> None: + super(ShortTermRetentionPolicy, self).__init__(**kwargs) + self.retention_days = retention_days diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py index d423b2c8f9a6..a4ba7cd8c102 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/subscription_usage_py3.py @@ -55,7 +55,7 @@ class SubscriptionUsage(ProxyResource): } def __init__(self, **kwargs) -> None: - super(SubscriptionUsage, self).__init__(, **kwargs) + super(SubscriptionUsage, self).__init__(**kwargs) self.display_name = None self.current_value = None self.limit = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py index 21f3f098b6b6..30a633cda9a1 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_linked_database_py3.py @@ -64,7 +64,7 @@ class SyncAgentLinkedDatabase(ProxyResource): } def __init__(self, **kwargs) -> None: - super(SyncAgentLinkedDatabase, self).__init__(, **kwargs) + super(SyncAgentLinkedDatabase, self).__init__(**kwargs) self.database_type = None self.database_id = None self.description = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py index fdbde09feaaf..06fa4a8f1100 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_agent_py3.py @@ -68,7 +68,7 @@ class SyncAgent(ProxyResource): } def __init__(self, *, sync_database_id: str=None, **kwargs) -> None: - super(SyncAgent, self).__init__(, **kwargs) + super(SyncAgent, self).__init__(**kwargs) self.sync_agent_name = None self.sync_database_id = sync_database_id self.last_alive_time = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py index ef4d9b5c4e09..8d1a557ef6ca 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_group_py3.py @@ -71,7 +71,7 @@ class SyncGroup(ProxyResource): } def __init__(self, *, interval: int=None, conflict_resolution_policy=None, sync_database_id: str=None, hub_database_user_name: str=None, hub_database_password: str=None, schema=None, **kwargs) -> None: - super(SyncGroup, self).__init__(, **kwargs) + super(SyncGroup, self).__init__(**kwargs) self.interval = interval self.last_sync_time = None self.conflict_resolution_policy = conflict_resolution_policy diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py index 2de86a351632..74b903a63b0f 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sync_member_py3.py @@ -77,7 +77,7 @@ class SyncMember(ProxyResource): } def __init__(self, *, database_type=None, sync_agent_id: str=None, sql_server_database_id: str=None, server_name: str=None, database_name: str=None, user_name: str=None, password: str=None, sync_direction=None, **kwargs) -> None: - super(SyncMember, self).__init__(, **kwargs) + super(SyncMember, self).__init__(**kwargs) self.database_type = database_type self.sync_agent_id = sync_agent_id self.sql_server_database_id = sql_server_database_id diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py index 0564a5188e2a..4d8ec200976a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/tracked_resource_py3.py @@ -48,6 +48,6 @@ class TrackedResource(Resource): } def __init__(self, *, location: str, tags=None, **kwargs) -> None: - super(TrackedResource, self).__init__(, **kwargs) + super(TrackedResource, self).__init__(**kwargs) self.tags = tags self.location = location diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py index 3302a21c7431..f8d509c9a56e 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_activity_py3.py @@ -54,7 +54,7 @@ class TransparentDataEncryptionActivity(ProxyResource): } def __init__(self, **kwargs) -> None: - super(TransparentDataEncryptionActivity, self).__init__(, **kwargs) + super(TransparentDataEncryptionActivity, self).__init__(**kwargs) self.location = None self.status = None self.percent_complete = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py index 847a88fc7b59..bc38ca655789 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/transparent_data_encryption_py3.py @@ -48,6 +48,6 @@ class TransparentDataEncryption(ProxyResource): } def __init__(self, *, status=None, **kwargs) -> None: - super(TransparentDataEncryption, self).__init__(, **kwargs) + super(TransparentDataEncryption, self).__init__(**kwargs) self.location = None self.status = status diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py index f37229f245b3..4fd7a128505a 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/virtual_network_rule_py3.py @@ -55,7 +55,7 @@ class VirtualNetworkRule(ProxyResource): } def __init__(self, *, virtual_network_subnet_id: str, ignore_missing_vnet_service_endpoint: bool=None, **kwargs) -> None: - super(VirtualNetworkRule, self).__init__(, **kwargs) + super(VirtualNetworkRule, self).__init__(**kwargs) self.virtual_network_subnet_id = virtual_network_subnet_id self.ignore_missing_vnet_service_endpoint = ignore_missing_vnet_service_endpoint self.state = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index b8252710a9d4..54f846ee2941 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -54,6 +54,7 @@ from .elastic_pool_operations import ElasticPoolOperations from .capabilities_operations import CapabilitiesOperations from .instance_failover_groups_operations import InstanceFailoverGroupsOperations +from .short_term_retention_policies_operations import ShortTermRetentionPoliciesOperations __all__ = [ 'RecoverableDatabasesOperations', @@ -101,4 +102,5 @@ 'ElasticPoolOperations', 'CapabilitiesOperations', 'InstanceFailoverGroupsOperations', + 'ShortTermRetentionPoliciesOperations', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/short_term_retention_policies_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/short_term_retention_policies_operations.py new file mode 100644 index 000000000000..d1b13416523d --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/short_term_retention_policies_operations.py @@ -0,0 +1,332 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ShortTermRetentionPoliciesOperations(object): + """ShortTermRetentionPoliciesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar policy_name: The policy name. Should always be "default". Constant value: "default". + :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.policy_name = "default" + self.api_version = "2017-10-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a database's short term retention policy. + + :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: ShortTermRetentionPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ShortTermRetentionPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'policyName': self._serialize.url("self.policy_name", self.policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters) + response = self._client.send(request, header_parameters, 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('ShortTermRetentionPolicy', 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}/backupShortTermRetentionPolicies/{policyName}'} + + + def _create_or_update_initial( + self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ShortTermRetentionPolicy(retention_days=retention_days) + + # 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'), + 'policyName': self._serialize.url("self.policy_name", self.policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'ShortTermRetentionPolicy') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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('ShortTermRetentionPolicy', 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, retention_days=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a database's short term retention policy. + + :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 retention_days: The backup retention period in days. This is + how many days Point-in-Time Restore will be supported. + :type retention_days: int + :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 + ShortTermRetentionPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ShortTermRetentionPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ShortTermRetentionPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + retention_days=retention_days, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ShortTermRetentionPolicy', 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}/backupShortTermRetentionPolicies/{policyName}'} + + + def _update_initial( + self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ShortTermRetentionPolicy(retention_days=retention_days) + + # 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'), + 'policyName': self._serialize.url("self.policy_name", self.policy_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['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, 'ShortTermRetentionPolicy') + + # Construct and send request + request = self._client.patch(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, 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('ShortTermRetentionPolicy', 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, retention_days=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a database's short term retention policy. + + :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 retention_days: The backup retention period in days. This is + how many days Point-in-Time Restore will be supported. + :type retention_days: int + :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 + ShortTermRetentionPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ShortTermRetentionPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ShortTermRetentionPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + retention_days=retention_days, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ShortTermRetentionPolicy', 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}/backupShortTermRetentionPolicies/{policyName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py index a456e841a328..9aa7e05bf265 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -58,6 +58,7 @@ from .operations.elastic_pool_operations import ElasticPoolOperations from .operations.capabilities_operations import CapabilitiesOperations from .operations.instance_failover_groups_operations import InstanceFailoverGroupsOperations +from .operations.short_term_retention_policies_operations import ShortTermRetentionPoliciesOperations from . import models @@ -94,7 +95,7 @@ def __init__( self.subscription_id = subscription_id -class SqlManagementClient(object): +class SqlManagementClient(SDKClient): """The Azure SQL Database management API provides a RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete databases. :ivar config: Configuration for client. @@ -190,6 +191,8 @@ class SqlManagementClient(object): :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations :ivar instance_failover_groups: InstanceFailoverGroups operations :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations + :ivar short_term_retention_policies: ShortTermRetentionPolicies operations + :vartype short_term_retention_policies: azure.mgmt.sql.operations.ShortTermRetentionPoliciesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -204,7 +207,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = SqlManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(SqlManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) @@ -300,3 +303,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self.config, self._serialize, self._deserialize) + self.short_term_retention_policies = ShortTermRetentionPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize)