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..521aba20f657 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 @@ -89,7 +89,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 +97,14 @@ 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 ManagedDatabaseRestoreDetailsOperations from .operations import ManagedDatabasesOperations +from .operations import ServerAzureADOnlyAuthenticationsOperations from . import models @@ -265,8 +266,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 +282,22 @@ 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 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 :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -467,8 +470,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 +486,19 @@ 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.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) 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..b6d43857df72 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 @@ -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 @@ -143,6 +144,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 @@ -281,6 +283,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 @@ -325,6 +328,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 +431,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 @@ -515,13 +520,10 @@ VulnerabilityAssessmentScanState, InstanceFailoverGroupReplicationRole, InstancePoolLicenseType, - IdentityType, - ManagedServerCreateMode, - ManagedInstanceLicenseType, - ManagedInstanceProxyOverride, PrivateLinkServiceConnectionStateStatus, PrivateLinkServiceConnectionStateActionsRequire, PrivateEndpointProvisioningState, + IdentityType, ServerPublicNetworkAccess, CheckNameAvailabilityReason, MaxSizeUnit, @@ -536,6 +538,9 @@ SyncMemberState, ManagedDatabaseStatus, ManagedDatabaseCreateMode, + ManagedServerCreateMode, + ManagedInstanceLicenseType, + ManagedInstanceProxyOverride, LongTermRetentionDatabaseState, VulnerabilityAssessmentPolicyBaselineName, SensitivityLabelSource, @@ -639,6 +644,7 @@ 'ManagedInstanceOperationParametersPair', 'ManagedInstanceOperationSteps', 'ManagedInstancePairInfo', + 'ManagedInstancePrivateLinkServiceConnectionStateProperty', 'ManagedInstanceUpdate', 'ManagedInstanceVcoresCapability', 'ManagedInstanceVersionCapability', @@ -683,6 +689,7 @@ 'Server', 'ServerAutomaticTuning', 'ServerAzureADAdministrator', + 'ServerAzureADOnlyAuthentication', 'ServerBlobAuditingPolicy', 'ServerCommunicationLink', 'ServerConnectionPolicy', @@ -794,7 +801,6 @@ 'ServerVulnerabilityAssessmentPaged', 'InstancePoolPaged', 'UsagePaged', - 'ManagedInstancePaged', 'PrivateEndpointConnectionPaged', 'PrivateLinkResourcePaged', 'ServerPaged', @@ -802,14 +808,16 @@ 'ManagedInstanceLongTermRetentionPolicyPaged', 'WorkloadGroupPaged', 'WorkloadClassifierPaged', - 'ServerAzureADAdministratorPaged', 'ManagedInstanceOperationPaged', + 'ServerAzureADAdministratorPaged', 'SyncDatabaseIdPropertiesPaged', 'SyncFullSchemaPropertiesPaged', 'SyncGroupLogPropertiesPaged', 'SyncGroupPaged', 'SyncMemberPaged', + 'ManagedInstancePaged', 'ManagedDatabasePaged', + 'ServerAzureADOnlyAuthenticationPaged', 'ServerConnectionType', 'SecurityAlertPolicyState', 'SecurityAlertPolicyEmailAccountAdmins', @@ -872,13 +880,10 @@ 'VulnerabilityAssessmentScanState', 'InstanceFailoverGroupReplicationRole', 'InstancePoolLicenseType', - 'IdentityType', - 'ManagedServerCreateMode', - 'ManagedInstanceLicenseType', - 'ManagedInstanceProxyOverride', 'PrivateLinkServiceConnectionStateStatus', 'PrivateLinkServiceConnectionStateActionsRequire', 'PrivateEndpointProvisioningState', + 'IdentityType', 'ServerPublicNetworkAccess', 'CheckNameAvailabilityReason', 'MaxSizeUnit', @@ -893,6 +898,9 @@ 'SyncMemberState', 'ManagedDatabaseStatus', 'ManagedDatabaseCreateMode', + 'ManagedServerCreateMode', + 'ManagedInstanceLicenseType', + 'ManagedInstanceProxyOverride', '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..46d629248880 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 @@ -5110,6 +5110,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. @@ -5193,6 +5196,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 +5210,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'}, @@ -5232,6 +5237,7 @@ 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) @@ -5824,6 +5830,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 +5874,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. @@ -5913,6 +5958,7 @@ class ManagedInstanceUpdate(Model): """ _validation = { + 'provisioning_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, @@ -5920,6 +5966,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'}, @@ -5946,6 +5993,7 @@ class ManagedInstanceUpdate(Model): 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) @@ -7861,9 +7909,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 +7921,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 +7942,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..172e1073b880 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 @@ -5110,6 +5110,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. @@ -5193,6 +5196,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 +5210,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'}, @@ -5232,6 +5237,7 @@ def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed 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 @@ -5824,6 +5830,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 +5874,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. @@ -5913,6 +5958,7 @@ class ManagedInstanceUpdate(Model): """ _validation = { + 'provisioning_state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, @@ -5920,6 +5966,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'}, @@ -5946,6 +5993,7 @@ class ManagedInstanceUpdate(Model): 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: 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 @@ -7861,9 +7909,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 +7921,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 +7937,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..6560c2313abc 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 @@ -831,19 +831,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 +922,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 +1013,19 @@ 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 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..7f426cee849b 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 @@ -563,30 +563,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 +585,11 @@ class PrivateEndpointProvisioningState(str, Enum): rejecting = "Rejecting" +class IdentityType(str, Enum): + + system_assigned = "SystemAssigned" + + class ServerPublicNetworkAccess(str, Enum): enabled = "Enabled" @@ -729,6 +710,25 @@ 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 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..4215659f473a 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 @@ -85,7 +85,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 +93,14 @@ 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 ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations from ._managed_databases_operations import ManagedDatabasesOperations +from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations __all__ = [ 'RecoverableDatabasesOperations', @@ -178,7 +179,6 @@ 'ManagedDatabaseSensitivityLabelsOperations', 'InstancePoolsOperations', 'UsagesOperations', - 'ManagedInstancesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', 'ServersOperations', @@ -187,10 +187,12 @@ 'ManagedInstanceLongTermRetentionPoliciesOperations', 'WorkloadGroupsOperations', 'WorkloadClassifiersOperations', - 'ServerAzureADAdministratorsOperations', 'ManagedInstanceOperations', + 'ServerAzureADAdministratorsOperations', 'SyncGroupsOperations', 'SyncMembersOperations', + 'ManagedInstancesOperations', 'ManagedDatabaseRestoreDetailsOperations', 'ManagedDatabasesOperations', + 'ServerAzureADOnlyAuthenticationsOperations', ] 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/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*[\'"]([^\'"]*)[\'"]',