From e0507ce34f87959ed1e5730916fe6e46d3a93d87 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 20 Apr 2018 01:05:35 +0000 Subject: [PATCH 1/2] Generated from 15e066396a2791da1195f7d902ec6cdd27dc99aa Removed ShortTermRetentionPolicies_ListByDatabase until it is fixed to return array --- .../azure/mgmt/sql/models/__init__.py | 62 +- .../backup_long_term_retention_policy_py3.py | 2 +- .../complete_database_restore_definition.py | 35 -- ...omplete_database_restore_definition_py3.py | 35 -- .../sql/models/data_masking_policy_py3.py | 2 +- .../mgmt/sql/models/data_masking_rule_py3.py | 2 +- .../models/database_automatic_tuning_py3.py | 2 +- .../database_blob_auditing_policy_py3.py | 2 +- .../mgmt/sql/models/database_operation_py3.py | 2 +- .../database_security_alert_policy_py3.py | 2 +- .../sql/models/elastic_pool_activity_py3.py | 2 +- .../elastic_pool_database_activity_py3.py | 2 +- .../sql/models/elastic_pool_operation_py3.py | 2 +- .../sql/models/encryption_protector_py3.py | 2 +- .../mgmt/sql/models/failover_group_py3.py | 2 +- .../mgmt/sql/models/firewall_rule_py3.py | 2 +- .../mgmt/sql/models/geo_backup_policy_py3.py | 2 +- .../sql/models/import_export_response_py3.py | 2 +- .../sql/models/instance_failover_group.py | 82 --- .../models/instance_failover_group_paged.py | 27 - .../sql/models/instance_failover_group_py3.py | 82 --- ...tance_failover_group_read_only_endpoint.py | 30 - ...e_failover_group_read_only_endpoint_py3.py | 30 - ...ance_failover_group_read_write_endpoint.py | 45 -- ..._failover_group_read_write_endpoint_py3.py | 45 -- .../models/long_term_retention_backup_py3.py | 2 +- .../azure/mgmt/sql/models/managed_database.py | 123 ---- .../mgmt/sql/models/managed_database_paged.py | 27 - .../mgmt/sql/models/managed_database_py3.py | 123 ---- .../sql/models/managed_database_update.py | 106 ---- .../sql/models/managed_database_update_py3.py | 106 ---- .../azure/mgmt/sql/models/managed_instance.py | 99 --- .../mgmt/sql/models/managed_instance_paged.py | 27 - .../sql/models/managed_instance_pair_info.py | 34 - .../models/managed_instance_pair_info_py3.py | 34 - .../mgmt/sql/models/managed_instance_py3.py | 99 --- .../sql/models/managed_instance_update.py | 77 --- .../sql/models/managed_instance_update_py3.py | 77 --- .../mgmt/sql/models/partner_region_info.py | 41 -- .../sql/models/partner_region_info_py3.py | 41 -- .../mgmt/sql/models/proxy_resource_py3.py | 2 +- .../models/recommended_elastic_pool_py3.py | 2 +- .../mgmt/sql/models/recommended_index_py3.py | 2 +- .../sql/models/recoverable_database_py3.py | 2 +- .../mgmt/sql/models/replication_link_py3.py | 2 +- .../models/restorable_dropped_database_py3.py | 2 +- .../mgmt/sql/models/restore_point_py3.py | 2 +- .../sql/models/server_automatic_tuning_py3.py | 2 +- .../server_azure_ad_administrator_py3.py | 2 +- .../models/server_communication_link_py3.py | 2 +- .../models/server_connection_policy_py3.py | 2 +- .../mgmt/sql/models/server_dns_alias_py3.py | 2 +- .../azure/mgmt/sql/models/server_key_py3.py | 2 +- .../mgmt/sql/models/service_objective_py3.py | 2 +- .../sql/models/service_tier_advisor_py3.py | 2 +- .../sql/models/sql_management_client_enums.py | 44 +- .../mgmt/sql/models/subscription_usage_py3.py | 2 +- .../models/sync_agent_linked_database_py3.py | 2 +- .../azure/mgmt/sql/models/sync_agent_py3.py | 2 +- .../azure/mgmt/sql/models/sync_group_py3.py | 2 +- .../azure/mgmt/sql/models/sync_member_py3.py | 2 +- .../mgmt/sql/models/tracked_resource_py3.py | 2 +- ...ransparent_data_encryption_activity_py3.py | 2 +- .../models/transparent_data_encryption_py3.py | 2 +- .../sql/models/virtual_network_rule_py3.py | 2 +- .../azure/mgmt/sql/operations/__init__.py | 6 - .../instance_failover_groups_operations.py | 580 ------------------ .../managed_databases_operations.py | 571 ----------------- .../managed_instances_operations.py | 527 ---------------- .../azure/mgmt/sql/sql_management_client.py | 21 +- 70 files changed, 64 insertions(+), 3252 deletions(-) delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py delete mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 68a33220325e..5423a4320c1c 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -57,13 +57,10 @@ from .partner_info_py3 import PartnerInfo from .failover_group_py3 import FailoverGroup from .failover_group_update_py3 import FailoverGroupUpdate - from .resource_identity_py3 import ResourceIdentity - from .sku_py3 import Sku - from .managed_instance_py3 import ManagedInstance - from .managed_instance_update_py3 import ManagedInstanceUpdate from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation from .server_key_py3 import ServerKey + from .resource_identity_py3 import ResourceIdentity from .server_py3 import Server from .server_update_py3 import ServerUpdate from .sync_agent_py3 import SyncAgent @@ -83,9 +80,6 @@ from .virtual_network_rule_py3 import VirtualNetworkRule from .long_term_retention_backup_py3 import LongTermRetentionBackup from .backup_long_term_retention_policy_py3 import BackupLongTermRetentionPolicy - from .complete_database_restore_definition_py3 import CompleteDatabaseRestoreDefinition - from .managed_database_py3 import ManagedDatabase - from .managed_database_update_py3 import ManagedDatabaseUpdate from .automatic_tuning_server_options_py3 import AutomaticTuningServerOptions from .server_automatic_tuning_py3 import ServerAutomaticTuning from .server_dns_alias_py3 import ServerDnsAlias @@ -98,6 +92,7 @@ from .log_size_capability_py3 import LogSizeCapability from .max_size_range_capability_py3 import MaxSizeRangeCapability from .performance_level_capability_py3 import PerformanceLevelCapability + from .sku_py3 import Sku from .license_type_capability_py3 import LicenseTypeCapability from .service_objective_capability_py3 import ServiceObjectiveCapability from .edition_capability_py3 import EditionCapability @@ -117,11 +112,6 @@ from .elastic_pool_per_database_settings_py3 import ElasticPoolPerDatabaseSettings from .elastic_pool_py3 import ElasticPool from .elastic_pool_update_py3 import ElasticPoolUpdate - from .instance_failover_group_read_write_endpoint_py3 import InstanceFailoverGroupReadWriteEndpoint - from .instance_failover_group_read_only_endpoint_py3 import InstanceFailoverGroupReadOnlyEndpoint - from .partner_region_info_py3 import PartnerRegionInfo - from .managed_instance_pair_info_py3 import ManagedInstancePairInfo - from .instance_failover_group_py3 import InstanceFailoverGroup except (SyntaxError, ImportError): from .resource import Resource from .tracked_resource import TrackedResource @@ -170,13 +160,10 @@ from .partner_info import PartnerInfo from .failover_group import FailoverGroup from .failover_group_update import FailoverGroupUpdate - from .resource_identity import ResourceIdentity - from .sku import Sku - from .managed_instance import ManagedInstance - from .managed_instance_update import ManagedInstanceUpdate from .operation_display import OperationDisplay from .operation import Operation from .server_key import ServerKey + from .resource_identity import ResourceIdentity from .server import Server from .server_update import ServerUpdate from .sync_agent import SyncAgent @@ -196,9 +183,6 @@ from .virtual_network_rule import VirtualNetworkRule from .long_term_retention_backup import LongTermRetentionBackup from .backup_long_term_retention_policy import BackupLongTermRetentionPolicy - from .complete_database_restore_definition import CompleteDatabaseRestoreDefinition - from .managed_database import ManagedDatabase - from .managed_database_update import ManagedDatabaseUpdate from .automatic_tuning_server_options import AutomaticTuningServerOptions from .server_automatic_tuning import ServerAutomaticTuning from .server_dns_alias import ServerDnsAlias @@ -211,6 +195,7 @@ from .log_size_capability import LogSizeCapability from .max_size_range_capability import MaxSizeRangeCapability from .performance_level_capability import PerformanceLevelCapability + from .sku import Sku from .license_type_capability import LicenseTypeCapability from .service_objective_capability import ServiceObjectiveCapability from .edition_capability import EditionCapability @@ -230,11 +215,6 @@ from .elastic_pool_per_database_settings import ElasticPoolPerDatabaseSettings from .elastic_pool import ElasticPool from .elastic_pool_update import ElasticPoolUpdate - from .instance_failover_group_read_write_endpoint import InstanceFailoverGroupReadWriteEndpoint - from .instance_failover_group_read_only_endpoint import InstanceFailoverGroupReadOnlyEndpoint - from .partner_region_info import PartnerRegionInfo - from .managed_instance_pair_info import ManagedInstancePairInfo - from .instance_failover_group import InstanceFailoverGroup from .recoverable_database_paged import RecoverableDatabasePaged from .restorable_dropped_database_paged import RestorableDroppedDatabasePaged from .server_paged import ServerPaged @@ -259,7 +239,6 @@ from .database_usage_paged import DatabaseUsagePaged from .encryption_protector_paged import EncryptionProtectorPaged from .failover_group_paged import FailoverGroupPaged -from .managed_instance_paged import ManagedInstancePaged from .operation_paged import OperationPaged from .server_key_paged import ServerKeyPaged from .sync_agent_paged import SyncAgentPaged @@ -272,12 +251,10 @@ from .subscription_usage_paged import SubscriptionUsagePaged from .virtual_network_rule_paged import VirtualNetworkRulePaged from .long_term_retention_backup_paged import LongTermRetentionBackupPaged -from .managed_database_paged import ManagedDatabasePaged from .server_dns_alias_paged import ServerDnsAliasPaged from .restore_point_paged import RestorePointPaged from .database_operation_paged import DatabaseOperationPaged from .elastic_pool_operation_paged import ElasticPoolOperationPaged -from .instance_failover_group_paged import InstanceFailoverGroupPaged from .sql_management_client_enums import ( CheckNameAvailabilityReason, ServerConnectionType, @@ -312,8 +289,8 @@ ReadWriteEndpointFailoverPolicy, ReadOnlyEndpointFailoverPolicy, FailoverGroupReplicationRole, - IdentityType, OperationOrigin, + IdentityType, SyncAgentState, SyncMemberDbType, SyncGroupLogType, @@ -322,9 +299,6 @@ SyncDirection, SyncMemberState, VirtualNetworkRuleState, - ManagedDatabaseStatus, - CatalogCollationType, - ManagedDatabaseCreateMode, AutomaticTuningServerMode, AutomaticTuningServerReason, RestorePointType, @@ -336,11 +310,11 @@ CreateMode, SampleName, DatabaseStatus, + CatalogCollationType, DatabaseLicenseType, DatabaseReadScale, ElasticPoolState, ElasticPoolLicenseType, - InstanceFailoverGroupReplicationRole, LongTermRetentionDatabaseState, CapabilityGroup, ) @@ -393,13 +367,10 @@ 'PartnerInfo', 'FailoverGroup', 'FailoverGroupUpdate', - 'ResourceIdentity', - 'Sku', - 'ManagedInstance', - 'ManagedInstanceUpdate', 'OperationDisplay', 'Operation', 'ServerKey', + 'ResourceIdentity', 'Server', 'ServerUpdate', 'SyncAgent', @@ -419,9 +390,6 @@ 'VirtualNetworkRule', 'LongTermRetentionBackup', 'BackupLongTermRetentionPolicy', - 'CompleteDatabaseRestoreDefinition', - 'ManagedDatabase', - 'ManagedDatabaseUpdate', 'AutomaticTuningServerOptions', 'ServerAutomaticTuning', 'ServerDnsAlias', @@ -434,6 +402,7 @@ 'LogSizeCapability', 'MaxSizeRangeCapability', 'PerformanceLevelCapability', + 'Sku', 'LicenseTypeCapability', 'ServiceObjectiveCapability', 'EditionCapability', @@ -453,11 +422,6 @@ 'ElasticPoolPerDatabaseSettings', 'ElasticPool', 'ElasticPoolUpdate', - 'InstanceFailoverGroupReadWriteEndpoint', - 'InstanceFailoverGroupReadOnlyEndpoint', - 'PartnerRegionInfo', - 'ManagedInstancePairInfo', - 'InstanceFailoverGroup', 'RecoverableDatabasePaged', 'RestorableDroppedDatabasePaged', 'ServerPaged', @@ -482,7 +446,6 @@ 'DatabaseUsagePaged', 'EncryptionProtectorPaged', 'FailoverGroupPaged', - 'ManagedInstancePaged', 'OperationPaged', 'ServerKeyPaged', 'SyncAgentPaged', @@ -495,12 +458,10 @@ 'SubscriptionUsagePaged', 'VirtualNetworkRulePaged', 'LongTermRetentionBackupPaged', - 'ManagedDatabasePaged', 'ServerDnsAliasPaged', 'RestorePointPaged', 'DatabaseOperationPaged', 'ElasticPoolOperationPaged', - 'InstanceFailoverGroupPaged', 'CheckNameAvailabilityReason', 'ServerConnectionType', 'SecurityAlertPolicyState', @@ -534,8 +495,8 @@ 'ReadWriteEndpointFailoverPolicy', 'ReadOnlyEndpointFailoverPolicy', 'FailoverGroupReplicationRole', - 'IdentityType', 'OperationOrigin', + 'IdentityType', 'SyncAgentState', 'SyncMemberDbType', 'SyncGroupLogType', @@ -544,9 +505,6 @@ 'SyncDirection', 'SyncMemberState', 'VirtualNetworkRuleState', - 'ManagedDatabaseStatus', - 'CatalogCollationType', - 'ManagedDatabaseCreateMode', 'AutomaticTuningServerMode', 'AutomaticTuningServerReason', 'RestorePointType', @@ -558,11 +516,11 @@ 'CreateMode', 'SampleName', 'DatabaseStatus', + 'CatalogCollationType', 'DatabaseLicenseType', 'DatabaseReadScale', 'ElasticPoolState', 'ElasticPoolLicenseType', - 'InstanceFailoverGroupReplicationRole', 'LongTermRetentionDatabaseState', 'CapabilityGroup', ] 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/complete_database_restore_definition.py b/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition.py deleted file mode 100644 index 926012a21f09..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CompleteDatabaseRestoreDefinition(Model): - """Contains the information necessary to perform a complete database restore - operation. - - All required parameters must be populated in order to send to Azure. - - :param last_backup_name: Required. The last backup name to apply - :type last_backup_name: str - """ - - _validation = { - 'last_backup_name': {'required': True}, - } - - _attribute_map = { - 'last_backup_name': {'key': 'lastBackupName', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(CompleteDatabaseRestoreDefinition, self).__init__(**kwargs) - self.last_backup_name = kwargs.get('last_backup_name', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py deleted file mode 100644 index 8b3c7f3da1f8..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py +++ /dev/null @@ -1,35 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class CompleteDatabaseRestoreDefinition(Model): - """Contains the information necessary to perform a complete database restore - operation. - - All required parameters must be populated in order to send to Azure. - - :param last_backup_name: Required. The last backup name to apply - :type last_backup_name: str - """ - - _validation = { - 'last_backup_name': {'required': True}, - } - - _attribute_map = { - 'last_backup_name': {'key': 'lastBackupName', 'type': 'str'}, - } - - def __init__(self, *, last_backup_name: str, **kwargs) -> None: - super(CompleteDatabaseRestoreDefinition, self).__init__(**kwargs) - self.last_backup_name = last_backup_name 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.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group.py deleted file mode 100644 index f360ffbfed57..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource import ProxyResource - - -class InstanceFailoverGroup(ProxyResource): - """An instance failover group. - - 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 read_write_endpoint: Required. Read-write endpoint of the failover - group instance. - :type read_write_endpoint: - ~azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint - :param read_only_endpoint: Read-only endpoint of the failover group - instance. - :type read_only_endpoint: - ~azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint - :ivar replication_role: Local replication role of the failover group - instance. Possible values include: 'Primary', 'Secondary' - :vartype replication_role: str or - ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole - :ivar replication_state: Replication state of the failover group instance. - :vartype replication_state: str - :param partner_regions: Required. Partner region information for the - failover group. - :type partner_regions: list[~azure.mgmt.sql.models.PartnerRegionInfo] - :param managed_instance_pairs: Required. List of managed instance pairs in - the failover group. - :type managed_instance_pairs: - list[~azure.mgmt.sql.models.ManagedInstancePairInfo] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'read_write_endpoint': {'required': True}, - 'replication_role': {'readonly': True}, - 'replication_state': {'readonly': True}, - 'partner_regions': {'required': True}, - 'managed_instance_pairs': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'read_write_endpoint': {'key': 'properties.readWriteEndpoint', 'type': 'InstanceFailoverGroupReadWriteEndpoint'}, - 'read_only_endpoint': {'key': 'properties.readOnlyEndpoint', 'type': 'InstanceFailoverGroupReadOnlyEndpoint'}, - 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, - 'replication_state': {'key': 'properties.replicationState', 'type': 'str'}, - 'partner_regions': {'key': 'properties.partnerRegions', 'type': '[PartnerRegionInfo]'}, - 'managed_instance_pairs': {'key': 'properties.managedInstancePairs', 'type': '[ManagedInstancePairInfo]'}, - } - - def __init__(self, **kwargs): - super(InstanceFailoverGroup, self).__init__(**kwargs) - self.read_write_endpoint = kwargs.get('read_write_endpoint', None) - self.read_only_endpoint = kwargs.get('read_only_endpoint', None) - self.replication_role = None - self.replication_state = None - self.partner_regions = kwargs.get('partner_regions', None) - self.managed_instance_pairs = kwargs.get('managed_instance_pairs', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py deleted file mode 100644 index c67eaf2ef670..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class InstanceFailoverGroupPaged(Paged): - """ - A paging container for iterating over a list of :class:`InstanceFailoverGroup ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[InstanceFailoverGroup]'} - } - - def __init__(self, *args, **kwargs): - - super(InstanceFailoverGroupPaged, self).__init__(*args, **kwargs) 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 deleted file mode 100644 index a3da8a6a7f55..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py +++ /dev/null @@ -1,82 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .proxy_resource import ProxyResource - - -class InstanceFailoverGroup(ProxyResource): - """An instance failover group. - - 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 read_write_endpoint: Required. Read-write endpoint of the failover - group instance. - :type read_write_endpoint: - ~azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint - :param read_only_endpoint: Read-only endpoint of the failover group - instance. - :type read_only_endpoint: - ~azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint - :ivar replication_role: Local replication role of the failover group - instance. Possible values include: 'Primary', 'Secondary' - :vartype replication_role: str or - ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole - :ivar replication_state: Replication state of the failover group instance. - :vartype replication_state: str - :param partner_regions: Required. Partner region information for the - failover group. - :type partner_regions: list[~azure.mgmt.sql.models.PartnerRegionInfo] - :param managed_instance_pairs: Required. List of managed instance pairs in - the failover group. - :type managed_instance_pairs: - list[~azure.mgmt.sql.models.ManagedInstancePairInfo] - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'read_write_endpoint': {'required': True}, - 'replication_role': {'readonly': True}, - 'replication_state': {'readonly': True}, - 'partner_regions': {'required': True}, - 'managed_instance_pairs': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'read_write_endpoint': {'key': 'properties.readWriteEndpoint', 'type': 'InstanceFailoverGroupReadWriteEndpoint'}, - 'read_only_endpoint': {'key': 'properties.readOnlyEndpoint', 'type': 'InstanceFailoverGroupReadOnlyEndpoint'}, - 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, - 'replication_state': {'key': 'properties.replicationState', 'type': 'str'}, - 'partner_regions': {'key': 'properties.partnerRegions', 'type': '[PartnerRegionInfo]'}, - 'managed_instance_pairs': {'key': 'properties.managedInstancePairs', 'type': '[ManagedInstancePairInfo]'}, - } - - def __init__(self, *, read_write_endpoint, partner_regions, managed_instance_pairs, read_only_endpoint=None, **kwargs) -> None: - super(InstanceFailoverGroup, self).__init__(, **kwargs) - self.read_write_endpoint = read_write_endpoint - self.read_only_endpoint = read_only_endpoint - self.replication_role = None - self.replication_state = None - self.partner_regions = partner_regions - self.managed_instance_pairs = managed_instance_pairs diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py deleted file mode 100644 index 2a9857817ae4..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InstanceFailoverGroupReadOnlyEndpoint(Model): - """Read-only endpoint of the failover group instance. - - :param failover_policy: Failover policy of the read-only endpoint for the - failover group. Possible values include: 'Disabled', 'Enabled' - :type failover_policy: str or - ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy - """ - - _attribute_map = { - 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(InstanceFailoverGroupReadOnlyEndpoint, self).__init__(**kwargs) - self.failover_policy = kwargs.get('failover_policy', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py deleted file mode 100644 index 71c9f180cdf7..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py +++ /dev/null @@ -1,30 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InstanceFailoverGroupReadOnlyEndpoint(Model): - """Read-only endpoint of the failover group instance. - - :param failover_policy: Failover policy of the read-only endpoint for the - failover group. Possible values include: 'Disabled', 'Enabled' - :type failover_policy: str or - ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy - """ - - _attribute_map = { - 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, - } - - def __init__(self, *, failover_policy=None, **kwargs) -> None: - super(InstanceFailoverGroupReadOnlyEndpoint, self).__init__(**kwargs) - self.failover_policy = failover_policy diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py deleted file mode 100644 index 89a86899e503..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InstanceFailoverGroupReadWriteEndpoint(Model): - """Read-write endpoint of the failover group instance. - - All required parameters must be populated in order to send to Azure. - - :param failover_policy: Required. Failover policy of the read-write - endpoint for the failover group. If failoverPolicy is Automatic then - failoverWithDataLossGracePeriodMinutes is required. Possible values - include: 'Manual', 'Automatic' - :type failover_policy: str or - ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy - :param failover_with_data_loss_grace_period_minutes: Grace period before - failover with data loss is attempted for the read-write endpoint. If - failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is - required. - :type failover_with_data_loss_grace_period_minutes: int - """ - - _validation = { - 'failover_policy': {'required': True}, - } - - _attribute_map = { - 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, - 'failover_with_data_loss_grace_period_minutes': {'key': 'failoverWithDataLossGracePeriodMinutes', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(InstanceFailoverGroupReadWriteEndpoint, self).__init__(**kwargs) - self.failover_policy = kwargs.get('failover_policy', None) - self.failover_with_data_loss_grace_period_minutes = kwargs.get('failover_with_data_loss_grace_period_minutes', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py deleted file mode 100644 index 7fdc047ba37c..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InstanceFailoverGroupReadWriteEndpoint(Model): - """Read-write endpoint of the failover group instance. - - All required parameters must be populated in order to send to Azure. - - :param failover_policy: Required. Failover policy of the read-write - endpoint for the failover group. If failoverPolicy is Automatic then - failoverWithDataLossGracePeriodMinutes is required. Possible values - include: 'Manual', 'Automatic' - :type failover_policy: str or - ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy - :param failover_with_data_loss_grace_period_minutes: Grace period before - failover with data loss is attempted for the read-write endpoint. If - failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is - required. - :type failover_with_data_loss_grace_period_minutes: int - """ - - _validation = { - 'failover_policy': {'required': True}, - } - - _attribute_map = { - 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, - 'failover_with_data_loss_grace_period_minutes': {'key': 'failoverWithDataLossGracePeriodMinutes', 'type': 'int'}, - } - - def __init__(self, *, failover_policy, failover_with_data_loss_grace_period_minutes: int=None, **kwargs) -> None: - super(InstanceFailoverGroupReadWriteEndpoint, self).__init__(**kwargs) - self.failover_policy = failover_policy - self.failover_with_data_loss_grace_period_minutes = failover_with_data_loss_grace_period_minutes 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/managed_database.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py deleted file mode 100644 index cdc79bb248ef..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource import TrackedResource - - -class ManagedDatabase(TrackedResource): - """A managed 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 tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :param collation: Collation of the managed database. - :type collation: str - :ivar status: Status for the database. Possible values include: 'Online', - 'Offline', 'Shutdown', 'Creating', 'Inaccessible' - :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus - :ivar creation_date: Creation date of the database. - :vartype creation_date: datetime - :ivar earliest_restore_point: Earliest restore point in time for point in - time restore. - :vartype earliest_restore_point: datetime - :param restore_point_in_time: Conditional. If createMode is - PointInTimeRestore, this value is required. 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 - :ivar default_secondary_location: Geo paired region. - :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: - Create a database by restoring a point in time backup of an existing - database. SourceDatabaseName, SourceManagedInstanceName and PointInTime - must be specified. RestoreExternalBackup: Create a database by restoring - from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Possible values include: - 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' - :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :param storage_container_uri: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the uri of the - storage container where backups for this restore are stored. - :type storage_container_uri: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :param storage_container_sas_token: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the storage - container sas token. - :type storage_container_sas_token: str - :ivar failover_group_id: Instance Failover Group resource identifier that - this managed database belongs to. - :vartype failover_group_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'status': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'earliest_restore_point': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ManagedDatabase, self).__init__(**kwargs) - self.collation = kwargs.get('collation', None) - self.status = None - self.creation_date = None - self.earliest_restore_point = None - self.restore_point_in_time = kwargs.get('restore_point_in_time', None) - self.default_secondary_location = None - self.catalog_collation = kwargs.get('catalog_collation', None) - self.create_mode = kwargs.get('create_mode', None) - self.storage_container_uri = kwargs.get('storage_container_uri', None) - self.source_database_id = kwargs.get('source_database_id', None) - self.storage_container_sas_token = kwargs.get('storage_container_sas_token', None) - self.failover_group_id = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py deleted file mode 100644 index e15d9d532b5a..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ManagedDatabasePaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedDatabase ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedDatabase]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedDatabasePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py deleted file mode 100644 index c17cd2ac18a5..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource import TrackedResource - - -class ManagedDatabase(TrackedResource): - """A managed 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 tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :param collation: Collation of the managed database. - :type collation: str - :ivar status: Status for the database. Possible values include: 'Online', - 'Offline', 'Shutdown', 'Creating', 'Inaccessible' - :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus - :ivar creation_date: Creation date of the database. - :vartype creation_date: datetime - :ivar earliest_restore_point: Earliest restore point in time for point in - time restore. - :vartype earliest_restore_point: datetime - :param restore_point_in_time: Conditional. If createMode is - PointInTimeRestore, this value is required. 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 - :ivar default_secondary_location: Geo paired region. - :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: - Create a database by restoring a point in time backup of an existing - database. SourceDatabaseName, SourceManagedInstanceName and PointInTime - must be specified. RestoreExternalBackup: Create a database by restoring - from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Possible values include: - 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' - :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :param storage_container_uri: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the uri of the - storage container where backups for this restore are stored. - :type storage_container_uri: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :param storage_container_sas_token: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the storage - container sas token. - :type storage_container_sas_token: str - :ivar failover_group_id: Instance Failover Group resource identifier that - this managed database belongs to. - :vartype failover_group_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'status': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'earliest_restore_point': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - } - - def __init__(self, *, location: str, tags=None, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, storage_container_sas_token: str=None, **kwargs) -> None: - super(ManagedDatabase, self).__init__(tags=tags, location=location, **kwargs) - self.collation = collation - self.status = None - self.creation_date = None - self.earliest_restore_point = None - self.restore_point_in_time = restore_point_in_time - self.default_secondary_location = None - self.catalog_collation = catalog_collation - self.create_mode = create_mode - self.storage_container_uri = storage_container_uri - self.source_database_id = source_database_id - self.storage_container_sas_token = storage_container_sas_token - self.failover_group_id = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py deleted file mode 100644 index 4335e9b19dfa..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ManagedDatabaseUpdate(Model): - """An managed database update. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param collation: Collation of the managed database. - :type collation: str - :ivar status: Status for the database. Possible values include: 'Online', - 'Offline', 'Shutdown', 'Creating', 'Inaccessible' - :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus - :ivar creation_date: Creation date of the database. - :vartype creation_date: datetime - :ivar earliest_restore_point: Earliest restore point in time for point in - time restore. - :vartype earliest_restore_point: datetime - :param restore_point_in_time: Conditional. If createMode is - PointInTimeRestore, this value is required. 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 - :ivar default_secondary_location: Geo paired region. - :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: - Create a database by restoring a point in time backup of an existing - database. SourceDatabaseName, SourceManagedInstanceName and PointInTime - must be specified. RestoreExternalBackup: Create a database by restoring - from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Possible values include: - 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' - :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :param storage_container_uri: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the uri of the - storage container where backups for this restore are stored. - :type storage_container_uri: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :param storage_container_sas_token: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the storage - container sas token. - :type storage_container_sas_token: str - :ivar failover_group_id: Instance Failover Group resource identifier that - this managed database belongs to. - :vartype failover_group_id: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'status': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'earliest_restore_point': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - } - - _attribute_map = { - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(ManagedDatabaseUpdate, self).__init__(**kwargs) - self.collation = kwargs.get('collation', None) - self.status = None - self.creation_date = None - self.earliest_restore_point = None - self.restore_point_in_time = kwargs.get('restore_point_in_time', None) - self.default_secondary_location = None - self.catalog_collation = kwargs.get('catalog_collation', None) - self.create_mode = kwargs.get('create_mode', None) - self.storage_container_uri = kwargs.get('storage_container_uri', None) - self.source_database_id = kwargs.get('source_database_id', None) - self.storage_container_sas_token = kwargs.get('storage_container_sas_token', None) - self.failover_group_id = None - self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py deleted file mode 100644 index 668eec38f38b..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ManagedDatabaseUpdate(Model): - """An managed database update. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param collation: Collation of the managed database. - :type collation: str - :ivar status: Status for the database. Possible values include: 'Online', - 'Offline', 'Shutdown', 'Creating', 'Inaccessible' - :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus - :ivar creation_date: Creation date of the database. - :vartype creation_date: datetime - :ivar earliest_restore_point: Earliest restore point in time for point in - time restore. - :vartype earliest_restore_point: datetime - :param restore_point_in_time: Conditional. If createMode is - PointInTimeRestore, this value is required. 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 - :ivar default_secondary_location: Geo paired region. - :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: - Create a database by restoring a point in time backup of an existing - database. SourceDatabaseName, SourceManagedInstanceName and PointInTime - must be specified. RestoreExternalBackup: Create a database by restoring - from external backup files. Collation, StorageContainerUri and - StorageContainerSasToken must be specified. Possible values include: - 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' - :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode - :param storage_container_uri: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the uri of the - storage container where backups for this restore are stored. - :type storage_container_uri: str - :param source_database_id: The resource identifier of the source database - associated with create operation of this database. - :type source_database_id: str - :param storage_container_sas_token: Conditional. If createMode is - RestoreExternalBackup, this value is required. Specifies the storage - container sas token. - :type storage_container_sas_token: str - :ivar failover_group_id: Instance Failover Group resource identifier that - this managed database belongs to. - :vartype failover_group_id: str - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'status': {'readonly': True}, - 'creation_date': {'readonly': True}, - 'earliest_restore_point': {'readonly': True}, - 'default_secondary_location': {'readonly': True}, - 'failover_group_id': {'readonly': True}, - } - - _attribute_map = { - 'collation': {'key': 'properties.collation', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, - 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, - 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, - 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, - 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, - 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, - 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, storage_container_sas_token: str=None, tags=None, **kwargs) -> None: - super(ManagedDatabaseUpdate, self).__init__(**kwargs) - self.collation = collation - self.status = None - self.creation_date = None - self.earliest_restore_point = None - self.restore_point_in_time = restore_point_in_time - self.default_secondary_location = None - self.catalog_collation = catalog_collation - self.create_mode = create_mode - self.storage_container_uri = storage_container_uri - self.source_database_id = source_database_id - self.storage_container_sas_token = storage_container_sas_token - self.failover_group_id = None - self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py deleted file mode 100644 index 6af89171cd35..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource import TrackedResource - - -class ManagedInstance(TrackedResource): - """An Azure SQL managed instance. - - 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 tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :param identity: The Azure Active Directory identity of the managed - instance. - :type identity: ~azure.mgmt.sql.models.ResourceIdentity - :param sku: Managed instance sku - :type sku: ~azure.mgmt.sql.models.Sku - :ivar fully_qualified_domain_name: The fully qualified domain name of the - managed instance. - :vartype fully_qualified_domain_name: str - :param administrator_login: Administrator username for the managed - instance. Can only be specified when the managed instance is being created - (and is required for creation). - :type administrator_login: str - :param administrator_login_password: The administrator login password - (required for managed instance creation). - :type administrator_login_password: str - :param subnet_id: Subnet resource ID for the managed instance. - :type subnet_id: str - :ivar state: The state of the managed instance. - :vartype state: str - :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. - :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. - :type storage_size_in_gb: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'fully_qualified_domain_name': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, - 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, - 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(ManagedInstance, self).__init__(**kwargs) - self.identity = kwargs.get('identity', None) - self.sku = kwargs.get('sku', None) - self.fully_qualified_domain_name = None - self.administrator_login = kwargs.get('administrator_login', None) - self.administrator_login_password = kwargs.get('administrator_login_password', None) - self.subnet_id = kwargs.get('subnet_id', None) - self.state = None - self.license_type = kwargs.get('license_type', None) - self.v_cores = kwargs.get('v_cores', None) - self.storage_size_in_gb = kwargs.get('storage_size_in_gb', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py deleted file mode 100644 index c39881da9f3b..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py +++ /dev/null @@ -1,27 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.paging import Paged - - -class ManagedInstancePaged(Paged): - """ - A paging container for iterating over a list of :class:`ManagedInstance ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstance]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedInstancePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py deleted file mode 100644 index ee49c1db0c62..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ManagedInstancePairInfo(Model): - """Pairs of Managed Instances in the failover group. - - :param primary_managed_instance_id: Id of Primary Managed Instance in - pair. - :type primary_managed_instance_id: str - :param partner_managed_instance_id: Id of Partner Managed Instance in - pair. - :type partner_managed_instance_id: str - """ - - _attribute_map = { - 'primary_managed_instance_id': {'key': 'primaryManagedInstanceId', 'type': 'str'}, - 'partner_managed_instance_id': {'key': 'partnerManagedInstanceId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ManagedInstancePairInfo, self).__init__(**kwargs) - self.primary_managed_instance_id = kwargs.get('primary_managed_instance_id', None) - self.partner_managed_instance_id = kwargs.get('partner_managed_instance_id', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py deleted file mode 100644 index 49f52752b439..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ManagedInstancePairInfo(Model): - """Pairs of Managed Instances in the failover group. - - :param primary_managed_instance_id: Id of Primary Managed Instance in - pair. - :type primary_managed_instance_id: str - :param partner_managed_instance_id: Id of Partner Managed Instance in - pair. - :type partner_managed_instance_id: str - """ - - _attribute_map = { - 'primary_managed_instance_id': {'key': 'primaryManagedInstanceId', 'type': 'str'}, - 'partner_managed_instance_id': {'key': 'partnerManagedInstanceId', 'type': 'str'}, - } - - def __init__(self, *, primary_managed_instance_id: str=None, partner_managed_instance_id: str=None, **kwargs) -> None: - super(ManagedInstancePairInfo, self).__init__(**kwargs) - self.primary_managed_instance_id = primary_managed_instance_id - self.partner_managed_instance_id = partner_managed_instance_id diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py deleted file mode 100644 index d6c710b8773b..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from .tracked_resource import TrackedResource - - -class ManagedInstance(TrackedResource): - """An Azure SQL managed instance. - - 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 tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. Resource location. - :type location: str - :param identity: The Azure Active Directory identity of the managed - instance. - :type identity: ~azure.mgmt.sql.models.ResourceIdentity - :param sku: Managed instance sku - :type sku: ~azure.mgmt.sql.models.Sku - :ivar fully_qualified_domain_name: The fully qualified domain name of the - managed instance. - :vartype fully_qualified_domain_name: str - :param administrator_login: Administrator username for the managed - instance. Can only be specified when the managed instance is being created - (and is required for creation). - :type administrator_login: str - :param administrator_login_password: The administrator login password - (required for managed instance creation). - :type administrator_login_password: str - :param subnet_id: Subnet resource ID for the managed instance. - :type subnet_id: str - :ivar state: The state of the managed instance. - :vartype state: str - :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. - :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. - :type storage_size_in_gb: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'required': True}, - 'fully_qualified_domain_name': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, - 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, - 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, - } - - def __init__(self, *, location: str, tags=None, identity=None, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, **kwargs) -> None: - super(ManagedInstance, self).__init__(tags=tags, location=location, **kwargs) - self.identity = identity - self.sku = sku - self.fully_qualified_domain_name = None - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.subnet_id = subnet_id - self.state = None - self.license_type = license_type - self.v_cores = v_cores - self.storage_size_in_gb = storage_size_in_gb diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py deleted file mode 100644 index 7ea51f29ddff..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ManagedInstanceUpdate(Model): - """An update request for an Azure SQL Database managed instance. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param sku: Managed instance sku - :type sku: ~azure.mgmt.sql.models.Sku - :ivar fully_qualified_domain_name: The fully qualified domain name of the - managed instance. - :vartype fully_qualified_domain_name: str - :param administrator_login: Administrator username for the managed - instance. Can only be specified when the managed instance is being created - (and is required for creation). - :type administrator_login: str - :param administrator_login_password: The administrator login password - (required for managed instance creation). - :type administrator_login_password: str - :param subnet_id: Subnet resource ID for the managed instance. - :type subnet_id: str - :ivar state: The state of the managed instance. - :vartype state: str - :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. - :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. - :type storage_size_in_gb: int - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'fully_qualified_domain_name': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, - 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, - 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, **kwargs): - super(ManagedInstanceUpdate, self).__init__(**kwargs) - self.sku = kwargs.get('sku', None) - self.fully_qualified_domain_name = None - self.administrator_login = kwargs.get('administrator_login', None) - self.administrator_login_password = kwargs.get('administrator_login_password', None) - self.subnet_id = kwargs.get('subnet_id', None) - self.state = None - self.license_type = kwargs.get('license_type', None) - self.v_cores = kwargs.get('v_cores', None) - self.storage_size_in_gb = kwargs.get('storage_size_in_gb', None) - self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py deleted file mode 100644 index 0adbe5f439f8..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class ManagedInstanceUpdate(Model): - """An update request for an Azure SQL Database managed instance. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param sku: Managed instance sku - :type sku: ~azure.mgmt.sql.models.Sku - :ivar fully_qualified_domain_name: The fully qualified domain name of the - managed instance. - :vartype fully_qualified_domain_name: str - :param administrator_login: Administrator username for the managed - instance. Can only be specified when the managed instance is being created - (and is required for creation). - :type administrator_login: str - :param administrator_login_password: The administrator login password - (required for managed instance creation). - :type administrator_login_password: str - :param subnet_id: Subnet resource ID for the managed instance. - :type subnet_id: str - :ivar state: The state of the managed instance. - :vartype state: str - :param license_type: The license type. Possible values are - 'LicenseIncluded' and 'BasePrice'. - :type license_type: str - :param v_cores: The number of VCores. - :type v_cores: int - :param storage_size_in_gb: The maximum storage size in GB. - :type storage_size_in_gb: int - :param tags: Resource tags. - :type tags: dict[str, str] - """ - - _validation = { - 'fully_qualified_domain_name': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'sku': {'key': 'sku', 'type': 'Sku'}, - 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, - 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, - 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, - 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - } - - def __init__(self, *, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, tags=None, **kwargs) -> None: - super(ManagedInstanceUpdate, self).__init__(**kwargs) - self.sku = sku - self.fully_qualified_domain_name = None - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.subnet_id = subnet_id - self.state = None - self.license_type = license_type - self.v_cores = v_cores - self.storage_size_in_gb = storage_size_in_gb - self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py b/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py deleted file mode 100644 index 4d8e2688acb1..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PartnerRegionInfo(Model): - """Partner region information for the failover group. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param location: Geo location of the partner managed instances. - :type location: str - :ivar replication_role: Replication role of the partner managed instances. - Possible values include: 'Primary', 'Secondary' - :vartype replication_role: str or - ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole - """ - - _validation = { - 'replication_role': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'replication_role': {'key': 'replicationRole', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(PartnerRegionInfo, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.replication_role = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py deleted file mode 100644 index 76c52b49c0ba..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class PartnerRegionInfo(Model): - """Partner region information for the failover group. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :param location: Geo location of the partner managed instances. - :type location: str - :ivar replication_role: Replication role of the partner managed instances. - Possible values include: 'Primary', 'Secondary' - :vartype replication_role: str or - ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole - """ - - _validation = { - 'replication_role': {'readonly': True}, - } - - _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, - 'replication_role': {'key': 'replicationRole', 'type': 'str'}, - } - - def __init__(self, *, location: str=None, **kwargs) -> None: - super(PartnerRegionInfo, self).__init__(**kwargs) - self.location = location - self.replication_role = 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/sql_management_client_enums.py b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index 3a82b6370cd3..62713566786f 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -326,17 +326,17 @@ class FailoverGroupReplicationRole(str, Enum): secondary = "Secondary" -class IdentityType(str, Enum): - - system_assigned = "SystemAssigned" - - class OperationOrigin(str, Enum): user = "user" system = "system" +class IdentityType(str, Enum): + + system_assigned = "SystemAssigned" + + class SyncAgentState(str, Enum): online = "Online" @@ -411,28 +411,6 @@ class VirtualNetworkRuleState(str, Enum): unknown = "Unknown" -class ManagedDatabaseStatus(str, Enum): - - online = "Online" - offline = "Offline" - shutdown = "Shutdown" - creating = "Creating" - inaccessible = "Inaccessible" - - -class CatalogCollationType(str, Enum): - - database_default = "DATABASE_DEFAULT" - sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" - - -class ManagedDatabaseCreateMode(str, Enum): - - default = "Default" - restore_external_backup = "RestoreExternalBackup" - point_in_time_restore = "PointInTimeRestore" - - class AutomaticTuningServerMode(str, Enum): custom = "Custom" @@ -537,6 +515,12 @@ class DatabaseStatus(str, Enum): scaling = "Scaling" +class CatalogCollationType(str, Enum): + + database_default = "DATABASE_DEFAULT" + sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" + + class DatabaseLicenseType(str, Enum): license_included = "LicenseIncluded" @@ -562,12 +546,6 @@ class ElasticPoolLicenseType(str, Enum): base_price = "BasePrice" -class InstanceFailoverGroupReplicationRole(str, Enum): - - primary = "Primary" - secondary = "Secondary" - - class LongTermRetentionDatabaseState(str, Enum): all = "All" 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..fdda72bc17ff 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -36,7 +36,6 @@ from .database_automatic_tuning_operations import DatabaseAutomaticTuningOperations from .encryption_protectors_operations import EncryptionProtectorsOperations from .failover_groups_operations import FailoverGroupsOperations -from .managed_instances_operations import ManagedInstancesOperations from .operations import Operations from .server_keys_operations import ServerKeysOperations from .sync_agents_operations import SyncAgentsOperations @@ -46,14 +45,12 @@ from .virtual_network_rules_operations import VirtualNetworkRulesOperations from .long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations -from .managed_databases_operations import ManagedDatabasesOperations from .server_automatic_tuning_operations import ServerAutomaticTuningOperations from .server_dns_aliases_operations import ServerDnsAliasesOperations from .restore_points_operations import RestorePointsOperations from .database_operations import DatabaseOperations from .elastic_pool_operations import ElasticPoolOperations from .capabilities_operations import CapabilitiesOperations -from .instance_failover_groups_operations import InstanceFailoverGroupsOperations __all__ = [ 'RecoverableDatabasesOperations', @@ -83,7 +80,6 @@ 'DatabaseAutomaticTuningOperations', 'EncryptionProtectorsOperations', 'FailoverGroupsOperations', - 'ManagedInstancesOperations', 'Operations', 'ServerKeysOperations', 'SyncAgentsOperations', @@ -93,12 +89,10 @@ 'VirtualNetworkRulesOperations', 'LongTermRetentionBackupsOperations', 'BackupLongTermRetentionPoliciesOperations', - 'ManagedDatabasesOperations', 'ServerAutomaticTuningOperations', 'ServerDnsAliasesOperations', 'RestorePointsOperations', 'DatabaseOperations', 'ElasticPoolOperations', 'CapabilitiesOperations', - 'InstanceFailoverGroupsOperations', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py deleted file mode 100644 index 8e9e2c566109..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py +++ /dev/null @@ -1,580 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class InstanceFailoverGroupsOperations(object): - """InstanceFailoverGroupsOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-10-01-preview" - - self.config = config - - def get( - self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): - """Gets a failover group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param location_name: The name of the region where the resource is - located. - :type location_name: str - :param failover_group_name: The name of the failover group. - :type failover_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: InstanceFailoverGroup or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup 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'), - 'locationName': self._serialize.url("location_name", location_name, 'str'), - 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # 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('InstanceFailoverGroup', 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'} - - - def _create_or_update_initial( - self, resource_group_name, location_name, failover_group_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'locationName': self._serialize.url("location_name", location_name, 'str'), - 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # 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, 'InstanceFailoverGroup') - - # 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, 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('InstanceFailoverGroup', response) - if response.status_code == 201: - deserialized = self._deserialize('InstanceFailoverGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, location_name, failover_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updates a failover group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param location_name: The name of the region where the resource is - located. - :type location_name: str - :param failover_group_name: The name of the failover group. - :type failover_group_name: str - :param parameters: The failover group parameters. - :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup - :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 InstanceFailoverGroup - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstanceFailoverGroup]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('InstanceFailoverGroup', 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'} - - - def _delete_initial( - self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'locationName': self._serialize.url("location_name", location_name, 'str'), - 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # 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.delete(url, query_parameters) - response = self._client.send(request, header_parameters, 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, location_name, failover_group_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a failover group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param location_name: The name of the region where the resource is - located. - :type location_name: str - :param failover_group_name: The name of the failover group. - :type failover_group_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, - location_name=location_name, - failover_group_name=failover_group_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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'} - - def list_by_location( - self, resource_group_name, location_name, custom_headers=None, raw=False, **operation_config): - """Lists the failover groups in a location. - - :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 location_name: The name of the region where the resource is - located. - :type location_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 InstanceFailoverGroup - :rtype: - ~azure.mgmt.sql.models.InstanceFailoverGroupPaged[~azure.mgmt.sql.models.InstanceFailoverGroup] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_location.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'locationName': self._serialize.url("location_name", location_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['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 - - return response - - # Deserialize response - deserialized = models.InstanceFailoverGroupPaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.InstanceFailoverGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups'} - - - def _failover_initial( - self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.failover.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'locationName': self._serialize.url("location_name", location_name, 'str'), - 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # 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.post(url, query_parameters) - response = self._client.send(request, header_parameters, 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('InstanceFailoverGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def failover( - self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Fails over from the current primary managed instance to this managed - instance. - - :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 location_name: The name of the region where the resource is - located. - :type location_name: str - :param failover_group_name: The name of the failover group. - :type failover_group_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 InstanceFailoverGroup - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstanceFailoverGroup]] - :raises: :class:`CloudError` - """ - raw_result = self._failover_initial( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('InstanceFailoverGroup', 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) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover'} - - - def _force_failover_allow_data_loss_initial( - self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.force_failover_allow_data_loss.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'locationName': self._serialize.url("location_name", location_name, 'str'), - 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # 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.post(url, query_parameters) - response = self._client.send(request, header_parameters, 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('InstanceFailoverGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def force_failover_allow_data_loss( - self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Fails over from the current primary managed instance to this managed - instance. This operation might result in data loss. - - :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 location_name: The name of the region where the resource is - located. - :type location_name: str - :param failover_group_name: The name of the failover group. - :type failover_group_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 InstanceFailoverGroup - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstanceFailoverGroup]] - :raises: :class:`CloudError` - """ - raw_result = self._force_failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - location_name=location_name, - failover_group_name=failover_group_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('InstanceFailoverGroup', 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) - force_failover_allow_data_loss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py deleted file mode 100644 index d4d2bb29f2b5..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py +++ /dev/null @@ -1,571 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class ManagedDatabasesOperations(object): - """ManagedDatabasesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2017-03-01-preview" - - self.config = config - - - def _complete_restore_initial( - self, location_name, operation_id, last_backup_name, custom_headers=None, raw=False, **operation_config): - parameters = models.CompleteDatabaseRestoreDefinition(last_backup_name=last_backup_name) - - # Construct URL - url = self.complete_restore.metadata['url'] - path_format_arguments = { - 'locationName': self._serialize.url("location_name", location_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, '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, 'CompleteDatabaseRestoreDefinition') - - # Construct and send request - request = self._client.post(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 - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def complete_restore( - self, location_name, operation_id, last_backup_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Completes the restore operation on a managed database. - - :param location_name: The name of the region where the resource is - located. - :type location_name: str - :param operation_id: Management operation id that this request tries - to complete. - :type operation_id: str - :param last_backup_name: The last backup name to apply - :type last_backup_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._complete_restore_initial( - location_name=location_name, - operation_id=operation_id, - last_backup_name=last_backup_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) - complete_restore.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseRestoreAzureAsyncOperation/{operationId}/completeRestore'} - - def list_by_instance( - self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of managed 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 managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedDatabase - :rtype: - ~azure.mgmt.sql.models.ManagedDatabasePaged[~azure.mgmt.sql.models.ManagedDatabase] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_instance.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['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 - - return response - - # Deserialize response - deserialized = models.ManagedDatabasePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ManagedDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_instance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases'} - - def get( - self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a managed 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 managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param database_name: The name of the database. - :type database_name: str - :param 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: ManagedDatabase or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ManagedDatabase or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - '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("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('ManagedDatabase', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'} - - - def _create_or_update_initial( - self, resource_group_name, managed_instance_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_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("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, 'ManagedDatabase') - - # 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, 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('ManagedDatabase', response) - if response.status_code == 201: - deserialized = self._deserialize('ManagedDatabase', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, managed_instance_name, 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 managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param database_name: The name of the database. - :type database_name: str - :param parameters: The requested database resource state. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabase - :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 ManagedDatabase or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedDatabase] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedDatabase]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedDatabase', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'} - - - def _delete_initial( - self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - '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("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.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes the managed 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 managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - 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/managedInstances/{managedInstanceName}/databases/{databaseName}'} - - - def _update_initial( - self, resource_group_name, managed_instance_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - '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("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, 'ManagedDatabaseUpdate') - - # 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('ManagedDatabase', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, managed_instance_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 managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param database_name: The name of the database. - :type database_name: str - :param parameters: The requested database resource state. - :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate - :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 ManagedDatabase or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedDatabase] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedDatabase]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - database_name=database_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedDatabase', 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/managedInstances/{managedInstanceName}/databases/{databaseName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py deleted file mode 100644 index 1bd0b6a0d60c..000000000000 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py +++ /dev/null @@ -1,527 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling - -from .. import models - - -class ManagedInstancesOperations(object): - """ManagedInstancesOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2015-05-01-preview" - - self.config = config - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of all managed instances in the subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedInstance - :rtype: - ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['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 - - return response - - # Deserialize response - deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} - - def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of managed instances in a resource group. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedInstance - :rtype: - ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] - :raises: :class:`CloudError` - """ - def internal_paging(next_link=None, raw=False): - - if not next_link: - # Construct URL - url = self.list_by_resource_group.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['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 - - return response - - # Deserialize response - deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) - - if raw: - header_dict = {} - client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - return client_raw_response - - return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances'} - - def get( - self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): - """Gets a managed instance. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ManagedInstance or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ManagedInstance or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - '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('ManagedInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} - - - def _create_or_update_initial( - self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # 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, 'ManagedInstance') - - # 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, 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('ManagedInstance', response) - if response.status_code == 201: - deserialized = self._deserialize('ManagedInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_or_update( - self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updates a managed instance. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param parameters: The requested managed instance resource state. - :type parameters: ~azure.mgmt.sql.models.ManagedInstance - :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 ManagedInstance or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstance] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstance]] - :raises: :class:`CloudError` - """ - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} - - - def _delete_initial( - self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - '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.delete(url, query_parameters) - response = self._client.send(request, header_parameters, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete( - self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a managed instance. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} - - - def _update_initial( - self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.update.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - '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, 'ManagedInstanceUpdate') - - # 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('ManagedInstance', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def update( - self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Updates a managed instance. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param parameters: The requested managed instance resource state. - :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate - :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 ManagedInstance or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstance] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstance]] - :raises: :class:`CloudError` - """ - raw_result = self._update_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ManagedInstance', 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/managedInstances/{managedInstanceName}'} 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..3d71bd1986b7 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 @@ -40,7 +40,6 @@ from .operations.database_automatic_tuning_operations import DatabaseAutomaticTuningOperations from .operations.encryption_protectors_operations import EncryptionProtectorsOperations from .operations.failover_groups_operations import FailoverGroupsOperations -from .operations.managed_instances_operations import ManagedInstancesOperations from .operations.operations import Operations from .operations.server_keys_operations import ServerKeysOperations from .operations.sync_agents_operations import SyncAgentsOperations @@ -50,14 +49,12 @@ from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations from .operations.long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .operations.backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations -from .operations.managed_databases_operations import ManagedDatabasesOperations from .operations.server_automatic_tuning_operations import ServerAutomaticTuningOperations from .operations.server_dns_aliases_operations import ServerDnsAliasesOperations from .operations.restore_points_operations import RestorePointsOperations from .operations.database_operations import DatabaseOperations from .operations.elastic_pool_operations import ElasticPoolOperations from .operations.capabilities_operations import CapabilitiesOperations -from .operations.instance_failover_groups_operations import InstanceFailoverGroupsOperations from . import models @@ -94,7 +91,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. @@ -154,8 +151,6 @@ class SqlManagementClient(object): :vartype encryption_protectors: azure.mgmt.sql.operations.EncryptionProtectorsOperations :ivar failover_groups: FailoverGroups operations :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations - :ivar managed_instances: ManagedInstances operations - :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.sql.operations.Operations :ivar server_keys: ServerKeys operations @@ -174,8 +169,6 @@ class SqlManagementClient(object): :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations :ivar backup_long_term_retention_policies: BackupLongTermRetentionPolicies operations :vartype backup_long_term_retention_policies: azure.mgmt.sql.operations.BackupLongTermRetentionPoliciesOperations - :ivar managed_databases: ManagedDatabases operations - :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations :ivar server_automatic_tuning: ServerAutomaticTuning operations :vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations :ivar server_dns_aliases: ServerDnsAliases operations @@ -188,8 +181,6 @@ class SqlManagementClient(object): :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperations :ivar capabilities: Capabilities operations :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations - :ivar instance_failover_groups: InstanceFailoverGroups operations - :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -204,7 +195,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) @@ -264,8 +255,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.failover_groups = FailoverGroupsOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instances = ManagedInstancesOperations( - self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.server_keys = ServerKeysOperations( @@ -284,8 +273,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.backup_long_term_retention_policies = BackupLongTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_databases = ManagedDatabasesOperations( - self._client, self.config, self._serialize, self._deserialize) self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self.config, self._serialize, self._deserialize) self.server_dns_aliases = ServerDnsAliasesOperations( @@ -298,5 +285,3 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.capabilities = CapabilitiesOperations( self._client, self.config, self._serialize, self._deserialize) - self.instance_failover_groups = InstanceFailoverGroupsOperations( - self._client, self.config, self._serialize, self._deserialize) From 026978eb5c12da12cea98316e66d7ead09c92897 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 20 Apr 2018 06:50:03 +0000 Subject: [PATCH 2/2] Generated from c5b0234ad63d8130d3f2af0d43aed548bf0c20eb Merge branch 'master' into master --- .../azure/mgmt/sql/models/__init__.py | 65 +- .../complete_database_restore_definition.py | 35 ++ ...omplete_database_restore_definition_py3.py | 35 ++ .../sql/models/instance_failover_group.py | 82 +++ .../models/instance_failover_group_paged.py | 27 + .../sql/models/instance_failover_group_py3.py | 82 +++ ...tance_failover_group_read_only_endpoint.py | 30 + ...e_failover_group_read_only_endpoint_py3.py | 30 + ...ance_failover_group_read_write_endpoint.py | 45 ++ ..._failover_group_read_write_endpoint_py3.py | 45 ++ .../azure/mgmt/sql/models/managed_database.py | 123 ++++ .../mgmt/sql/models/managed_database_paged.py | 27 + .../mgmt/sql/models/managed_database_py3.py | 123 ++++ .../sql/models/managed_database_update.py | 106 ++++ .../sql/models/managed_database_update_py3.py | 106 ++++ .../azure/mgmt/sql/models/managed_instance.py | 99 +++ .../mgmt/sql/models/managed_instance_paged.py | 27 + .../sql/models/managed_instance_pair_info.py | 34 + .../models/managed_instance_pair_info_py3.py | 34 + .../mgmt/sql/models/managed_instance_py3.py | 99 +++ .../sql/models/managed_instance_update.py | 77 +++ .../sql/models/managed_instance_update_py3.py | 77 +++ .../mgmt/sql/models/partner_region_info.py | 41 ++ .../sql/models/partner_region_info_py3.py | 41 ++ .../sql/models/short_term_retention_policy.py | 47 ++ .../models/short_term_retention_policy_py3.py | 47 ++ .../sql/models/sql_management_client_enums.py | 44 +- .../azure/mgmt/sql/operations/__init__.py | 8 + .../instance_failover_groups_operations.py | 580 ++++++++++++++++++ .../managed_databases_operations.py | 571 +++++++++++++++++ .../managed_instances_operations.py | 527 ++++++++++++++++ ...hort_term_retention_policies_operations.py | 332 ++++++++++ .../azure/mgmt/sql/sql_management_client.py | 20 + 33 files changed, 3645 insertions(+), 21 deletions(-) create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/models/short_term_retention_policy_py3.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py create mode 100644 azure-mgmt-sql/azure/mgmt/sql/operations/short_term_retention_policies_operations.py diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 5423a4320c1c..a84dc982d5a2 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -57,10 +57,13 @@ from .partner_info_py3 import PartnerInfo from .failover_group_py3 import FailoverGroup from .failover_group_update_py3 import FailoverGroupUpdate + from .resource_identity_py3 import ResourceIdentity + from .sku_py3 import Sku + from .managed_instance_py3 import ManagedInstance + from .managed_instance_update_py3 import ManagedInstanceUpdate from .operation_display_py3 import OperationDisplay from .operation_py3 import Operation from .server_key_py3 import ServerKey - from .resource_identity_py3 import ResourceIdentity from .server_py3 import Server from .server_update_py3 import ServerUpdate from .sync_agent_py3 import SyncAgent @@ -80,6 +83,9 @@ from .virtual_network_rule_py3 import VirtualNetworkRule from .long_term_retention_backup_py3 import LongTermRetentionBackup from .backup_long_term_retention_policy_py3 import BackupLongTermRetentionPolicy + from .complete_database_restore_definition_py3 import CompleteDatabaseRestoreDefinition + from .managed_database_py3 import ManagedDatabase + from .managed_database_update_py3 import ManagedDatabaseUpdate from .automatic_tuning_server_options_py3 import AutomaticTuningServerOptions from .server_automatic_tuning_py3 import ServerAutomaticTuning from .server_dns_alias_py3 import ServerDnsAlias @@ -92,7 +98,6 @@ from .log_size_capability_py3 import LogSizeCapability from .max_size_range_capability_py3 import MaxSizeRangeCapability from .performance_level_capability_py3 import PerformanceLevelCapability - from .sku_py3 import Sku from .license_type_capability_py3 import LicenseTypeCapability from .service_objective_capability_py3 import ServiceObjectiveCapability from .edition_capability_py3 import EditionCapability @@ -112,6 +117,12 @@ from .elastic_pool_per_database_settings_py3 import ElasticPoolPerDatabaseSettings from .elastic_pool_py3 import ElasticPool from .elastic_pool_update_py3 import ElasticPoolUpdate + from .instance_failover_group_read_write_endpoint_py3 import InstanceFailoverGroupReadWriteEndpoint + from .instance_failover_group_read_only_endpoint_py3 import InstanceFailoverGroupReadOnlyEndpoint + 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 @@ -160,10 +171,13 @@ from .partner_info import PartnerInfo from .failover_group import FailoverGroup from .failover_group_update import FailoverGroupUpdate + from .resource_identity import ResourceIdentity + from .sku import Sku + from .managed_instance import ManagedInstance + from .managed_instance_update import ManagedInstanceUpdate from .operation_display import OperationDisplay from .operation import Operation from .server_key import ServerKey - from .resource_identity import ResourceIdentity from .server import Server from .server_update import ServerUpdate from .sync_agent import SyncAgent @@ -183,6 +197,9 @@ from .virtual_network_rule import VirtualNetworkRule from .long_term_retention_backup import LongTermRetentionBackup from .backup_long_term_retention_policy import BackupLongTermRetentionPolicy + from .complete_database_restore_definition import CompleteDatabaseRestoreDefinition + from .managed_database import ManagedDatabase + from .managed_database_update import ManagedDatabaseUpdate from .automatic_tuning_server_options import AutomaticTuningServerOptions from .server_automatic_tuning import ServerAutomaticTuning from .server_dns_alias import ServerDnsAlias @@ -195,7 +212,6 @@ from .log_size_capability import LogSizeCapability from .max_size_range_capability import MaxSizeRangeCapability from .performance_level_capability import PerformanceLevelCapability - from .sku import Sku from .license_type_capability import LicenseTypeCapability from .service_objective_capability import ServiceObjectiveCapability from .edition_capability import EditionCapability @@ -215,6 +231,12 @@ from .elastic_pool_per_database_settings import ElasticPoolPerDatabaseSettings from .elastic_pool import ElasticPool from .elastic_pool_update import ElasticPoolUpdate + from .instance_failover_group_read_write_endpoint import InstanceFailoverGroupReadWriteEndpoint + from .instance_failover_group_read_only_endpoint import InstanceFailoverGroupReadOnlyEndpoint + 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 @@ -239,6 +261,7 @@ from .database_usage_paged import DatabaseUsagePaged from .encryption_protector_paged import EncryptionProtectorPaged from .failover_group_paged import FailoverGroupPaged +from .managed_instance_paged import ManagedInstancePaged from .operation_paged import OperationPaged from .server_key_paged import ServerKeyPaged from .sync_agent_paged import SyncAgentPaged @@ -251,10 +274,12 @@ from .subscription_usage_paged import SubscriptionUsagePaged from .virtual_network_rule_paged import VirtualNetworkRulePaged from .long_term_retention_backup_paged import LongTermRetentionBackupPaged +from .managed_database_paged import ManagedDatabasePaged from .server_dns_alias_paged import ServerDnsAliasPaged from .restore_point_paged import RestorePointPaged from .database_operation_paged import DatabaseOperationPaged from .elastic_pool_operation_paged import ElasticPoolOperationPaged +from .instance_failover_group_paged import InstanceFailoverGroupPaged from .sql_management_client_enums import ( CheckNameAvailabilityReason, ServerConnectionType, @@ -289,8 +314,8 @@ ReadWriteEndpointFailoverPolicy, ReadOnlyEndpointFailoverPolicy, FailoverGroupReplicationRole, - OperationOrigin, IdentityType, + OperationOrigin, SyncAgentState, SyncMemberDbType, SyncGroupLogType, @@ -299,6 +324,9 @@ SyncDirection, SyncMemberState, VirtualNetworkRuleState, + ManagedDatabaseStatus, + CatalogCollationType, + ManagedDatabaseCreateMode, AutomaticTuningServerMode, AutomaticTuningServerReason, RestorePointType, @@ -310,11 +338,11 @@ CreateMode, SampleName, DatabaseStatus, - CatalogCollationType, DatabaseLicenseType, DatabaseReadScale, ElasticPoolState, ElasticPoolLicenseType, + InstanceFailoverGroupReplicationRole, LongTermRetentionDatabaseState, CapabilityGroup, ) @@ -367,10 +395,13 @@ 'PartnerInfo', 'FailoverGroup', 'FailoverGroupUpdate', + 'ResourceIdentity', + 'Sku', + 'ManagedInstance', + 'ManagedInstanceUpdate', 'OperationDisplay', 'Operation', 'ServerKey', - 'ResourceIdentity', 'Server', 'ServerUpdate', 'SyncAgent', @@ -390,6 +421,9 @@ 'VirtualNetworkRule', 'LongTermRetentionBackup', 'BackupLongTermRetentionPolicy', + 'CompleteDatabaseRestoreDefinition', + 'ManagedDatabase', + 'ManagedDatabaseUpdate', 'AutomaticTuningServerOptions', 'ServerAutomaticTuning', 'ServerDnsAlias', @@ -402,7 +436,6 @@ 'LogSizeCapability', 'MaxSizeRangeCapability', 'PerformanceLevelCapability', - 'Sku', 'LicenseTypeCapability', 'ServiceObjectiveCapability', 'EditionCapability', @@ -422,6 +455,12 @@ 'ElasticPoolPerDatabaseSettings', 'ElasticPool', 'ElasticPoolUpdate', + 'InstanceFailoverGroupReadWriteEndpoint', + 'InstanceFailoverGroupReadOnlyEndpoint', + 'PartnerRegionInfo', + 'ManagedInstancePairInfo', + 'InstanceFailoverGroup', + 'ShortTermRetentionPolicy', 'RecoverableDatabasePaged', 'RestorableDroppedDatabasePaged', 'ServerPaged', @@ -446,6 +485,7 @@ 'DatabaseUsagePaged', 'EncryptionProtectorPaged', 'FailoverGroupPaged', + 'ManagedInstancePaged', 'OperationPaged', 'ServerKeyPaged', 'SyncAgentPaged', @@ -458,10 +498,12 @@ 'SubscriptionUsagePaged', 'VirtualNetworkRulePaged', 'LongTermRetentionBackupPaged', + 'ManagedDatabasePaged', 'ServerDnsAliasPaged', 'RestorePointPaged', 'DatabaseOperationPaged', 'ElasticPoolOperationPaged', + 'InstanceFailoverGroupPaged', 'CheckNameAvailabilityReason', 'ServerConnectionType', 'SecurityAlertPolicyState', @@ -495,8 +537,8 @@ 'ReadWriteEndpointFailoverPolicy', 'ReadOnlyEndpointFailoverPolicy', 'FailoverGroupReplicationRole', - 'OperationOrigin', 'IdentityType', + 'OperationOrigin', 'SyncAgentState', 'SyncMemberDbType', 'SyncGroupLogType', @@ -505,6 +547,9 @@ 'SyncDirection', 'SyncMemberState', 'VirtualNetworkRuleState', + 'ManagedDatabaseStatus', + 'CatalogCollationType', + 'ManagedDatabaseCreateMode', 'AutomaticTuningServerMode', 'AutomaticTuningServerReason', 'RestorePointType', @@ -516,11 +561,11 @@ 'CreateMode', 'SampleName', 'DatabaseStatus', - 'CatalogCollationType', 'DatabaseLicenseType', 'DatabaseReadScale', 'ElasticPoolState', 'ElasticPoolLicenseType', + 'InstanceFailoverGroupReplicationRole', 'LongTermRetentionDatabaseState', 'CapabilityGroup', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition.py b/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition.py new file mode 100644 index 000000000000..926012a21f09 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CompleteDatabaseRestoreDefinition(Model): + """Contains the information necessary to perform a complete database restore + operation. + + All required parameters must be populated in order to send to Azure. + + :param last_backup_name: Required. The last backup name to apply + :type last_backup_name: str + """ + + _validation = { + 'last_backup_name': {'required': True}, + } + + _attribute_map = { + 'last_backup_name': {'key': 'lastBackupName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CompleteDatabaseRestoreDefinition, self).__init__(**kwargs) + self.last_backup_name = kwargs.get('last_backup_name', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py new file mode 100644 index 000000000000..8b3c7f3da1f8 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/complete_database_restore_definition_py3.py @@ -0,0 +1,35 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class CompleteDatabaseRestoreDefinition(Model): + """Contains the information necessary to perform a complete database restore + operation. + + All required parameters must be populated in order to send to Azure. + + :param last_backup_name: Required. The last backup name to apply + :type last_backup_name: str + """ + + _validation = { + 'last_backup_name': {'required': True}, + } + + _attribute_map = { + 'last_backup_name': {'key': 'lastBackupName', 'type': 'str'}, + } + + def __init__(self, *, last_backup_name: str, **kwargs) -> None: + super(CompleteDatabaseRestoreDefinition, self).__init__(**kwargs) + self.last_backup_name = last_backup_name diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group.py new file mode 100644 index 000000000000..f360ffbfed57 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group.py @@ -0,0 +1,82 @@ +# 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 InstanceFailoverGroup(ProxyResource): + """An instance failover group. + + 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 read_write_endpoint: Required. Read-write endpoint of the failover + group instance. + :type read_write_endpoint: + ~azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint + :param read_only_endpoint: Read-only endpoint of the failover group + instance. + :type read_only_endpoint: + ~azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint + :ivar replication_role: Local replication role of the failover group + instance. Possible values include: 'Primary', 'Secondary' + :vartype replication_role: str or + ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole + :ivar replication_state: Replication state of the failover group instance. + :vartype replication_state: str + :param partner_regions: Required. Partner region information for the + failover group. + :type partner_regions: list[~azure.mgmt.sql.models.PartnerRegionInfo] + :param managed_instance_pairs: Required. List of managed instance pairs in + the failover group. + :type managed_instance_pairs: + list[~azure.mgmt.sql.models.ManagedInstancePairInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'read_write_endpoint': {'required': True}, + 'replication_role': {'readonly': True}, + 'replication_state': {'readonly': True}, + 'partner_regions': {'required': True}, + 'managed_instance_pairs': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'read_write_endpoint': {'key': 'properties.readWriteEndpoint', 'type': 'InstanceFailoverGroupReadWriteEndpoint'}, + 'read_only_endpoint': {'key': 'properties.readOnlyEndpoint', 'type': 'InstanceFailoverGroupReadOnlyEndpoint'}, + 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, + 'replication_state': {'key': 'properties.replicationState', 'type': 'str'}, + 'partner_regions': {'key': 'properties.partnerRegions', 'type': '[PartnerRegionInfo]'}, + 'managed_instance_pairs': {'key': 'properties.managedInstancePairs', 'type': '[ManagedInstancePairInfo]'}, + } + + def __init__(self, **kwargs): + super(InstanceFailoverGroup, self).__init__(**kwargs) + self.read_write_endpoint = kwargs.get('read_write_endpoint', None) + self.read_only_endpoint = kwargs.get('read_only_endpoint', None) + self.replication_role = None + self.replication_state = None + self.partner_regions = kwargs.get('partner_regions', None) + self.managed_instance_pairs = kwargs.get('managed_instance_pairs', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py new file mode 100644 index 000000000000..c67eaf2ef670 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class InstanceFailoverGroupPaged(Paged): + """ + A paging container for iterating over a list of :class:`InstanceFailoverGroup ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[InstanceFailoverGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(InstanceFailoverGroupPaged, self).__init__(*args, **kwargs) 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 new file mode 100644 index 000000000000..885fd2a8d52e --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_py3.py @@ -0,0 +1,82 @@ +# 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 InstanceFailoverGroup(ProxyResource): + """An instance failover group. + + 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 read_write_endpoint: Required. Read-write endpoint of the failover + group instance. + :type read_write_endpoint: + ~azure.mgmt.sql.models.InstanceFailoverGroupReadWriteEndpoint + :param read_only_endpoint: Read-only endpoint of the failover group + instance. + :type read_only_endpoint: + ~azure.mgmt.sql.models.InstanceFailoverGroupReadOnlyEndpoint + :ivar replication_role: Local replication role of the failover group + instance. Possible values include: 'Primary', 'Secondary' + :vartype replication_role: str or + ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole + :ivar replication_state: Replication state of the failover group instance. + :vartype replication_state: str + :param partner_regions: Required. Partner region information for the + failover group. + :type partner_regions: list[~azure.mgmt.sql.models.PartnerRegionInfo] + :param managed_instance_pairs: Required. List of managed instance pairs in + the failover group. + :type managed_instance_pairs: + list[~azure.mgmt.sql.models.ManagedInstancePairInfo] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'read_write_endpoint': {'required': True}, + 'replication_role': {'readonly': True}, + 'replication_state': {'readonly': True}, + 'partner_regions': {'required': True}, + 'managed_instance_pairs': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'read_write_endpoint': {'key': 'properties.readWriteEndpoint', 'type': 'InstanceFailoverGroupReadWriteEndpoint'}, + 'read_only_endpoint': {'key': 'properties.readOnlyEndpoint', 'type': 'InstanceFailoverGroupReadOnlyEndpoint'}, + 'replication_role': {'key': 'properties.replicationRole', 'type': 'str'}, + 'replication_state': {'key': 'properties.replicationState', 'type': 'str'}, + 'partner_regions': {'key': 'properties.partnerRegions', 'type': '[PartnerRegionInfo]'}, + 'managed_instance_pairs': {'key': 'properties.managedInstancePairs', 'type': '[ManagedInstancePairInfo]'}, + } + + def __init__(self, *, read_write_endpoint, partner_regions, managed_instance_pairs, read_only_endpoint=None, **kwargs) -> None: + super(InstanceFailoverGroup, self).__init__(**kwargs) + self.read_write_endpoint = read_write_endpoint + self.read_only_endpoint = read_only_endpoint + self.replication_role = None + self.replication_state = None + self.partner_regions = partner_regions + self.managed_instance_pairs = managed_instance_pairs diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py new file mode 100644 index 000000000000..2a9857817ae4 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InstanceFailoverGroupReadOnlyEndpoint(Model): + """Read-only endpoint of the failover group instance. + + :param failover_policy: Failover policy of the read-only endpoint for the + failover group. Possible values include: 'Disabled', 'Enabled' + :type failover_policy: str or + ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy + """ + + _attribute_map = { + 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(InstanceFailoverGroupReadOnlyEndpoint, self).__init__(**kwargs) + self.failover_policy = kwargs.get('failover_policy', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py new file mode 100644 index 000000000000..71c9f180cdf7 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_only_endpoint_py3.py @@ -0,0 +1,30 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InstanceFailoverGroupReadOnlyEndpoint(Model): + """Read-only endpoint of the failover group instance. + + :param failover_policy: Failover policy of the read-only endpoint for the + failover group. Possible values include: 'Disabled', 'Enabled' + :type failover_policy: str or + ~azure.mgmt.sql.models.ReadOnlyEndpointFailoverPolicy + """ + + _attribute_map = { + 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, + } + + def __init__(self, *, failover_policy=None, **kwargs) -> None: + super(InstanceFailoverGroupReadOnlyEndpoint, self).__init__(**kwargs) + self.failover_policy = failover_policy diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py new file mode 100644 index 000000000000..89a86899e503 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InstanceFailoverGroupReadWriteEndpoint(Model): + """Read-write endpoint of the failover group instance. + + All required parameters must be populated in order to send to Azure. + + :param failover_policy: Required. Failover policy of the read-write + endpoint for the failover group. If failoverPolicy is Automatic then + failoverWithDataLossGracePeriodMinutes is required. Possible values + include: 'Manual', 'Automatic' + :type failover_policy: str or + ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy + :param failover_with_data_loss_grace_period_minutes: Grace period before + failover with data loss is attempted for the read-write endpoint. If + failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is + required. + :type failover_with_data_loss_grace_period_minutes: int + """ + + _validation = { + 'failover_policy': {'required': True}, + } + + _attribute_map = { + 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, + 'failover_with_data_loss_grace_period_minutes': {'key': 'failoverWithDataLossGracePeriodMinutes', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(InstanceFailoverGroupReadWriteEndpoint, self).__init__(**kwargs) + self.failover_policy = kwargs.get('failover_policy', None) + self.failover_with_data_loss_grace_period_minutes = kwargs.get('failover_with_data_loss_grace_period_minutes', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py new file mode 100644 index 000000000000..7fdc047ba37c --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/instance_failover_group_read_write_endpoint_py3.py @@ -0,0 +1,45 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class InstanceFailoverGroupReadWriteEndpoint(Model): + """Read-write endpoint of the failover group instance. + + All required parameters must be populated in order to send to Azure. + + :param failover_policy: Required. Failover policy of the read-write + endpoint for the failover group. If failoverPolicy is Automatic then + failoverWithDataLossGracePeriodMinutes is required. Possible values + include: 'Manual', 'Automatic' + :type failover_policy: str or + ~azure.mgmt.sql.models.ReadWriteEndpointFailoverPolicy + :param failover_with_data_loss_grace_period_minutes: Grace period before + failover with data loss is attempted for the read-write endpoint. If + failoverPolicy is Automatic then failoverWithDataLossGracePeriodMinutes is + required. + :type failover_with_data_loss_grace_period_minutes: int + """ + + _validation = { + 'failover_policy': {'required': True}, + } + + _attribute_map = { + 'failover_policy': {'key': 'failoverPolicy', 'type': 'str'}, + 'failover_with_data_loss_grace_period_minutes': {'key': 'failoverWithDataLossGracePeriodMinutes', 'type': 'int'}, + } + + def __init__(self, *, failover_policy, failover_with_data_loss_grace_period_minutes: int=None, **kwargs) -> None: + super(InstanceFailoverGroupReadWriteEndpoint, self).__init__(**kwargs) + self.failover_policy = failover_policy + self.failover_with_data_loss_grace_period_minutes = failover_with_data_loss_grace_period_minutes diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py new file mode 100644 index 000000000000..cdc79bb248ef --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class ManagedDatabase(TrackedResource): + """A managed 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. Resource location. + :type location: str + :param collation: Collation of the managed database. + :type collation: str + :ivar status: Status for the database. Possible values include: 'Online', + 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus + :ivar creation_date: Creation date of the database. + :vartype creation_date: datetime + :ivar earliest_restore_point: Earliest restore point in time for point in + time restore. + :vartype earliest_restore_point: datetime + :param restore_point_in_time: Conditional. If createMode is + PointInTimeRestore, this value is required. 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 + :ivar default_secondary_location: Geo paired region. + :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: + Create a database by restoring a point in time backup of an existing + database. SourceDatabaseName, SourceManagedInstanceName and PointInTime + must be specified. RestoreExternalBackup: Create a database by restoring + from external backup files. Collation, StorageContainerUri and + StorageContainerSasToken must be specified. Possible values include: + 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode + :param storage_container_uri: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the uri of the + storage container where backups for this restore are stored. + :type storage_container_uri: str + :param source_database_id: The resource identifier of the source database + associated with create operation of this database. + :type source_database_id: str + :param storage_container_sas_token: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the storage + container sas token. + :type storage_container_sas_token: str + :ivar failover_group_id: Instance Failover Group resource identifier that + this managed database belongs to. + :vartype failover_group_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'status': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'earliest_restore_point': {'readonly': True}, + 'default_secondary_location': {'readonly': True}, + 'failover_group_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'collation': {'key': 'properties.collation', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, + 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, + 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, + 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, + 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedDatabase, self).__init__(**kwargs) + self.collation = kwargs.get('collation', None) + self.status = None + self.creation_date = None + self.earliest_restore_point = None + self.restore_point_in_time = kwargs.get('restore_point_in_time', None) + self.default_secondary_location = None + self.catalog_collation = kwargs.get('catalog_collation', None) + self.create_mode = kwargs.get('create_mode', None) + self.storage_container_uri = kwargs.get('storage_container_uri', None) + self.source_database_id = kwargs.get('source_database_id', None) + self.storage_container_sas_token = kwargs.get('storage_container_sas_token', None) + self.failover_group_id = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py new file mode 100644 index 000000000000..e15d9d532b5a --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ManagedDatabasePaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedDatabase ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedDatabase]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedDatabasePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py new file mode 100644 index 000000000000..c17cd2ac18a5 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_py3.py @@ -0,0 +1,123 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class ManagedDatabase(TrackedResource): + """A managed 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. Resource location. + :type location: str + :param collation: Collation of the managed database. + :type collation: str + :ivar status: Status for the database. Possible values include: 'Online', + 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus + :ivar creation_date: Creation date of the database. + :vartype creation_date: datetime + :ivar earliest_restore_point: Earliest restore point in time for point in + time restore. + :vartype earliest_restore_point: datetime + :param restore_point_in_time: Conditional. If createMode is + PointInTimeRestore, this value is required. 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 + :ivar default_secondary_location: Geo paired region. + :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: + Create a database by restoring a point in time backup of an existing + database. SourceDatabaseName, SourceManagedInstanceName and PointInTime + must be specified. RestoreExternalBackup: Create a database by restoring + from external backup files. Collation, StorageContainerUri and + StorageContainerSasToken must be specified. Possible values include: + 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode + :param storage_container_uri: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the uri of the + storage container where backups for this restore are stored. + :type storage_container_uri: str + :param source_database_id: The resource identifier of the source database + associated with create operation of this database. + :type source_database_id: str + :param storage_container_sas_token: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the storage + container sas token. + :type storage_container_sas_token: str + :ivar failover_group_id: Instance Failover Group resource identifier that + this managed database belongs to. + :vartype failover_group_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'status': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'earliest_restore_point': {'readonly': True}, + 'default_secondary_location': {'readonly': True}, + 'failover_group_id': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'collation': {'key': 'properties.collation', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, + 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, + 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, + 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, + 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, storage_container_sas_token: str=None, **kwargs) -> None: + super(ManagedDatabase, self).__init__(tags=tags, location=location, **kwargs) + self.collation = collation + self.status = None + self.creation_date = None + self.earliest_restore_point = None + self.restore_point_in_time = restore_point_in_time + self.default_secondary_location = None + self.catalog_collation = catalog_collation + self.create_mode = create_mode + self.storage_container_uri = storage_container_uri + self.source_database_id = source_database_id + self.storage_container_sas_token = storage_container_sas_token + self.failover_group_id = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py new file mode 100644 index 000000000000..4335e9b19dfa --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedDatabaseUpdate(Model): + """An managed database update. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param collation: Collation of the managed database. + :type collation: str + :ivar status: Status for the database. Possible values include: 'Online', + 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus + :ivar creation_date: Creation date of the database. + :vartype creation_date: datetime + :ivar earliest_restore_point: Earliest restore point in time for point in + time restore. + :vartype earliest_restore_point: datetime + :param restore_point_in_time: Conditional. If createMode is + PointInTimeRestore, this value is required. 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 + :ivar default_secondary_location: Geo paired region. + :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: + Create a database by restoring a point in time backup of an existing + database. SourceDatabaseName, SourceManagedInstanceName and PointInTime + must be specified. RestoreExternalBackup: Create a database by restoring + from external backup files. Collation, StorageContainerUri and + StorageContainerSasToken must be specified. Possible values include: + 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode + :param storage_container_uri: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the uri of the + storage container where backups for this restore are stored. + :type storage_container_uri: str + :param source_database_id: The resource identifier of the source database + associated with create operation of this database. + :type source_database_id: str + :param storage_container_sas_token: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the storage + container sas token. + :type storage_container_sas_token: str + :ivar failover_group_id: Instance Failover Group resource identifier that + this managed database belongs to. + :vartype failover_group_id: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'status': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'earliest_restore_point': {'readonly': True}, + 'default_secondary_location': {'readonly': True}, + 'failover_group_id': {'readonly': True}, + } + + _attribute_map = { + 'collation': {'key': 'properties.collation', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, + 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, + 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, + 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, + 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ManagedDatabaseUpdate, self).__init__(**kwargs) + self.collation = kwargs.get('collation', None) + self.status = None + self.creation_date = None + self.earliest_restore_point = None + self.restore_point_in_time = kwargs.get('restore_point_in_time', None) + self.default_secondary_location = None + self.catalog_collation = kwargs.get('catalog_collation', None) + self.create_mode = kwargs.get('create_mode', None) + self.storage_container_uri = kwargs.get('storage_container_uri', None) + self.source_database_id = kwargs.get('source_database_id', None) + self.storage_container_sas_token = kwargs.get('storage_container_sas_token', None) + self.failover_group_id = None + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py new file mode 100644 index 000000000000..668eec38f38b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_database_update_py3.py @@ -0,0 +1,106 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedDatabaseUpdate(Model): + """An managed database update. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param collation: Collation of the managed database. + :type collation: str + :ivar status: Status for the database. Possible values include: 'Online', + 'Offline', 'Shutdown', 'Creating', 'Inaccessible' + :vartype status: str or ~azure.mgmt.sql.models.ManagedDatabaseStatus + :ivar creation_date: Creation date of the database. + :vartype creation_date: datetime + :ivar earliest_restore_point: Earliest restore point in time for point in + time restore. + :vartype earliest_restore_point: datetime + :param restore_point_in_time: Conditional. If createMode is + PointInTimeRestore, this value is required. 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 + :ivar default_secondary_location: Geo paired region. + :vartype default_secondary_location: 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 create_mode: Managed database create mode. PointInTimeRestore: + Create a database by restoring a point in time backup of an existing + database. SourceDatabaseName, SourceManagedInstanceName and PointInTime + must be specified. RestoreExternalBackup: Create a database by restoring + from external backup files. Collation, StorageContainerUri and + StorageContainerSasToken must be specified. Possible values include: + 'Default', 'RestoreExternalBackup', 'PointInTimeRestore' + :type create_mode: str or ~azure.mgmt.sql.models.ManagedDatabaseCreateMode + :param storage_container_uri: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the uri of the + storage container where backups for this restore are stored. + :type storage_container_uri: str + :param source_database_id: The resource identifier of the source database + associated with create operation of this database. + :type source_database_id: str + :param storage_container_sas_token: Conditional. If createMode is + RestoreExternalBackup, this value is required. Specifies the storage + container sas token. + :type storage_container_sas_token: str + :ivar failover_group_id: Instance Failover Group resource identifier that + this managed database belongs to. + :vartype failover_group_id: str + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'status': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'earliest_restore_point': {'readonly': True}, + 'default_secondary_location': {'readonly': True}, + 'failover_group_id': {'readonly': True}, + } + + _attribute_map = { + 'collation': {'key': 'properties.collation', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'earliest_restore_point': {'key': 'properties.earliestRestorePoint', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'default_secondary_location': {'key': 'properties.defaultSecondaryLocation', 'type': 'str'}, + 'catalog_collation': {'key': 'properties.catalogCollation', 'type': 'str'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'storage_container_uri': {'key': 'properties.storageContainerUri', 'type': 'str'}, + 'source_database_id': {'key': 'properties.sourceDatabaseId', 'type': 'str'}, + 'storage_container_sas_token': {'key': 'properties.storageContainerSasToken', 'type': 'str'}, + 'failover_group_id': {'key': 'properties.failoverGroupId', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, collation: str=None, restore_point_in_time=None, catalog_collation=None, create_mode=None, storage_container_uri: str=None, source_database_id: str=None, storage_container_sas_token: str=None, tags=None, **kwargs) -> None: + super(ManagedDatabaseUpdate, self).__init__(**kwargs) + self.collation = collation + self.status = None + self.creation_date = None + self.earliest_restore_point = None + self.restore_point_in_time = restore_point_in_time + self.default_secondary_location = None + self.catalog_collation = catalog_collation + self.create_mode = create_mode + self.storage_container_uri = storage_container_uri + self.source_database_id = source_database_id + self.storage_container_sas_token = storage_container_sas_token + self.failover_group_id = None + self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py new file mode 100644 index 000000000000..6af89171cd35 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class ManagedInstance(TrackedResource): + """An Azure SQL managed instance. + + 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. Resource location. + :type location: str + :param identity: The Azure Active Directory identity of the managed + instance. + :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :param sku: Managed instance sku + :type sku: ~azure.mgmt.sql.models.Sku + :ivar fully_qualified_domain_name: The fully qualified domain name of the + managed instance. + :vartype fully_qualified_domain_name: str + :param administrator_login: Administrator username for the managed + instance. Can only be specified when the managed instance is being created + (and is required for creation). + :type administrator_login: str + :param administrator_login_password: The administrator login password + (required for managed instance creation). + :type administrator_login_password: str + :param subnet_id: Subnet resource ID for the managed instance. + :type subnet_id: str + :ivar state: The state of the managed instance. + :vartype state: str + :param license_type: The license type. Possible values are + 'LicenseIncluded' and 'BasePrice'. + :type license_type: str + :param v_cores: The number of VCores. + :type v_cores: int + :param storage_size_in_gb: The maximum storage size in GB. + :type storage_size_in_gb: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'fully_qualified_domain_name': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, + 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ManagedInstance, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) + self.sku = kwargs.get('sku', None) + self.fully_qualified_domain_name = None + self.administrator_login = kwargs.get('administrator_login', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.state = None + self.license_type = kwargs.get('license_type', None) + self.v_cores = kwargs.get('v_cores', None) + self.storage_size_in_gb = kwargs.get('storage_size_in_gb', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py new file mode 100644 index 000000000000..c39881da9f3b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_paged.py @@ -0,0 +1,27 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class ManagedInstancePaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedInstance ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedInstance]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstancePaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py new file mode 100644 index 000000000000..ee49c1db0c62 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedInstancePairInfo(Model): + """Pairs of Managed Instances in the failover group. + + :param primary_managed_instance_id: Id of Primary Managed Instance in + pair. + :type primary_managed_instance_id: str + :param partner_managed_instance_id: Id of Partner Managed Instance in + pair. + :type partner_managed_instance_id: str + """ + + _attribute_map = { + 'primary_managed_instance_id': {'key': 'primaryManagedInstanceId', 'type': 'str'}, + 'partner_managed_instance_id': {'key': 'partnerManagedInstanceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedInstancePairInfo, self).__init__(**kwargs) + self.primary_managed_instance_id = kwargs.get('primary_managed_instance_id', None) + self.partner_managed_instance_id = kwargs.get('partner_managed_instance_id', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py new file mode 100644 index 000000000000..49f52752b439 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_pair_info_py3.py @@ -0,0 +1,34 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedInstancePairInfo(Model): + """Pairs of Managed Instances in the failover group. + + :param primary_managed_instance_id: Id of Primary Managed Instance in + pair. + :type primary_managed_instance_id: str + :param partner_managed_instance_id: Id of Partner Managed Instance in + pair. + :type partner_managed_instance_id: str + """ + + _attribute_map = { + 'primary_managed_instance_id': {'key': 'primaryManagedInstanceId', 'type': 'str'}, + 'partner_managed_instance_id': {'key': 'partnerManagedInstanceId', 'type': 'str'}, + } + + def __init__(self, *, primary_managed_instance_id: str=None, partner_managed_instance_id: str=None, **kwargs) -> None: + super(ManagedInstancePairInfo, self).__init__(**kwargs) + self.primary_managed_instance_id = primary_managed_instance_id + self.partner_managed_instance_id = partner_managed_instance_id diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py new file mode 100644 index 000000000000..d6c710b8773b --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_py3.py @@ -0,0 +1,99 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from .tracked_resource import TrackedResource + + +class ManagedInstance(TrackedResource): + """An Azure SQL managed instance. + + 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 tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. Resource location. + :type location: str + :param identity: The Azure Active Directory identity of the managed + instance. + :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :param sku: Managed instance sku + :type sku: ~azure.mgmt.sql.models.Sku + :ivar fully_qualified_domain_name: The fully qualified domain name of the + managed instance. + :vartype fully_qualified_domain_name: str + :param administrator_login: Administrator username for the managed + instance. Can only be specified when the managed instance is being created + (and is required for creation). + :type administrator_login: str + :param administrator_login_password: The administrator login password + (required for managed instance creation). + :type administrator_login_password: str + :param subnet_id: Subnet resource ID for the managed instance. + :type subnet_id: str + :ivar state: The state of the managed instance. + :vartype state: str + :param license_type: The license type. Possible values are + 'LicenseIncluded' and 'BasePrice'. + :type license_type: str + :param v_cores: The number of VCores. + :type v_cores: int + :param storage_size_in_gb: The maximum storage size in GB. + :type storage_size_in_gb: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + 'fully_qualified_domain_name': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, + 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, + } + + def __init__(self, *, location: str, tags=None, identity=None, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, **kwargs) -> None: + super(ManagedInstance, self).__init__(tags=tags, location=location, **kwargs) + self.identity = identity + self.sku = sku + self.fully_qualified_domain_name = None + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.subnet_id = subnet_id + self.state = None + self.license_type = license_type + self.v_cores = v_cores + self.storage_size_in_gb = storage_size_in_gb diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py new file mode 100644 index 000000000000..7ea51f29ddff --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedInstanceUpdate(Model): + """An update request for an Azure SQL Database managed instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku: Managed instance sku + :type sku: ~azure.mgmt.sql.models.Sku + :ivar fully_qualified_domain_name: The fully qualified domain name of the + managed instance. + :vartype fully_qualified_domain_name: str + :param administrator_login: Administrator username for the managed + instance. Can only be specified when the managed instance is being created + (and is required for creation). + :type administrator_login: str + :param administrator_login_password: The administrator login password + (required for managed instance creation). + :type administrator_login_password: str + :param subnet_id: Subnet resource ID for the managed instance. + :type subnet_id: str + :ivar state: The state of the managed instance. + :vartype state: str + :param license_type: The license type. Possible values are + 'LicenseIncluded' and 'BasePrice'. + :type license_type: str + :param v_cores: The number of VCores. + :type v_cores: int + :param storage_size_in_gb: The maximum storage size in GB. + :type storage_size_in_gb: int + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'fully_qualified_domain_name': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, + 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(ManagedInstanceUpdate, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.fully_qualified_domain_name = None + self.administrator_login = kwargs.get('administrator_login', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.subnet_id = kwargs.get('subnet_id', None) + self.state = None + self.license_type = kwargs.get('license_type', None) + self.v_cores = kwargs.get('v_cores', None) + self.storage_size_in_gb = kwargs.get('storage_size_in_gb', None) + self.tags = kwargs.get('tags', None) diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py new file mode 100644 index 000000000000..0adbe5f439f8 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/managed_instance_update_py3.py @@ -0,0 +1,77 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ManagedInstanceUpdate(Model): + """An update request for an Azure SQL Database managed instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku: Managed instance sku + :type sku: ~azure.mgmt.sql.models.Sku + :ivar fully_qualified_domain_name: The fully qualified domain name of the + managed instance. + :vartype fully_qualified_domain_name: str + :param administrator_login: Administrator username for the managed + instance. Can only be specified when the managed instance is being created + (and is required for creation). + :type administrator_login: str + :param administrator_login_password: The administrator login password + (required for managed instance creation). + :type administrator_login_password: str + :param subnet_id: Subnet resource ID for the managed instance. + :type subnet_id: str + :ivar state: The state of the managed instance. + :vartype state: str + :param license_type: The license type. Possible values are + 'LicenseIncluded' and 'BasePrice'. + :type license_type: str + :param v_cores: The number of VCores. + :type v_cores: int + :param storage_size_in_gb: The maximum storage size in GB. + :type storage_size_in_gb: int + :param tags: Resource tags. + :type tags: dict[str, str] + """ + + _validation = { + 'fully_qualified_domain_name': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, + 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, + 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'license_type': {'key': 'properties.licenseType', 'type': 'str'}, + 'v_cores': {'key': 'properties.vCores', 'type': 'int'}, + 'storage_size_in_gb': {'key': 'properties.storageSizeInGB', 'type': 'int'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type: str=None, v_cores: int=None, storage_size_in_gb: int=None, tags=None, **kwargs) -> None: + super(ManagedInstanceUpdate, self).__init__(**kwargs) + self.sku = sku + self.fully_qualified_domain_name = None + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.subnet_id = subnet_id + self.state = None + self.license_type = license_type + self.v_cores = v_cores + self.storage_size_in_gb = storage_size_in_gb + self.tags = tags diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py b/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py new file mode 100644 index 000000000000..4d8e2688acb1 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PartnerRegionInfo(Model): + """Partner region information for the failover group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location: Geo location of the partner managed instances. + :type location: str + :ivar replication_role: Replication role of the partner managed instances. + Possible values include: 'Primary', 'Secondary' + :vartype replication_role: str or + ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole + """ + + _validation = { + 'replication_role': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'replication_role': {'key': 'replicationRole', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PartnerRegionInfo, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + self.replication_role = None diff --git a/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py b/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py new file mode 100644 index 000000000000..76c52b49c0ba --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/models/partner_region_info_py3.py @@ -0,0 +1,41 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class PartnerRegionInfo(Model): + """Partner region information for the failover group. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param location: Geo location of the partner managed instances. + :type location: str + :ivar replication_role: Replication role of the partner managed instances. + Possible values include: 'Primary', 'Secondary' + :vartype replication_role: str or + ~azure.mgmt.sql.models.InstanceFailoverGroupReplicationRole + """ + + _validation = { + 'replication_role': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'replication_role': {'key': 'replicationRole', 'type': 'str'}, + } + + def __init__(self, *, location: str=None, **kwargs) -> None: + super(PartnerRegionInfo, self).__init__(**kwargs) + self.location = location + self.replication_role = 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/sql_management_client_enums.py b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py index 62713566786f..3a82b6370cd3 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py +++ b/azure-mgmt-sql/azure/mgmt/sql/models/sql_management_client_enums.py @@ -326,15 +326,15 @@ class FailoverGroupReplicationRole(str, Enum): secondary = "Secondary" -class OperationOrigin(str, Enum): +class IdentityType(str, Enum): - user = "user" - system = "system" + system_assigned = "SystemAssigned" -class IdentityType(str, Enum): +class OperationOrigin(str, Enum): - system_assigned = "SystemAssigned" + user = "user" + system = "system" class SyncAgentState(str, Enum): @@ -411,6 +411,28 @@ class VirtualNetworkRuleState(str, Enum): unknown = "Unknown" +class ManagedDatabaseStatus(str, Enum): + + online = "Online" + offline = "Offline" + shutdown = "Shutdown" + creating = "Creating" + inaccessible = "Inaccessible" + + +class CatalogCollationType(str, Enum): + + database_default = "DATABASE_DEFAULT" + sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" + + +class ManagedDatabaseCreateMode(str, Enum): + + default = "Default" + restore_external_backup = "RestoreExternalBackup" + point_in_time_restore = "PointInTimeRestore" + + class AutomaticTuningServerMode(str, Enum): custom = "Custom" @@ -515,12 +537,6 @@ class DatabaseStatus(str, Enum): scaling = "Scaling" -class CatalogCollationType(str, Enum): - - database_default = "DATABASE_DEFAULT" - sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" - - class DatabaseLicenseType(str, Enum): license_included = "LicenseIncluded" @@ -546,6 +562,12 @@ class ElasticPoolLicenseType(str, Enum): base_price = "BasePrice" +class InstanceFailoverGroupReplicationRole(str, Enum): + + primary = "Primary" + secondary = "Secondary" + + class LongTermRetentionDatabaseState(str, Enum): all = "All" diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index fdda72bc17ff..54f846ee2941 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -36,6 +36,7 @@ from .database_automatic_tuning_operations import DatabaseAutomaticTuningOperations from .encryption_protectors_operations import EncryptionProtectorsOperations from .failover_groups_operations import FailoverGroupsOperations +from .managed_instances_operations import ManagedInstancesOperations from .operations import Operations from .server_keys_operations import ServerKeysOperations from .sync_agents_operations import SyncAgentsOperations @@ -45,12 +46,15 @@ from .virtual_network_rules_operations import VirtualNetworkRulesOperations from .long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations +from .managed_databases_operations import ManagedDatabasesOperations from .server_automatic_tuning_operations import ServerAutomaticTuningOperations from .server_dns_aliases_operations import ServerDnsAliasesOperations from .restore_points_operations import RestorePointsOperations from .database_operations import DatabaseOperations 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', @@ -80,6 +84,7 @@ 'DatabaseAutomaticTuningOperations', 'EncryptionProtectorsOperations', 'FailoverGroupsOperations', + 'ManagedInstancesOperations', 'Operations', 'ServerKeysOperations', 'SyncAgentsOperations', @@ -89,10 +94,13 @@ 'VirtualNetworkRulesOperations', 'LongTermRetentionBackupsOperations', 'BackupLongTermRetentionPoliciesOperations', + 'ManagedDatabasesOperations', 'ServerAutomaticTuningOperations', 'ServerDnsAliasesOperations', 'RestorePointsOperations', 'DatabaseOperations', 'ElasticPoolOperations', 'CapabilitiesOperations', + 'InstanceFailoverGroupsOperations', + 'ShortTermRetentionPoliciesOperations', ] diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py new file mode 100644 index 000000000000..8e9e2c566109 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/instance_failover_groups_operations.py @@ -0,0 +1,580 @@ +# 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 InstanceFailoverGroupsOperations(object): + """InstanceFailoverGroupsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-10-01-preview" + + self.config = config + + def get( + self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a failover group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param location_name: The name of the region where the resource is + located. + :type location_name: str + :param failover_group_name: The name of the failover group. + :type failover_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: InstanceFailoverGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.InstanceFailoverGroup 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'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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('InstanceFailoverGroup', 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'} + + + def _create_or_update_initial( + self, resource_group_name, location_name, failover_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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, 'InstanceFailoverGroup') + + # 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, 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('InstanceFailoverGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('InstanceFailoverGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, location_name, failover_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a failover group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param location_name: The name of the region where the resource is + located. + :type location_name: str + :param failover_group_name: The name of the failover group. + :type failover_group_name: str + :param parameters: The failover group parameters. + :type parameters: ~azure.mgmt.sql.models.InstanceFailoverGroup + :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 InstanceFailoverGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstanceFailoverGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('InstanceFailoverGroup', 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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'} + + + def _delete_initial( + self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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.delete(url, query_parameters) + response = self._client.send(request, header_parameters, 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, location_name, failover_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a failover group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param location_name: The name of the region where the resource is + located. + :type location_name: str + :param failover_group_name: The name of the failover group. + :type failover_group_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, + location_name=location_name, + failover_group_name=failover_group_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/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}'} + + def list_by_location( + self, resource_group_name, location_name, custom_headers=None, raw=False, **operation_config): + """Lists the failover groups in a location. + + :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 location_name: The name of the region where the resource is + located. + :type location_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 InstanceFailoverGroup + :rtype: + ~azure.mgmt.sql.models.InstanceFailoverGroupPaged[~azure.mgmt.sql.models.InstanceFailoverGroup] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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 + + return response + + # Deserialize response + deserialized = models.InstanceFailoverGroupPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.InstanceFailoverGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups'} + + + def _failover_initial( + self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.failover.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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('InstanceFailoverGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def failover( + self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Fails over from the current primary managed instance to this managed + instance. + + :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 location_name: The name of the region where the resource is + located. + :type location_name: str + :param failover_group_name: The name of the failover group. + :type failover_group_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 InstanceFailoverGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstanceFailoverGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._failover_initial( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('InstanceFailoverGroup', 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) + failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/failover'} + + + def _force_failover_allow_data_loss_initial( + self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.force_failover_allow_data_loss.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'failoverGroupName': self._serialize.url("failover_group_name", failover_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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('InstanceFailoverGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def force_failover_allow_data_loss( + self, resource_group_name, location_name, failover_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Fails over from the current primary managed instance to this managed + instance. This operation might result in data loss. + + :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 location_name: The name of the region where the resource is + located. + :type location_name: str + :param failover_group_name: The name of the failover group. + :type failover_group_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 InstanceFailoverGroup + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.InstanceFailoverGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.InstanceFailoverGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._force_failover_allow_data_loss_initial( + resource_group_name=resource_group_name, + location_name=location_name, + failover_group_name=failover_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('InstanceFailoverGroup', 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) + force_failover_allow_data_loss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/instanceFailoverGroups/{failoverGroupName}/forceFailoverAllowDataLoss'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py new file mode 100644 index 000000000000..d4d2bb29f2b5 --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_databases_operations.py @@ -0,0 +1,571 @@ +# 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 ManagedDatabasesOperations(object): + """ManagedDatabasesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2017-03-01-preview" + + self.config = config + + + def _complete_restore_initial( + self, location_name, operation_id, last_backup_name, custom_headers=None, raw=False, **operation_config): + parameters = models.CompleteDatabaseRestoreDefinition(last_backup_name=last_backup_name) + + # Construct URL + url = self.complete_restore.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, '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, 'CompleteDatabaseRestoreDefinition') + + # Construct and send request + request = self._client.post(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 + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def complete_restore( + self, location_name, operation_id, last_backup_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Completes the restore operation on a managed database. + + :param location_name: The name of the region where the resource is + located. + :type location_name: str + :param operation_id: Management operation id that this request tries + to complete. + :type operation_id: str + :param last_backup_name: The last backup name to apply + :type last_backup_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._complete_restore_initial( + location_name=location_name, + operation_id=operation_id, + last_backup_name=last_backup_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) + complete_restore.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseRestoreAzureAsyncOperation/{operationId}/completeRestore'} + + def list_by_instance( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of managed 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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedDatabase + :rtype: + ~azure.mgmt.sql.models.ManagedDatabasePaged[~azure.mgmt.sql.models.ManagedDatabase] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_instance.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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 + + return response + + # Deserialize response + deserialized = models.ManagedDatabasePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_instance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases'} + + def get( + self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a managed 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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param 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: ManagedDatabase or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ManagedDatabase or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + '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("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('ManagedDatabase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'} + + + def _create_or_update_initial( + self, resource_group_name, managed_instance_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_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("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, 'ManagedDatabase') + + # 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, 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('ManagedDatabase', response) + if response.status_code == 201: + deserialized = self._deserialize('ManagedDatabase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, managed_instance_name, 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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param parameters: The requested database resource state. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabase + :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 ManagedDatabase or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedDatabase] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedDatabase]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ManagedDatabase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}'} + + + def _delete_initial( + self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + '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("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.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the managed 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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + 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/managedInstances/{managedInstanceName}/databases/{databaseName}'} + + + def _update_initial( + self, resource_group_name, managed_instance_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + '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("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, 'ManagedDatabaseUpdate') + + # 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('ManagedDatabase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, managed_instance_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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param parameters: The requested database resource state. + :type parameters: ~azure.mgmt.sql.models.ManagedDatabaseUpdate + :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 ManagedDatabase or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedDatabase] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedDatabase]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + database_name=database_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ManagedDatabase', 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/managedInstances/{managedInstanceName}/databases/{databaseName}'} diff --git a/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py new file mode 100644 index 000000000000..1bd0b6a0d60c --- /dev/null +++ b/azure-mgmt-sql/azure/mgmt/sql/operations/managed_instances_operations.py @@ -0,0 +1,527 @@ +# 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 ManagedInstancesOperations(object): + """ManagedInstancesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2015-05-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in the subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedInstance + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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 + + return response + + # Deserialize response + deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of managed instances in a resource group. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedInstance + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['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 + + return response + + # Deserialize response + deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances'} + + def get( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets a managed instance. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagedInstance or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ManagedInstance or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + '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('ManagedInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} + + + def _create_or_update_initial( + self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # 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, 'ManagedInstance') + + # 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, 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('ManagedInstance', response) + if response.status_code == 201: + deserialized = self._deserialize('ManagedInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a managed instance. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. + :type parameters: ~azure.mgmt.sql.models.ManagedInstance + :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 ManagedInstance or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstance] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstance]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ManagedInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} + + + def _delete_initial( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + '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.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a managed instance. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} + + + def _update_initial( + self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + '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, 'ManagedInstanceUpdate') + + # 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('ManagedInstance', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates a managed instance. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param parameters: The requested managed instance resource state. + :type parameters: ~azure.mgmt.sql.models.ManagedInstanceUpdate + :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 ManagedInstance or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstance] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstance]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ManagedInstance', 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/managedInstances/{managedInstanceName}'} 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 3d71bd1986b7..9aa7e05bf265 100644 --- a/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py +++ b/azure-mgmt-sql/azure/mgmt/sql/sql_management_client.py @@ -40,6 +40,7 @@ from .operations.database_automatic_tuning_operations import DatabaseAutomaticTuningOperations from .operations.encryption_protectors_operations import EncryptionProtectorsOperations from .operations.failover_groups_operations import FailoverGroupsOperations +from .operations.managed_instances_operations import ManagedInstancesOperations from .operations.operations import Operations from .operations.server_keys_operations import ServerKeysOperations from .operations.sync_agents_operations import SyncAgentsOperations @@ -49,12 +50,15 @@ from .operations.virtual_network_rules_operations import VirtualNetworkRulesOperations from .operations.long_term_retention_backups_operations import LongTermRetentionBackupsOperations from .operations.backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations +from .operations.managed_databases_operations import ManagedDatabasesOperations from .operations.server_automatic_tuning_operations import ServerAutomaticTuningOperations from .operations.server_dns_aliases_operations import ServerDnsAliasesOperations from .operations.restore_points_operations import RestorePointsOperations from .operations.database_operations import DatabaseOperations 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 @@ -151,6 +155,8 @@ class SqlManagementClient(SDKClient): :vartype encryption_protectors: azure.mgmt.sql.operations.EncryptionProtectorsOperations :ivar failover_groups: FailoverGroups operations :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations + :ivar managed_instances: ManagedInstances operations + :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar operations: Operations operations :vartype operations: azure.mgmt.sql.operations.Operations :ivar server_keys: ServerKeys operations @@ -169,6 +175,8 @@ class SqlManagementClient(SDKClient): :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations :ivar backup_long_term_retention_policies: BackupLongTermRetentionPolicies operations :vartype backup_long_term_retention_policies: azure.mgmt.sql.operations.BackupLongTermRetentionPoliciesOperations + :ivar managed_databases: ManagedDatabases operations + :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations :ivar server_automatic_tuning: ServerAutomaticTuning operations :vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations :ivar server_dns_aliases: ServerDnsAliases operations @@ -181,6 +189,10 @@ class SqlManagementClient(SDKClient): :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperations :ivar capabilities: Capabilities operations :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 @@ -255,6 +267,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.failover_groups = FailoverGroupsOperations( self._client, self.config, self._serialize, self._deserialize) + self.managed_instances = ManagedInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) self.server_keys = ServerKeysOperations( @@ -273,6 +287,8 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.backup_long_term_retention_policies = BackupLongTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) + self.managed_databases = ManagedDatabasesOperations( + self._client, self.config, self._serialize, self._deserialize) self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self.config, self._serialize, self._deserialize) self.server_dns_aliases = ServerDnsAliasesOperations( @@ -285,3 +301,7 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.capabilities = CapabilitiesOperations( 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)