From 30123b90c55a99cd17993268b99cf5c8a0f931be Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 19 Nov 2021 05:35:44 +0000 Subject: [PATCH] CodeGen from PR 16752 in Azure/azure-rest-api-specs Merge 5ec263377279512f549edca8a070f0d3cc32f423 into 9dee51c3deb2b76628f6496665d53861cdb7efcf --- sdk/sql/azure-mgmt-sql/_meta.json | 2 +- .../azure/mgmt/sql/_metadata.json | 17 +- .../azure/mgmt/sql/_sql_management_client.py | 73 ++- .../azure-mgmt-sql/azure/mgmt/sql/_version.py | 2 +- .../mgmt/sql/aio/_sql_management_client.py | 73 ++- .../azure/mgmt/sql/aio/operations/__init__.py | 30 +- .../aio/operations/_databases_operations.py | 28 +- .../_ledger_digest_uploads_operations.py | 212 +++++-- ..._long_term_retention_backups_operations.py | 28 +- ...ion_managed_instance_backups_operations.py | 20 +- .../_managed_instances_operations.py | 18 +- ...rver_security_alert_policies_operations.py | 10 +- ...restorable_dropped_databases_operations.py | 4 +- ...le_dropped_managed_databases_operations.py | 4 +- .../_server_connection_policies_operations.py | 229 ++++++-- ...rver_security_alert_policies_operations.py | 10 +- .../aio/operations/_sync_groups_operations.py | 4 +- ...t_data_encryption_activities_operations.py | 127 ----- ...transparent_data_encryptions_operations.py | 187 +++++-- .../azure/mgmt/sql/models/__init__.py | 54 +- .../azure/mgmt/sql/models/_models.py | 495 ++++++++++------ .../azure/mgmt/sql/models/_models_py3.py | 529 ++++++++++++------ .../models/_sql_management_client_enums.py | 86 +-- .../azure/mgmt/sql/operations/__init__.py | 30 +- .../sql/operations/_databases_operations.py | 28 +- .../_ledger_digest_uploads_operations.py | 214 +++++-- ..._long_term_retention_backups_operations.py | 28 +- ...ion_managed_instance_backups_operations.py | 20 +- .../_managed_instances_operations.py | 18 +- ...rver_security_alert_policies_operations.py | 10 +- ...restorable_dropped_databases_operations.py | 4 +- ...le_dropped_managed_databases_operations.py | 4 +- .../_server_connection_policies_operations.py | 231 ++++++-- ...rver_security_alert_policies_operations.py | 10 +- .../sql/operations/_sync_groups_operations.py | 4 +- ...t_data_encryption_activities_operations.py | 132 ----- ...transparent_data_encryptions_operations.py | 188 +++++-- 37 files changed, 1949 insertions(+), 1214 deletions(-) delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json index 05c8c8d78316..366bc0f8fc12 100644 --- a/sdk/sql/azure-mgmt-sql/_meta.json +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "cc268fe6b328f3857edb3ec9bce796e7ffc11f85", + "commit": "f7587aad9020f9f0ce1e3a07693205b35b745d45", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/sql/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/sql/resource-manager/readme.md" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json index 4d0c4303c3ab..a9e8e820118c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json @@ -1,6 +1,6 @@ { "chosen_version": "", - "total_api_version_list": ["2014-04-01", "2020-11-01-preview", "2021-02-01-preview"], + "total_api_version_list": ["2014-04-01", "2020-11-01-preview", "2021-02-01-preview", "2021-05-01-preview"], "client": { "name": "SqlManagementClient", "filename": "_sql_management_client", @@ -99,7 +99,6 @@ }, "operation_groups": { "recoverable_databases": "RecoverableDatabasesOperations", - "server_connection_policies": "ServerConnectionPoliciesOperations", "data_masking_policies": "DataMaskingPoliciesOperations", "data_masking_rules": "DataMaskingRulesOperations", "geo_backup_policies": "GeoBackupPoliciesOperations", @@ -110,8 +109,6 @@ "service_objectives": "ServiceObjectivesOperations", "elastic_pool_activities": "ElasticPoolActivitiesOperations", "elastic_pool_database_activities": "ElasticPoolDatabaseActivitiesOperations", - "transparent_data_encryptions": "TransparentDataEncryptionsOperations", - "transparent_data_encryption_activities": "TransparentDataEncryptionActivitiesOperations", "server_usages": "ServerUsagesOperations", "extended_database_blob_auditing_policies": "ExtendedDatabaseBlobAuditingPoliciesOperations", "extended_server_blob_auditing_policies": "ExtendedServerBlobAuditingPoliciesOperations", @@ -145,8 +142,6 @@ "job_target_groups": "JobTargetGroupsOperations", "job_versions": "JobVersionsOperations", "capabilities": "CapabilitiesOperations", - "long_term_retention_backups": "LongTermRetentionBackupsOperations", - "long_term_retention_managed_instance_backups": "LongTermRetentionManagedInstanceBackupsOperations", "long_term_retention_policies": "LongTermRetentionPoliciesOperations", "maintenance_window_options": "MaintenanceWindowOptionsOperations", "maintenance_windows": "MaintenanceWindowsOperations", @@ -173,7 +168,6 @@ "managed_instance_operations": "ManagedInstanceOperationsOperations", "managed_instance_private_endpoint_connections": "ManagedInstancePrivateEndpointConnectionsOperations", "managed_instance_private_link_resources": "ManagedInstancePrivateLinkResourcesOperations", - "managed_instances": "ManagedInstancesOperations", "managed_instance_tde_certificates": "ManagedInstanceTdeCertificatesOperations", "managed_instance_vulnerability_assessments": "ManagedInstanceVulnerabilityAssessmentsOperations", "managed_restorable_dropped_database_backup_short_term_retention_policies": "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations", @@ -208,15 +202,20 @@ "virtual_network_rules": "VirtualNetworkRulesOperations", "workload_classifiers": "WorkloadClassifiersOperations", "workload_groups": "WorkloadGroupsOperations", + "transparent_data_encryptions": "TransparentDataEncryptionsOperations", "backup_short_term_retention_policies": "BackupShortTermRetentionPoliciesOperations", "database_extensions": "DatabaseExtensionsOperations", "database_operations": "DatabaseOperationsOperations", "database_usages": "DatabaseUsagesOperations", "ledger_digest_uploads": "LedgerDigestUploadsOperations", "outbound_firewall_rules": "OutboundFirewallRulesOperations", + "servers": "ServersOperations", + "usages": "UsagesOperations", + "long_term_retention_backups": "LongTermRetentionBackupsOperations", + "long_term_retention_managed_instance_backups": "LongTermRetentionManagedInstanceBackupsOperations", + "managed_instances": "ManagedInstancesOperations", "restorable_dropped_databases": "RestorableDroppedDatabasesOperations", "restorable_dropped_managed_databases": "RestorableDroppedManagedDatabasesOperations", - "servers": "ServersOperations", - "usages": "UsagesOperations" + "server_connection_policies": "ServerConnectionPoliciesOperations" } } \ No newline at end of file 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 7cc74c21d044..005af492b32c 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 @@ -20,7 +20,6 @@ from ._configuration import SqlManagementClientConfiguration from .operations import RecoverableDatabasesOperations -from .operations import ServerConnectionPoliciesOperations from .operations import DataMaskingPoliciesOperations from .operations import DataMaskingRulesOperations from .operations import GeoBackupPoliciesOperations @@ -31,8 +30,6 @@ from .operations import ServiceObjectivesOperations from .operations import ElasticPoolActivitiesOperations from .operations import ElasticPoolDatabaseActivitiesOperations -from .operations import TransparentDataEncryptionsOperations -from .operations import TransparentDataEncryptionActivitiesOperations from .operations import ServerUsagesOperations from .operations import ExtendedDatabaseBlobAuditingPoliciesOperations from .operations import ExtendedServerBlobAuditingPoliciesOperations @@ -66,8 +63,6 @@ from .operations import JobTargetGroupsOperations from .operations import JobVersionsOperations from .operations import CapabilitiesOperations -from .operations import LongTermRetentionBackupsOperations -from .operations import LongTermRetentionManagedInstanceBackupsOperations from .operations import LongTermRetentionPoliciesOperations from .operations import MaintenanceWindowOptionsOperations from .operations import MaintenanceWindowsOperations @@ -94,7 +89,6 @@ from .operations import ManagedInstanceOperationsOperations from .operations import ManagedInstancePrivateEndpointConnectionsOperations from .operations import ManagedInstancePrivateLinkResourcesOperations -from .operations import ManagedInstancesOperations from .operations import ManagedInstanceTdeCertificatesOperations from .operations import ManagedInstanceVulnerabilityAssessmentsOperations from .operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations @@ -129,16 +123,21 @@ from .operations import VirtualNetworkRulesOperations from .operations import WorkloadClassifiersOperations from .operations import WorkloadGroupsOperations +from .operations import TransparentDataEncryptionsOperations from .operations import BackupShortTermRetentionPoliciesOperations from .operations import DatabaseExtensionsOperations from .operations import DatabaseOperationsOperations from .operations import DatabaseUsagesOperations from .operations import LedgerDigestUploadsOperations from .operations import OutboundFirewallRulesOperations -from .operations import RestorableDroppedDatabasesOperations -from .operations import RestorableDroppedManagedDatabasesOperations from .operations import ServersOperations from .operations import UsagesOperations +from .operations import LongTermRetentionBackupsOperations +from .operations import LongTermRetentionManagedInstanceBackupsOperations +from .operations import ManagedInstancesOperations +from .operations import RestorableDroppedDatabasesOperations +from .operations import RestorableDroppedManagedDatabasesOperations +from .operations import ServerConnectionPoliciesOperations from . import models @@ -147,8 +146,6 @@ class SqlManagementClient(object): :ivar recoverable_databases: RecoverableDatabasesOperations operations :vartype recoverable_databases: azure.mgmt.sql.operations.RecoverableDatabasesOperations - :ivar server_connection_policies: ServerConnectionPoliciesOperations operations - :vartype server_connection_policies: azure.mgmt.sql.operations.ServerConnectionPoliciesOperations :ivar data_masking_policies: DataMaskingPoliciesOperations operations :vartype data_masking_policies: azure.mgmt.sql.operations.DataMaskingPoliciesOperations :ivar data_masking_rules: DataMaskingRulesOperations operations @@ -169,10 +166,6 @@ class SqlManagementClient(object): :vartype elastic_pool_activities: azure.mgmt.sql.operations.ElasticPoolActivitiesOperations :ivar elastic_pool_database_activities: ElasticPoolDatabaseActivitiesOperations operations :vartype elastic_pool_database_activities: azure.mgmt.sql.operations.ElasticPoolDatabaseActivitiesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: azure.mgmt.sql.operations.TransparentDataEncryptionsOperations - :ivar transparent_data_encryption_activities: TransparentDataEncryptionActivitiesOperations operations - :vartype transparent_data_encryption_activities: azure.mgmt.sql.operations.TransparentDataEncryptionActivitiesOperations :ivar server_usages: ServerUsagesOperations operations :vartype server_usages: azure.mgmt.sql.operations.ServerUsagesOperations :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations operations @@ -239,10 +232,6 @@ class SqlManagementClient(object): :vartype job_versions: azure.mgmt.sql.operations.JobVersionsOperations :ivar capabilities: CapabilitiesOperations operations :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations - :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations - :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations - :ivar long_term_retention_managed_instance_backups: LongTermRetentionManagedInstanceBackupsOperations operations - :vartype long_term_retention_managed_instance_backups: azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations :vartype long_term_retention_policies: azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations @@ -295,8 +284,6 @@ class SqlManagementClient(object): :vartype managed_instance_private_endpoint_connections: azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations :ivar managed_instance_private_link_resources: ManagedInstancePrivateLinkResourcesOperations operations :vartype managed_instance_private_link_resources: azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations :vartype managed_instance_tde_certificates: azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations :ivar managed_instance_vulnerability_assessments: ManagedInstanceVulnerabilityAssessmentsOperations operations @@ -365,6 +352,8 @@ class SqlManagementClient(object): :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations :ivar workload_groups: WorkloadGroupsOperations operations :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: azure.mgmt.sql.operations.TransparentDataEncryptionsOperations :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations operations :vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations :ivar database_extensions: DatabaseExtensionsOperations operations @@ -377,14 +366,22 @@ class SqlManagementClient(object): :vartype ledger_digest_uploads: azure.mgmt.sql.operations.LedgerDigestUploadsOperations :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations :vartype outbound_firewall_rules: azure.mgmt.sql.operations.OutboundFirewallRulesOperations - :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations - :vartype restorable_dropped_databases: azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations - :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations operations - :vartype restorable_dropped_managed_databases: azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations :ivar servers: ServersOperations operations :vartype servers: azure.mgmt.sql.operations.ServersOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.sql.operations.UsagesOperations + :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations + :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations + :ivar long_term_retention_managed_instance_backups: LongTermRetentionManagedInstanceBackupsOperations operations + :vartype long_term_retention_managed_instance_backups: azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations + :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations + :vartype restorable_dropped_databases: azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations + :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations operations + :vartype restorable_dropped_managed_databases: azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations + :ivar server_connection_policies: ServerConnectionPoliciesOperations operations + :vartype server_connection_policies: azure.mgmt.sql.operations.ServerConnectionPoliciesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The subscription ID that identifies an Azure subscription. @@ -413,8 +410,6 @@ def __init__( self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize) - self.server_connection_policies = ServerConnectionPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) self.data_masking_policies = DataMaskingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.data_masking_rules = DataMaskingRulesOperations( @@ -435,10 +430,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryption_activities = TransparentDataEncryptionActivitiesOperations( - self._client, self._config, self._serialize, self._deserialize) self.server_usages = ServerUsagesOperations( self._client, self._config, self._serialize, self._deserialize) self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( @@ -505,10 +496,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.capabilities = CapabilitiesOperations( self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_backups = LongTermRetentionBackupsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( - self._client, self._config, self._serialize, self._deserialize) self.long_term_retention_policies = LongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.maintenance_window_options = MaintenanceWindowOptionsOperations( @@ -561,8 +548,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) - self.managed_instances = ManagedInstancesOperations( - self._client, self._config, self._serialize, self._deserialize) self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize) self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( @@ -631,6 +616,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.workload_groups = WorkloadGroupsOperations( self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize) self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.database_extensions = DatabaseExtensionsOperations( @@ -643,13 +630,21 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.outbound_firewall_rules = OutboundFirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize) + self.servers = ServersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.long_term_retention_backups = LongTermRetentionBackupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.managed_instances = ManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize) self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize) self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize) - self.servers = ServersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( + self.server_connection_policies = ServerConnectionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) def _send_request(self, http_request, **kwargs): diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py index 42cbaea39a1c..c78e629b6f08 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.1" +VERSION = "0.9.0" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py index c43d2b6edb43..d7ce36546c20 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py @@ -18,7 +18,6 @@ from ._configuration import SqlManagementClientConfiguration from .operations import RecoverableDatabasesOperations -from .operations import ServerConnectionPoliciesOperations from .operations import DataMaskingPoliciesOperations from .operations import DataMaskingRulesOperations from .operations import GeoBackupPoliciesOperations @@ -29,8 +28,6 @@ from .operations import ServiceObjectivesOperations from .operations import ElasticPoolActivitiesOperations from .operations import ElasticPoolDatabaseActivitiesOperations -from .operations import TransparentDataEncryptionsOperations -from .operations import TransparentDataEncryptionActivitiesOperations from .operations import ServerUsagesOperations from .operations import ExtendedDatabaseBlobAuditingPoliciesOperations from .operations import ExtendedServerBlobAuditingPoliciesOperations @@ -64,8 +61,6 @@ from .operations import JobTargetGroupsOperations from .operations import JobVersionsOperations from .operations import CapabilitiesOperations -from .operations import LongTermRetentionBackupsOperations -from .operations import LongTermRetentionManagedInstanceBackupsOperations from .operations import LongTermRetentionPoliciesOperations from .operations import MaintenanceWindowOptionsOperations from .operations import MaintenanceWindowsOperations @@ -92,7 +87,6 @@ from .operations import ManagedInstanceOperationsOperations from .operations import ManagedInstancePrivateEndpointConnectionsOperations from .operations import ManagedInstancePrivateLinkResourcesOperations -from .operations import ManagedInstancesOperations from .operations import ManagedInstanceTdeCertificatesOperations from .operations import ManagedInstanceVulnerabilityAssessmentsOperations from .operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations @@ -127,16 +121,21 @@ from .operations import VirtualNetworkRulesOperations from .operations import WorkloadClassifiersOperations from .operations import WorkloadGroupsOperations +from .operations import TransparentDataEncryptionsOperations from .operations import BackupShortTermRetentionPoliciesOperations from .operations import DatabaseExtensionsOperations from .operations import DatabaseOperationsOperations from .operations import DatabaseUsagesOperations from .operations import LedgerDigestUploadsOperations from .operations import OutboundFirewallRulesOperations -from .operations import RestorableDroppedDatabasesOperations -from .operations import RestorableDroppedManagedDatabasesOperations from .operations import ServersOperations from .operations import UsagesOperations +from .operations import LongTermRetentionBackupsOperations +from .operations import LongTermRetentionManagedInstanceBackupsOperations +from .operations import ManagedInstancesOperations +from .operations import RestorableDroppedDatabasesOperations +from .operations import RestorableDroppedManagedDatabasesOperations +from .operations import ServerConnectionPoliciesOperations from .. import models @@ -145,8 +144,6 @@ class SqlManagementClient(object): :ivar recoverable_databases: RecoverableDatabasesOperations operations :vartype recoverable_databases: azure.mgmt.sql.aio.operations.RecoverableDatabasesOperations - :ivar server_connection_policies: ServerConnectionPoliciesOperations operations - :vartype server_connection_policies: azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations :ivar data_masking_policies: DataMaskingPoliciesOperations operations :vartype data_masking_policies: azure.mgmt.sql.aio.operations.DataMaskingPoliciesOperations :ivar data_masking_rules: DataMaskingRulesOperations operations @@ -167,10 +164,6 @@ class SqlManagementClient(object): :vartype elastic_pool_activities: azure.mgmt.sql.aio.operations.ElasticPoolActivitiesOperations :ivar elastic_pool_database_activities: ElasticPoolDatabaseActivitiesOperations operations :vartype elastic_pool_database_activities: azure.mgmt.sql.aio.operations.ElasticPoolDatabaseActivitiesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations - :ivar transparent_data_encryption_activities: TransparentDataEncryptionActivitiesOperations operations - :vartype transparent_data_encryption_activities: azure.mgmt.sql.aio.operations.TransparentDataEncryptionActivitiesOperations :ivar server_usages: ServerUsagesOperations operations :vartype server_usages: azure.mgmt.sql.aio.operations.ServerUsagesOperations :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations operations @@ -237,10 +230,6 @@ class SqlManagementClient(object): :vartype job_versions: azure.mgmt.sql.aio.operations.JobVersionsOperations :ivar capabilities: CapabilitiesOperations operations :vartype capabilities: azure.mgmt.sql.aio.operations.CapabilitiesOperations - :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations - :vartype long_term_retention_backups: azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations - :ivar long_term_retention_managed_instance_backups: LongTermRetentionManagedInstanceBackupsOperations operations - :vartype long_term_retention_managed_instance_backups: azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations :ivar long_term_retention_policies: LongTermRetentionPoliciesOperations operations :vartype long_term_retention_policies: azure.mgmt.sql.aio.operations.LongTermRetentionPoliciesOperations :ivar maintenance_window_options: MaintenanceWindowOptionsOperations operations @@ -293,8 +282,6 @@ class SqlManagementClient(object): :vartype managed_instance_private_endpoint_connections: azure.mgmt.sql.aio.operations.ManagedInstancePrivateEndpointConnectionsOperations :ivar managed_instance_private_link_resources: ManagedInstancePrivateLinkResourcesOperations operations :vartype managed_instance_private_link_resources: azure.mgmt.sql.aio.operations.ManagedInstancePrivateLinkResourcesOperations - :ivar managed_instances: ManagedInstancesOperations operations - :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificatesOperations operations :vartype managed_instance_tde_certificates: azure.mgmt.sql.aio.operations.ManagedInstanceTdeCertificatesOperations :ivar managed_instance_vulnerability_assessments: ManagedInstanceVulnerabilityAssessmentsOperations operations @@ -363,6 +350,8 @@ class SqlManagementClient(object): :vartype workload_classifiers: azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations :ivar workload_groups: WorkloadGroupsOperations operations :vartype workload_groups: azure.mgmt.sql.aio.operations.WorkloadGroupsOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations operations :vartype backup_short_term_retention_policies: azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations :ivar database_extensions: DatabaseExtensionsOperations operations @@ -375,14 +364,22 @@ class SqlManagementClient(object): :vartype ledger_digest_uploads: azure.mgmt.sql.aio.operations.LedgerDigestUploadsOperations :ivar outbound_firewall_rules: OutboundFirewallRulesOperations operations :vartype outbound_firewall_rules: azure.mgmt.sql.aio.operations.OutboundFirewallRulesOperations - :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations - :vartype restorable_dropped_databases: azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations - :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations operations - :vartype restorable_dropped_managed_databases: azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations :ivar servers: ServersOperations operations :vartype servers: azure.mgmt.sql.aio.operations.ServersOperations :ivar usages: UsagesOperations operations :vartype usages: azure.mgmt.sql.aio.operations.UsagesOperations + :ivar long_term_retention_backups: LongTermRetentionBackupsOperations operations + :vartype long_term_retention_backups: azure.mgmt.sql.aio.operations.LongTermRetentionBackupsOperations + :ivar long_term_retention_managed_instance_backups: LongTermRetentionManagedInstanceBackupsOperations operations + :vartype long_term_retention_managed_instance_backups: azure.mgmt.sql.aio.operations.LongTermRetentionManagedInstanceBackupsOperations + :ivar managed_instances: ManagedInstancesOperations operations + :vartype managed_instances: azure.mgmt.sql.aio.operations.ManagedInstancesOperations + :ivar restorable_dropped_databases: RestorableDroppedDatabasesOperations operations + :vartype restorable_dropped_databases: azure.mgmt.sql.aio.operations.RestorableDroppedDatabasesOperations + :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabasesOperations operations + :vartype restorable_dropped_managed_databases: azure.mgmt.sql.aio.operations.RestorableDroppedManagedDatabasesOperations + :ivar server_connection_policies: ServerConnectionPoliciesOperations operations + :vartype server_connection_policies: azure.mgmt.sql.aio.operations.ServerConnectionPoliciesOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The subscription ID that identifies an Azure subscription. @@ -410,8 +407,6 @@ def __init__( self.recoverable_databases = RecoverableDatabasesOperations( self._client, self._config, self._serialize, self._deserialize) - self.server_connection_policies = ServerConnectionPoliciesOperations( - self._client, self._config, self._serialize, self._deserialize) self.data_masking_policies = DataMaskingPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.data_masking_rules = DataMaskingRulesOperations( @@ -432,10 +427,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryption_activities = TransparentDataEncryptionActivitiesOperations( - self._client, self._config, self._serialize, self._deserialize) self.server_usages = ServerUsagesOperations( self._client, self._config, self._serialize, self._deserialize) self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( @@ -502,10 +493,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.capabilities = CapabilitiesOperations( self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_backups = LongTermRetentionBackupsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( - self._client, self._config, self._serialize, self._deserialize) self.long_term_retention_policies = LongTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.maintenance_window_options = MaintenanceWindowOptionsOperations( @@ -558,8 +545,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.managed_instance_private_link_resources = ManagedInstancePrivateLinkResourcesOperations( self._client, self._config, self._serialize, self._deserialize) - self.managed_instances = ManagedInstancesOperations( - self._client, self._config, self._serialize, self._deserialize) self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( self._client, self._config, self._serialize, self._deserialize) self.managed_instance_vulnerability_assessments = ManagedInstanceVulnerabilityAssessmentsOperations( @@ -628,6 +613,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.workload_groups = WorkloadGroupsOperations( self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize) self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.database_extensions = DatabaseExtensionsOperations( @@ -640,13 +627,21 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.outbound_firewall_rules = OutboundFirewallRulesOperations( self._client, self._config, self._serialize, self._deserialize) + self.servers = ServersOperations( + self._client, self._config, self._serialize, self._deserialize) + self.usages = UsagesOperations( + self._client, self._config, self._serialize, self._deserialize) + self.long_term_retention_backups = LongTermRetentionBackupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self._client, self._config, self._serialize, self._deserialize) + self.managed_instances = ManagedInstancesOperations( + self._client, self._config, self._serialize, self._deserialize) self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize) self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self._config, self._serialize, self._deserialize) - self.servers = ServersOperations( - self._client, self._config, self._serialize, self._deserialize) - self.usages = UsagesOperations( + self.server_connection_policies = ServerConnectionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py index 92dc7fbad3cb..f990cc3c49ea 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py @@ -7,7 +7,6 @@ # -------------------------------------------------------------------------- from ._recoverable_databases_operations import RecoverableDatabasesOperations -from ._server_connection_policies_operations import ServerConnectionPoliciesOperations from ._data_masking_policies_operations import DataMaskingPoliciesOperations from ._data_masking_rules_operations import DataMaskingRulesOperations from ._geo_backup_policies_operations import GeoBackupPoliciesOperations @@ -18,8 +17,6 @@ from ._service_objectives_operations import ServiceObjectivesOperations from ._elastic_pool_activities_operations import ElasticPoolActivitiesOperations from ._elastic_pool_database_activities_operations import ElasticPoolDatabaseActivitiesOperations -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations -from ._transparent_data_encryption_activities_operations import TransparentDataEncryptionActivitiesOperations from ._server_usages_operations import ServerUsagesOperations from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations @@ -53,8 +50,6 @@ from ._job_target_groups_operations import JobTargetGroupsOperations from ._job_versions_operations import JobVersionsOperations from ._capabilities_operations import CapabilitiesOperations -from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations -from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations from ._maintenance_window_options_operations import MaintenanceWindowOptionsOperations from ._maintenance_windows_operations import MaintenanceWindowsOperations @@ -81,7 +76,6 @@ from ._managed_instance_operations_operations import ManagedInstanceOperationsOperations from ._managed_instance_private_endpoint_connections_operations import ManagedInstancePrivateEndpointConnectionsOperations from ._managed_instance_private_link_resources_operations import ManagedInstancePrivateLinkResourcesOperations -from ._managed_instances_operations import ManagedInstancesOperations from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations from ._managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations @@ -116,20 +110,24 @@ from ._virtual_network_rules_operations import VirtualNetworkRulesOperations from ._workload_classifiers_operations import WorkloadClassifiersOperations from ._workload_groups_operations import WorkloadGroupsOperations +from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from ._database_extensions_operations import DatabaseExtensionsOperations from ._database_operations_operations import DatabaseOperationsOperations from ._database_usages_operations import DatabaseUsagesOperations from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations -from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations -from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations from ._servers_operations import ServersOperations from ._usages_operations import UsagesOperations +from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations +from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations +from ._managed_instances_operations import ManagedInstancesOperations +from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations +from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations +from ._server_connection_policies_operations import ServerConnectionPoliciesOperations __all__ = [ 'RecoverableDatabasesOperations', - 'ServerConnectionPoliciesOperations', 'DataMaskingPoliciesOperations', 'DataMaskingRulesOperations', 'GeoBackupPoliciesOperations', @@ -140,8 +138,6 @@ 'ServiceObjectivesOperations', 'ElasticPoolActivitiesOperations', 'ElasticPoolDatabaseActivitiesOperations', - 'TransparentDataEncryptionsOperations', - 'TransparentDataEncryptionActivitiesOperations', 'ServerUsagesOperations', 'ExtendedDatabaseBlobAuditingPoliciesOperations', 'ExtendedServerBlobAuditingPoliciesOperations', @@ -175,8 +171,6 @@ 'JobTargetGroupsOperations', 'JobVersionsOperations', 'CapabilitiesOperations', - 'LongTermRetentionBackupsOperations', - 'LongTermRetentionManagedInstanceBackupsOperations', 'LongTermRetentionPoliciesOperations', 'MaintenanceWindowOptionsOperations', 'MaintenanceWindowsOperations', @@ -203,7 +197,6 @@ 'ManagedInstanceOperationsOperations', 'ManagedInstancePrivateEndpointConnectionsOperations', 'ManagedInstancePrivateLinkResourcesOperations', - 'ManagedInstancesOperations', 'ManagedInstanceTdeCertificatesOperations', 'ManagedInstanceVulnerabilityAssessmentsOperations', 'ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations', @@ -238,14 +231,19 @@ 'VirtualNetworkRulesOperations', 'WorkloadClassifiersOperations', 'WorkloadGroupsOperations', + 'TransparentDataEncryptionsOperations', 'BackupShortTermRetentionPoliciesOperations', 'DatabaseExtensionsOperations', 'DatabaseOperationsOperations', 'DatabaseUsagesOperations', 'LedgerDigestUploadsOperations', 'OutboundFirewallRulesOperations', - 'RestorableDroppedDatabasesOperations', - 'RestorableDroppedManagedDatabasesOperations', 'ServersOperations', 'UsagesOperations', + 'LongTermRetentionBackupsOperations', + 'LongTermRetentionManagedInstanceBackupsOperations', + 'ManagedInstancesOperations', + 'RestorableDroppedDatabasesOperations', + 'RestorableDroppedManagedDatabasesOperations', + 'ServerConnectionPoliciesOperations', ] diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py index a97428a133b9..554db3b46751 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_databases_operations.py @@ -231,7 +231,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -311,7 +311,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -361,7 +361,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -497,7 +497,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -612,7 +612,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -759,7 +759,7 @@ def list_by_elastic_pool( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -825,7 +825,7 @@ async def _failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._failover_initial.metadata['url'] # type: ignore @@ -956,7 +956,7 @@ def list_inaccessible_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1020,7 +1020,7 @@ async def _pause_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -1144,7 +1144,7 @@ async def _resume_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -1268,7 +1268,7 @@ async def _upgrade_data_warehouse_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._upgrade_data_warehouse_initial.metadata['url'] # type: ignore @@ -1399,7 +1399,7 @@ async def rename( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1449,7 +1449,7 @@ async def _import_method_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1583,7 +1583,7 @@ async def _export_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py index f68bf89ad335..91146f456188 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py @@ -12,7 +12,9 @@ from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models @@ -108,7 +110,7 @@ async def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore - async def create_or_update( + async def _create_or_update_initial( self, resource_group_name: str, server_name: str, @@ -117,25 +119,6 @@ async def create_or_update( parameters: "_models.LedgerDigestUploads", **kwargs: Any ) -> Optional["_models.LedgerDigestUploads"]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -146,7 +129,7 @@ async def create_or_update( accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -184,7 +167,90 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, "_models.LedgerDigestUploadsName"], + parameters: "_models.LedgerDigestUploads", + **kwargs: Any + ) -> AsyncLROPoller["_models.LedgerDigestUploads"]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore def list_by_database( self, @@ -265,7 +331,7 @@ async def get_next(next_link=None): ) list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads'} # type: ignore - async def disable( + async def _disable_initial( self, resource_group_name: str, server_name: str, @@ -273,23 +339,6 @@ async def disable( ledger_digest_uploads: Union[str, "_models.LedgerDigestUploadsName"], **kwargs: Any ) -> Optional["_models.LedgerDigestUploads"]: - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -299,7 +348,7 @@ async def disable( accept = "application/json" # Construct URL - url = self.disable.metadata['url'] # type: ignore + url = self._disable_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -333,4 +382,83 @@ async def disable( return cls(pipeline_response, deserialized, {}) return deserialized - disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + _disable_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + + async def begin_disable( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, "_models.LedgerDigestUploadsName"], + **kwargs: Any + ) -> AsyncLROPoller["_models.LedgerDigestUploads"]: + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._disable_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py index 25543cddfd16..3d47b1d46525 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_backups_operations.py @@ -57,7 +57,7 @@ async def _copy_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -197,7 +197,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -351,7 +351,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -402,7 +402,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -542,7 +542,7 @@ def list_by_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -626,7 +626,7 @@ def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -711,7 +711,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -782,7 +782,7 @@ async def _copy_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -930,7 +930,7 @@ async def _update_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1095,7 +1095,7 @@ async def get_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -1148,7 +1148,7 @@ async def _delete_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_by_resource_group_initial.metadata['url'] # type: ignore @@ -1299,7 +1299,7 @@ def list_by_resource_group_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1388,7 +1388,7 @@ def list_by_resource_group_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1478,7 +1478,7 @@ def list_by_resource_group_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py index d456d8693580..2365cf743737 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_long_term_retention_managed_instance_backups_operations.py @@ -71,7 +71,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -122,7 +122,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -262,7 +262,7 @@ def list_by_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -349,7 +349,7 @@ def list_by_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -432,7 +432,7 @@ def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -519,7 +519,7 @@ async def get_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -572,7 +572,7 @@ async def _delete_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_by_resource_group_initial.metadata['url'] # type: ignore @@ -723,7 +723,7 @@ def list_by_resource_group_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -815,7 +815,7 @@ def list_by_resource_group_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -903,7 +903,7 @@ def list_by_resource_group_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py index d4357dc7de30..0cfbe4c6ca0e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_instances_operations.py @@ -69,7 +69,7 @@ def list_by_instance_pool( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -217,7 +217,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -296,7 +296,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -346,7 +346,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -475,7 +475,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -583,7 +583,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -744,7 +744,7 @@ def list_by_managed_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -822,7 +822,7 @@ async def _failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._failover_initial.metadata['url'] # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py index 55e5422d21dc..3bfa09c9a56b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], **kwargs: Any ) -> "_models.ManagedServerSecurityAlertPolicy": """Get a managed server's threat detection policy. @@ -58,7 +58,7 @@ async def get( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ManagedServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy @@ -110,7 +110,7 @@ async def _create_or_update_initial( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ManagedServerSecurityAlertPolicy", **kwargs: Any ) -> Optional["_models.ManagedServerSecurityAlertPolicy"]: @@ -167,7 +167,7 @@ async def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ManagedServerSecurityAlertPolicy", **kwargs: Any ) -> AsyncLROPoller["_models.ManagedServerSecurityAlertPolicy"]: @@ -179,7 +179,7 @@ async def begin_create_or_update( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The managed server security alert policy. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py index db5efbde1d51..9eb106ad30e6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_databases_operations.py @@ -64,7 +64,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py index 5a7338635929..cdaf2db7aea3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_restorable_dropped_managed_databases_operations.py @@ -64,7 +64,7 @@ def list_by_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py index 9d0966e0eaf1..96c09f77bba5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_connection_policies_operations.py @@ -5,13 +5,16 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models @@ -40,15 +43,14 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def create_or_update( + async def get( self, resource_group_name: str, server_name: str, connection_policy_name: Union[str, "_models.ConnectionPolicyName"], - parameters: "_models.ServerConnectionPolicy", **kwargs: Any ) -> "_models.ServerConnectionPolicy": - """Creates or updates the server's connection policy. + """Gets a server connection policy. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @@ -57,8 +59,6 @@ async def create_or_update( :type server_name: str :param connection_policy_name: The name of the connection policy. :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a secure connection policy. - :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy :keyword callable cls: A custom type or function that will be passed the direct response :return: ServerConnectionPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy @@ -69,17 +69,16 @@ async def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore 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'), 'connectionPolicyName': self._serialize.url("connection_policy_name", connection_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -89,68 +88,48 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ServerConnectionPolicy') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) + deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore - async def get( + async def _create_or_update_initial( self, resource_group_name: str, server_name: str, connection_policy_name: Union[str, "_models.ConnectionPolicyName"], + parameters: "_models.ServerConnectionPolicy", **kwargs: Any - ) -> "_models.ServerConnectionPolicy": - """Gets the server's secure connection policy. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param connection_policy_name: The name of the connection policy. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerConnectionPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerConnectionPolicy"] + ) -> Optional["_models.ServerConnectionPolicy"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerConnectionPolicy"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self._create_or_update_initial.metadata['url'] # type: ignore 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'), 'connectionPolicyName': self._serialize.url("connection_policy_name", connection_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -160,20 +139,178 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ServerConnectionPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + connection_policy_name: Union[str, "_models.ConnectionPolicyName"], + parameters: "_models.ServerConnectionPolicy", + **kwargs: Any + ) -> AsyncLROPoller["_models.ServerConnectionPolicy"]: + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param connection_policy_name: The name of the connection policy. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. + :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ServerConnectionPolicy or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerConnectionPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + connection_policy_name=connection_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'connectionPolicyName': self._serialize.url("connection_policy_name", connection_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + + def list_by_server( + self, + resource_group_name: str, + server_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.ServerConnectionPolicyListResult"]: + """Lists connection policy. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServerConnectionPolicyListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerConnectionPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('ServerConnectionPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py index 991d0be5e5c8..8086f41e9c49 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], **kwargs: Any ) -> "_models.ServerSecurityAlertPolicy": """Get a server's security alert policy. @@ -58,7 +58,7 @@ async def get( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy @@ -110,7 +110,7 @@ async def _create_or_update_initial( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ServerSecurityAlertPolicy", **kwargs: Any ) -> Optional["_models.ServerSecurityAlertPolicy"]: @@ -167,7 +167,7 @@ async def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ServerSecurityAlertPolicy", **kwargs: Any ) -> AsyncLROPoller["_models.ServerSecurityAlertPolicy"]: @@ -179,7 +179,7 @@ async def begin_create_or_update( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The server security alert policy. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py index 2a714c6b13da..3ba9b7d383d6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py @@ -325,7 +325,7 @@ def list_logs( sync_group_name: str, start_time: str, end_time: str, - type: Union[str, "_models.Enum77"], + type: Union[str, "_models.Enum60"], continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.SyncGroupLogListResult"]: @@ -345,7 +345,7 @@ def list_logs( :param end_time: Get logs generated before this time. :type end_time: str :param type: The types of logs to retrieve. - :type type: str or ~azure.mgmt.sql.models.Enum77 + :type type: str or ~azure.mgmt.sql.models.Enum60 :param continuation_token_parameter: The continuation token for this operation. :type continuation_token_parameter: str :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py deleted file mode 100644 index ee95b2c2ae88..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class TransparentDataEncryptionActivitiesOperations: - """TransparentDataEncryptionActivitiesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.sql.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_configuration( - self, - resource_group_name: str, - server_name: str, - database_name: str, - transparent_data_encryption_name: Union[str, "_models.TransparentDataEncryptionName"], - **kwargs: Any - ) -> AsyncIterable["_models.TransparentDataEncryptionActivityListResult"]: - """Returns a database's transparent data encryption operation result. - - :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 for which the transparent data encryption - applies. - :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TransparentDataEncryptionActivityListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.TransparentDataEncryptionActivityListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryptionActivityListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_configuration.metadata['url'] # type: ignore - 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'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('TransparentDataEncryptionActivityListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py index 8894320e1575..9da319aff594 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py @@ -5,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest @@ -40,53 +41,47 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def create_or_update( + async def get( self, resource_group_name: str, server_name: str, database_name: str, - transparent_data_encryption_name: Union[str, "_models.TransparentDataEncryptionName"], - parameters: "_models.TransparentDataEncryption", + tde_name: Union[str, "_models.TransparentDataEncryptionName"], **kwargs: Any - ) -> "_models.TransparentDataEncryption": - """Creates or updates a database's transparent data encryption configuration. + ) -> "_models.LogicalDatabaseTransparentDataEncryption": + """Gets a logical database's transparent data encryption. :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 for which setting the transparent data - encryption applies. + :param database_name: The name of the logical database for which the transparent data + encryption is defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The required parameters for creating or updating transparent data - encryption. - :type parameters: ~azure.mgmt.sql.models.TransparentDataEncryption + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryption"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-02-01-preview" accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore 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'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -96,74 +91,69 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TransparentDataEncryption') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore - async def get( + async def create_or_update( self, resource_group_name: str, server_name: str, database_name: str, - transparent_data_encryption_name: Union[str, "_models.TransparentDataEncryptionName"], + tde_name: Union[str, "_models.TransparentDataEncryptionName"], + parameters: "_models.LogicalDatabaseTransparentDataEncryption", **kwargs: Any - ) -> "_models.TransparentDataEncryption": - """Gets a database's transparent data encryption configuration. + ) -> Optional["_models.LogicalDatabaseTransparentDataEncryption"]: + """Updates a logical database's transparent data encryption configuration. :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 for which the transparent data encryption - applies. + :param database_name: The name of the logical database for which the security alert policy is + defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogicalDatabaseTransparentDataEncryption"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create_or_update.metadata['url'] # type: ignore 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'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -173,20 +163,109 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LogicalDatabaseTransparentDataEncryption') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore + + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.LogicalDatabaseTransparentDataEncryptionListResult"]: + """Gets a list of the logical database's transparent data encryption. + + :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 logical database for which the transparent data + encryption is defined. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LogicalDatabaseTransparentDataEncryptionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption'} # type: ignore 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 db89bafe250b..0939278d2835 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 @@ -32,6 +32,7 @@ from ._models_py3 import DatabaseColumn from ._models_py3 import DatabaseColumnListResult from ._models_py3 import DatabaseExtensions + from ._models_py3 import DatabaseIdentity from ._models_py3 import DatabaseListResult from ._models_py3 import DatabaseOperation from ._models_py3 import DatabaseOperationListResult @@ -44,11 +45,13 @@ from ._models_py3 import DatabaseUpdate from ._models_py3 import DatabaseUsage from ._models_py3 import DatabaseUsageListResult + from ._models_py3 import DatabaseUserIdentity from ._models_py3 import DatabaseVulnerabilityAssessment from ._models_py3 import DatabaseVulnerabilityAssessmentListResult from ._models_py3 import DatabaseVulnerabilityAssessmentRuleBaseline from ._models_py3 import DatabaseVulnerabilityAssessmentRuleBaselineItem from ._models_py3 import DatabaseVulnerabilityAssessmentScansExport + from ._models_py3 import Delegation from ._models_py3 import DeletedServer from ._models_py3 import DeletedServerListResult from ._models_py3 import EditionCapability @@ -124,6 +127,8 @@ from ._models_py3 import LicenseTypeCapability from ._models_py3 import LocationCapabilities from ._models_py3 import LogSizeCapability + from ._models_py3 import LogicalDatabaseTransparentDataEncryption + from ._models_py3 import LogicalDatabaseTransparentDataEncryptionListResult from ._models_py3 import LogicalServerSecurityAlertPolicyListResult from ._models_py3 import LongTermRetentionBackup from ._models_py3 import LongTermRetentionBackupListResult @@ -265,6 +270,7 @@ from ._models_py3 import ServerCommunicationLink from ._models_py3 import ServerCommunicationLinkListResult from ._models_py3 import ServerConnectionPolicy + from ._models_py3 import ServerConnectionPolicyListResult from ._models_py3 import ServerDevOpsAuditSettingsListResult from ._models_py3 import ServerDevOpsAuditingSettings from ._models_py3 import ServerDnsAlias @@ -290,6 +296,7 @@ from ._models_py3 import ServiceObjective from ._models_py3 import ServiceObjectiveCapability from ._models_py3 import ServiceObjectiveListResult + from ._models_py3 import ServicePrincipal from ._models_py3 import Sku from ._models_py3 import SloUsageMetric from ._models_py3 import SqlAgentConfiguration @@ -323,9 +330,6 @@ from ._models_py3 import TopQueries from ._models_py3 import TopQueriesListResult from ._models_py3 import TrackedResource - from ._models_py3 import TransparentDataEncryption - from ._models_py3 import TransparentDataEncryptionActivity - from ._models_py3 import TransparentDataEncryptionActivityListResult from ._models_py3 import UnlinkParameters from ._models_py3 import UpdateLongTermRetentionBackupParameters from ._models_py3 import UpdateManagedInstanceDnsServersOperation @@ -373,6 +377,7 @@ from ._models import DatabaseColumn # type: ignore from ._models import DatabaseColumnListResult # type: ignore from ._models import DatabaseExtensions # type: ignore + from ._models import DatabaseIdentity # type: ignore from ._models import DatabaseListResult # type: ignore from ._models import DatabaseOperation # type: ignore from ._models import DatabaseOperationListResult # type: ignore @@ -385,11 +390,13 @@ from ._models import DatabaseUpdate # type: ignore from ._models import DatabaseUsage # type: ignore from ._models import DatabaseUsageListResult # type: ignore + from ._models import DatabaseUserIdentity # type: ignore from ._models import DatabaseVulnerabilityAssessment # type: ignore from ._models import DatabaseVulnerabilityAssessmentListResult # type: ignore from ._models import DatabaseVulnerabilityAssessmentRuleBaseline # type: ignore from ._models import DatabaseVulnerabilityAssessmentRuleBaselineItem # type: ignore from ._models import DatabaseVulnerabilityAssessmentScansExport # type: ignore + from ._models import Delegation # type: ignore from ._models import DeletedServer # type: ignore from ._models import DeletedServerListResult # type: ignore from ._models import EditionCapability # type: ignore @@ -465,6 +472,8 @@ from ._models import LicenseTypeCapability # type: ignore from ._models import LocationCapabilities # type: ignore from ._models import LogSizeCapability # type: ignore + from ._models import LogicalDatabaseTransparentDataEncryption # type: ignore + from ._models import LogicalDatabaseTransparentDataEncryptionListResult # type: ignore from ._models import LogicalServerSecurityAlertPolicyListResult # type: ignore from ._models import LongTermRetentionBackup # type: ignore from ._models import LongTermRetentionBackupListResult # type: ignore @@ -606,6 +615,7 @@ from ._models import ServerCommunicationLink # type: ignore from ._models import ServerCommunicationLinkListResult # type: ignore from ._models import ServerConnectionPolicy # type: ignore + from ._models import ServerConnectionPolicyListResult # type: ignore from ._models import ServerDevOpsAuditSettingsListResult # type: ignore from ._models import ServerDevOpsAuditingSettings # type: ignore from ._models import ServerDnsAlias # type: ignore @@ -631,6 +641,7 @@ from ._models import ServiceObjective # type: ignore from ._models import ServiceObjectiveCapability # type: ignore from ._models import ServiceObjectiveListResult # type: ignore + from ._models import ServicePrincipal # type: ignore from ._models import Sku # type: ignore from ._models import SloUsageMetric # type: ignore from ._models import SqlAgentConfiguration # type: ignore @@ -664,9 +675,6 @@ from ._models import TopQueries # type: ignore from ._models import TopQueriesListResult # type: ignore from ._models import TrackedResource # type: ignore - from ._models import TransparentDataEncryption # type: ignore - from ._models import TransparentDataEncryptionActivity # type: ignore - from ._models import TransparentDataEncryptionActivityListResult # type: ignore from ._models import UnlinkParameters # type: ignore from ._models import UpdateLongTermRetentionBackupParameters # type: ignore from ._models import UpdateManagedInstanceDnsServersOperation # type: ignore @@ -713,11 +721,11 @@ ConnectionPolicyName, CreateMode, CreatedByType, - CurrentBackupStorageRedundancy, DataMaskingFunction, DataMaskingRuleState, DataMaskingState, DataWarehouseUserActivityName, + DatabaseIdentityType, DatabaseLicenseType, DatabaseReadScale, DatabaseState, @@ -728,7 +736,7 @@ ElasticPoolLicenseType, ElasticPoolState, EncryptionProtectorName, - Enum77, + Enum60, FailoverGroupReplicationRole, GeoBackupPolicyName, GeoBackupPolicyState, @@ -782,14 +790,11 @@ ReplicationLinkType, ReplicationRole, ReplicationState, - RequestedBackupStorageRedundancy, - RestorableDroppedDatabasePropertiesBackupStorageRedundancy, RestoreDetailsName, RestorePointType, SampleName, SecondaryType, SecurityAlertPolicyName, - SecurityAlertPolicyNameAutoGenerated, SecurityAlertPolicyState, SecurityAlertsPolicyState, SecurityEventType, @@ -802,9 +807,9 @@ ServerTrustGroupPropertiesTrustScopesItem, ServerWorkspaceFeature, ServiceObjectiveName, + ServicePrincipalType, ShortTermRetentionPolicyName, SqlAgentConfigurationPropertiesState, - StorageAccountType, StorageCapabilityStorageAccountType, StorageKeyType, SyncAgentState, @@ -815,11 +820,8 @@ SyncMemberDbType, SyncMemberState, TableTemporalType, - TargetBackupStorageRedundancy, - TransparentDataEncryptionActivityStatus, TransparentDataEncryptionName, TransparentDataEncryptionState, - TransparentDataEncryptionStatus, UnitDefinitionType, UnitType, UpsertManagedServerOperationStepStatus, @@ -856,6 +858,7 @@ 'DatabaseColumn', 'DatabaseColumnListResult', 'DatabaseExtensions', + 'DatabaseIdentity', 'DatabaseListResult', 'DatabaseOperation', 'DatabaseOperationListResult', @@ -868,11 +871,13 @@ 'DatabaseUpdate', 'DatabaseUsage', 'DatabaseUsageListResult', + 'DatabaseUserIdentity', 'DatabaseVulnerabilityAssessment', 'DatabaseVulnerabilityAssessmentListResult', 'DatabaseVulnerabilityAssessmentRuleBaseline', 'DatabaseVulnerabilityAssessmentRuleBaselineItem', 'DatabaseVulnerabilityAssessmentScansExport', + 'Delegation', 'DeletedServer', 'DeletedServerListResult', 'EditionCapability', @@ -948,6 +953,8 @@ 'LicenseTypeCapability', 'LocationCapabilities', 'LogSizeCapability', + 'LogicalDatabaseTransparentDataEncryption', + 'LogicalDatabaseTransparentDataEncryptionListResult', 'LogicalServerSecurityAlertPolicyListResult', 'LongTermRetentionBackup', 'LongTermRetentionBackupListResult', @@ -1089,6 +1096,7 @@ 'ServerCommunicationLink', 'ServerCommunicationLinkListResult', 'ServerConnectionPolicy', + 'ServerConnectionPolicyListResult', 'ServerDevOpsAuditSettingsListResult', 'ServerDevOpsAuditingSettings', 'ServerDnsAlias', @@ -1114,6 +1122,7 @@ 'ServiceObjective', 'ServiceObjectiveCapability', 'ServiceObjectiveListResult', + 'ServicePrincipal', 'Sku', 'SloUsageMetric', 'SqlAgentConfiguration', @@ -1147,9 +1156,6 @@ 'TopQueries', 'TopQueriesListResult', 'TrackedResource', - 'TransparentDataEncryption', - 'TransparentDataEncryptionActivity', - 'TransparentDataEncryptionActivityListResult', 'UnlinkParameters', 'UpdateLongTermRetentionBackupParameters', 'UpdateManagedInstanceDnsServersOperation', @@ -1194,11 +1200,11 @@ 'ConnectionPolicyName', 'CreateMode', 'CreatedByType', - 'CurrentBackupStorageRedundancy', 'DataMaskingFunction', 'DataMaskingRuleState', 'DataMaskingState', 'DataWarehouseUserActivityName', + 'DatabaseIdentityType', 'DatabaseLicenseType', 'DatabaseReadScale', 'DatabaseState', @@ -1209,7 +1215,7 @@ 'ElasticPoolLicenseType', 'ElasticPoolState', 'EncryptionProtectorName', - 'Enum77', + 'Enum60', 'FailoverGroupReplicationRole', 'GeoBackupPolicyName', 'GeoBackupPolicyState', @@ -1263,14 +1269,11 @@ 'ReplicationLinkType', 'ReplicationRole', 'ReplicationState', - 'RequestedBackupStorageRedundancy', - 'RestorableDroppedDatabasePropertiesBackupStorageRedundancy', 'RestoreDetailsName', 'RestorePointType', 'SampleName', 'SecondaryType', 'SecurityAlertPolicyName', - 'SecurityAlertPolicyNameAutoGenerated', 'SecurityAlertPolicyState', 'SecurityAlertsPolicyState', 'SecurityEventType', @@ -1283,9 +1286,9 @@ 'ServerTrustGroupPropertiesTrustScopesItem', 'ServerWorkspaceFeature', 'ServiceObjectiveName', + 'ServicePrincipalType', 'ShortTermRetentionPolicyName', 'SqlAgentConfigurationPropertiesState', - 'StorageAccountType', 'StorageCapabilityStorageAccountType', 'StorageKeyType', 'SyncAgentState', @@ -1296,11 +1299,8 @@ 'SyncMemberDbType', 'SyncMemberState', 'TableTemporalType', - 'TargetBackupStorageRedundancy', - 'TransparentDataEncryptionActivityStatus', 'TransparentDataEncryptionName', 'TransparentDataEncryptionState', - 'TransparentDataEncryptionStatus', 'UnitDefinitionType', 'UnitType', 'UpsertManagedServerOperationStepStatus', 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 5dd8f1a0f817..eb0f3bff19f7 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 @@ -542,9 +542,8 @@ class CopyLongTermRetentionBackupParameters(msrest.serialization.Model): :param target_database_name: The name of the database owns the copied backup. :type target_database_name: str :param target_backup_storage_redundancy: The storage redundancy type of the copied backup. - Possible values include: "Geo", "Local", "Zone". - :type target_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.TargetBackupStorageRedundancy + Possible values include: "Geo", "Local", "Zone", "GeoZone". + :type target_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ _attribute_map = { @@ -675,6 +674,8 @@ class Database(TrackedResource): :vartype kind: str :ivar managed_by: Resource that manages the database. :vartype managed_by: str + :param identity: The Azure Active Directory identity of the database. + :type identity: ~azure.mgmt.sql.models.DatabaseIdentity :param create_mode: Specifies the mode of database creation. Default: regular database creation. @@ -723,7 +724,7 @@ class Database(TrackedResource): "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", - "Disabled". + "Disabled", "Stopping", "Stopped", "Starting". :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -786,13 +787,13 @@ class Database(TrackedResource): of -1 means that automatic pause is disabled. :type auto_pause_delay: int :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this database. Possible values include: "Geo", "Local", "Zone". + this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param requested_backup_storage_redundancy: The storage account type to be used to store - backups for this database. Possible values include: "Geo", "Local", "Zone". + backups for this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused. :type min_capacity: float :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 @@ -810,6 +811,11 @@ class Database(TrackedResource): :type is_ledger_on: bool :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. :vartype is_infra_encryption_enabled: bool + :param federated_client_id: The Client id used for cross tenant per database CMK scenario. + :type federated_client_id: str + :param primary_delegated_identity_client_id: The Primary Delegated Identity Client id used for + per database CMK - for internal use only. + :type primary_delegated_identity_client_id: str """ _validation = { @@ -844,6 +850,7 @@ class Database(TrackedResource): 'sku': {'key': 'sku', 'type': 'Sku'}, 'kind': {'key': 'kind', 'type': 'str'}, 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'DatabaseIdentity'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'collation': {'key': 'properties.collation', 'type': 'str'}, 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, @@ -881,6 +888,8 @@ class Database(TrackedResource): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, 'is_infra_encryption_enabled': {'key': 'properties.isInfraEncryptionEnabled', 'type': 'bool'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'primary_delegated_identity_client_id': {'key': 'properties.primaryDelegatedIdentityClientId', 'type': 'str'}, } def __init__( @@ -891,6 +900,7 @@ def __init__( self.sku = kwargs.get('sku', None) self.kind = None self.managed_by = None + self.identity = kwargs.get('identity', None) self.create_mode = kwargs.get('create_mode', None) self.collation = kwargs.get('collation', None) self.max_size_bytes = kwargs.get('max_size_bytes', None) @@ -928,6 +938,8 @@ def __init__( self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) self.is_ledger_on = kwargs.get('is_ledger_on', None) self.is_infra_encryption_enabled = None + self.federated_client_id = kwargs.get('federated_client_id', None) + self.primary_delegated_identity_client_id = kwargs.get('primary_delegated_identity_client_id', None) class DatabaseAutomaticTuning(ProxyResource): @@ -1313,6 +1325,43 @@ def __init__( self.storage_uri = kwargs.get('storage_uri', None) +class DatabaseIdentity(msrest.serialization.Model): + """Azure Active Directory identity configuration for a resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. Possible values include: "None", "UserAssigned". + :type type: str or ~azure.mgmt.sql.models.DatabaseIdentityType + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + :param user_assigned_identities: The resource ids of the user assigned identities to use. + :type user_assigned_identities: dict[str, ~azure.mgmt.sql.models.DatabaseUserIdentity] + :param delegated_resources: Resources delegated to the database - Internal Use Only. + :type delegated_resources: dict[str, ~azure.mgmt.sql.models.Delegation] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{DatabaseUserIdentity}'}, + 'delegated_resources': {'key': 'delegatedResources', 'type': '{Delegation}'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseIdentity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.tenant_id = None + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) + self.delegated_resources = kwargs.get('delegated_resources', None) + + class DatabaseListResult(msrest.serialization.Model): """A list of databases. @@ -1723,6 +1772,8 @@ class DatabaseUpdate(msrest.serialization.Model): :param sku: The name and tier of the SKU. :type sku: ~azure.mgmt.sql.models.Sku + :param identity: Database identity. + :type identity: ~azure.mgmt.sql.models.DatabaseIdentity :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param create_mode: Specifies the mode of database creation. @@ -1773,7 +1824,7 @@ class DatabaseUpdate(msrest.serialization.Model): "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", - "Disabled". + "Disabled", "Stopping", "Stopped", "Starting". :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -1836,13 +1887,13 @@ class DatabaseUpdate(msrest.serialization.Model): of -1 means that automatic pause is disabled. :type auto_pause_delay: int :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this database. Possible values include: "Geo", "Local", "Zone". + this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param requested_backup_storage_redundancy: The storage account type to be used to store - backups for this database. Possible values include: "Geo", "Local", "Zone". + backups for this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused. :type min_capacity: float :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 @@ -1860,6 +1911,11 @@ class DatabaseUpdate(msrest.serialization.Model): :type is_ledger_on: bool :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. :vartype is_infra_encryption_enabled: bool + :param federated_client_id: The Client id used for cross tenant per database CMK scenario. + :type federated_client_id: str + :param primary_delegated_identity_client_id: The Primary Delegated Identity Client id used for + per database CMK - for internal use only. + :type primary_delegated_identity_client_id: str """ _validation = { @@ -1881,6 +1937,7 @@ class DatabaseUpdate(msrest.serialization.Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'DatabaseIdentity'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'collation': {'key': 'properties.collation', 'type': 'str'}, @@ -1919,6 +1976,8 @@ class DatabaseUpdate(msrest.serialization.Model): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, 'is_infra_encryption_enabled': {'key': 'properties.isInfraEncryptionEnabled', 'type': 'bool'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'primary_delegated_identity_client_id': {'key': 'properties.primaryDelegatedIdentityClientId', 'type': 'str'}, } def __init__( @@ -1927,6 +1986,7 @@ def __init__( ): super(DatabaseUpdate, self).__init__(**kwargs) self.sku = kwargs.get('sku', None) + self.identity = kwargs.get('identity', None) self.tags = kwargs.get('tags', None) self.create_mode = kwargs.get('create_mode', None) self.collation = kwargs.get('collation', None) @@ -1965,6 +2025,8 @@ def __init__( self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) self.is_ledger_on = kwargs.get('is_ledger_on', None) self.is_infra_encryption_enabled = None + self.federated_client_id = kwargs.get('federated_client_id', None) + self.primary_delegated_identity_client_id = kwargs.get('primary_delegated_identity_client_id', None) class DatabaseUsage(ProxyResource): @@ -2049,6 +2111,36 @@ def __init__( self.next_link = None +class DatabaseUserIdentity(msrest.serialization.Model): + """Azure Active Directory identity configuration for a resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory client id. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseUserIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class DatabaseVulnerabilityAssessment(ProxyResource): """A database vulnerability assessment. @@ -2484,6 +2576,35 @@ def __init__( self.next_link = None +class Delegation(msrest.serialization.Model): + """Delegated Resource Properties - Internal Use Only. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param resource_id: The resource id of the source resource - Internal Use Only. + :type resource_id: str + :ivar tenant_id: AAD tenant guid of the source resource identity - Internal Use Only. + :vartype tenant_id: str + """ + + _validation = { + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(Delegation, self).__init__(**kwargs) + self.resource_id = kwargs.get('resource_id', None) + self.tenant_id = None + + class DeletedServer(ProxyResource): """A deleted server. @@ -6150,6 +6271,73 @@ def __init__( self.reason = kwargs.get('reason', None) +class LogicalDatabaseTransparentDataEncryption(ProxyResource): + """A logical database transparent data encryption state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Specifies the state of the transparent data encryption. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryption, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + + +class LogicalDatabaseTransparentDataEncryptionListResult(msrest.serialization.Model): + """A list of transparent data encryptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LogicalDatabaseTransparentDataEncryption]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryptionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class LogicalServerSecurityAlertPolicyListResult(msrest.serialization.Model): """A list of the server's security alert policies. @@ -6235,10 +6423,10 @@ class LongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: ~datetime.datetime :ivar backup_storage_redundancy: The storage redundancy type of the backup. Possible values - include: "Geo", "Local", "Zone". + include: "Geo", "Local", "Zone", "GeoZone". :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy :param requested_backup_storage_redundancy: The storage redundancy type of the backup. Possible - values include: "Geo", "Local", "Zone". + values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ @@ -6335,7 +6523,7 @@ class LongTermRetentionBackupOperationResult(ProxyResource): :ivar to_backup_resource_id: Target backup resource id. :vartype to_backup_resource_id: str :ivar target_backup_storage_redundancy: The storage redundancy type of the copied backup. - Possible values include: "Geo", "Local", "Zone". + Possible values include: "Geo", "Local", "Zone", "GeoZone". :vartype target_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy :ivar status: Operation status. @@ -7186,7 +7374,8 @@ class ManagedInstance(TrackedResource): BC_Gen5. :type sku: ~azure.mgmt.sql.models.Sku :ivar provisioning_state: Possible values include: "Creating", "Deleting", "Updating", - "Unknown", "Succeeded", "Failed". + "Unknown", "Succeeded", "Failed", "Accepted", "Created", "Deleted", "Unrecognized", "Running", + "Canceled", "NotSpecified", "Registering", "TimedOut". :vartype provisioning_state: str or ~azure.mgmt.sql.models.ManagedInstancePropertiesProvisioningState :param managed_instance_create_mode: Specifies the mode of database creation. @@ -7254,10 +7443,18 @@ class ManagedInstance(TrackedResource): :vartype private_endpoint_connections: list[~azure.mgmt.sql.models.ManagedInstancePecProperty] :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 + :ivar current_backup_storage_redundancy: The storage account type used to store backups for + this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), + Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Possible values include: "Geo", + "Local", "Zone", "GeoZone". + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be used to store + backups for this instance. The options are Local (LocallyRedundantStorage), Zone + (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + Possible values include: "Geo", "Local", "Zone", "GeoZone". + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy :param zone_redundant: Whether or not the multi-az is enabled. :type zone_redundant: bool :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be @@ -7267,6 +7464,8 @@ class ManagedInstance(TrackedResource): :type key_id: str :param administrators: The Azure Active Directory administrator of the server. :type administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator + :param service_principal: The managed instance's service principal. + :type service_principal: ~azure.mgmt.sql.models.ServicePrincipal """ _validation = { @@ -7279,6 +7478,7 @@ class ManagedInstance(TrackedResource): 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -7311,11 +7511,13 @@ class ManagedInstance(TrackedResource): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ManagedInstancePecProperty]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, + 'current_backup_storage_redundancy': {'key': 'properties.currentBackupStorageRedundancy', 'type': 'str'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ManagedInstanceExternalAdministrator'}, + 'service_principal': {'key': 'properties.servicePrincipal', 'type': 'ServicePrincipal'}, } def __init__( @@ -7347,11 +7549,13 @@ def __init__( self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) self.private_endpoint_connections = None self.minimal_tls_version = kwargs.get('minimal_tls_version', None) - self.storage_account_type = kwargs.get('storage_account_type', None) + self.current_backup_storage_redundancy = None + self.requested_backup_storage_redundancy = kwargs.get('requested_backup_storage_redundancy', None) self.zone_redundant = kwargs.get('zone_redundant', None) self.primary_user_assigned_identity_id = kwargs.get('primary_user_assigned_identity_id', None) self.key_id = kwargs.get('key_id', None) self.administrators = kwargs.get('administrators', None) + self.service_principal = kwargs.get('service_principal', None) class ManagedInstanceAdministrator(ProxyResource): @@ -7879,7 +8083,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: ~datetime.datetime :ivar backup_storage_redundancy: The storage redundancy type of the backup. Possible values - include: "Geo", "Local", "Zone". + include: "Geo", "Local", "Zone", "GeoZone". :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ @@ -8666,7 +8870,8 @@ class ManagedInstanceUpdate(msrest.serialization.Model): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :ivar provisioning_state: Possible values include: "Creating", "Deleting", "Updating", - "Unknown", "Succeeded", "Failed". + "Unknown", "Succeeded", "Failed", "Accepted", "Created", "Deleted", "Unrecognized", "Running", + "Canceled", "NotSpecified", "Registering", "TimedOut". :vartype provisioning_state: str or ~azure.mgmt.sql.models.ManagedInstancePropertiesProvisioningState :param managed_instance_create_mode: Specifies the mode of database creation. @@ -8734,10 +8939,18 @@ class ManagedInstanceUpdate(msrest.serialization.Model): :vartype private_endpoint_connections: list[~azure.mgmt.sql.models.ManagedInstancePecProperty] :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 + :ivar current_backup_storage_redundancy: The storage account type used to store backups for + this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), + Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Possible values include: "Geo", + "Local", "Zone", "GeoZone". + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be used to store + backups for this instance. The options are Local (LocallyRedundantStorage), Zone + (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + Possible values include: "Geo", "Local", "Zone", "GeoZone". + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy :param zone_redundant: Whether or not the multi-az is enabled. :type zone_redundant: bool :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be @@ -8747,6 +8960,8 @@ class ManagedInstanceUpdate(msrest.serialization.Model): :type key_id: str :param administrators: The Azure Active Directory administrator of the server. :type administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator + :param service_principal: The managed instance's service principal. + :type service_principal: ~azure.mgmt.sql.models.ServicePrincipal """ _validation = { @@ -8755,6 +8970,7 @@ class ManagedInstanceUpdate(msrest.serialization.Model): 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -8783,11 +8999,13 @@ class ManagedInstanceUpdate(msrest.serialization.Model): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ManagedInstancePecProperty]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, + 'current_backup_storage_redundancy': {'key': 'properties.currentBackupStorageRedundancy', 'type': 'str'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ManagedInstanceExternalAdministrator'}, + 'service_principal': {'key': 'properties.servicePrincipal', 'type': 'ServicePrincipal'}, } def __init__( @@ -8820,11 +9038,13 @@ def __init__( self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) self.private_endpoint_connections = None self.minimal_tls_version = kwargs.get('minimal_tls_version', None) - self.storage_account_type = kwargs.get('storage_account_type', None) + self.current_backup_storage_redundancy = None + self.requested_backup_storage_redundancy = kwargs.get('requested_backup_storage_redundancy', None) self.zone_redundant = kwargs.get('zone_redundant', None) self.primary_user_assigned_identity_id = kwargs.get('primary_user_assigned_identity_id', None) self.key_id = kwargs.get('key_id', None) self.administrators = kwargs.get('administrators', None) + self.service_principal = kwargs.get('service_principal', None) class ManagedInstanceVcoresCapability(msrest.serialization.Model): @@ -11374,9 +11594,6 @@ class RestorableDroppedDatabase(ProxyResource): :vartype database_name: str :ivar max_size_bytes: The max size of the database expressed in bytes. :vartype max_size_bytes: long - :ivar elastic_pool_id: DEPRECATED: The resource name of the elastic pool containing this - database. This property is deprecated and the value will always be null. - :vartype elastic_pool_id: str :ivar creation_date: The creation date of the database (ISO8601 format). :vartype creation_date: ~datetime.datetime :ivar deletion_date: The deletion date of the database (ISO8601 format). @@ -11384,9 +11601,8 @@ class RestorableDroppedDatabase(ProxyResource): :ivar earliest_restore_date: The earliest restore date of the database (ISO8601 format). :vartype earliest_restore_date: ~datetime.datetime :ivar backup_storage_redundancy: The storage account type used to store backups for this - database. Possible values include: "Geo", "Local", "Zone". - :vartype backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RestorableDroppedDatabasePropertiesBackupStorageRedundancy + database. Possible values include: "Geo", "Local", "Zone", "GeoZone". + :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ _validation = { @@ -11395,7 +11611,6 @@ class RestorableDroppedDatabase(ProxyResource): 'type': {'readonly': True}, 'database_name': {'readonly': True}, 'max_size_bytes': {'readonly': True}, - 'elastic_pool_id': {'readonly': True}, 'creation_date': {'readonly': True}, 'deletion_date': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, @@ -11411,7 +11626,6 @@ class RestorableDroppedDatabase(ProxyResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'elastic_pool_id': {'key': 'properties.elasticPoolId', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'}, 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, @@ -11428,7 +11642,6 @@ def __init__( self.tags = kwargs.get('tags', None) self.database_name = None self.max_size_bytes = None - self.elastic_pool_id = None self.creation_date = None self.deletion_date = None self.earliest_restore_date = None @@ -12556,7 +12769,7 @@ def __init__( class ServerConnectionPolicy(ProxyResource): - """A server secure connection policy. + """A server connection policy. Variables are only populated by the server, and will be ignored when sending a request. @@ -12566,12 +12779,12 @@ class ServerConnectionPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar kind: Metadata used for the Azure portal experience. - :vartype kind: str :ivar location: Resource location. :vartype location: str + :ivar kind: Metadata used for the Azure portal experience. + :vartype kind: str :param connection_type: The server connection type. Possible values include: "Default", - "Proxy", "Redirect". + "Redirect", "Proxy". :type connection_type: str or ~azure.mgmt.sql.models.ServerConnectionType """ @@ -12579,16 +12792,16 @@ class ServerConnectionPolicy(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'readonly': True}, 'location': {'readonly': True}, + 'kind': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, } @@ -12597,11 +12810,41 @@ def __init__( **kwargs ): super(ServerConnectionPolicy, self).__init__(**kwargs) - self.kind = None self.location = None + self.kind = None self.connection_type = kwargs.get('connection_type', None) +class ServerConnectionPolicyListResult(msrest.serialization.Model): + """A list of server connection policy objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.ServerConnectionPolicy] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServerConnectionPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerConnectionPolicyListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class ServerDevOpsAuditingSettings(ProxyResource): """A server DevOps auditing settings. @@ -13797,6 +14040,45 @@ def __init__( self.value = kwargs['value'] +class ServicePrincipal(msrest.serialization.Model): + """The managed instance's service principal configuration for a resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The Azure Active Directory application object id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory application client id. + :vartype client_id: str + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + :param type: Service principal type. Possible values include: "None", "SystemAssigned". + :type type: str or ~azure.mgmt.sql.models.ServicePrincipalType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServicePrincipal, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + self.tenant_id = None + self.type = kwargs.get('type', None) + + class Sku(msrest.serialization.Model): """An ARM Resource SKU. @@ -15097,121 +15379,6 @@ def __init__( self.next_link = None -class TransparentDataEncryption(ProxyResource): - """Represents a database transparent data encryption configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :param status: The status of the database transparent data encryption. Possible values include: - "Enabled", "Disabled". - :type status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = kwargs.get('status', None) - - -class TransparentDataEncryptionActivity(ProxyResource): - """Represents a database transparent data encryption Scan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :ivar status: The status of the database. Possible values include: "Encrypting", "Decrypting". - :vartype status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionActivityStatus - :ivar percent_complete: The percent complete of the transparent data encryption scan for a - database. - :vartype percent_complete: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'status': {'readonly': True}, - 'percent_complete': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryptionActivity, self).__init__(**kwargs) - self.location = None - self.status = None - self.percent_complete = None - - -class TransparentDataEncryptionActivityListResult(msrest.serialization.Model): - """Represents the response to a list database transparent data encryption activity request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The list of database transparent data encryption activities. - :type value: list[~azure.mgmt.sql.models.TransparentDataEncryptionActivity] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[TransparentDataEncryptionActivity]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryptionActivityListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - - class UnlinkParameters(msrest.serialization.Model): """Represents the parameters for Unlink Replication Link request. @@ -15236,9 +15403,9 @@ class UpdateLongTermRetentionBackupParameters(msrest.serialization.Model): """Contains the information necessary to perform long term retention backup update operation. :param requested_backup_storage_redundancy: The storage redundancy type of the copied backup. - Possible values include: "Geo", "Local", "Zone". + Possible values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy """ _attribute_map = { 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 2c17ba58eb75..2f5c2873f211 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 @@ -560,9 +560,8 @@ class CopyLongTermRetentionBackupParameters(msrest.serialization.Model): :param target_database_name: The name of the database owns the copied backup. :type target_database_name: str :param target_backup_storage_redundancy: The storage redundancy type of the copied backup. - Possible values include: "Geo", "Local", "Zone". - :type target_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.TargetBackupStorageRedundancy + Possible values include: "Geo", "Local", "Zone", "GeoZone". + :type target_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ _attribute_map = { @@ -582,7 +581,7 @@ def __init__( target_server_resource_id: Optional[str] = None, target_server_fully_qualified_domain_name: Optional[str] = None, target_database_name: Optional[str] = None, - target_backup_storage_redundancy: Optional[Union[str, "TargetBackupStorageRedundancy"]] = None, + target_backup_storage_redundancy: Optional[Union[str, "BackupStorageRedundancy"]] = None, **kwargs ): super(CopyLongTermRetentionBackupParameters, self).__init__(**kwargs) @@ -705,6 +704,8 @@ class Database(TrackedResource): :vartype kind: str :ivar managed_by: Resource that manages the database. :vartype managed_by: str + :param identity: The Azure Active Directory identity of the database. + :type identity: ~azure.mgmt.sql.models.DatabaseIdentity :param create_mode: Specifies the mode of database creation. Default: regular database creation. @@ -753,7 +754,7 @@ class Database(TrackedResource): "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", - "Disabled". + "Disabled", "Stopping", "Stopped", "Starting". :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -816,13 +817,13 @@ class Database(TrackedResource): of -1 means that automatic pause is disabled. :type auto_pause_delay: int :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this database. Possible values include: "Geo", "Local", "Zone". + this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param requested_backup_storage_redundancy: The storage account type to be used to store - backups for this database. Possible values include: "Geo", "Local", "Zone". + backups for this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused. :type min_capacity: float :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 @@ -840,6 +841,11 @@ class Database(TrackedResource): :type is_ledger_on: bool :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. :vartype is_infra_encryption_enabled: bool + :param federated_client_id: The Client id used for cross tenant per database CMK scenario. + :type federated_client_id: str + :param primary_delegated_identity_client_id: The Primary Delegated Identity Client id used for + per database CMK - for internal use only. + :type primary_delegated_identity_client_id: str """ _validation = { @@ -874,6 +880,7 @@ class Database(TrackedResource): 'sku': {'key': 'sku', 'type': 'Sku'}, 'kind': {'key': 'kind', 'type': 'str'}, 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'DatabaseIdentity'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'collation': {'key': 'properties.collation', 'type': 'str'}, 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, @@ -911,6 +918,8 @@ class Database(TrackedResource): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, 'is_infra_encryption_enabled': {'key': 'properties.isInfraEncryptionEnabled', 'type': 'bool'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'primary_delegated_identity_client_id': {'key': 'properties.primaryDelegatedIdentityClientId', 'type': 'str'}, } def __init__( @@ -919,6 +928,7 @@ def __init__( location: str, tags: Optional[Dict[str, str]] = None, sku: Optional["Sku"] = None, + identity: Optional["DatabaseIdentity"] = None, create_mode: Optional[Union[str, "CreateMode"]] = None, collation: Optional[str] = None, max_size_bytes: Optional[int] = None, @@ -938,16 +948,19 @@ def __init__( high_availability_replica_count: Optional[int] = None, secondary_type: Optional[Union[str, "SecondaryType"]] = None, auto_pause_delay: Optional[int] = None, - requested_backup_storage_redundancy: Optional[Union[str, "RequestedBackupStorageRedundancy"]] = None, + requested_backup_storage_redundancy: Optional[Union[str, "BackupStorageRedundancy"]] = None, min_capacity: Optional[float] = None, maintenance_configuration_id: Optional[str] = None, is_ledger_on: Optional[bool] = None, + federated_client_id: Optional[str] = None, + primary_delegated_identity_client_id: Optional[str] = None, **kwargs ): super(Database, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.kind = None self.managed_by = None + self.identity = identity self.create_mode = create_mode self.collation = collation self.max_size_bytes = max_size_bytes @@ -985,6 +998,8 @@ def __init__( self.maintenance_configuration_id = maintenance_configuration_id self.is_ledger_on = is_ledger_on self.is_infra_encryption_enabled = None + self.federated_client_id = federated_client_id + self.primary_delegated_identity_client_id = primary_delegated_identity_client_id class DatabaseAutomaticTuning(ProxyResource): @@ -1393,6 +1408,47 @@ def __init__( self.storage_uri = storage_uri +class DatabaseIdentity(msrest.serialization.Model): + """Azure Active Directory identity configuration for a resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param type: The identity type. Possible values include: "None", "UserAssigned". + :type type: str or ~azure.mgmt.sql.models.DatabaseIdentityType + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + :param user_assigned_identities: The resource ids of the user assigned identities to use. + :type user_assigned_identities: dict[str, ~azure.mgmt.sql.models.DatabaseUserIdentity] + :param delegated_resources: Resources delegated to the database - Internal Use Only. + :type delegated_resources: dict[str, ~azure.mgmt.sql.models.Delegation] + """ + + _validation = { + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{DatabaseUserIdentity}'}, + 'delegated_resources': {'key': 'delegatedResources', 'type': '{Delegation}'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "DatabaseIdentityType"]] = None, + user_assigned_identities: Optional[Dict[str, "DatabaseUserIdentity"]] = None, + delegated_resources: Optional[Dict[str, "Delegation"]] = None, + **kwargs + ): + super(DatabaseIdentity, self).__init__(**kwargs) + self.type = type + self.tenant_id = None + self.user_assigned_identities = user_assigned_identities + self.delegated_resources = delegated_resources + + class DatabaseListResult(msrest.serialization.Model): """A list of databases. @@ -1814,6 +1870,8 @@ class DatabaseUpdate(msrest.serialization.Model): :param sku: The name and tier of the SKU. :type sku: ~azure.mgmt.sql.models.Sku + :param identity: Database identity. + :type identity: ~azure.mgmt.sql.models.DatabaseIdentity :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :param create_mode: Specifies the mode of database creation. @@ -1864,7 +1922,7 @@ class DatabaseUpdate(msrest.serialization.Model): "RecoveryPending", "Recovering", "Suspect", "Offline", "Standby", "Shutdown", "EmergencyMode", "AutoClosed", "Copying", "Creating", "Inaccessible", "OfflineSecondary", "Pausing", "Paused", "Resuming", "Scaling", "OfflineChangingDwPerformanceTiers", "OnlineChangingDwPerformanceTiers", - "Disabled". + "Disabled", "Stopping", "Stopped", "Starting". :vartype status: str or ~azure.mgmt.sql.models.DatabaseStatus :ivar database_id: The ID of the database. :vartype database_id: str @@ -1927,13 +1985,13 @@ class DatabaseUpdate(msrest.serialization.Model): of -1 means that automatic pause is disabled. :type auto_pause_delay: int :ivar current_backup_storage_redundancy: The storage account type used to store backups for - this database. Possible values include: "Geo", "Local", "Zone". + this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :vartype current_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param requested_backup_storage_redundancy: The storage account type to be used to store - backups for this database. Possible values include: "Geo", "Local", "Zone". + backups for this database. Possible values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused. :type min_capacity: float :ivar paused_date: The date when database was paused by user configuration or action(ISO8601 @@ -1951,6 +2009,11 @@ class DatabaseUpdate(msrest.serialization.Model): :type is_ledger_on: bool :ivar is_infra_encryption_enabled: Infra encryption is enabled for this database. :vartype is_infra_encryption_enabled: bool + :param federated_client_id: The Client id used for cross tenant per database CMK scenario. + :type federated_client_id: str + :param primary_delegated_identity_client_id: The Primary Delegated Identity Client id used for + per database CMK - for internal use only. + :type primary_delegated_identity_client_id: str """ _validation = { @@ -1972,6 +2035,7 @@ class DatabaseUpdate(msrest.serialization.Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, + 'identity': {'key': 'identity', 'type': 'DatabaseIdentity'}, 'tags': {'key': 'tags', 'type': '{str}'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'collation': {'key': 'properties.collation', 'type': 'str'}, @@ -2010,12 +2074,15 @@ class DatabaseUpdate(msrest.serialization.Model): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, 'is_infra_encryption_enabled': {'key': 'properties.isInfraEncryptionEnabled', 'type': 'bool'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'primary_delegated_identity_client_id': {'key': 'properties.primaryDelegatedIdentityClientId', 'type': 'str'}, } def __init__( self, *, sku: Optional["Sku"] = None, + identity: Optional["DatabaseIdentity"] = None, tags: Optional[Dict[str, str]] = None, create_mode: Optional[Union[str, "CreateMode"]] = None, collation: Optional[str] = None, @@ -2036,14 +2103,17 @@ def __init__( high_availability_replica_count: Optional[int] = None, secondary_type: Optional[Union[str, "SecondaryType"]] = None, auto_pause_delay: Optional[int] = None, - requested_backup_storage_redundancy: Optional[Union[str, "RequestedBackupStorageRedundancy"]] = None, + requested_backup_storage_redundancy: Optional[Union[str, "BackupStorageRedundancy"]] = None, min_capacity: Optional[float] = None, maintenance_configuration_id: Optional[str] = None, is_ledger_on: Optional[bool] = None, + federated_client_id: Optional[str] = None, + primary_delegated_identity_client_id: Optional[str] = None, **kwargs ): super(DatabaseUpdate, self).__init__(**kwargs) self.sku = sku + self.identity = identity self.tags = tags self.create_mode = create_mode self.collation = collation @@ -2082,6 +2152,8 @@ def __init__( self.maintenance_configuration_id = maintenance_configuration_id self.is_ledger_on = is_ledger_on self.is_infra_encryption_enabled = None + self.federated_client_id = federated_client_id + self.primary_delegated_identity_client_id = primary_delegated_identity_client_id class DatabaseUsage(ProxyResource): @@ -2166,6 +2238,36 @@ def __init__( self.next_link = None +class DatabaseUserIdentity(msrest.serialization.Model): + """Azure Active Directory identity configuration for a resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The Azure Active Directory principal id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory client id. + :vartype client_id: str + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseUserIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class DatabaseVulnerabilityAssessment(ProxyResource): """A database vulnerability assessment. @@ -2627,6 +2729,37 @@ def __init__( self.next_link = None +class Delegation(msrest.serialization.Model): + """Delegated Resource Properties - Internal Use Only. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param resource_id: The resource id of the source resource - Internal Use Only. + :type resource_id: str + :ivar tenant_id: AAD tenant guid of the source resource identity - Internal Use Only. + :vartype tenant_id: str + """ + + _validation = { + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'resource_id': {'key': 'resourceId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__( + self, + *, + resource_id: Optional[str] = None, + **kwargs + ): + super(Delegation, self).__init__(**kwargs) + self.resource_id = resource_id + self.tenant_id = None + + class DeletedServer(ProxyResource): """A deleted server. @@ -6504,6 +6637,75 @@ def __init__( self.reason = reason +class LogicalDatabaseTransparentDataEncryption(ProxyResource): + """A logical database transparent data encryption state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Specifies the state of the transparent data encryption. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "TransparentDataEncryptionState"]] = None, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryption, self).__init__(**kwargs) + self.state = state + + +class LogicalDatabaseTransparentDataEncryptionListResult(msrest.serialization.Model): + """A list of transparent data encryptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LogicalDatabaseTransparentDataEncryption]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryptionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class LogicalServerSecurityAlertPolicyListResult(msrest.serialization.Model): """A list of the server's security alert policies. @@ -6589,10 +6791,10 @@ class LongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: ~datetime.datetime :ivar backup_storage_redundancy: The storage redundancy type of the backup. Possible values - include: "Geo", "Local", "Zone". + include: "Geo", "Local", "Zone", "GeoZone". :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy :param requested_backup_storage_redundancy: The storage redundancy type of the backup. Possible - values include: "Geo", "Local", "Zone". + values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ @@ -6691,7 +6893,7 @@ class LongTermRetentionBackupOperationResult(ProxyResource): :ivar to_backup_resource_id: Target backup resource id. :vartype to_backup_resource_id: str :ivar target_backup_storage_redundancy: The storage redundancy type of the copied backup. - Possible values include: "Geo", "Local", "Zone". + Possible values include: "Geo", "Local", "Zone", "GeoZone". :vartype target_backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy :ivar status: Operation status. @@ -7602,7 +7804,8 @@ class ManagedInstance(TrackedResource): BC_Gen5. :type sku: ~azure.mgmt.sql.models.Sku :ivar provisioning_state: Possible values include: "Creating", "Deleting", "Updating", - "Unknown", "Succeeded", "Failed". + "Unknown", "Succeeded", "Failed", "Accepted", "Created", "Deleted", "Unrecognized", "Running", + "Canceled", "NotSpecified", "Registering", "TimedOut". :vartype provisioning_state: str or ~azure.mgmt.sql.models.ManagedInstancePropertiesProvisioningState :param managed_instance_create_mode: Specifies the mode of database creation. @@ -7670,10 +7873,18 @@ class ManagedInstance(TrackedResource): :vartype private_endpoint_connections: list[~azure.mgmt.sql.models.ManagedInstancePecProperty] :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 + :ivar current_backup_storage_redundancy: The storage account type used to store backups for + this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), + Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Possible values include: "Geo", + "Local", "Zone", "GeoZone". + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be used to store + backups for this instance. The options are Local (LocallyRedundantStorage), Zone + (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + Possible values include: "Geo", "Local", "Zone", "GeoZone". + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy :param zone_redundant: Whether or not the multi-az is enabled. :type zone_redundant: bool :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be @@ -7683,6 +7894,8 @@ class ManagedInstance(TrackedResource): :type key_id: str :param administrators: The Azure Active Directory administrator of the server. :type administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator + :param service_principal: The managed instance's service principal. + :type service_principal: ~azure.mgmt.sql.models.ServicePrincipal """ _validation = { @@ -7695,6 +7908,7 @@ class ManagedInstance(TrackedResource): 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -7727,11 +7941,13 @@ class ManagedInstance(TrackedResource): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ManagedInstancePecProperty]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, + 'current_backup_storage_redundancy': {'key': 'properties.currentBackupStorageRedundancy', 'type': 'str'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ManagedInstanceExternalAdministrator'}, + 'service_principal': {'key': 'properties.servicePrincipal', 'type': 'ServicePrincipal'}, } def __init__( @@ -7758,11 +7974,12 @@ def __init__( instance_pool_id: Optional[str] = None, maintenance_configuration_id: Optional[str] = None, minimal_tls_version: Optional[str] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + requested_backup_storage_redundancy: Optional[Union[str, "BackupStorageRedundancy"]] = None, zone_redundant: Optional[bool] = None, primary_user_assigned_identity_id: Optional[str] = None, key_id: Optional[str] = None, administrators: Optional["ManagedInstanceExternalAdministrator"] = None, + service_principal: Optional["ServicePrincipal"] = None, **kwargs ): super(ManagedInstance, self).__init__(location=location, tags=tags, **kwargs) @@ -7790,11 +8007,13 @@ def __init__( self.maintenance_configuration_id = maintenance_configuration_id self.private_endpoint_connections = None self.minimal_tls_version = minimal_tls_version - self.storage_account_type = storage_account_type + self.current_backup_storage_redundancy = None + self.requested_backup_storage_redundancy = requested_backup_storage_redundancy self.zone_redundant = zone_redundant self.primary_user_assigned_identity_id = primary_user_assigned_identity_id self.key_id = key_id self.administrators = administrators + self.service_principal = service_principal class ManagedInstanceAdministrator(ProxyResource): @@ -8347,7 +8566,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: ~datetime.datetime :ivar backup_storage_redundancy: The storage redundancy type of the backup. Possible values - include: "Geo", "Local", "Zone". + include: "Geo", "Local", "Zone", "GeoZone". :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ @@ -9157,7 +9376,8 @@ class ManagedInstanceUpdate(msrest.serialization.Model): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] :ivar provisioning_state: Possible values include: "Creating", "Deleting", "Updating", - "Unknown", "Succeeded", "Failed". + "Unknown", "Succeeded", "Failed", "Accepted", "Created", "Deleted", "Unrecognized", "Running", + "Canceled", "NotSpecified", "Registering", "TimedOut". :vartype provisioning_state: str or ~azure.mgmt.sql.models.ManagedInstancePropertiesProvisioningState :param managed_instance_create_mode: Specifies the mode of database creation. @@ -9225,10 +9445,18 @@ class ManagedInstanceUpdate(msrest.serialization.Model): :vartype private_endpoint_connections: list[~azure.mgmt.sql.models.ManagedInstancePecProperty] :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 + :ivar current_backup_storage_redundancy: The storage account type used to store backups for + this instance. The options are Local (LocallyRedundantStorage), Zone (ZoneRedundantStorage), + Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). Possible values include: "Geo", + "Local", "Zone", "GeoZone". + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be used to store + backups for this instance. The options are Local (LocallyRedundantStorage), Zone + (ZoneRedundantStorage), Geo (GeoRedundantStorage) and GeoZone(GeoZoneRedundantStorage). + Possible values include: "Geo", "Local", "Zone", "GeoZone". + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy :param zone_redundant: Whether or not the multi-az is enabled. :type zone_redundant: bool :param primary_user_assigned_identity_id: The resource id of a user assigned identity to be @@ -9238,6 +9466,8 @@ class ManagedInstanceUpdate(msrest.serialization.Model): :type key_id: str :param administrators: The Azure Active Directory administrator of the server. :type administrators: ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator + :param service_principal: The managed instance's service principal. + :type service_principal: ~azure.mgmt.sql.models.ServicePrincipal """ _validation = { @@ -9246,6 +9476,7 @@ class ManagedInstanceUpdate(msrest.serialization.Model): 'state': {'readonly': True}, 'dns_zone': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -9274,11 +9505,13 @@ class ManagedInstanceUpdate(msrest.serialization.Model): 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ManagedInstancePecProperty]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, - 'storage_account_type': {'key': 'properties.storageAccountType', 'type': 'str'}, + 'current_backup_storage_redundancy': {'key': 'properties.currentBackupStorageRedundancy', 'type': 'str'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, 'zone_redundant': {'key': 'properties.zoneRedundant', 'type': 'bool'}, 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, 'key_id': {'key': 'properties.keyId', 'type': 'str'}, 'administrators': {'key': 'properties.administrators', 'type': 'ManagedInstanceExternalAdministrator'}, + 'service_principal': {'key': 'properties.servicePrincipal', 'type': 'ServicePrincipal'}, } def __init__( @@ -9304,11 +9537,12 @@ def __init__( instance_pool_id: Optional[str] = None, maintenance_configuration_id: Optional[str] = None, minimal_tls_version: Optional[str] = None, - storage_account_type: Optional[Union[str, "StorageAccountType"]] = None, + requested_backup_storage_redundancy: Optional[Union[str, "BackupStorageRedundancy"]] = None, zone_redundant: Optional[bool] = None, primary_user_assigned_identity_id: Optional[str] = None, key_id: Optional[str] = None, administrators: Optional["ManagedInstanceExternalAdministrator"] = None, + service_principal: Optional["ServicePrincipal"] = None, **kwargs ): super(ManagedInstanceUpdate, self).__init__(**kwargs) @@ -9337,11 +9571,13 @@ def __init__( self.maintenance_configuration_id = maintenance_configuration_id self.private_endpoint_connections = None self.minimal_tls_version = minimal_tls_version - self.storage_account_type = storage_account_type + self.current_backup_storage_redundancy = None + self.requested_backup_storage_redundancy = requested_backup_storage_redundancy self.zone_redundant = zone_redundant self.primary_user_assigned_identity_id = primary_user_assigned_identity_id self.key_id = key_id self.administrators = administrators + self.service_principal = service_principal class ManagedInstanceVcoresCapability(msrest.serialization.Model): @@ -11965,9 +12201,6 @@ class RestorableDroppedDatabase(ProxyResource): :vartype database_name: str :ivar max_size_bytes: The max size of the database expressed in bytes. :vartype max_size_bytes: long - :ivar elastic_pool_id: DEPRECATED: The resource name of the elastic pool containing this - database. This property is deprecated and the value will always be null. - :vartype elastic_pool_id: str :ivar creation_date: The creation date of the database (ISO8601 format). :vartype creation_date: ~datetime.datetime :ivar deletion_date: The deletion date of the database (ISO8601 format). @@ -11975,9 +12208,8 @@ class RestorableDroppedDatabase(ProxyResource): :ivar earliest_restore_date: The earliest restore date of the database (ISO8601 format). :vartype earliest_restore_date: ~datetime.datetime :ivar backup_storage_redundancy: The storage account type used to store backups for this - database. Possible values include: "Geo", "Local", "Zone". - :vartype backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RestorableDroppedDatabasePropertiesBackupStorageRedundancy + database. Possible values include: "Geo", "Local", "Zone", "GeoZone". + :vartype backup_storage_redundancy: str or ~azure.mgmt.sql.models.BackupStorageRedundancy """ _validation = { @@ -11986,7 +12218,6 @@ class RestorableDroppedDatabase(ProxyResource): 'type': {'readonly': True}, 'database_name': {'readonly': True}, 'max_size_bytes': {'readonly': True}, - 'elastic_pool_id': {'readonly': True}, 'creation_date': {'readonly': True}, 'deletion_date': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, @@ -12002,7 +12233,6 @@ class RestorableDroppedDatabase(ProxyResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'long'}, - 'elastic_pool_id': {'key': 'properties.elasticPoolId', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'deletion_date': {'key': 'properties.deletionDate', 'type': 'iso-8601'}, 'earliest_restore_date': {'key': 'properties.earliestRestoreDate', 'type': 'iso-8601'}, @@ -12023,7 +12253,6 @@ def __init__( self.tags = tags self.database_name = None self.max_size_bytes = None - self.elastic_pool_id = None self.creation_date = None self.deletion_date = None self.earliest_restore_date = None @@ -13210,7 +13439,7 @@ def __init__( class ServerConnectionPolicy(ProxyResource): - """A server secure connection policy. + """A server connection policy. Variables are only populated by the server, and will be ignored when sending a request. @@ -13220,12 +13449,12 @@ class ServerConnectionPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar kind: Metadata used for the Azure portal experience. - :vartype kind: str :ivar location: Resource location. :vartype location: str + :ivar kind: Metadata used for the Azure portal experience. + :vartype kind: str :param connection_type: The server connection type. Possible values include: "Default", - "Proxy", "Redirect". + "Redirect", "Proxy". :type connection_type: str or ~azure.mgmt.sql.models.ServerConnectionType """ @@ -13233,16 +13462,16 @@ class ServerConnectionPolicy(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'readonly': True}, 'location': {'readonly': True}, + 'kind': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, 'connection_type': {'key': 'properties.connectionType', 'type': 'str'}, } @@ -13253,11 +13482,41 @@ def __init__( **kwargs ): super(ServerConnectionPolicy, self).__init__(**kwargs) - self.kind = None self.location = None + self.kind = None self.connection_type = connection_type +class ServerConnectionPolicyListResult(msrest.serialization.Model): + """A list of server connection policy objects. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.ServerConnectionPolicy] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServerConnectionPolicy]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServerConnectionPolicyListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class ServerDevOpsAuditingSettings(ProxyResource): """A server DevOps auditing settings. @@ -14510,6 +14769,47 @@ def __init__( self.value = value +class ServicePrincipal(msrest.serialization.Model): + """The managed instance's service principal configuration for a resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar principal_id: The Azure Active Directory application object id. + :vartype principal_id: str + :ivar client_id: The Azure Active Directory application client id. + :vartype client_id: str + :ivar tenant_id: The Azure Active Directory tenant id. + :vartype tenant_id: str + :param type: Service principal type. Possible values include: "None", "SystemAssigned". + :type type: str or ~azure.mgmt.sql.models.ServicePrincipalType + """ + + _validation = { + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, + 'tenant_id': {'readonly': True}, + } + + _attribute_map = { + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__( + self, + *, + type: Optional[Union[str, "ServicePrincipalType"]] = None, + **kwargs + ): + super(ServicePrincipal, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + self.tenant_id = None + self.type = type + + class Sku(msrest.serialization.Model): """An ARM Resource SKU. @@ -15866,125 +16166,6 @@ def __init__( self.next_link = None -class TransparentDataEncryption(ProxyResource): - """Represents a database transparent data encryption configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :param status: The status of the database transparent data encryption. Possible values include: - "Enabled", "Disabled". - :type status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "TransparentDataEncryptionStatus"]] = None, - **kwargs - ): - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = status - - -class TransparentDataEncryptionActivity(ProxyResource): - """Represents a database transparent data encryption Scan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :ivar status: The status of the database. Possible values include: "Encrypting", "Decrypting". - :vartype status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionActivityStatus - :ivar percent_complete: The percent complete of the transparent data encryption scan for a - database. - :vartype percent_complete: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'status': {'readonly': True}, - 'percent_complete': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryptionActivity, self).__init__(**kwargs) - self.location = None - self.status = None - self.percent_complete = None - - -class TransparentDataEncryptionActivityListResult(msrest.serialization.Model): - """Represents the response to a list database transparent data encryption activity request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The list of database transparent data encryption activities. - :type value: list[~azure.mgmt.sql.models.TransparentDataEncryptionActivity] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[TransparentDataEncryptionActivity]'}, - } - - def __init__( - self, - *, - value: List["TransparentDataEncryptionActivity"], - **kwargs - ): - super(TransparentDataEncryptionActivityListResult, self).__init__(**kwargs) - self.value = value - - class UnlinkParameters(msrest.serialization.Model): """Represents the parameters for Unlink Replication Link request. @@ -16011,9 +16192,9 @@ class UpdateLongTermRetentionBackupParameters(msrest.serialization.Model): """Contains the information necessary to perform long term retention backup update operation. :param requested_backup_storage_redundancy: The storage redundancy type of the copied backup. - Possible values include: "Geo", "Local", "Zone". + Possible values include: "Geo", "Local", "Zone", "GeoZone". :type requested_backup_storage_redundancy: str or - ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + ~azure.mgmt.sql.models.BackupStorageRedundancy """ _attribute_map = { @@ -16023,7 +16204,7 @@ class UpdateLongTermRetentionBackupParameters(msrest.serialization.Model): def __init__( self, *, - requested_backup_storage_redundancy: Optional[Union[str, "RequestedBackupStorageRedundancy"]] = None, + requested_backup_storage_redundancy: Optional[Union[str, "BackupStorageRedundancy"]] = None, **kwargs ): super(UpdateLongTermRetentionBackupParameters, self).__init__(**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 a9a95e2d3790..84179809aa20 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 @@ -133,12 +133,13 @@ class AutomaticTuningServerReason(with_metaclass(_CaseInsensitiveEnumMeta, str, AUTO_CONFIGURED = "AutoConfigured" class BackupStorageRedundancy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The storage redundancy type of the copied backup + """The storage account type used to store backups for this database. """ GEO = "Geo" LOCAL = "Local" ZONE = "Zone" + GEO_ZONE = "GeoZone" class BlobAuditingPolicyState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Specifies the state of the audit. If state is Enabled, storageEndpoint or @@ -275,13 +276,12 @@ class CreateMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): RESTORE_LONG_TERM_RETENTION_BACKUP = "RestoreLongTermRetentionBackup" ONLINE_SECONDARY = "OnlineSecondary" -class CurrentBackupStorageRedundancy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The storage account type used to store backups for this database. +class DatabaseIdentityType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The identity type """ - GEO = "Geo" - LOCAL = "Local" - ZONE = "Zone" + NONE = "None" + USER_ASSIGNED = "UserAssigned" class DatabaseLicenseType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The license type to apply for this database. ``LicenseIncluded`` if you need a license, or @@ -331,6 +331,9 @@ class DatabaseStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OFFLINE_CHANGING_DW_PERFORMANCE_TIERS = "OfflineChangingDwPerformanceTiers" ONLINE_CHANGING_DW_PERFORMANCE_TIERS = "OnlineChangingDwPerformanceTiers" DISABLED = "Disabled" + STOPPING = "Stopping" + STOPPED = "Stopped" + STARTING = "Starting" class DataMaskingFunction(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The masking function that is used for the data masking rule. @@ -411,7 +414,7 @@ class EncryptionProtectorName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum CURRENT = "current" -class Enum77(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum60(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ALL = "All" ERROR = "Error" @@ -624,6 +627,15 @@ class ManagedInstancePropertiesProvisioningState(with_metaclass(_CaseInsensitive UNKNOWN = "Unknown" SUCCEEDED = "Succeeded" FAILED = "Failed" + ACCEPTED = "Accepted" + CREATED = "Created" + DELETED = "Deleted" + UNRECOGNIZED = "Unrecognized" + RUNNING = "Running" + CANCELED = "Canceled" + NOT_SPECIFIED = "NotSpecified" + REGISTERING = "Registering" + TIMED_OUT = "TimedOut" class ManagedInstanceProxyOverride(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Connection type used for connecting to the instance. @@ -859,22 +871,6 @@ class ReplicaType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PRIMARY = "Primary" READABLE_SECONDARY = "ReadableSecondary" -class RequestedBackupStorageRedundancy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The storage redundancy type of the copied backup - """ - - GEO = "Geo" - LOCAL = "Local" - ZONE = "Zone" - -class RestorableDroppedDatabasePropertiesBackupStorageRedundancy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The storage account type used to store backups for this database. - """ - - GEO = "Geo" - LOCAL = "Local" - ZONE = "Zone" - class RestoreDetailsName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DEFAULT = "Default" @@ -903,10 +899,6 @@ class SecondaryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): class SecurityAlertPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - DEFAULT = "default" - -class SecurityAlertPolicyNameAutoGenerated(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - DEFAULT = "Default" class SecurityAlertPolicyState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -957,8 +949,8 @@ class ServerConnectionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """ DEFAULT = "Default" - PROXY = "Proxy" REDIRECT = "Redirect" + PROXY = "Proxy" class ServerKeyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The encryption protector type like 'ServiceManaged', 'AzureKeyVault'. @@ -1058,6 +1050,13 @@ class ServiceObjectiveName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DS2000 = "DS2000" ELASTIC_POOL = "ElasticPool" +class ServicePrincipalType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Service principal type. + """ + + NONE = "None" + SYSTEM_ASSIGNED = "SystemAssigned" + class ShortTermRetentionPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DEFAULT = "default" @@ -1069,15 +1068,6 @@ class SqlAgentConfigurationPropertiesState(with_metaclass(_CaseInsensitiveEnumMe ENABLED = "Enabled" DISABLED = "Disabled" -class StorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The storage account type used to store backups for this instance. The options are LRS - (LocallyRedundantStorage), ZRS (ZoneRedundantStorage) and GRS (GeoRedundantStorage) - """ - - GRS = "GRS" - LRS = "LRS" - ZRS = "ZRS" - class StorageCapabilityStorageAccountType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The storage account type for the database's backups. """ @@ -1173,21 +1163,6 @@ class TableTemporalType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): HISTORY_TABLE = "HistoryTable" SYSTEM_VERSIONED_TEMPORAL_TABLE = "SystemVersionedTemporalTable" -class TargetBackupStorageRedundancy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The storage redundancy type of the copied backup - """ - - GEO = "Geo" - LOCAL = "Local" - ZONE = "Zone" - -class TransparentDataEncryptionActivityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the database. - """ - - ENCRYPTING = "Encrypting" - DECRYPTING = "Decrypting" - class TransparentDataEncryptionName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CURRENT = "current" @@ -1199,13 +1174,6 @@ class TransparentDataEncryptionState(with_metaclass(_CaseInsensitiveEnumMeta, st ENABLED = "Enabled" DISABLED = "Disabled" -class TransparentDataEncryptionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the database transparent data encryption. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - class UnitDefinitionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The unit of the metric. """ 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 92dc7fbad3cb..f990cc3c49ea 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 @@ -7,7 +7,6 @@ # -------------------------------------------------------------------------- from ._recoverable_databases_operations import RecoverableDatabasesOperations -from ._server_connection_policies_operations import ServerConnectionPoliciesOperations from ._data_masking_policies_operations import DataMaskingPoliciesOperations from ._data_masking_rules_operations import DataMaskingRulesOperations from ._geo_backup_policies_operations import GeoBackupPoliciesOperations @@ -18,8 +17,6 @@ from ._service_objectives_operations import ServiceObjectivesOperations from ._elastic_pool_activities_operations import ElasticPoolActivitiesOperations from ._elastic_pool_database_activities_operations import ElasticPoolDatabaseActivitiesOperations -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations -from ._transparent_data_encryption_activities_operations import TransparentDataEncryptionActivitiesOperations from ._server_usages_operations import ServerUsagesOperations from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations @@ -53,8 +50,6 @@ from ._job_target_groups_operations import JobTargetGroupsOperations from ._job_versions_operations import JobVersionsOperations from ._capabilities_operations import CapabilitiesOperations -from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations -from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations from ._long_term_retention_policies_operations import LongTermRetentionPoliciesOperations from ._maintenance_window_options_operations import MaintenanceWindowOptionsOperations from ._maintenance_windows_operations import MaintenanceWindowsOperations @@ -81,7 +76,6 @@ from ._managed_instance_operations_operations import ManagedInstanceOperationsOperations from ._managed_instance_private_endpoint_connections_operations import ManagedInstancePrivateEndpointConnectionsOperations from ._managed_instance_private_link_resources_operations import ManagedInstancePrivateLinkResourcesOperations -from ._managed_instances_operations import ManagedInstancesOperations from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations from ._managed_instance_vulnerability_assessments_operations import ManagedInstanceVulnerabilityAssessmentsOperations from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations @@ -116,20 +110,24 @@ from ._virtual_network_rules_operations import VirtualNetworkRulesOperations from ._workload_classifiers_operations import WorkloadClassifiersOperations from ._workload_groups_operations import WorkloadGroupsOperations +from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from ._database_extensions_operations import DatabaseExtensionsOperations from ._database_operations_operations import DatabaseOperationsOperations from ._database_usages_operations import DatabaseUsagesOperations from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations -from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations -from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations from ._servers_operations import ServersOperations from ._usages_operations import UsagesOperations +from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations +from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations +from ._managed_instances_operations import ManagedInstancesOperations +from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations +from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations +from ._server_connection_policies_operations import ServerConnectionPoliciesOperations __all__ = [ 'RecoverableDatabasesOperations', - 'ServerConnectionPoliciesOperations', 'DataMaskingPoliciesOperations', 'DataMaskingRulesOperations', 'GeoBackupPoliciesOperations', @@ -140,8 +138,6 @@ 'ServiceObjectivesOperations', 'ElasticPoolActivitiesOperations', 'ElasticPoolDatabaseActivitiesOperations', - 'TransparentDataEncryptionsOperations', - 'TransparentDataEncryptionActivitiesOperations', 'ServerUsagesOperations', 'ExtendedDatabaseBlobAuditingPoliciesOperations', 'ExtendedServerBlobAuditingPoliciesOperations', @@ -175,8 +171,6 @@ 'JobTargetGroupsOperations', 'JobVersionsOperations', 'CapabilitiesOperations', - 'LongTermRetentionBackupsOperations', - 'LongTermRetentionManagedInstanceBackupsOperations', 'LongTermRetentionPoliciesOperations', 'MaintenanceWindowOptionsOperations', 'MaintenanceWindowsOperations', @@ -203,7 +197,6 @@ 'ManagedInstanceOperationsOperations', 'ManagedInstancePrivateEndpointConnectionsOperations', 'ManagedInstancePrivateLinkResourcesOperations', - 'ManagedInstancesOperations', 'ManagedInstanceTdeCertificatesOperations', 'ManagedInstanceVulnerabilityAssessmentsOperations', 'ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations', @@ -238,14 +231,19 @@ 'VirtualNetworkRulesOperations', 'WorkloadClassifiersOperations', 'WorkloadGroupsOperations', + 'TransparentDataEncryptionsOperations', 'BackupShortTermRetentionPoliciesOperations', 'DatabaseExtensionsOperations', 'DatabaseOperationsOperations', 'DatabaseUsagesOperations', 'LedgerDigestUploadsOperations', 'OutboundFirewallRulesOperations', - 'RestorableDroppedDatabasesOperations', - 'RestorableDroppedManagedDatabasesOperations', 'ServersOperations', 'UsagesOperations', + 'LongTermRetentionBackupsOperations', + 'LongTermRetentionManagedInstanceBackupsOperations', + 'ManagedInstancesOperations', + 'RestorableDroppedDatabasesOperations', + 'RestorableDroppedManagedDatabasesOperations', + 'ServerConnectionPoliciesOperations', ] 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 e2da69bf04db..6de290589a12 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 @@ -238,7 +238,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -319,7 +319,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -370,7 +370,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -508,7 +508,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -625,7 +625,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -774,7 +774,7 @@ def list_by_elastic_pool( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -841,7 +841,7 @@ def _failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._failover_initial.metadata['url'] # type: ignore @@ -974,7 +974,7 @@ def list_inaccessible_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1039,7 +1039,7 @@ def _pause_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -1165,7 +1165,7 @@ def _resume_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -1291,7 +1291,7 @@ def _upgrade_data_warehouse_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._upgrade_data_warehouse_initial.metadata['url'] # type: ignore @@ -1424,7 +1424,7 @@ def rename( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1475,7 +1475,7 @@ def _import_method_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1611,7 +1611,7 @@ def _export_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py index db8e2947abab..3f74b2164b24 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py @@ -12,7 +12,9 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models @@ -113,7 +115,7 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore - def create_or_update( + def _create_or_update_initial( self, resource_group_name, # type: str server_name, # type: str @@ -123,25 +125,6 @@ def create_or_update( **kwargs # type: Any ): # type: (...) -> Optional["_models.LedgerDigestUploads"] - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -152,7 +135,7 @@ def create_or_update( accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -190,7 +173,91 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + server_name, # type: str + database_name, # type: str + ledger_digest_uploads, # type: Union[str, "_models.LedgerDigestUploadsName"] + parameters, # type: "_models.LedgerDigestUploads" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.LedgerDigestUploads"] + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore def list_by_database( self, @@ -272,7 +339,7 @@ def get_next(next_link=None): ) list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads'} # type: ignore - def disable( + def _disable_initial( self, resource_group_name, # type: str server_name, # type: str @@ -281,23 +348,6 @@ def disable( **kwargs # type: Any ): # type: (...) -> Optional["_models.LedgerDigestUploads"] - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -307,7 +357,7 @@ def disable( accept = "application/json" # Construct URL - url = self.disable.metadata['url'] # type: ignore + url = self._disable_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -341,4 +391,84 @@ def disable( return cls(pipeline_response, deserialized, {}) return deserialized - disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + _disable_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + + def begin_disable( + self, + resource_group_name, # type: str + server_name, # type: str + database_name, # type: str + ledger_digest_uploads, # type: Union[str, "_models.LedgerDigestUploadsName"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.LedgerDigestUploads"] + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._disable_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + 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'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py index 43df1dc67b95..dba1d2b19ac0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_backups_operations.py @@ -62,7 +62,7 @@ def _copy_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -204,7 +204,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -360,7 +360,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -412,7 +412,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -554,7 +554,7 @@ def list_by_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -639,7 +639,7 @@ def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -725,7 +725,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -797,7 +797,7 @@ def _copy_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -947,7 +947,7 @@ def _update_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1114,7 +1114,7 @@ def get_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -1168,7 +1168,7 @@ def _delete_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_by_resource_group_initial.metadata['url'] # type: ignore @@ -1321,7 +1321,7 @@ def list_by_resource_group_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1411,7 +1411,7 @@ def list_by_resource_group_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1502,7 +1502,7 @@ def list_by_resource_group_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py index 28e4f9dc7793..dff4bb682835 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_managed_instance_backups_operations.py @@ -76,7 +76,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -128,7 +128,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -270,7 +270,7 @@ def list_by_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -358,7 +358,7 @@ def list_by_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -442,7 +442,7 @@ def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -530,7 +530,7 @@ def get_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -584,7 +584,7 @@ def _delete_by_resource_group_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_by_resource_group_initial.metadata['url'] # type: ignore @@ -737,7 +737,7 @@ def list_by_resource_group_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -830,7 +830,7 @@ def list_by_resource_group_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -919,7 +919,7 @@ def list_by_resource_group_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 94cad47fbde1..bc5cd0ce1df5 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 @@ -74,7 +74,7 @@ def list_by_instance_pool( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -224,7 +224,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -304,7 +304,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL @@ -355,7 +355,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -486,7 +486,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -596,7 +596,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -759,7 +759,7 @@ def list_by_managed_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -838,7 +838,7 @@ def _failover_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-11-01-preview" + api_version = "2021-05-01-preview" # Construct URL url = self._failover_initial.metadata['url'] # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py index aef6ed163ac5..429162531975 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py @@ -51,7 +51,7 @@ def get( self, resource_group_name, # type: str managed_instance_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] **kwargs # type: Any ): # type: (...) -> "_models.ManagedServerSecurityAlertPolicy" @@ -63,7 +63,7 @@ def get( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ManagedServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy @@ -115,7 +115,7 @@ def _create_or_update_initial( self, resource_group_name, # type: str managed_instance_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ManagedServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -173,7 +173,7 @@ def begin_create_or_update( self, resource_group_name, # type: str managed_instance_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ManagedServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -186,7 +186,7 @@ def begin_create_or_update( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The managed server security alert policy. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py index c2b3053578cb..f219d90bfec4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_databases_operations.py @@ -69,7 +69,7 @@ def list_by_server( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py index 23c987a7d1b7..80ff10df5a50 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restorable_dropped_managed_databases_operations.py @@ -69,7 +69,7 @@ def list_by_instance( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-02-01-preview" + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py index d4c447ec3073..ff6464887389 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py @@ -9,15 +9,18 @@ import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,16 +47,15 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def create_or_update( + def get( self, resource_group_name, # type: str server_name, # type: str connection_policy_name, # type: Union[str, "_models.ConnectionPolicyName"] - parameters, # type: "_models.ServerConnectionPolicy" **kwargs # type: Any ): # type: (...) -> "_models.ServerConnectionPolicy" - """Creates or updates the server's connection policy. + """Gets a server connection policy. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @@ -62,8 +64,6 @@ def create_or_update( :type server_name: str :param connection_policy_name: The name of the connection policy. :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :param parameters: The required parameters for updating a secure connection policy. - :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy :keyword callable cls: A custom type or function that will be passed the direct response :return: ServerConnectionPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy @@ -74,17 +74,16 @@ def create_or_update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-05-01-preview" accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore 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'), 'connectionPolicyName': self._serialize.url("connection_policy_name", connection_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -94,69 +93,49 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'ServerConnectionPolicy') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) + deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore - def get( + def _create_or_update_initial( self, resource_group_name, # type: str server_name, # type: str connection_policy_name, # type: Union[str, "_models.ConnectionPolicyName"] + parameters, # type: "_models.ServerConnectionPolicy" **kwargs # type: Any ): - # type: (...) -> "_models.ServerConnectionPolicy" - """Gets the server's secure connection policy. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param connection_policy_name: The name of the connection policy. - :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: ServerConnectionPolicy, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerConnectionPolicy"] + # type: (...) -> Optional["_models.ServerConnectionPolicy"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServerConnectionPolicy"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" + api_version = "2021-05-01-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self._create_or_update_initial.metadata['url'] # type: ignore 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'), 'connectionPolicyName': self._serialize.url("connection_policy_name", connection_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -166,20 +145,180 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'ServerConnectionPolicy') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + server_name, # type: str + connection_policy_name, # type: Union[str, "_models.ConnectionPolicyName"] + parameters, # type: "_models.ServerConnectionPolicy" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.ServerConnectionPolicy"] + """Updates a server connection policy. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param connection_policy_name: The name of the connection policy. + :type connection_policy_name: str or ~azure.mgmt.sql.models.ConnectionPolicyName + :param parameters: The required parameters for updating a server connection policy. + :type parameters: ~azure.mgmt.sql.models.ServerConnectionPolicy + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either ServerConnectionPolicy or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.ServerConnectionPolicy] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerConnectionPolicy"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + connection_policy_name=connection_policy_name, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ServerConnectionPolicy', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'connectionPolicyName': self._serialize.url("connection_policy_name", connection_policy_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} # type: ignore + + def list_by_server( + self, + resource_group_name, # type: str + server_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.ServerConnectionPolicyListResult"] + """Lists connection policy. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either ServerConnectionPolicyListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.ServerConnectionPolicyListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ServerConnectionPolicyListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-05-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('ServerConnectionPolicyListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py index 34ca09e756df..3534bc825bf3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py @@ -51,7 +51,7 @@ def get( self, resource_group_name, # type: str server_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] **kwargs # type: Any ): # type: (...) -> "_models.ServerSecurityAlertPolicy" @@ -63,7 +63,7 @@ def get( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy @@ -115,7 +115,7 @@ def _create_or_update_initial( self, resource_group_name, # type: str server_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -173,7 +173,7 @@ def begin_create_or_update( self, resource_group_name, # type: str server_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -186,7 +186,7 @@ def begin_create_or_update( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The server security alert policy. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py index a3256265690f..e07c23af964b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py @@ -333,7 +333,7 @@ def list_logs( sync_group_name, # type: str start_time, # type: str end_time, # type: str - type, # type: Union[str, "_models.Enum77"] + type, # type: Union[str, "_models.Enum60"] continuation_token_parameter=None, # type: Optional[str] **kwargs # type: Any ): @@ -354,7 +354,7 @@ def list_logs( :param end_time: Get logs generated before this time. :type end_time: str :param type: The types of logs to retrieve. - :type type: str or ~azure.mgmt.sql.models.Enum77 + :type type: str or ~azure.mgmt.sql.models.Enum60 :param continuation_token_parameter: The continuation token for this operation. :type continuation_token_parameter: str :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py deleted file mode 100644 index ec34c61315c6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class TransparentDataEncryptionActivitiesOperations(object): - """TransparentDataEncryptionActivitiesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.sql.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_configuration( - self, - resource_group_name, # type: str - server_name, # type: str - database_name, # type: str - transparent_data_encryption_name, # type: Union[str, "_models.TransparentDataEncryptionName"] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.TransparentDataEncryptionActivityListResult"] - """Returns a database's transparent data encryption operation result. - - :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 for which the transparent data encryption - applies. - :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TransparentDataEncryptionActivityListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.TransparentDataEncryptionActivityListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryptionActivityListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_configuration.metadata['url'] # type: ignore - 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'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('TransparentDataEncryptionActivityListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py index df0ecaabf571..ff414142d1c4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py @@ -9,6 +9,7 @@ import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -17,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,54 +45,48 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def create_or_update( + def get( self, resource_group_name, # type: str server_name, # type: str database_name, # type: str - transparent_data_encryption_name, # type: Union[str, "_models.TransparentDataEncryptionName"] - parameters, # type: "_models.TransparentDataEncryption" + tde_name, # type: Union[str, "_models.TransparentDataEncryptionName"] **kwargs # type: Any ): - # type: (...) -> "_models.TransparentDataEncryption" - """Creates or updates a database's transparent data encryption configuration. + # type: (...) -> "_models.LogicalDatabaseTransparentDataEncryption" + """Gets a logical database's transparent data encryption. :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 for which setting the transparent data - encryption applies. + :param database_name: The name of the logical database for which the transparent data + encryption is defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The required parameters for creating or updating transparent data - encryption. - :type parameters: ~azure.mgmt.sql.models.TransparentDataEncryption + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryption"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-02-01-preview" accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore 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'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -101,75 +96,70 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TransparentDataEncryption') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore - def get( + def create_or_update( self, resource_group_name, # type: str server_name, # type: str database_name, # type: str - transparent_data_encryption_name, # type: Union[str, "_models.TransparentDataEncryptionName"] + tde_name, # type: Union[str, "_models.TransparentDataEncryptionName"] + parameters, # type: "_models.LogicalDatabaseTransparentDataEncryption" **kwargs # type: Any ): - # type: (...) -> "_models.TransparentDataEncryption" - """Gets a database's transparent data encryption configuration. + # type: (...) -> Optional["_models.LogicalDatabaseTransparentDataEncryption"] + """Updates a logical database's transparent data encryption configuration. :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 for which the transparent data encryption - applies. + :param database_name: The name of the logical database for which the security alert policy is + defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogicalDatabaseTransparentDataEncryption"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create_or_update.metadata['url'] # type: ignore 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'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -179,20 +169,110 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LogicalDatabaseTransparentDataEncryption') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore + + def list_by_database( + self, + resource_group_name, # type: str + server_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LogicalDatabaseTransparentDataEncryptionListResult"] + """Gets a list of the logical database's transparent data encryption. + + :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 logical database for which the transparent data + encryption is defined. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LogicalDatabaseTransparentDataEncryptionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] # type: ignore + 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 = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption'} # type: ignore