diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py index 67c64ba79636..f44654f61c0d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py @@ -78,7 +78,6 @@ from .operations import ManagedDatabaseVulnerabilityAssessmentScansOperations from .operations import ManagedDatabaseVulnerabilityAssessmentsOperations from .operations import InstanceFailoverGroupsOperations -from .operations import BackupShortTermRetentionPoliciesOperations from .operations import TdeCertificatesOperations from .operations import ManagedInstanceTdeCertificatesOperations from .operations import ManagedInstanceKeysOperations @@ -89,7 +88,6 @@ from .operations import ManagedDatabaseSensitivityLabelsOperations from .operations import InstancePoolsOperations from .operations import UsagesOperations -from .operations import ManagedInstancesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations from .operations import ServersOperations @@ -98,12 +96,16 @@ from .operations import ManagedInstanceLongTermRetentionPoliciesOperations from .operations import WorkloadGroupsOperations from .operations import WorkloadClassifiersOperations -from .operations import ServerAzureADAdministratorsOperations from .operations import ManagedInstanceOperations +from .operations import ServerAzureADAdministratorsOperations from .operations import SyncGroupsOperations from .operations import SyncMembersOperations +from .operations import ManagedInstancesOperations +from .operations import BackupShortTermRetentionPoliciesOperations from .operations import ManagedDatabaseRestoreDetailsOperations from .operations import ManagedDatabasesOperations +from .operations import ServerAzureADOnlyAuthenticationsOperations +from .operations import ImportExportOperations from . import models @@ -243,8 +245,6 @@ class SqlManagementClient(SDKClient): :vartype managed_database_vulnerability_assessments: azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations :ivar instance_failover_groups: InstanceFailoverGroups operations :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations - :ivar backup_short_term_retention_policies: BackupShortTermRetentionPolicies operations - :vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations :ivar tde_certificates: TdeCertificates operations :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificates operations @@ -265,8 +265,6 @@ class SqlManagementClient(SDKClient): :vartype instance_pools: azure.mgmt.sql.operations.InstancePoolsOperations :ivar usages: Usages operations :vartype usages: azure.mgmt.sql.operations.UsagesOperations - :ivar managed_instances: ManagedInstances operations - :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar private_endpoint_connections: PrivateEndpointConnections operations :vartype private_endpoint_connections: azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResources operations @@ -283,18 +281,26 @@ class SqlManagementClient(SDKClient): :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations :ivar workload_classifiers: WorkloadClassifiers operations :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations - :ivar server_azure_ad_administrators: ServerAzureADAdministrators operations - :vartype server_azure_ad_administrators: azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations :ivar managed_instance_operations: ManagedInstanceOperations operations :vartype managed_instance_operations: azure.mgmt.sql.operations.ManagedInstanceOperations + :ivar server_azure_ad_administrators: ServerAzureADAdministrators operations + :vartype server_azure_ad_administrators: azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations :ivar sync_groups: SyncGroups operations :vartype sync_groups: azure.mgmt.sql.operations.SyncGroupsOperations :ivar sync_members: SyncMembers operations :vartype sync_members: azure.mgmt.sql.operations.SyncMembersOperations + :ivar managed_instances: ManagedInstances operations + :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations + :ivar backup_short_term_retention_policies: BackupShortTermRetentionPolicies operations + :vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations :ivar managed_database_restore_details: ManagedDatabaseRestoreDetails operations :vartype managed_database_restore_details: azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations :ivar managed_databases: ManagedDatabases operations :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations + :ivar server_azure_ad_only_authentications: ServerAzureADOnlyAuthentications operations + :vartype server_azure_ad_only_authentications: azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations + :ivar import_export: ImportExport operations + :vartype import_export: azure.mgmt.sql.operations.ImportExportOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -445,8 +451,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self.config, self._serialize, self._deserialize) - self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) self.tde_certificates = TdeCertificatesOperations( self._client, self.config, self._serialize, self._deserialize) self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( @@ -467,8 +471,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.usages = UsagesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instances = ManagedInstancesOperations( - self._client, self.config, self._serialize, self._deserialize) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( @@ -485,15 +487,23 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.workload_classifiers = WorkloadClassifiersOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( - self._client, self.config, self._serialize, self._deserialize) self.managed_instance_operations = ManagedInstanceOperations( self._client, self.config, self._serialize, self._deserialize) + self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( + self._client, self.config, self._serialize, self._deserialize) self.sync_groups = SyncGroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.sync_members = SyncMembersOperations( self._client, self.config, self._serialize, self._deserialize) + self.managed_instances = ManagedInstancesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( self._client, self.config, self._serialize, self._deserialize) self.managed_databases = ManagedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) + self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.import_export = ImportExportOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 74be0f46025c..31a29be00ef2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -44,7 +44,7 @@ from ._models_py3 import ElasticPoolPerformanceLevelCapability from ._models_py3 import ElasticPoolUpdate from ._models_py3 import EncryptionProtector - from ._models_py3 import ExportRequest + from ._models_py3 import ExportDatabaseDefinition from ._models_py3 import ExtendedDatabaseBlobAuditingPolicy from ._models_py3 import ExtendedServerBlobAuditingPolicy from ._models_py3 import FailoverGroup @@ -53,9 +53,9 @@ from ._models_py3 import FailoverGroupUpdate from ._models_py3 import FirewallRule from ._models_py3 import GeoBackupPolicy - from ._models_py3 import ImportExportResponse - from ._models_py3 import ImportExtensionRequest - from ._models_py3 import ImportRequest + from ._models_py3 import ImportExistingDatabaseDefinition + from ._models_py3 import ImportExportOperationResult + from ._models_py3 import ImportNewDatabaseDefinition from ._models_py3 import InstanceFailoverGroup from ._models_py3 import InstanceFailoverGroupReadOnlyEndpoint from ._models_py3 import InstanceFailoverGroupReadWriteEndpoint @@ -99,6 +99,7 @@ from ._models_py3 import ManagedInstanceOperationParametersPair from ._models_py3 import ManagedInstanceOperationSteps from ._models_py3 import ManagedInstancePairInfo + from ._models_py3 import ManagedInstancePrivateLinkServiceConnectionStateProperty from ._models_py3 import ManagedInstanceUpdate from ._models_py3 import ManagedInstanceVcoresCapability from ._models_py3 import ManagedInstanceVersionCapability @@ -113,6 +114,7 @@ from ._models_py3 import MetricValue from ._models_py3 import MinCapacityCapability from ._models_py3 import Name + from ._models_py3 import NetworkIsolationSettings from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationImpact @@ -121,6 +123,7 @@ from ._models_py3 import PerformanceLevelCapability from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointConnectionProperties + from ._models_py3 import PrivateEndpointConnectionRequestStatus from ._models_py3 import PrivateEndpointProperty from ._models_py3 import PrivateLinkResource from ._models_py3 import PrivateLinkResourceProperties @@ -143,6 +146,7 @@ from ._models_py3 import Server from ._models_py3 import ServerAutomaticTuning from ._models_py3 import ServerAzureADAdministrator + from ._models_py3 import ServerAzureADOnlyAuthentication from ._models_py3 import ServerBlobAuditingPolicy from ._models_py3 import ServerCommunicationLink from ._models_py3 import ServerConnectionPolicy @@ -226,7 +230,7 @@ from ._models import ElasticPoolPerformanceLevelCapability from ._models import ElasticPoolUpdate from ._models import EncryptionProtector - from ._models import ExportRequest + from ._models import ExportDatabaseDefinition from ._models import ExtendedDatabaseBlobAuditingPolicy from ._models import ExtendedServerBlobAuditingPolicy from ._models import FailoverGroup @@ -235,9 +239,9 @@ from ._models import FailoverGroupUpdate from ._models import FirewallRule from ._models import GeoBackupPolicy - from ._models import ImportExportResponse - from ._models import ImportExtensionRequest - from ._models import ImportRequest + from ._models import ImportExistingDatabaseDefinition + from ._models import ImportExportOperationResult + from ._models import ImportNewDatabaseDefinition from ._models import InstanceFailoverGroup from ._models import InstanceFailoverGroupReadOnlyEndpoint from ._models import InstanceFailoverGroupReadWriteEndpoint @@ -281,6 +285,7 @@ from ._models import ManagedInstanceOperationParametersPair from ._models import ManagedInstanceOperationSteps from ._models import ManagedInstancePairInfo + from ._models import ManagedInstancePrivateLinkServiceConnectionStateProperty from ._models import ManagedInstanceUpdate from ._models import ManagedInstanceVcoresCapability from ._models import ManagedInstanceVersionCapability @@ -295,6 +300,7 @@ from ._models import MetricValue from ._models import MinCapacityCapability from ._models import Name + from ._models import NetworkIsolationSettings from ._models import Operation from ._models import OperationDisplay from ._models import OperationImpact @@ -303,6 +309,7 @@ from ._models import PerformanceLevelCapability from ._models import PrivateEndpointConnection from ._models import PrivateEndpointConnectionProperties + from ._models import PrivateEndpointConnectionRequestStatus from ._models import PrivateEndpointProperty from ._models import PrivateLinkResource from ._models import PrivateLinkResourceProperties @@ -325,6 +332,7 @@ from ._models import Server from ._models import ServerAutomaticTuning from ._models import ServerAzureADAdministrator + from ._models import ServerAzureADOnlyAuthentication from ._models import ServerBlobAuditingPolicy from ._models import ServerCommunicationLink from ._models import ServerConnectionPolicy @@ -427,6 +435,7 @@ from ._paged_models import RestorePointPaged from ._paged_models import SensitivityLabelPaged from ._paged_models import ServerAzureADAdministratorPaged +from ._paged_models import ServerAzureADOnlyAuthenticationPaged from ._paged_models import ServerBlobAuditingPolicyPaged from ._paged_models import ServerCommunicationLinkPaged from ._paged_models import ServerDnsAliasPaged @@ -461,10 +470,6 @@ DataMaskingRuleState, DataMaskingFunction, GeoBackupPolicyState, - DatabaseEdition, - ServiceObjectiveName, - StorageKeyType, - AuthenticationType, UnitType, PrimaryAggregationType, UnitDefinitionType, @@ -475,6 +480,7 @@ RecommendedIndexState, RecommendedIndexType, TransparentDataEncryptionStatus, + ServiceObjectiveName, TransparentDataEncryptionActivityStatus, AutomaticTuningMode, AutomaticTuningOptionModeDesired, @@ -515,13 +521,10 @@ VulnerabilityAssessmentScanState, InstanceFailoverGroupReplicationRole, InstancePoolLicenseType, - IdentityType, - ManagedServerCreateMode, - ManagedInstanceLicenseType, - ManagedInstanceProxyOverride, PrivateLinkServiceConnectionStateStatus, PrivateLinkServiceConnectionStateActionsRequire, PrivateEndpointProvisioningState, + IdentityType, ServerPublicNetworkAccess, CheckNameAvailabilityReason, MaxSizeUnit, @@ -536,6 +539,11 @@ SyncMemberState, ManagedDatabaseStatus, ManagedDatabaseCreateMode, + ManagedServerCreateMode, + ManagedInstanceLicenseType, + ManagedInstanceProxyOverride, + StorageAccountType, + StorageKeyType, LongTermRetentionDatabaseState, VulnerabilityAssessmentPolicyBaselineName, SensitivityLabelSource, @@ -584,7 +592,7 @@ 'ElasticPoolPerformanceLevelCapability', 'ElasticPoolUpdate', 'EncryptionProtector', - 'ExportRequest', + 'ExportDatabaseDefinition', 'ExtendedDatabaseBlobAuditingPolicy', 'ExtendedServerBlobAuditingPolicy', 'FailoverGroup', @@ -593,9 +601,9 @@ 'FailoverGroupUpdate', 'FirewallRule', 'GeoBackupPolicy', - 'ImportExportResponse', - 'ImportExtensionRequest', - 'ImportRequest', + 'ImportExistingDatabaseDefinition', + 'ImportExportOperationResult', + 'ImportNewDatabaseDefinition', 'InstanceFailoverGroup', 'InstanceFailoverGroupReadOnlyEndpoint', 'InstanceFailoverGroupReadWriteEndpoint', @@ -639,6 +647,7 @@ 'ManagedInstanceOperationParametersPair', 'ManagedInstanceOperationSteps', 'ManagedInstancePairInfo', + 'ManagedInstancePrivateLinkServiceConnectionStateProperty', 'ManagedInstanceUpdate', 'ManagedInstanceVcoresCapability', 'ManagedInstanceVersionCapability', @@ -653,6 +662,7 @@ 'MetricValue', 'MinCapacityCapability', 'Name', + 'NetworkIsolationSettings', 'Operation', 'OperationDisplay', 'OperationImpact', @@ -661,6 +671,7 @@ 'PerformanceLevelCapability', 'PrivateEndpointConnection', 'PrivateEndpointConnectionProperties', + 'PrivateEndpointConnectionRequestStatus', 'PrivateEndpointProperty', 'PrivateLinkResource', 'PrivateLinkResourceProperties', @@ -683,6 +694,7 @@ 'Server', 'ServerAutomaticTuning', 'ServerAzureADAdministrator', + 'ServerAzureADOnlyAuthentication', 'ServerBlobAuditingPolicy', 'ServerCommunicationLink', 'ServerConnectionPolicy', @@ -786,7 +798,6 @@ 'ElasticPoolOperationPaged', 'VulnerabilityAssessmentScanRecordPaged', 'InstanceFailoverGroupPaged', - 'BackupShortTermRetentionPolicyPaged', 'ManagedInstanceKeyPaged', 'ManagedInstanceEncryptionProtectorPaged', 'RecoverableManagedDatabasePaged', @@ -794,7 +805,6 @@ 'ServerVulnerabilityAssessmentPaged', 'InstancePoolPaged', 'UsagePaged', - 'ManagedInstancePaged', 'PrivateEndpointConnectionPaged', 'PrivateLinkResourcePaged', 'ServerPaged', @@ -802,14 +812,17 @@ 'ManagedInstanceLongTermRetentionPolicyPaged', 'WorkloadGroupPaged', 'WorkloadClassifierPaged', - 'ServerAzureADAdministratorPaged', 'ManagedInstanceOperationPaged', + 'ServerAzureADAdministratorPaged', 'SyncDatabaseIdPropertiesPaged', 'SyncFullSchemaPropertiesPaged', 'SyncGroupLogPropertiesPaged', 'SyncGroupPaged', 'SyncMemberPaged', + 'ManagedInstancePaged', + 'BackupShortTermRetentionPolicyPaged', 'ManagedDatabasePaged', + 'ServerAzureADOnlyAuthenticationPaged', 'ServerConnectionType', 'SecurityAlertPolicyState', 'SecurityAlertPolicyEmailAccountAdmins', @@ -818,10 +831,6 @@ 'DataMaskingRuleState', 'DataMaskingFunction', 'GeoBackupPolicyState', - 'DatabaseEdition', - 'ServiceObjectiveName', - 'StorageKeyType', - 'AuthenticationType', 'UnitType', 'PrimaryAggregationType', 'UnitDefinitionType', @@ -832,6 +841,7 @@ 'RecommendedIndexState', 'RecommendedIndexType', 'TransparentDataEncryptionStatus', + 'ServiceObjectiveName', 'TransparentDataEncryptionActivityStatus', 'AutomaticTuningMode', 'AutomaticTuningOptionModeDesired', @@ -872,13 +882,10 @@ 'VulnerabilityAssessmentScanState', 'InstanceFailoverGroupReplicationRole', 'InstancePoolLicenseType', - 'IdentityType', - 'ManagedServerCreateMode', - 'ManagedInstanceLicenseType', - 'ManagedInstanceProxyOverride', 'PrivateLinkServiceConnectionStateStatus', 'PrivateLinkServiceConnectionStateActionsRequire', 'PrivateEndpointProvisioningState', + 'IdentityType', 'ServerPublicNetworkAccess', 'CheckNameAvailabilityReason', 'MaxSizeUnit', @@ -893,6 +900,11 @@ 'SyncMemberState', 'ManagedDatabaseStatus', 'ManagedDatabaseCreateMode', + 'ManagedServerCreateMode', + 'ManagedInstanceLicenseType', + 'ManagedInstanceProxyOverride', + 'StorageAccountType', + 'StorageKeyType', 'LongTermRetentionDatabaseState', 'VulnerabilityAssessmentPolicyBaselineName', 'SensitivityLabelSource', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py index 0afc5b980357..afb4b8a4dd46 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py @@ -280,6 +280,11 @@ class BackupShortTermRetentionPolicy(ProxyResource): :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 diff_backup_interval_in_hours: The differential backup interval in + hours. This is how many interval hours between each differential backup + will be supported. This is only applicable to live databases but not + dropped databases. + :type diff_backup_interval_in_hours: int """ _validation = { @@ -293,11 +298,13 @@ class BackupShortTermRetentionPolicy(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + 'diff_backup_interval_in_hours': {'key': 'properties.diffBackupIntervalInHours', 'type': 'int'}, } def __init__(self, **kwargs): super(BackupShortTermRetentionPolicy, self).__init__(**kwargs) self.retention_days = kwargs.get('retention_days', None) + self.diff_backup_interval_in_hours = kwargs.get('diff_backup_interval_in_hours', None) class CheckNameAvailabilityRequest(Model): @@ -2607,28 +2614,28 @@ def __init__(self, **kwargs): self.thumbprint = None -class ExportRequest(Model): - """Export database parameters. +class ExportDatabaseDefinition(Model): + """Contains the information necessary to perform export database operation. All required parameters must be populated in order to send to Azure. - :param storage_key_type: Required. The type of the storage key to use. - Possible values include: 'StorageAccessKey', 'SharedAccessKey' + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :param storage_key: Required. The storage key to use. If storage key type - is SharedAccessKey, it must be preceded with a "?." + :param storage_key: Required. Storage key. :type storage_key: str - :param storage_uri: Required. The storage uri to use. + :param storage_uri: Required. Storage Uri. :type storage_uri: str - :param administrator_login: Required. The name of the SQL administrator. + :param administrator_login: Required. Administrator login name. :type administrator_login: str - :param administrator_login_password: Required. The password of the SQL - administrator. + :param administrator_login_password: Required. Administrator login + password. :type administrator_login_password: str - :param authentication_type: The authentication type. Possible values - include: 'SQL', 'ADPassword'. Default value: "SQL" . - :type authentication_type: str or - ~azure.mgmt.sql.models.AuthenticationType + :param authentication_type: Authentication type. + :type authentication_type: str + :param network_isolation: Optional resource information to enable network + isolation for request. + :type network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings """ _validation = { @@ -2640,22 +2647,24 @@ class ExportRequest(Model): } _attribute_map = { - 'storage_key_type': {'key': 'storageKeyType', 'type': 'StorageKeyType'}, + 'storage_key_type': {'key': 'storageKeyType', 'type': 'str'}, 'storage_key': {'key': 'storageKey', 'type': 'str'}, 'storage_uri': {'key': 'storageUri', 'type': 'str'}, 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, - 'authentication_type': {'key': 'authenticationType', 'type': 'AuthenticationType'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'network_isolation': {'key': 'networkIsolation', 'type': 'NetworkIsolationSettings'}, } def __init__(self, **kwargs): - super(ExportRequest, self).__init__(**kwargs) + super(ExportDatabaseDefinition, self).__init__(**kwargs) self.storage_key_type = kwargs.get('storage_key_type', None) self.storage_key = kwargs.get('storage_key', None) self.storage_uri = kwargs.get('storage_uri', None) self.administrator_login = kwargs.get('administrator_login', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) - self.authentication_type = kwargs.get('authentication_type', "SQL") + self.authentication_type = kwargs.get('authentication_type', None) + self.network_isolation = kwargs.get('network_isolation', None) class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): @@ -3265,8 +3274,62 @@ def __init__(self, **kwargs): self.location = None -class ImportExportResponse(ProxyResource): - """Response for Import/Export Get operation. +class ImportExistingDatabaseDefinition(Model): + """Contains the information necessary to perform import operation for existing + database. + + All required parameters must be populated in order to send to Azure. + + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' + :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :param storage_key: Required. Storage key. + :type storage_key: str + :param storage_uri: Required. Storage Uri. + :type storage_uri: str + :param administrator_login: Required. Administrator login name. + :type administrator_login: str + :param administrator_login_password: Required. Administrator login + password. + :type administrator_login_password: str + :param authentication_type: Authentication type. + :type authentication_type: str + :param network_isolation: Optional resource information to enable network + isolation for request. + :type network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + """ + + _validation = { + 'storage_key_type': {'required': True}, + 'storage_key': {'required': True}, + 'storage_uri': {'required': True}, + 'administrator_login': {'required': True}, + 'administrator_login_password': {'required': True}, + } + + _attribute_map = { + 'storage_key_type': {'key': 'storageKeyType', 'type': 'str'}, + 'storage_key': {'key': 'storageKey', 'type': 'str'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'network_isolation': {'key': 'networkIsolation', 'type': 'NetworkIsolationSettings'}, + } + + def __init__(self, **kwargs): + super(ImportExistingDatabaseDefinition, self).__init__(**kwargs) + self.storage_key_type = kwargs.get('storage_key_type', None) + self.storage_key = kwargs.get('storage_key', None) + self.storage_uri = kwargs.get('storage_uri', None) + self.administrator_login = kwargs.get('administrator_login', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.network_isolation = kwargs.get('network_isolation', None) + + +class ImportExportOperationResult(ProxyResource): + """An ImportExport operation result resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -3277,192 +3340,108 @@ class ImportExportResponse(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar request_type: The request type of the operation. - :vartype request_type: str - :ivar request_id: The request type of the operation. + :ivar request_id: Request Id. :vartype request_id: str - :ivar server_name: The name of the server. + :ivar request_type: Request type. + :vartype request_type: str + :ivar queued_time: Queued time. + :vartype queued_time: str + :ivar last_modified_time: Last modified time. + :vartype last_modified_time: str + :ivar blob_uri: Blob Uri. + :vartype blob_uri: str + :ivar server_name: Server name. :vartype server_name: str - :ivar database_name: The name of the database. + :ivar database_name: Database name. :vartype database_name: str - :ivar status: The status message returned from the server. + :ivar status: Operation status. :vartype status: str - :ivar last_modified_time: The operation status last modified time. - :vartype last_modified_time: str - :ivar queued_time: The operation queued time. - :vartype queued_time: str - :ivar blob_uri: The blob uri. - :vartype blob_uri: str - :ivar error_message: The error message returned from the server. + :ivar error_message: Error message. :vartype error_message: str + :ivar private_endpoint_connections: Gets the status of private endpoints + associated with this request. + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'request_type': {'readonly': True}, 'request_id': {'readonly': True}, + 'request_type': {'readonly': True}, + 'queued_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'blob_uri': {'readonly': True}, 'server_name': {'readonly': True}, 'database_name': {'readonly': True}, 'status': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'queued_time': {'readonly': True}, - 'blob_uri': {'readonly': True}, 'error_message': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'request_type': {'key': 'properties.requestType', 'type': 'str'}, 'request_id': {'key': 'properties.requestId', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'queued_time': {'key': 'properties.queuedTime', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, + 'blob_uri': {'key': 'properties.blobUri', 'type': 'str'}, 'server_name': {'key': 'properties.serverName', 'type': 'str'}, 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, - 'queued_time': {'key': 'properties.queuedTime', 'type': 'str'}, - 'blob_uri': {'key': 'properties.blobUri', 'type': 'str'}, 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionRequestStatus]'}, } def __init__(self, **kwargs): - super(ImportExportResponse, self).__init__(**kwargs) - self.request_type = None + super(ImportExportOperationResult, self).__init__(**kwargs) self.request_id = None + self.request_type = None + self.queued_time = None + self.last_modified_time = None + self.blob_uri = None self.server_name = None self.database_name = None self.status = None - self.last_modified_time = None - self.queued_time = None - self.blob_uri = None self.error_message = None + self.private_endpoint_connections = None -class ImportExtensionRequest(Model): - """Import database parameters. - - 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. - - :param name: The name of the extension. - :type name: str - :param type: The type of the extension. - :type type: str - :param storage_key_type: Required. The type of the storage key to use. - Possible values include: 'StorageAccessKey', 'SharedAccessKey' - :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :param storage_key: Required. The storage key to use. If storage key type - is SharedAccessKey, it must be preceded with a "?." - :type storage_key: str - :param storage_uri: Required. The storage uri to use. - :type storage_uri: str - :param administrator_login: Required. The name of the SQL administrator. - :type administrator_login: str - :param administrator_login_password: Required. The password of the SQL - administrator. - :type administrator_login_password: str - :param authentication_type: The authentication type. Possible values - include: 'SQL', 'ADPassword'. Default value: "SQL" . - :type authentication_type: str or - ~azure.mgmt.sql.models.AuthenticationType - :ivar operation_mode: Required. The type of import operation being - performed. This is always Import. Default value: "Import" . - :vartype operation_mode: str - """ - - _validation = { - 'storage_key_type': {'required': True}, - 'storage_key': {'required': True}, - 'storage_uri': {'required': True}, - 'administrator_login': {'required': True}, - 'administrator_login_password': {'required': True}, - 'operation_mode': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'storage_key_type': {'key': 'properties.storageKeyType', 'type': 'StorageKeyType'}, - 'storage_key': {'key': 'properties.storageKey', 'type': 'str'}, - 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, - 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'authentication_type': {'key': 'properties.authenticationType', 'type': 'AuthenticationType'}, - 'operation_mode': {'key': 'properties.operationMode', 'type': 'str'}, - } - - operation_mode = "Import" - - def __init__(self, **kwargs): - super(ImportExtensionRequest, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) - self.storage_key_type = kwargs.get('storage_key_type', None) - self.storage_key = kwargs.get('storage_key', None) - self.storage_uri = kwargs.get('storage_uri', None) - self.administrator_login = kwargs.get('administrator_login', None) - self.administrator_login_password = kwargs.get('administrator_login_password', None) - self.authentication_type = kwargs.get('authentication_type', "SQL") - - -class ImportRequest(ExportRequest): - """Import database parameters. +class ImportNewDatabaseDefinition(Model): + """Contains the information necessary to perform import operation for new + database. All required parameters must be populated in order to send to Azure. - :param storage_key_type: Required. The type of the storage key to use. - Possible values include: 'StorageAccessKey', 'SharedAccessKey' + :param database_name: Name of the import database. + :type database_name: str + :param edition: Edition of the import database. + :type edition: str + :param service_objective_name: Service level objective name of the import + database. + :type service_objective_name: str + :param max_size_bytes: Max size in bytes for the import database. + :type max_size_bytes: str + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :param storage_key: Required. The storage key to use. If storage key type - is SharedAccessKey, it must be preceded with a "?." + :param storage_key: Required. Storage key. :type storage_key: str - :param storage_uri: Required. The storage uri to use. + :param storage_uri: Required. Storage Uri. :type storage_uri: str - :param administrator_login: Required. The name of the SQL administrator. + :param administrator_login: Required. Administrator login name. :type administrator_login: str - :param administrator_login_password: Required. The password of the SQL - administrator. + :param administrator_login_password: Required. Administrator login + password. :type administrator_login_password: str - :param authentication_type: The authentication type. Possible values - include: 'SQL', 'ADPassword'. Default value: "SQL" . - :type authentication_type: str or - ~azure.mgmt.sql.models.AuthenticationType - :param database_name: Required. The name of the database to import. - :type database_name: str - :param edition: Required. The edition for the database being created. - The list of SKUs may vary by region and support offer. To determine the - SKUs (including the SKU name, tier/edition, family, and capacity) that are - available to your subscription in an Azure region, use the - `Capabilities_ListByLocation` REST API or one of the following commands: - ```azurecli - az sql db list-editions -l -o table - ```` - ```powershell - Get-AzSqlServerServiceObjective -Location - ```` - . Possible values include: 'Web', 'Business', 'Basic', 'Standard', - 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' - :type edition: str or ~azure.mgmt.sql.models.DatabaseEdition - :param service_objective_name: Required. The name of the service objective - to assign to the database. Possible values include: 'System', 'System0', - 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', - 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', - 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', - 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', - 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', - 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', - 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', - 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - :type service_objective_name: str or - ~azure.mgmt.sql.models.ServiceObjectiveName - :param max_size_bytes: Required. The maximum size for the newly imported - database. - :type max_size_bytes: str + :param authentication_type: Authentication type. + :type authentication_type: str + :param network_isolation: Optional resource information to enable network + isolation for request. + :type network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings """ _validation = { @@ -3471,31 +3450,35 @@ class ImportRequest(ExportRequest): 'storage_uri': {'required': True}, 'administrator_login': {'required': True}, 'administrator_login_password': {'required': True}, - 'database_name': {'required': True}, - 'edition': {'required': True}, - 'service_objective_name': {'required': True}, - 'max_size_bytes': {'required': True}, } _attribute_map = { - 'storage_key_type': {'key': 'storageKeyType', 'type': 'StorageKeyType'}, - 'storage_key': {'key': 'storageKey', 'type': 'str'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, - 'authentication_type': {'key': 'authenticationType', 'type': 'AuthenticationType'}, 'database_name': {'key': 'databaseName', 'type': 'str'}, 'edition': {'key': 'edition', 'type': 'str'}, 'service_objective_name': {'key': 'serviceObjectiveName', 'type': 'str'}, 'max_size_bytes': {'key': 'maxSizeBytes', 'type': 'str'}, + 'storage_key_type': {'key': 'storageKeyType', 'type': 'str'}, + 'storage_key': {'key': 'storageKey', 'type': 'str'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'network_isolation': {'key': 'networkIsolation', 'type': 'NetworkIsolationSettings'}, } def __init__(self, **kwargs): - super(ImportRequest, self).__init__(**kwargs) + super(ImportNewDatabaseDefinition, self).__init__(**kwargs) self.database_name = kwargs.get('database_name', None) self.edition = kwargs.get('edition', None) self.service_objective_name = kwargs.get('service_objective_name', None) self.max_size_bytes = kwargs.get('max_size_bytes', None) + self.storage_key_type = kwargs.get('storage_key_type', None) + self.storage_key = kwargs.get('storage_key', None) + self.storage_uri = kwargs.get('storage_uri', None) + self.administrator_login = kwargs.get('administrator_login', None) + self.administrator_login_password = kwargs.get('administrator_login_password', None) + self.authentication_type = kwargs.get('authentication_type', None) + self.network_isolation = kwargs.get('network_isolation', None) class InstanceFailoverGroup(ProxyResource): @@ -5110,6 +5093,9 @@ class ManagedInstance(TrackedResource): :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku + :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', + 'Updating', 'Unknown', 'Succeeded', 'Failed' + :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. Default: Regular instance creation. @@ -5186,6 +5172,12 @@ class ManagedInstance(TrackedResource): :param minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' :type minimal_tls_version: str + :param storage_account_type: The storage account type used to store + backups for this instance. The options are LRS (LocallyRedundantStorage), + ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). Possible values + include: 'GRS', 'LRS', 'ZRS' + :type storage_account_type: str or + ~azure.mgmt.sql.models.StorageAccountType """ _validation = { @@ -5193,6 +5185,7 @@ class ManagedInstance(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, @@ -5206,6 +5199,7 @@ class ManagedInstance(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, @@ -5226,12 +5220,14 @@ class ManagedInstance(TrackedResource): 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, + 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, } def __init__(self, **kwargs): super(ManagedInstance, self).__init__(**kwargs) self.identity = kwargs.get('identity', None) self.sku = kwargs.get('sku', None) + self.provisioning_state = None self.managed_instance_create_mode = kwargs.get('managed_instance_create_mode', None) self.fully_qualified_domain_name = None self.administrator_login = kwargs.get('administrator_login', None) @@ -5252,6 +5248,7 @@ def __init__(self, **kwargs): self.instance_pool_id = kwargs.get('instance_pool_id', None) self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) self.minimal_tls_version = kwargs.get('minimal_tls_version', None) + self.storage_account_type = kwargs.get('storage_account_type', None) class ManagedInstanceAdministrator(ProxyResource): @@ -5824,6 +5821,42 @@ def __init__(self, **kwargs): self.partner_managed_instance_id = kwargs.get('partner_managed_instance_id', None) +class ManagedInstancePrivateLinkServiceConnectionStateProperty(Model): + """ManagedInstancePrivateLinkServiceConnectionStateProperty. + + 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. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The private link service connection description. + :vartype actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedInstancePrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = None + + class ManagedInstanceUpdate(Model): """An update request for an Azure SQL Database managed instance. @@ -5832,6 +5865,9 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku + :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', + 'Updating', 'Unknown', 'Succeeded', 'Failed' + :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. Default: Regular instance creation. @@ -5908,11 +5944,18 @@ class ManagedInstanceUpdate(Model): :param minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' :type minimal_tls_version: str + :param storage_account_type: The storage account type used to store + backups for this instance. The options are LRS (LocallyRedundantStorage), + ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). Possible values + include: 'GRS', 'LRS', 'ZRS' + :type storage_account_type: str or + ~azure.mgmt.sql.models.StorageAccountType :param tags: Resource tags. :type tags: dict[str, str] """ _validation = { + 'provisioning_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, @@ -5920,6 +5963,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, @@ -5940,12 +5984,14 @@ class ManagedInstanceUpdate(Model): 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, + 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.provisioning_state = None self.managed_instance_create_mode = kwargs.get('managed_instance_create_mode', None) self.fully_qualified_domain_name = None self.administrator_login = kwargs.get('administrator_login', None) @@ -5966,6 +6012,7 @@ def __init__(self, **kwargs): self.instance_pool_id = kwargs.get('instance_pool_id', None) self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) self.minimal_tls_version = kwargs.get('minimal_tls_version', None) + self.storage_account_type = kwargs.get('storage_account_type', None) self.tags = kwargs.get('tags', None) @@ -6544,6 +6591,32 @@ def __init__(self, **kwargs): self.localized_value = kwargs.get('localized_value', None) +class NetworkIsolationSettings(Model): + """Contains the ARM resources for which to create private endpoint connection. + + :param storage_account_resource_id: The resource id for the storage + account used to store BACPAC file. If set, private endpoint connection + will be created for the storage account. Must match storage account used + for StorageUri parameter. + :type storage_account_resource_id: str + :param sql_server_resource_id: The resource id for the SQL server which is + the target of this request. If set, private endpoint connection will be + created for the SQL server. Must match server which is target of the + operation. + :type sql_server_resource_id: str + """ + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'sqlServerResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NetworkIsolationSettings, self).__init__(**kwargs) + self.storage_account_resource_id = kwargs.get('storage_account_resource_id', None) + self.sql_server_resource_id = kwargs.get('sql_server_resource_id', None) + + class Operation(Model): """SQL REST API operation definition. @@ -6842,6 +6915,41 @@ def __init__(self, **kwargs): self.provisioning_state = None +class PrivateEndpointConnectionRequestStatus(Model): + """Contains the private endpoint connection requests status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar private_link_service_id: Resource id for which the private endpoint + is created. + :vartype private_link_service_id: str + :ivar private_endpoint_connection_name: The connection name for the + private endpoint. + :vartype private_endpoint_connection_name: str + :ivar status: Status of this private endpoint connection. + :vartype status: str + """ + + _validation = { + 'private_link_service_id': {'readonly': True}, + 'private_endpoint_connection_name': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'private_link_service_id': {'key': 'privateLinkServiceId', 'type': 'str'}, + 'private_endpoint_connection_name': {'key': 'privateEndpointConnectionName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionRequestStatus, self).__init__(**kwargs) + self.private_link_service_id = None + self.private_endpoint_connection_name = None + self.status = None + + class PrivateEndpointProperty(Model): """PrivateEndpointProperty. @@ -7861,9 +7969,9 @@ class ServerAzureADAdministrator(ProxyResource): :type sid: str :param tenant_id: Tenant ID of the administrator. :type tenant_id: str - :param azure_ad_only_authentication: Azure Active Directory only + :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :type azure_ad_only_authentication: bool + :vartype azure_ad_only_authentication: bool """ _validation = { @@ -7873,6 +7981,7 @@ class ServerAzureADAdministrator(ProxyResource): 'administrator_type': {'required': True, 'constant': True}, 'login': {'required': True}, 'sid': {'required': True}, + 'azure_ad_only_authentication': {'readonly': True}, } _attribute_map = { @@ -7893,6 +8002,44 @@ def __init__(self, **kwargs): self.login = kwargs.get('login', None) self.sid = kwargs.get('sid', None) self.tenant_id = kwargs.get('tenant_id', None) + self.azure_ad_only_authentication = None + + +class ServerAzureADOnlyAuthentication(ProxyResource): + """Azure Active Directory only authentication. + + 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 azure_ad_only_authentication: Required. Azure Active Directory only + Authentication enabled. + :type azure_ad_only_authentication: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'azure_ad_only_authentication': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azure_ad_only_authentication': {'key': 'properties.azureADOnlyAuthentication', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServerAzureADOnlyAuthentication, self).__init__(**kwargs) self.azure_ad_only_authentication = kwargs.get('azure_ad_only_authentication', None) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py index 2145cfc94924..168aa32b7876 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py @@ -280,6 +280,11 @@ class BackupShortTermRetentionPolicy(ProxyResource): :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 diff_backup_interval_in_hours: The differential backup interval in + hours. This is how many interval hours between each differential backup + will be supported. This is only applicable to live databases but not + dropped databases. + :type diff_backup_interval_in_hours: int """ _validation = { @@ -293,11 +298,13 @@ class BackupShortTermRetentionPolicy(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + 'diff_backup_interval_in_hours': {'key': 'properties.diffBackupIntervalInHours', 'type': 'int'}, } - def __init__(self, *, retention_days: int=None, **kwargs) -> None: + def __init__(self, *, retention_days: int=None, diff_backup_interval_in_hours: int=None, **kwargs) -> None: super(BackupShortTermRetentionPolicy, self).__init__(**kwargs) self.retention_days = retention_days + self.diff_backup_interval_in_hours = diff_backup_interval_in_hours class CheckNameAvailabilityRequest(Model): @@ -2607,28 +2614,28 @@ def __init__(self, *, server_key_type, server_key_name: str=None, **kwargs) -> N self.thumbprint = None -class ExportRequest(Model): - """Export database parameters. +class ExportDatabaseDefinition(Model): + """Contains the information necessary to perform export database operation. All required parameters must be populated in order to send to Azure. - :param storage_key_type: Required. The type of the storage key to use. - Possible values include: 'StorageAccessKey', 'SharedAccessKey' + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :param storage_key: Required. The storage key to use. If storage key type - is SharedAccessKey, it must be preceded with a "?." + :param storage_key: Required. Storage key. :type storage_key: str - :param storage_uri: Required. The storage uri to use. + :param storage_uri: Required. Storage Uri. :type storage_uri: str - :param administrator_login: Required. The name of the SQL administrator. + :param administrator_login: Required. Administrator login name. :type administrator_login: str - :param administrator_login_password: Required. The password of the SQL - administrator. + :param administrator_login_password: Required. Administrator login + password. :type administrator_login_password: str - :param authentication_type: The authentication type. Possible values - include: 'SQL', 'ADPassword'. Default value: "SQL" . - :type authentication_type: str or - ~azure.mgmt.sql.models.AuthenticationType + :param authentication_type: Authentication type. + :type authentication_type: str + :param network_isolation: Optional resource information to enable network + isolation for request. + :type network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings """ _validation = { @@ -2640,22 +2647,24 @@ class ExportRequest(Model): } _attribute_map = { - 'storage_key_type': {'key': 'storageKeyType', 'type': 'StorageKeyType'}, + 'storage_key_type': {'key': 'storageKeyType', 'type': 'str'}, 'storage_key': {'key': 'storageKey', 'type': 'str'}, 'storage_uri': {'key': 'storageUri', 'type': 'str'}, 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, - 'authentication_type': {'key': 'authenticationType', 'type': 'AuthenticationType'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'network_isolation': {'key': 'networkIsolation', 'type': 'NetworkIsolationSettings'}, } - def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, administrator_login: str, administrator_login_password: str, authentication_type="SQL", **kwargs) -> None: - super(ExportRequest, self).__init__(**kwargs) + def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, administrator_login: str, administrator_login_password: str, authentication_type: str=None, network_isolation=None, **kwargs) -> None: + super(ExportDatabaseDefinition, self).__init__(**kwargs) self.storage_key_type = storage_key_type self.storage_key = storage_key self.storage_uri = storage_uri self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.authentication_type = authentication_type + self.network_isolation = network_isolation class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): @@ -3265,8 +3274,62 @@ def __init__(self, *, state, **kwargs) -> None: self.location = None -class ImportExportResponse(ProxyResource): - """Response for Import/Export Get operation. +class ImportExistingDatabaseDefinition(Model): + """Contains the information necessary to perform import operation for existing + database. + + All required parameters must be populated in order to send to Azure. + + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' + :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :param storage_key: Required. Storage key. + :type storage_key: str + :param storage_uri: Required. Storage Uri. + :type storage_uri: str + :param administrator_login: Required. Administrator login name. + :type administrator_login: str + :param administrator_login_password: Required. Administrator login + password. + :type administrator_login_password: str + :param authentication_type: Authentication type. + :type authentication_type: str + :param network_isolation: Optional resource information to enable network + isolation for request. + :type network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings + """ + + _validation = { + 'storage_key_type': {'required': True}, + 'storage_key': {'required': True}, + 'storage_uri': {'required': True}, + 'administrator_login': {'required': True}, + 'administrator_login_password': {'required': True}, + } + + _attribute_map = { + 'storage_key_type': {'key': 'storageKeyType', 'type': 'str'}, + 'storage_key': {'key': 'storageKey', 'type': 'str'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'network_isolation': {'key': 'networkIsolation', 'type': 'NetworkIsolationSettings'}, + } + + def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, administrator_login: str, administrator_login_password: str, authentication_type: str=None, network_isolation=None, **kwargs) -> None: + super(ImportExistingDatabaseDefinition, self).__init__(**kwargs) + self.storage_key_type = storage_key_type + self.storage_key = storage_key + self.storage_uri = storage_uri + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.authentication_type = authentication_type + self.network_isolation = network_isolation + + +class ImportExportOperationResult(ProxyResource): + """An ImportExport operation result resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -3277,192 +3340,108 @@ class ImportExportResponse(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar request_type: The request type of the operation. - :vartype request_type: str - :ivar request_id: The request type of the operation. + :ivar request_id: Request Id. :vartype request_id: str - :ivar server_name: The name of the server. + :ivar request_type: Request type. + :vartype request_type: str + :ivar queued_time: Queued time. + :vartype queued_time: str + :ivar last_modified_time: Last modified time. + :vartype last_modified_time: str + :ivar blob_uri: Blob Uri. + :vartype blob_uri: str + :ivar server_name: Server name. :vartype server_name: str - :ivar database_name: The name of the database. + :ivar database_name: Database name. :vartype database_name: str - :ivar status: The status message returned from the server. + :ivar status: Operation status. :vartype status: str - :ivar last_modified_time: The operation status last modified time. - :vartype last_modified_time: str - :ivar queued_time: The operation queued time. - :vartype queued_time: str - :ivar blob_uri: The blob uri. - :vartype blob_uri: str - :ivar error_message: The error message returned from the server. + :ivar error_message: Error message. :vartype error_message: str + :ivar private_endpoint_connections: Gets the status of private endpoints + associated with this request. + :vartype private_endpoint_connections: + list[~azure.mgmt.sql.models.PrivateEndpointConnectionRequestStatus] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'request_type': {'readonly': True}, 'request_id': {'readonly': True}, + 'request_type': {'readonly': True}, + 'queued_time': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'blob_uri': {'readonly': True}, 'server_name': {'readonly': True}, 'database_name': {'readonly': True}, 'status': {'readonly': True}, - 'last_modified_time': {'readonly': True}, - 'queued_time': {'readonly': True}, - 'blob_uri': {'readonly': True}, 'error_message': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'request_type': {'key': 'properties.requestType', 'type': 'str'}, 'request_id': {'key': 'properties.requestId', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'queued_time': {'key': 'properties.queuedTime', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, + 'blob_uri': {'key': 'properties.blobUri', 'type': 'str'}, 'server_name': {'key': 'properties.serverName', 'type': 'str'}, 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, - 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, - 'queued_time': {'key': 'properties.queuedTime', 'type': 'str'}, - 'blob_uri': {'key': 'properties.blobUri', 'type': 'str'}, 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionRequestStatus]'}, } def __init__(self, **kwargs) -> None: - super(ImportExportResponse, self).__init__(**kwargs) - self.request_type = None + super(ImportExportOperationResult, self).__init__(**kwargs) self.request_id = None + self.request_type = None + self.queued_time = None + self.last_modified_time = None + self.blob_uri = None self.server_name = None self.database_name = None self.status = None - self.last_modified_time = None - self.queued_time = None - self.blob_uri = None self.error_message = None + self.private_endpoint_connections = None -class ImportExtensionRequest(Model): - """Import database parameters. - - 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. - - :param name: The name of the extension. - :type name: str - :param type: The type of the extension. - :type type: str - :param storage_key_type: Required. The type of the storage key to use. - Possible values include: 'StorageAccessKey', 'SharedAccessKey' - :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :param storage_key: Required. The storage key to use. If storage key type - is SharedAccessKey, it must be preceded with a "?." - :type storage_key: str - :param storage_uri: Required. The storage uri to use. - :type storage_uri: str - :param administrator_login: Required. The name of the SQL administrator. - :type administrator_login: str - :param administrator_login_password: Required. The password of the SQL - administrator. - :type administrator_login_password: str - :param authentication_type: The authentication type. Possible values - include: 'SQL', 'ADPassword'. Default value: "SQL" . - :type authentication_type: str or - ~azure.mgmt.sql.models.AuthenticationType - :ivar operation_mode: Required. The type of import operation being - performed. This is always Import. Default value: "Import" . - :vartype operation_mode: str - """ - - _validation = { - 'storage_key_type': {'required': True}, - 'storage_key': {'required': True}, - 'storage_uri': {'required': True}, - 'administrator_login': {'required': True}, - 'administrator_login_password': {'required': True}, - 'operation_mode': {'required': True, 'constant': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'storage_key_type': {'key': 'properties.storageKeyType', 'type': 'StorageKeyType'}, - 'storage_key': {'key': 'properties.storageKey', 'type': 'str'}, - 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, - 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, - 'authentication_type': {'key': 'properties.authenticationType', 'type': 'AuthenticationType'}, - 'operation_mode': {'key': 'properties.operationMode', 'type': 'str'}, - } - - operation_mode = "Import" - - def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, administrator_login: str, administrator_login_password: str, name: str=None, type: str=None, authentication_type="SQL", **kwargs) -> None: - super(ImportExtensionRequest, self).__init__(**kwargs) - self.name = name - self.type = type - self.storage_key_type = storage_key_type - self.storage_key = storage_key - self.storage_uri = storage_uri - self.administrator_login = administrator_login - self.administrator_login_password = administrator_login_password - self.authentication_type = authentication_type - - -class ImportRequest(ExportRequest): - """Import database parameters. +class ImportNewDatabaseDefinition(Model): + """Contains the information necessary to perform import operation for new + database. All required parameters must be populated in order to send to Azure. - :param storage_key_type: Required. The type of the storage key to use. - Possible values include: 'StorageAccessKey', 'SharedAccessKey' + :param database_name: Name of the import database. + :type database_name: str + :param edition: Edition of the import database. + :type edition: str + :param service_objective_name: Service level objective name of the import + database. + :type service_objective_name: str + :param max_size_bytes: Max size in bytes for the import database. + :type max_size_bytes: str + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType - :param storage_key: Required. The storage key to use. If storage key type - is SharedAccessKey, it must be preceded with a "?." + :param storage_key: Required. Storage key. :type storage_key: str - :param storage_uri: Required. The storage uri to use. + :param storage_uri: Required. Storage Uri. :type storage_uri: str - :param administrator_login: Required. The name of the SQL administrator. + :param administrator_login: Required. Administrator login name. :type administrator_login: str - :param administrator_login_password: Required. The password of the SQL - administrator. + :param administrator_login_password: Required. Administrator login + password. :type administrator_login_password: str - :param authentication_type: The authentication type. Possible values - include: 'SQL', 'ADPassword'. Default value: "SQL" . - :type authentication_type: str or - ~azure.mgmt.sql.models.AuthenticationType - :param database_name: Required. The name of the database to import. - :type database_name: str - :param edition: Required. The edition for the database being created. - The list of SKUs may vary by region and support offer. To determine the - SKUs (including the SKU name, tier/edition, family, and capacity) that are - available to your subscription in an Azure region, use the - `Capabilities_ListByLocation` REST API or one of the following commands: - ```azurecli - az sql db list-editions -l -o table - ```` - ```powershell - Get-AzSqlServerServiceObjective -Location - ```` - . Possible values include: 'Web', 'Business', 'Basic', 'Standard', - 'Premium', 'PremiumRS', 'Free', 'Stretch', 'DataWarehouse', 'System', - 'System2', 'GeneralPurpose', 'BusinessCritical', 'Hyperscale' - :type edition: str or ~azure.mgmt.sql.models.DatabaseEdition - :param service_objective_name: Required. The name of the service objective - to assign to the database. Possible values include: 'System', 'System0', - 'System1', 'System2', 'System3', 'System4', 'System2L', 'System3L', - 'System4L', 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', - 'S9', 'S12', 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', - 'PRS4', 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', - 'DW1000', 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', - 'DW3000', 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', - 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', - 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - :type service_objective_name: str or - ~azure.mgmt.sql.models.ServiceObjectiveName - :param max_size_bytes: Required. The maximum size for the newly imported - database. - :type max_size_bytes: str + :param authentication_type: Authentication type. + :type authentication_type: str + :param network_isolation: Optional resource information to enable network + isolation for request. + :type network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings """ _validation = { @@ -3471,31 +3450,35 @@ class ImportRequest(ExportRequest): 'storage_uri': {'required': True}, 'administrator_login': {'required': True}, 'administrator_login_password': {'required': True}, - 'database_name': {'required': True}, - 'edition': {'required': True}, - 'service_objective_name': {'required': True}, - 'max_size_bytes': {'required': True}, } _attribute_map = { - 'storage_key_type': {'key': 'storageKeyType', 'type': 'StorageKeyType'}, - 'storage_key': {'key': 'storageKey', 'type': 'str'}, - 'storage_uri': {'key': 'storageUri', 'type': 'str'}, - 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, - 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, - 'authentication_type': {'key': 'authenticationType', 'type': 'AuthenticationType'}, 'database_name': {'key': 'databaseName', 'type': 'str'}, 'edition': {'key': 'edition', 'type': 'str'}, 'service_objective_name': {'key': 'serviceObjectiveName', 'type': 'str'}, 'max_size_bytes': {'key': 'maxSizeBytes', 'type': 'str'}, + 'storage_key_type': {'key': 'storageKeyType', 'type': 'str'}, + 'storage_key': {'key': 'storageKey', 'type': 'str'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + 'administrator_login': {'key': 'administratorLogin', 'type': 'str'}, + 'administrator_login_password': {'key': 'administratorLoginPassword', 'type': 'str'}, + 'authentication_type': {'key': 'authenticationType', 'type': 'str'}, + 'network_isolation': {'key': 'networkIsolation', 'type': 'NetworkIsolationSettings'}, } - def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, administrator_login: str, administrator_login_password: str, database_name: str, edition, service_objective_name, max_size_bytes: str, authentication_type="SQL", **kwargs) -> None: - super(ImportRequest, self).__init__(storage_key_type=storage_key_type, storage_key=storage_key, storage_uri=storage_uri, administrator_login=administrator_login, administrator_login_password=administrator_login_password, authentication_type=authentication_type, **kwargs) + def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, administrator_login: str, administrator_login_password: str, database_name: str=None, edition: str=None, service_objective_name: str=None, max_size_bytes: str=None, authentication_type: str=None, network_isolation=None, **kwargs) -> None: + super(ImportNewDatabaseDefinition, self).__init__(**kwargs) self.database_name = database_name self.edition = edition self.service_objective_name = service_objective_name self.max_size_bytes = max_size_bytes + self.storage_key_type = storage_key_type + self.storage_key = storage_key + self.storage_uri = storage_uri + self.administrator_login = administrator_login + self.administrator_login_password = administrator_login_password + self.authentication_type = authentication_type + self.network_isolation = network_isolation class InstanceFailoverGroup(ProxyResource): @@ -5110,6 +5093,9 @@ class ManagedInstance(TrackedResource): :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku + :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', + 'Updating', 'Unknown', 'Succeeded', 'Failed' + :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. Default: Regular instance creation. @@ -5186,6 +5172,12 @@ class ManagedInstance(TrackedResource): :param minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' :type minimal_tls_version: str + :param storage_account_type: The storage account type used to store + backups for this instance. The options are LRS (LocallyRedundantStorage), + ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). Possible values + include: 'GRS', 'LRS', 'ZRS' + :type storage_account_type: str or + ~azure.mgmt.sql.models.StorageAccountType """ _validation = { @@ -5193,6 +5185,7 @@ class ManagedInstance(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, + 'provisioning_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, @@ -5206,6 +5199,7 @@ class ManagedInstance(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, @@ -5226,12 +5220,14 @@ class ManagedInstance(TrackedResource): 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, + 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, storage_account_type=None, **kwargs) -> None: super(ManagedInstance, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.sku = sku + self.provisioning_state = None self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None self.administrator_login = administrator_login @@ -5252,6 +5248,7 @@ def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed self.instance_pool_id = instance_pool_id self.maintenance_configuration_id = maintenance_configuration_id self.minimal_tls_version = minimal_tls_version + self.storage_account_type = storage_account_type class ManagedInstanceAdministrator(ProxyResource): @@ -5824,6 +5821,42 @@ def __init__(self, *, primary_managed_instance_id: str=None, partner_managed_ins self.partner_managed_instance_id = partner_managed_instance_id +class ManagedInstancePrivateLinkServiceConnectionStateProperty(Model): + """ManagedInstancePrivateLinkServiceConnectionStateProperty. + + 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. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The private link service connection description. + :vartype actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status: str, description: str, **kwargs) -> None: + super(ManagedInstancePrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = status + self.description = description + self.actions_required = None + + class ManagedInstanceUpdate(Model): """An update request for an Azure SQL Database managed instance. @@ -5832,6 +5865,9 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku + :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', + 'Updating', 'Unknown', 'Succeeded', 'Failed' + :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. Default: Regular instance creation. @@ -5908,11 +5944,18 @@ class ManagedInstanceUpdate(Model): :param minimal_tls_version: Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' :type minimal_tls_version: str + :param storage_account_type: The storage account type used to store + backups for this instance. The options are LRS (LocallyRedundantStorage), + ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage). Possible values + include: 'GRS', 'LRS', 'ZRS' + :type storage_account_type: str or + ~azure.mgmt.sql.models.StorageAccountType :param tags: Resource tags. :type tags: dict[str, str] """ _validation = { + 'provisioning_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, @@ -5920,6 +5963,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, @@ -5940,12 +5984,14 @@ class ManagedInstanceUpdate(Model): 'instance_pool_id': {'key': 'properties.instancePoolId', 'type': 'str'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, + 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, storage_account_type=None, tags=None, **kwargs) -> None: super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = sku + self.provisioning_state = None self.managed_instance_create_mode = managed_instance_create_mode self.fully_qualified_domain_name = None self.administrator_login = administrator_login @@ -5966,6 +6012,7 @@ def __init__(self, *, sku=None, managed_instance_create_mode=None, administrator self.instance_pool_id = instance_pool_id self.maintenance_configuration_id = maintenance_configuration_id self.minimal_tls_version = minimal_tls_version + self.storage_account_type = storage_account_type self.tags = tags @@ -6544,6 +6591,32 @@ def __init__(self, *, value: str=None, localized_value: str=None, **kwargs) -> N self.localized_value = localized_value +class NetworkIsolationSettings(Model): + """Contains the ARM resources for which to create private endpoint connection. + + :param storage_account_resource_id: The resource id for the storage + account used to store BACPAC file. If set, private endpoint connection + will be created for the storage account. Must match storage account used + for StorageUri parameter. + :type storage_account_resource_id: str + :param sql_server_resource_id: The resource id for the SQL server which is + the target of this request. If set, private endpoint connection will be + created for the SQL server. Must match server which is target of the + operation. + :type sql_server_resource_id: str + """ + + _attribute_map = { + 'storage_account_resource_id': {'key': 'storageAccountResourceId', 'type': 'str'}, + 'sql_server_resource_id': {'key': 'sqlServerResourceId', 'type': 'str'}, + } + + def __init__(self, *, storage_account_resource_id: str=None, sql_server_resource_id: str=None, **kwargs) -> None: + super(NetworkIsolationSettings, self).__init__(**kwargs) + self.storage_account_resource_id = storage_account_resource_id + self.sql_server_resource_id = sql_server_resource_id + + class Operation(Model): """SQL REST API operation definition. @@ -6842,6 +6915,41 @@ def __init__(self, *, private_endpoint=None, private_link_service_connection_sta self.provisioning_state = None +class PrivateEndpointConnectionRequestStatus(Model): + """Contains the private endpoint connection requests status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar private_link_service_id: Resource id for which the private endpoint + is created. + :vartype private_link_service_id: str + :ivar private_endpoint_connection_name: The connection name for the + private endpoint. + :vartype private_endpoint_connection_name: str + :ivar status: Status of this private endpoint connection. + :vartype status: str + """ + + _validation = { + 'private_link_service_id': {'readonly': True}, + 'private_endpoint_connection_name': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'private_link_service_id': {'key': 'privateLinkServiceId', 'type': 'str'}, + 'private_endpoint_connection_name': {'key': 'privateEndpointConnectionName', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(PrivateEndpointConnectionRequestStatus, self).__init__(**kwargs) + self.private_link_service_id = None + self.private_endpoint_connection_name = None + self.status = None + + class PrivateEndpointProperty(Model): """PrivateEndpointProperty. @@ -7861,9 +7969,9 @@ class ServerAzureADAdministrator(ProxyResource): :type sid: str :param tenant_id: Tenant ID of the administrator. :type tenant_id: str - :param azure_ad_only_authentication: Azure Active Directory only + :ivar azure_ad_only_authentication: Azure Active Directory only Authentication enabled. - :type azure_ad_only_authentication: bool + :vartype azure_ad_only_authentication: bool """ _validation = { @@ -7873,6 +7981,7 @@ class ServerAzureADAdministrator(ProxyResource): 'administrator_type': {'required': True, 'constant': True}, 'login': {'required': True}, 'sid': {'required': True}, + 'azure_ad_only_authentication': {'readonly': True}, } _attribute_map = { @@ -7888,11 +7997,49 @@ class ServerAzureADAdministrator(ProxyResource): administrator_type = "ActiveDirectory" - def __init__(self, *, login: str, sid: str, tenant_id: str=None, azure_ad_only_authentication: bool=None, **kwargs) -> None: + def __init__(self, *, login: str, sid: str, tenant_id: str=None, **kwargs) -> None: super(ServerAzureADAdministrator, self).__init__(**kwargs) self.login = login self.sid = sid self.tenant_id = tenant_id + self.azure_ad_only_authentication = None + + +class ServerAzureADOnlyAuthentication(ProxyResource): + """Azure Active Directory only authentication. + + 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 azure_ad_only_authentication: Required. Azure Active Directory only + Authentication enabled. + :type azure_ad_only_authentication: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'azure_ad_only_authentication': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'azure_ad_only_authentication': {'key': 'properties.azureADOnlyAuthentication', 'type': 'bool'}, + } + + def __init__(self, *, azure_ad_only_authentication: bool, **kwargs) -> None: + super(ServerAzureADOnlyAuthentication, self).__init__(**kwargs) self.azure_ad_only_authentication = azure_ad_only_authentication diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py index 4c70305b679c..c2da5d9f08f3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py @@ -727,19 +727,6 @@ class InstanceFailoverGroupPaged(Paged): def __init__(self, *args, **kwargs): super(InstanceFailoverGroupPaged, self).__init__(*args, **kwargs) -class BackupShortTermRetentionPolicyPaged(Paged): - """ - A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[BackupShortTermRetentionPolicy]'} - } - - def __init__(self, *args, **kwargs): - - super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) class ManagedInstanceKeyPaged(Paged): """ A paging container for iterating over a list of :class:`ManagedInstanceKey ` object @@ -831,19 +818,6 @@ class UsagePaged(Paged): def __init__(self, *args, **kwargs): super(UsagePaged, self).__init__(*args, **kwargs) -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) class PrivateEndpointConnectionPaged(Paged): """ A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object @@ -935,32 +909,32 @@ class WorkloadClassifierPaged(Paged): def __init__(self, *args, **kwargs): super(WorkloadClassifierPaged, self).__init__(*args, **kwargs) -class ServerAzureADAdministratorPaged(Paged): +class ManagedInstanceOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerAzureADAdministrator ` object + A paging container for iterating over a list of :class:`ManagedInstanceOperation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerAzureADAdministrator]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceOperation]'} } def __init__(self, *args, **kwargs): - super(ServerAzureADAdministratorPaged, self).__init__(*args, **kwargs) -class ManagedInstanceOperationPaged(Paged): + super(ManagedInstanceOperationPaged, self).__init__(*args, **kwargs) +class ServerAzureADAdministratorPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceOperation ` object + A paging container for iterating over a list of :class:`ServerAzureADAdministrator ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceOperation]'} + 'current_page': {'key': 'value', 'type': '[ServerAzureADAdministrator]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceOperationPaged, self).__init__(*args, **kwargs) + super(ServerAzureADAdministratorPaged, self).__init__(*args, **kwargs) class SyncDatabaseIdPropertiesPaged(Paged): """ A paging container for iterating over a list of :class:`SyncDatabaseIdProperties ` object @@ -1026,6 +1000,32 @@ class SyncMemberPaged(Paged): def __init__(self, *args, **kwargs): super(SyncMemberPaged, self).__init__(*args, **kwargs) +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) +class BackupShortTermRetentionPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[BackupShortTermRetentionPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) class ManagedDatabasePaged(Paged): """ A paging container for iterating over a list of :class:`ManagedDatabase ` object @@ -1039,3 +1039,16 @@ class ManagedDatabasePaged(Paged): def __init__(self, *args, **kwargs): super(ManagedDatabasePaged, self).__init__(*args, **kwargs) +class ServerAzureADOnlyAuthenticationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerAzureADOnlyAuthentication ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerAzureADOnlyAuthentication]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerAzureADOnlyAuthenticationPaged, self).__init__(*args, **kwargs) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py index b8275e2d4df1..f88a28c8bad0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py @@ -66,105 +66,6 @@ class GeoBackupPolicyState(str, Enum): enabled = "Enabled" -class DatabaseEdition(str, Enum): - - web = "Web" - business = "Business" - basic = "Basic" - standard = "Standard" - premium = "Premium" - premium_rs = "PremiumRS" - free = "Free" - stretch = "Stretch" - data_warehouse = "DataWarehouse" - system = "System" - system2 = "System2" - general_purpose = "GeneralPurpose" - business_critical = "BusinessCritical" - hyperscale = "Hyperscale" - - -class ServiceObjectiveName(str, Enum): - - system = "System" - system0 = "System0" - system1 = "System1" - system2 = "System2" - system3 = "System3" - system4 = "System4" - system2_l = "System2L" - system3_l = "System3L" - system4_l = "System4L" - free = "Free" - basic = "Basic" - s0 = "S0" - s1 = "S1" - s2 = "S2" - s3 = "S3" - s4 = "S4" - s6 = "S6" - s7 = "S7" - s9 = "S9" - s12 = "S12" - p1 = "P1" - p2 = "P2" - p3 = "P3" - p4 = "P4" - p6 = "P6" - p11 = "P11" - p15 = "P15" - prs1 = "PRS1" - prs2 = "PRS2" - prs4 = "PRS4" - prs6 = "PRS6" - dw100 = "DW100" - dw200 = "DW200" - dw300 = "DW300" - dw400 = "DW400" - dw500 = "DW500" - dw600 = "DW600" - dw1000 = "DW1000" - dw1200 = "DW1200" - dw1000c = "DW1000c" - dw1500 = "DW1500" - dw1500c = "DW1500c" - dw2000 = "DW2000" - dw2000c = "DW2000c" - dw3000 = "DW3000" - dw2500c = "DW2500c" - dw3000c = "DW3000c" - dw6000 = "DW6000" - dw5000c = "DW5000c" - dw6000c = "DW6000c" - dw7500c = "DW7500c" - dw10000c = "DW10000c" - dw15000c = "DW15000c" - dw30000c = "DW30000c" - ds100 = "DS100" - ds200 = "DS200" - ds300 = "DS300" - ds400 = "DS400" - ds500 = "DS500" - ds600 = "DS600" - ds1000 = "DS1000" - ds1200 = "DS1200" - ds1500 = "DS1500" - ds2000 = "DS2000" - elastic_pool = "ElasticPool" - - -class StorageKeyType(str, Enum): - - storage_access_key = "StorageAccessKey" - shared_access_key = "SharedAccessKey" - - -class AuthenticationType(str, Enum): - - sql = "SQL" - ad_password = "ADPassword" - - class UnitType(str, Enum): count = "count" @@ -257,6 +158,75 @@ class TransparentDataEncryptionStatus(str, Enum): disabled = "Disabled" +class ServiceObjectiveName(str, Enum): + + system = "System" + system0 = "System0" + system1 = "System1" + system2 = "System2" + system3 = "System3" + system4 = "System4" + system2_l = "System2L" + system3_l = "System3L" + system4_l = "System4L" + free = "Free" + basic = "Basic" + s0 = "S0" + s1 = "S1" + s2 = "S2" + s3 = "S3" + s4 = "S4" + s6 = "S6" + s7 = "S7" + s9 = "S9" + s12 = "S12" + p1 = "P1" + p2 = "P2" + p3 = "P3" + p4 = "P4" + p6 = "P6" + p11 = "P11" + p15 = "P15" + prs1 = "PRS1" + prs2 = "PRS2" + prs4 = "PRS4" + prs6 = "PRS6" + dw100 = "DW100" + dw200 = "DW200" + dw300 = "DW300" + dw400 = "DW400" + dw500 = "DW500" + dw600 = "DW600" + dw1000 = "DW1000" + dw1200 = "DW1200" + dw1000c = "DW1000c" + dw1500 = "DW1500" + dw1500c = "DW1500c" + dw2000 = "DW2000" + dw2000c = "DW2000c" + dw3000 = "DW3000" + dw2500c = "DW2500c" + dw3000c = "DW3000c" + dw6000 = "DW6000" + dw5000c = "DW5000c" + dw6000c = "DW6000c" + dw7500c = "DW7500c" + dw10000c = "DW10000c" + dw15000c = "DW15000c" + dw30000c = "DW30000c" + ds100 = "DS100" + ds200 = "DS200" + ds300 = "DS300" + ds400 = "DS400" + ds500 = "DS500" + ds600 = "DS600" + ds1000 = "DS1000" + ds1200 = "DS1200" + ds1500 = "DS1500" + ds2000 = "DS2000" + elastic_pool = "ElasticPool" + + class TransparentDataEncryptionActivityStatus(str, Enum): encrypting = "Encrypting" @@ -563,30 +533,6 @@ class InstancePoolLicenseType(str, Enum): base_price = "BasePrice" -class IdentityType(str, Enum): - - system_assigned = "SystemAssigned" - - -class ManagedServerCreateMode(str, Enum): - - default = "Default" - point_in_time_restore = "PointInTimeRestore" - - -class ManagedInstanceLicenseType(str, Enum): - - license_included = "LicenseIncluded" - base_price = "BasePrice" - - -class ManagedInstanceProxyOverride(str, Enum): - - proxy = "Proxy" - redirect = "Redirect" - default = "Default" - - class PrivateLinkServiceConnectionStateStatus(str, Enum): approved = "Approved" @@ -609,6 +555,11 @@ class PrivateEndpointProvisioningState(str, Enum): rejecting = "Rejecting" +class IdentityType(str, Enum): + + system_assigned = "SystemAssigned" + + class ServerPublicNetworkAccess(str, Enum): enabled = "Enabled" @@ -729,6 +680,38 @@ class ManagedDatabaseCreateMode(str, Enum): restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" +class ManagedServerCreateMode(str, Enum): + + default = "Default" + point_in_time_restore = "PointInTimeRestore" + + +class ManagedInstanceLicenseType(str, Enum): + + license_included = "LicenseIncluded" + base_price = "BasePrice" + + +class ManagedInstanceProxyOverride(str, Enum): + + proxy = "Proxy" + redirect = "Redirect" + default = "Default" + + +class StorageAccountType(str, Enum): + + grs = "GRS" + lrs = "LRS" + zrs = "ZRS" + + +class StorageKeyType(str, Enum): + + shared_access_key = "SharedAccessKey" + storage_access_key = "StorageAccessKey" + + class LongTermRetentionDatabaseState(str, Enum): all = "All" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 9ab7784a088f..111e0b8248c5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -74,7 +74,6 @@ from ._managed_database_vulnerability_assessment_scans_operations import ManagedDatabaseVulnerabilityAssessmentScansOperations from ._managed_database_vulnerability_assessments_operations import ManagedDatabaseVulnerabilityAssessmentsOperations from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations -from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from ._tde_certificates_operations import TdeCertificatesOperations from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations from ._managed_instance_keys_operations import ManagedInstanceKeysOperations @@ -85,7 +84,6 @@ from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations from ._instance_pools_operations import InstancePoolsOperations from ._usages_operations import UsagesOperations -from ._managed_instances_operations import ManagedInstancesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._servers_operations import ServersOperations @@ -94,12 +92,16 @@ from ._managed_instance_long_term_retention_policies_operations import ManagedInstanceLongTermRetentionPoliciesOperations from ._workload_groups_operations import WorkloadGroupsOperations from ._workload_classifiers_operations import WorkloadClassifiersOperations -from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations from ._managed_instance_operations import ManagedInstanceOperations +from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations from ._sync_groups_operations import SyncGroupsOperations from ._sync_members_operations import SyncMembersOperations +from ._managed_instances_operations import ManagedInstancesOperations +from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations from ._managed_databases_operations import ManagedDatabasesOperations +from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations +from ._import_export_operations import ImportExportOperations __all__ = [ 'RecoverableDatabasesOperations', @@ -167,7 +169,6 @@ 'ManagedDatabaseVulnerabilityAssessmentScansOperations', 'ManagedDatabaseVulnerabilityAssessmentsOperations', 'InstanceFailoverGroupsOperations', - 'BackupShortTermRetentionPoliciesOperations', 'TdeCertificatesOperations', 'ManagedInstanceTdeCertificatesOperations', 'ManagedInstanceKeysOperations', @@ -178,7 +179,6 @@ 'ManagedDatabaseSensitivityLabelsOperations', 'InstancePoolsOperations', 'UsagesOperations', - 'ManagedInstancesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', 'ServersOperations', @@ -187,10 +187,14 @@ 'ManagedInstanceLongTermRetentionPoliciesOperations', 'WorkloadGroupsOperations', 'WorkloadClassifiersOperations', - 'ServerAzureADAdministratorsOperations', 'ManagedInstanceOperations', + 'ServerAzureADAdministratorsOperations', 'SyncGroupsOperations', 'SyncMembersOperations', + 'ManagedInstancesOperations', + 'BackupShortTermRetentionPoliciesOperations', 'ManagedDatabaseRestoreDetailsOperations', 'ManagedDatabasesOperations', + 'ServerAzureADOnlyAuthenticationsOperations', + 'ImportExportOperations', ] diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py index 1fab2366624f..eba12c423aed 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py @@ -28,7 +28,7 @@ class BackupShortTermRetentionPoliciesOperations(object): :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". + :ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.policy_name = "default" - self.api_version = "2017-10-01-preview" + self.api_version = "2020-02-02-preview" self.config = config @@ -113,8 +113,8 @@ def get( 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.BackupShortTermRetentionPolicy(retention_days=retention_days) + self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=None, custom_headers=None, raw=False, **operation_config): + parameters = models.BackupShortTermRetentionPolicy(retention_days=retention_days, diff_backup_interval_in_hours=diff_backup_interval_in_hours) # Construct URL url = self.create_or_update.metadata['url'] @@ -166,7 +166,7 @@ def _create_or_update_initial( 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): + self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=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 @@ -180,6 +180,11 @@ def create_or_update( :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 diff_backup_interval_in_hours: The differential backup interval + in hours. This is how many interval hours between each differential + backup will be supported. This is only applicable to live databases + but not dropped databases. + :type diff_backup_interval_in_hours: 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 @@ -199,6 +204,7 @@ def create_or_update( server_name=server_name, database_name=database_name, retention_days=retention_days, + diff_backup_interval_in_hours=diff_backup_interval_in_hours, custom_headers=custom_headers, raw=True, **operation_config @@ -224,8 +230,8 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, **operation_config): - parameters = models.BackupShortTermRetentionPolicy(retention_days=retention_days) + self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=None, custom_headers=None, raw=False, **operation_config): + parameters = models.BackupShortTermRetentionPolicy(retention_days=retention_days, diff_backup_interval_in_hours=diff_backup_interval_in_hours) # Construct URL url = self.update.metadata['url'] @@ -277,7 +283,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, server_name, database_name, retention_days=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, server_name, database_name, retention_days=None, diff_backup_interval_in_hours=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 @@ -291,6 +297,11 @@ def update( :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 diff_backup_interval_in_hours: The differential backup interval + in hours. This is how many interval hours between each differential + backup will be supported. This is only applicable to live databases + but not dropped databases. + :type diff_backup_interval_in_hours: 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 @@ -310,6 +321,7 @@ def update( server_name=server_name, database_name=database_name, retention_days=retention_days, + diff_backup_interval_in_hours=diff_backup_interval_in_hours, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py index e0aa41fadadd..61f20dbe5897 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py @@ -27,7 +27,6 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar extension_name: The name of the operation to perform. Constant value: "import". """ models = models @@ -37,334 +36,9 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.extension_name = "import" self.config = config - - def _import_method_initial( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2014-04-01" - - # Construct URL - url = self.import_method.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ImportRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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('ImportExportResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def import_method( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Imports a bacpac into a new database. . - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The required parameters for importing a Bacpac into - a database. - :type parameters: ~azure.mgmt.sql.models.ImportRequest - :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 ImportExportResponse or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._import_method_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ImportExportResponse', 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) - import_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'} - - - def _create_import_operation_initial( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2014-04-01" - - # Construct URL - url = self.create_import_operation.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - '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'), - 'extensionName': self._serialize.url("self.extension_name", self.extension_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ImportExtensionRequest') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [201, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('ImportExportResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_import_operation( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates an import operation that imports a bacpac into an existing - database. The existing database must be empty. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database to import into - :type database_name: str - :param parameters: The required parameters for importing a Bacpac into - a database. - :type parameters: ~azure.mgmt.sql.models.ImportExtensionRequest - :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 ImportExportResponse or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._create_import_operation_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ImportExportResponse', 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_import_operation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'} - - - def _export_initial( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2014-04-01" - - # Construct URL - url = self.export.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - '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') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ExportRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 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('ImportExportResponse', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def export( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Exports a database to a bacpac. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database to be exported. - :type database_name: str - :param parameters: The required parameters for exporting a database. - :type parameters: ~azure.mgmt.sql.models.ExportRequest - :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 ImportExportResponse or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportResponse] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportResponse]] - :raises: :class:`CloudError` - """ - raw_result = self._export_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ImportExportResponse', 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) - export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'} - def list_metrics( self, resource_group_name, server_name, database_name, filter, custom_headers=None, raw=False, **operation_config): """Returns database metrics. @@ -1504,3 +1178,112 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover'} + + + def _export_initial( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2020-02-02-preview" + + # Construct URL + url = self.export.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ExportDatabaseDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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('ImportExportOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def export( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Exports a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param parameters: The database export request parameters. + :type parameters: ~azure.mgmt.sql.models.ExportDatabaseDefinition + :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 + ImportExportOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._export_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ImportExportOperationResult', 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) + export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/export'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_import_export_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_import_export_operations.py new file mode 100644 index 000000000000..ce62b16c135a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_import_export_operations.py @@ -0,0 +1,150 @@ +# 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 ImportExportOperations(object): + """ImportExportOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-02-02-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-02-preview" + + self.config = config + + + def _import_method_initial( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.import_method.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ImportExistingDatabaseDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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('ImportExportOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def import_method( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param parameters: The database import request parameters. + :type parameters: + ~azure.mgmt.sql.models.ImportExistingDatabaseDefinition + :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 + ImportExportOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._import_method_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ImportExportOperationResult', 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) + import_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py index 2e49de1ea356..95e205d67278 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instances_operations.py @@ -39,81 +39,93 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def list_by_instance_pool( - self, resource_group_name, instance_pool_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of all managed instances in an instance pool. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param instance_pool_name: The instance pool name. - :type instance_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedInstance - :rtype: - ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] - :raises: :class:`CloudError` - """ - api_version = "2018-06-01-preview" - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_instance_pool.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def _failover_initial( + self, resource_group_name, managed_instance_name, replica_type=None, custom_headers=None, raw=False, **operation_config): + api_version = "2019-06-01-preview" - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + # Construct URL + url = self.failover.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - else: - url = next_link - query_parameters = {} + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str', min_length=1) + if replica_type is not None: + query_parameters['replicaType'] = self._serialize.query("replica_type", replica_type, 'str') - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) - def internal_paging(next_link=None): - request = prepare_request(next_link) + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - response = self._client.send(request, stream=False, **operation_config) + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + def failover( + self, resource_group_name, managed_instance_name, replica_type=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Failovers a managed instance. - return response + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param replica_type: The type of replica to be failed over. Possible + values include: 'Primary', 'ReadableSecondary' + :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._failover_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + replica_type=replica_type, + custom_headers=custom_headers, + raw=True, + **operation_config + ) - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response - return deserialized - list_by_instance_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances'} + 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/managedInstances/{managedInstanceName}/failover'} def list_by_resource_group( self, resource_group_name, custom_headers=None, raw=False, **operation_config): @@ -133,7 +145,7 @@ def list_by_resource_group( ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] :raises: :class:`CloudError` """ - api_version = "2018-06-01-preview" + api_version = "2020-02-02-preview" def prepare_request(next_link=None): if not next_link: @@ -208,7 +220,7 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2018-06-01-preview" + api_version = "2020-02-02-preview" # Construct URL url = self.get.metadata['url'] @@ -256,7 +268,7 @@ def get( def _create_or_update_initial( self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2018-06-01-preview" + api_version = "2020-02-02-preview" # Construct URL url = self.create_or_update.metadata['url'] @@ -362,7 +374,7 @@ def get_long_running_output(response): def _delete_initial( self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): - api_version = "2018-06-01-preview" + api_version = "2020-02-02-preview" # Construct URL url = self.delete.metadata['url'] @@ -445,7 +457,7 @@ def get_long_running_output(response): def _update_initial( self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2018-06-01-preview" + api_version = "2020-02-02-preview" # Construct URL url = self.update.metadata['url'] @@ -546,10 +558,16 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}'} - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of all managed instances in the subscription. + def list_by_instance_pool( + self, resource_group_name, instance_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in an instance pool. + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param instance_pool_name: The instance pool name. + :type instance_pool_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -560,13 +578,15 @@ def list( ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] :raises: :class:`CloudError` """ - api_version = "2018-06-01-preview" + api_version = "2020-02-02-preview" def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list.metadata['url'] + url = self.list_by_instance_pool.metadata['url'] path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'instancePoolName': self._serialize.url("instance_pool_name", instance_pool_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -612,92 +632,72 @@ def internal_paging(next_link=None): deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} + list_by_instance_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances'} + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in the subscription. - def _failover_initial( - self, resource_group_name, managed_instance_name, replica_type=None, custom_headers=None, raw=False, **operation_config): - api_version = "2019-06-01-preview" + :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` + """ + api_version = "2020-02-02-preview" - # Construct URL - url = self.failover.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def prepare_request(next_link=None): + 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("api_version", api_version, 'str', min_length=1) - if replica_type is not None: - query_parameters['replicaType'] = self._serialize.query("replica_type", replica_type, 'str') + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + def internal_paging(next_link=None): + request = prepare_request(next_link) - def failover( - self, resource_group_name, managed_instance_name, replica_type=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Failovers a managed instance. + response = self._client.send(request, stream=False, **operation_config) - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param replica_type: The type of replica to be failed over. Possible - values include: 'Primary', 'ReadableSecondary' - :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._failover_initial( - resource_group_name=resource_group_name, - managed_instance_name=managed_instance_name, - replica_type=replica_type, - custom_headers=custom_headers, - raw=True, - **operation_config - ) + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response + return response - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover'} + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py index 2bfa200b74fe..a14bcecb0748 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py @@ -170,8 +170,8 @@ def create_or_update( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param parameters: The required parameters for creating or updating an - Active Directory Administrator. + :param parameters: The requested Azure Active Directory administrator + Resource state. :type parameters: ~azure.mgmt.sql.models.ServerAzureADAdministrator :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -369,99 +369,3 @@ def internal_paging(next_link=None): return deserialized list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/administrators'} - - - def _disable_azure_ad_only_authentication_initial( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.disable_azure_ad_only_authentication.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ServerAzureADAdministrator', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def disable_azure_ad_only_authentication( - self, resource_group_name, server_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Disables Azure Active Directory only authentication on logical Server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param 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 - ServerAzureADAdministrator or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ServerAzureADAdministrator] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ServerAzureADAdministrator]] - :raises: :class:`CloudError` - """ - raw_result = self._disable_azure_ad_only_authentication_initial( - resource_group_name=resource_group_name, - server_name=server_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ServerAzureADAdministrator', 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) - disable_azure_ad_only_authentication.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/disableAzureADOnlyAuthentication'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py new file mode 100644 index 000000000000..37e8bf34606d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py @@ -0,0 +1,376 @@ +# 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 ServerAzureADOnlyAuthenticationsOperations(object): + """ServerAzureADOnlyAuthenticationsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :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: "2020-02-02-preview". + :ivar authentication_name: The name of server azure active directory only authentication. Constant value: "Default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-02-02-preview" + self.authentication_name = "Default" + + self.config = config + + def get( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets a specific Azure Active Directory only authentication property. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ServerAzureADOnlyAuthentication or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'authenticationName': self._serialize.url("self.authentication_name", self.authentication_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServerAzureADOnlyAuthentication', 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}/azureADOnlyAuthentications/{authenticationName}'} + + + def _create_or_update_initial( + self, resource_group_name, server_name, azure_ad_only_authentication, custom_headers=None, raw=False, **operation_config): + parameters = models.ServerAzureADOnlyAuthentication(azure_ad_only_authentication=azure_ad_only_authentication) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'authenticationName': self._serialize.url("self.authentication_name", self.authentication_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ServerAzureADOnlyAuthentication') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerAzureADOnlyAuthentication', response) + if response.status_code == 201: + deserialized = self._deserialize('ServerAzureADOnlyAuthentication', 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, azure_ad_only_authentication, custom_headers=None, raw=False, polling=True, **operation_config): + """Sets Server Active Directory only authentication property or updates an + existing server Active Directory only authentication property. + + :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 azure_ad_only_authentication: Azure Active Directory only + Authentication enabled. + :type azure_ad_only_authentication: bool + :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 + ServerAzureADOnlyAuthentication or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + azure_ad_only_authentication=azure_ad_only_authentication, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServerAzureADOnlyAuthentication', 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}/azureADOnlyAuthentications/{authenticationName}'} + + + def _delete_initial( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'authenticationName': self._serialize.url("self.authentication_name", self.authentication_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, server_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes an existing server Active Directory only authentication + property. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + server_name=server_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications/{authenticationName}'} + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of server Azure Active Directory only authentications. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ServerAzureADOnlyAuthentication + :rtype: + ~azure.mgmt.sql.models.ServerAzureADOnlyAuthenticationPaged[~azure.mgmt.sql.models.ServerAzureADOnlyAuthentication] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ServerAzureADOnlyAuthenticationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/azureADOnlyAuthentications'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py index 7abf430deda2..ebba98c1f7bf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py @@ -27,7 +27,6 @@ class ServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". """ models = models @@ -37,7 +36,6 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" self.config = config @@ -59,6 +57,8 @@ def list_by_resource_group( ~azure.mgmt.sql.models.ServerPaged[~azure.mgmt.sql.models.Server] :raises: :class:`CloudError` """ + api_version = "2019-06-01-preview" + def prepare_request(next_link=None): if not next_link: # Construct URL @@ -71,7 +71,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -132,6 +132,8 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + api_version = "2019-06-01-preview" + # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -143,7 +145,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -178,6 +180,8 @@ def get( def _create_or_update_initial( self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2019-06-01-preview" + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -189,7 +193,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -282,6 +286,8 @@ def get_long_running_output(response): def _delete_initial( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + api_version = "2019-06-01-preview" + # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -293,7 +299,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -363,6 +369,8 @@ def get_long_running_output(response): def _update_initial( self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2019-06-01-preview" + # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -374,7 +382,7 @@ def _update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -476,6 +484,8 @@ def list( ~azure.mgmt.sql.models.ServerPaged[~azure.mgmt.sql.models.Server] :raises: :class:`CloudError` """ + api_version = "2019-06-01-preview" + def prepare_request(next_link=None): if not next_link: # Construct URL @@ -487,7 +497,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -547,6 +557,8 @@ def check_name_availability( """ parameters = models.CheckNameAvailabilityRequest(name=name) + api_version = "2019-06-01-preview" + # Construct URL url = self.check_name_availability.metadata['url'] path_format_arguments = { @@ -556,7 +568,7 @@ def check_name_availability( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -591,3 +603,108 @@ def check_name_availability( return deserialized check_name_availability.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/checkNameAvailability'} + + + def _import_database_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + api_version = "2020-02-02-preview" + + # Construct URL + url = self.import_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ImportNewDatabaseDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 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('ImportExportOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def import_database( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The database import request parameters. + :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition + :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 + ImportExportOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._import_database_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ImportExportOperationResult', 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) + import_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'} diff --git a/sdk/sql/azure-mgmt-sql/setup.py b/sdk/sql/azure-mgmt-sql/setup.py index fbf27d76244c..97474e8ab13e 100644 --- a/sdk/sql/azure-mgmt-sql/setup.py +++ b/sdk/sql/azure-mgmt-sql/setup.py @@ -36,7 +36,7 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py') +with open(os.path.join(package_folder_path, 'version.py') if os.path.exists(os.path.join(package_folder_path, 'version.py')) else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',