From 9a6393b8fc68fa5122ec9f8fbc0dae94bdca93fb Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 6 May 2021 18:22:46 +0000 Subject: [PATCH] CodeGen from PR 13942 in Azure/azure-rest-api-specs Merge 4edcbf4ec7d4f46bc876e36e9b92fb2c7a8410f9 into 66077cad784e12c96d940c4fba6a0e34c54f9ea1 --- sdk/sql/azure-mgmt-sql/MANIFEST.in | 1 + sdk/sql/azure-mgmt-sql/_meta.json | 8 + .../azure/mgmt/sql/_sql_management_client.py | 647 ++- .../azure/mgmt/sql/models/__init__.py | 641 ++- .../azure/mgmt/sql/models/_models.py | 4566 +++++++++------- .../azure/mgmt/sql/models/_models_py3.py | 4640 ++++++++++------- .../azure/mgmt/sql/models/_paged_models.py | 673 +-- .../models/_sql_management_client_enums.py | 878 ++-- .../azure/mgmt/sql/operations/__init__.py | 300 +- ...hort_term_retention_policies_operations.py | 4 +- .../operations/_capabilities_operations.py | 4 +- ...a_warehouse_user_activities_operations.py} | 53 +- ...ns.py => _database_advisors_operations.py} | 149 +- .../_database_automatic_tuning_operations.py | 4 +- ...abase_blob_auditing_policies_operations.py | 4 +- ...ons.py => _database_columns_operations.py} | 230 +- .../_database_extensions_operations.py | 294 ++ .../sql/operations/_database_operations.py | 4 +- ...database_recommended_actions_operations.py | 264 + ...ons.py => _database_schemas_operations.py} | 169 +- ...ase_security_alert_policies_operations.py} | 108 +- ...ions.py => _database_tables_operations.py} | 188 +- .../operations/_database_usages_operations.py | 10 +- ...ty_assessment_rule_baselines_operations.py | 4 +- ...lnerability_assessment_scans_operations.py | 186 +- ...se_vulnerability_assessments_operations.py | 4 +- .../sql/operations/_databases_operations.py | 591 +-- .../operations/_deleted_servers_operations.py | 334 ++ ...tic_pool_database_activities_operations.py | 117 - .../operations/_elastic_pool_operations.py | 4 +- .../operations/_elastic_pools_operations.py | 192 +- .../_encryption_protectors_operations.py | 187 +- ...abase_blob_auditing_policies_operations.py | 4 +- ...erver_blob_auditing_policies_operations.py | 4 +- .../operations/_failover_groups_operations.py | 4 +- .../operations/_firewall_rules_operations.py | 186 +- .../_instance_failover_groups_operations.py | 4 +- .../operations/_instance_pools_operations.py | 4 +- .../sql/operations/_job_agents_operations.py | 4 +- .../operations/_job_credentials_operations.py | 4 +- .../operations/_job_executions_operations.py | 20 +- .../_job_step_executions_operations.py | 12 +- .../sql/operations/_job_steps_operations.py | 4 +- .../_job_target_executions_operations.py | 20 +- .../_job_target_groups_operations.py | 4 +- .../operations/_job_versions_operations.py | 4 +- .../mgmt/sql/operations/_jobs_operations.py | 4 +- .../_ledger_digest_uploads_operations.py | 332 ++ ..._long_term_retention_backups_operations.py | 628 ++- ...ion_managed_instance_backups_operations.py | 16 +- ...ong_term_retention_policies_operations.py} | 128 +- .../_maintenance_window_options_operations.py | 111 + ....py => _maintenance_windows_operations.py} | 75 +- ...hort_term_retention_policies_operations.py | 4 +- .../_managed_database_columns_operations.py | 301 ++ .../_managed_database_queries_operations.py | 202 + ...commended_sensitivity_labels_operations.py | 108 + ...ged_database_restore_details_operations.py | 4 +- .../_managed_database_schemas_operations.py | 191 + ...base_security_alert_policies_operations.py | 4 +- ...ed_database_security_events_operations.py} | 58 +- ..._database_sensitivity_labels_operations.py | 91 +- .../_managed_database_tables_operations.py | 197 + ..._transparent_data_encryption_operations.py | 270 + ...ty_assessment_rule_baselines_operations.py | 4 +- ...lnerability_assessment_scans_operations.py | 306 +- ...se_vulnerability_assessments_operations.py | 4 +- .../_managed_databases_operations.py | 4 +- ...aged_instance_administrators_operations.py | 6 +- ...zure_ad_only_authentications_operations.py | 4 +- ...stance_encryption_protectors_operations.py | 22 +- .../_managed_instance_keys_operations.py | 4 +- ...long_term_retention_policies_operations.py | 4 +- .../_managed_instance_operations.py | 120 +- ...private_endpoint_connections_operations.py | 388 ++ ...ance_private_link_resources_operations.py} | 165 +- ...ed_instance_tde_certificates_operations.py | 4 +- ...ce_vulnerability_assessments_operations.py | 4 +- .../_managed_instances_operations.py | 158 +- ...hort_term_retention_policies_operations.py | 8 +- ...rver_security_alert_policies_operations.py | 4 +- .../azure/mgmt/sql/operations/_operations.py | 4 +- ...ns.py => _operations_health_operations.py} | 44 +- ...=> _outbound_firewall_rules_operations.py} | 219 +- ...private_endpoint_connections_operations.py | 4 +- .../_private_link_resources_operations.py | 4 +- ...commended_sensitivity_labels_operations.py | 108 + ...ecoverable_managed_databases_operations.py | 4 +- .../_replication_links_operations.py | 425 +- ...restorable_dropped_databases_operations.py | 143 +- ...le_dropped_managed_databases_operations.py | 4 +- .../operations/_restore_points_operations.py | 4 +- .../_sensitivity_labels_operations.py | 91 +- .../operations/_server_advisors_operations.py | 251 + .../_server_automatic_tuning_operations.py | 4 +- ...rver_azure_ad_administrators_operations.py | 20 +- ...zure_ad_only_authentications_operations.py | 4 +- ...erver_blob_auditing_policies_operations.py | 4 +- ...erver_dev_ops_audit_settings_operations.py | 4 +- .../_server_dns_aliases_operations.py | 42 +- .../sql/operations/_server_keys_operations.py | 26 +- ...es_operations.py => _server_operations.py} | 22 +- ...rver_security_alert_policies_operations.py | 4 +- .../_server_trust_groups_operations.py | 4 +- ...er_vulnerability_assessments_operations.py | 4 +- .../sql/operations/_servers_operations.py | 125 +- ...operations.py => _sql_agent_operations.py} | 87 +- .../_subscription_usages_operations.py | 4 +- .../sql/operations/_sync_agents_operations.py | 4 +- .../sql/operations/_sync_groups_operations.py | 4 +- .../operations/_sync_members_operations.py | 4 +- .../_tde_certificates_operations.py | 4 +- .../sql/operations/_time_zones_operations.py | 170 + ...transparent_data_encryptions_operations.py | 172 +- .../mgmt/sql/operations/_usages_operations.py | 4 +- .../_virtual_clusters_operations.py | 86 +- .../_virtual_network_rules_operations.py | 4 +- .../_workload_classifiers_operations.py | 4 +- .../operations/_workload_groups_operations.py | 4 +- 119 files changed, 13800 insertions(+), 7988 deletions(-) create mode 100644 sdk/sql/azure-mgmt-sql/_meta.json rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_recoverable_databases_operations.py => _data_warehouse_user_activities_operations.py} (75%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_data_masking_policies_operations.py => _database_advisors_operations.py} (55%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_recommended_elastic_pools_operations.py => _database_columns_operations.py} (64%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_service_tier_advisors_operations.py => _database_schemas_operations.py} (81%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_geo_backup_policies_operations.py => _database_security_alert_policies_operations.py} (77%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_data_masking_rules_operations.py => _database_tables_operations.py} (69%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_backup_long_term_retention_policies_operations.py => _long_term_retention_policies_operations.py} (75%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_database_threat_detection_policies_operations.py => _maintenance_windows_operations.py} (72%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_transparent_data_encryption_activities_operations.py => _managed_database_security_events_operations.py} (62%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_service_objectives_operations.py => _managed_instance_private_link_resources_operations.py} (73%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_elastic_pool_activities_operations.py => _operations_health_operations.py} (66%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_server_communication_links_operations.py => _outbound_firewall_rules_operations.py} (72%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_server_usages_operations.py => _server_operations.py} (87%) rename sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/{_server_connection_policies_operations.py => _sql_agent_operations.py} (70%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py diff --git a/sdk/sql/azure-mgmt-sql/MANIFEST.in b/sdk/sql/azure-mgmt-sql/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/sql/azure-mgmt-sql/MANIFEST.in +++ b/sdk/sql/azure-mgmt-sql/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json new file mode 100644 index 000000000000..813583a9354c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "V2", + "use": "@microsoft.azure/autorest.python@~4.0.71", + "commit": "fe7906c146a3a87c2602048cb32f63c9f39ad20a", + "repository_url": "https://github.com/Azure/azure-rest-api-specs", + "autorest_command": "autorest specification/sql/resource-manager/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --use=@microsoft.azure/autorest.python@~4.0.71 --version=V2", + "readme": "specification/sql/resource-manager/readme.md" +} \ 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 29c37824309d..3585bc84beaf 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 @@ -13,42 +13,34 @@ from msrest import Serializer, Deserializer from ._configuration import SqlManagementClientConfiguration -from .operations import RecoverableDatabasesOperations -from .operations import RestorableDroppedDatabasesOperations -from .operations import ServerConnectionPoliciesOperations -from .operations import DatabaseThreatDetectionPoliciesOperations -from .operations import DataMaskingPoliciesOperations -from .operations import DataMaskingRulesOperations -from .operations import FirewallRulesOperations -from .operations import GeoBackupPoliciesOperations -from .operations import DatabasesOperations -from .operations import ElasticPoolsOperations -from .operations import RecommendedElasticPoolsOperations -from .operations import ReplicationLinksOperations -from .operations import ServerCommunicationLinksOperations -from .operations import ServiceObjectivesOperations -from .operations import ElasticPoolActivitiesOperations -from .operations import ElasticPoolDatabaseActivitiesOperations -from .operations import ServiceTierAdvisorsOperations -from .operations import TransparentDataEncryptionsOperations -from .operations import TransparentDataEncryptionActivitiesOperations -from .operations import ServerUsagesOperations -from .operations import DatabaseUsagesOperations -from .operations import DatabaseAutomaticTuningOperations -from .operations import EncryptionProtectorsOperations -from .operations import FailoverGroupsOperations -from .operations import Operations -from .operations import ServerKeysOperations -from .operations import SyncAgentsOperations -from .operations import SubscriptionUsagesOperations -from .operations import VirtualClustersOperations -from .operations import VirtualNetworkRulesOperations +from .operations import BackupShortTermRetentionPoliciesOperations from .operations import ExtendedDatabaseBlobAuditingPoliciesOperations from .operations import ExtendedServerBlobAuditingPoliciesOperations from .operations import ServerBlobAuditingPoliciesOperations from .operations import DatabaseBlobAuditingPoliciesOperations +from .operations import DatabaseAdvisorsOperations +from .operations import DatabaseAutomaticTuningOperations +from .operations import DatabaseColumnsOperations +from .operations import DatabaseExtensionsOperations +from .operations import DatabaseOperations +from .operations import DatabaseRecommendedActionsOperations +from .operations import DatabasesOperations +from .operations import DatabaseSchemasOperations +from .operations import DatabaseSecurityAlertPoliciesOperations +from .operations import DatabaseTablesOperations +from .operations import DatabaseUsagesOperations from .operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations from .operations import DatabaseVulnerabilityAssessmentsOperations +from .operations import DatabaseVulnerabilityAssessmentScansOperations +from .operations import DataWarehouseUserActivitiesOperations +from .operations import DeletedServersOperations +from .operations import ElasticPoolOperations +from .operations import ElasticPoolsOperations +from .operations import EncryptionProtectorsOperations +from .operations import FailoverGroupsOperations +from .operations import FirewallRulesOperations +from .operations import InstanceFailoverGroupsOperations +from .operations import InstancePoolsOperations from .operations import JobAgentsOperations from .operations import JobCredentialsOperations from .operations import JobExecutionsOperations @@ -58,56 +50,78 @@ from .operations import JobTargetExecutionsOperations from .operations import JobTargetGroupsOperations from .operations import JobVersionsOperations +from .operations import LedgerDigestUploadsOperations +from .operations import CapabilitiesOperations from .operations import LongTermRetentionBackupsOperations -from .operations import BackupLongTermRetentionPoliciesOperations +from .operations import LongTermRetentionManagedInstanceBackupsOperations +from .operations import LongTermRetentionPoliciesOperations +from .operations import MaintenanceWindowOptionsOperations +from .operations import MaintenanceWindowsOperations from .operations import ManagedBackupShortTermRetentionPoliciesOperations -from .operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations -from .operations import ServerAutomaticTuningOperations -from .operations import ServerDnsAliasesOperations -from .operations import ServerSecurityAlertPoliciesOperations -from .operations import RestorableDroppedManagedDatabasesOperations -from .operations import RestorePointsOperations +from .operations import ManagedDatabaseColumnsOperations +from .operations import ManagedDatabaseQueriesOperations +from .operations import ManagedDatabaseRestoreDetailsOperations +from .operations import ManagedDatabasesOperations +from .operations import ManagedDatabaseSchemasOperations from .operations import ManagedDatabaseSecurityAlertPoliciesOperations -from .operations import ManagedServerSecurityAlertPoliciesOperations -from .operations import SensitivityLabelsOperations -from .operations import ManagedInstanceAdministratorsOperations -from .operations import DatabaseOperations -from .operations import ElasticPoolOperations -from .operations import DatabaseVulnerabilityAssessmentScansOperations +from .operations import ManagedDatabaseSecurityEventsOperations +from .operations import ManagedDatabaseSensitivityLabelsOperations +from .operations import ManagedDatabaseRecommendedSensitivityLabelsOperations +from .operations import ManagedDatabaseTablesOperations +from .operations import ManagedDatabaseTransparentDataEncryptionOperations from .operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations -from .operations import ManagedDatabaseVulnerabilityAssessmentScansOperations from .operations import ManagedDatabaseVulnerabilityAssessmentsOperations -from .operations import InstanceFailoverGroupsOperations -from .operations import TdeCertificatesOperations -from .operations import ManagedInstanceTdeCertificatesOperations -from .operations import ManagedInstanceKeysOperations +from .operations import ManagedDatabaseVulnerabilityAssessmentScansOperations +from .operations import ManagedInstanceAdministratorsOperations +from .operations import ManagedInstanceAzureADOnlyAuthenticationsOperations from .operations import ManagedInstanceEncryptionProtectorsOperations -from .operations import RecoverableManagedDatabasesOperations -from .operations import BackupShortTermRetentionPoliciesOperations +from .operations import ManagedInstanceKeysOperations +from .operations import ManagedInstanceLongTermRetentionPoliciesOperations +from .operations import ManagedInstanceOperations +from .operations import ManagedInstancePrivateEndpointConnectionsOperations +from .operations import ManagedInstancePrivateLinkResourcesOperations +from .operations import ManagedInstancesOperations +from .operations import ManagedInstanceTdeCertificatesOperations from .operations import ManagedInstanceVulnerabilityAssessmentsOperations -from .operations import ServerVulnerabilityAssessmentsOperations -from .operations import ManagedDatabaseSensitivityLabelsOperations -from .operations import InstancePoolsOperations -from .operations import UsagesOperations +from .operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations +from .operations import ManagedServerSecurityAlertPoliciesOperations +from .operations import Operations +from .operations import OperationsHealthOperations +from .operations import OutboundFirewallRulesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations -from .operations import ServersOperations -from .operations import CapabilitiesOperations -from .operations import LongTermRetentionManagedInstanceBackupsOperations -from .operations import ManagedInstanceLongTermRetentionPoliciesOperations -from .operations import WorkloadGroupsOperations -from .operations import WorkloadClassifiersOperations -from .operations import ManagedInstanceOperations +from .operations import RecoverableManagedDatabasesOperations +from .operations import ReplicationLinksOperations +from .operations import RestorableDroppedDatabasesOperations +from .operations import RestorableDroppedManagedDatabasesOperations +from .operations import RestorePointsOperations +from .operations import SensitivityLabelsOperations +from .operations import RecommendedSensitivityLabelsOperations +from .operations import ServerAdvisorsOperations +from .operations import ServerAutomaticTuningOperations from .operations import ServerAzureADAdministratorsOperations -from .operations import SyncGroupsOperations -from .operations import SyncMembersOperations -from .operations import ManagedDatabasesOperations -from .operations import ManagedDatabaseRestoreDetailsOperations from .operations import ServerAzureADOnlyAuthenticationsOperations -from .operations import ManagedInstancesOperations -from .operations import ManagedInstanceAzureADOnlyAuthenticationsOperations -from .operations import ServerTrustGroupsOperations from .operations import ServerDevOpsAuditSettingsOperations +from .operations import ServerDnsAliasesOperations +from .operations import ServerKeysOperations +from .operations import ServerOperations +from .operations import ServersOperations +from .operations import ServerSecurityAlertPoliciesOperations +from .operations import ServerTrustGroupsOperations +from .operations import ServerVulnerabilityAssessmentsOperations +from .operations import SqlAgentOperations +from .operations import SubscriptionUsagesOperations +from .operations import SyncAgentsOperations +from .operations import SyncGroupsOperations +from .operations import SyncMembersOperations +from .operations import TdeCertificatesOperations +from .operations import TimeZonesOperations +from .operations import TransparentDataEncryptionsOperations +from .operations import UsagesOperations +from .operations import VirtualClustersOperations +from .operations import VirtualNetworkRulesOperations +from .operations import WorkloadClassifiersOperations +from .operations import WorkloadGroupsOperations from . import models @@ -117,66 +131,8 @@ class SqlManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: SqlManagementClientConfiguration - :ivar recoverable_databases: RecoverableDatabases operations - :vartype recoverable_databases: azure.mgmt.sql.operations.RecoverableDatabasesOperations - :ivar restorable_dropped_databases: RestorableDroppedDatabases operations - :vartype restorable_dropped_databases: azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations - :ivar server_connection_policies: ServerConnectionPolicies operations - :vartype server_connection_policies: azure.mgmt.sql.operations.ServerConnectionPoliciesOperations - :ivar database_threat_detection_policies: DatabaseThreatDetectionPolicies operations - :vartype database_threat_detection_policies: azure.mgmt.sql.operations.DatabaseThreatDetectionPoliciesOperations - :ivar data_masking_policies: DataMaskingPolicies operations - :vartype data_masking_policies: azure.mgmt.sql.operations.DataMaskingPoliciesOperations - :ivar data_masking_rules: DataMaskingRules operations - :vartype data_masking_rules: azure.mgmt.sql.operations.DataMaskingRulesOperations - :ivar firewall_rules: FirewallRules operations - :vartype firewall_rules: azure.mgmt.sql.operations.FirewallRulesOperations - :ivar geo_backup_policies: GeoBackupPolicies operations - :vartype geo_backup_policies: azure.mgmt.sql.operations.GeoBackupPoliciesOperations - :ivar databases: Databases operations - :vartype databases: azure.mgmt.sql.operations.DatabasesOperations - :ivar elastic_pools: ElasticPools operations - :vartype elastic_pools: azure.mgmt.sql.operations.ElasticPoolsOperations - :ivar recommended_elastic_pools: RecommendedElasticPools operations - :vartype recommended_elastic_pools: azure.mgmt.sql.operations.RecommendedElasticPoolsOperations - :ivar replication_links: ReplicationLinks operations - :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations - :ivar server_communication_links: ServerCommunicationLinks operations - :vartype server_communication_links: azure.mgmt.sql.operations.ServerCommunicationLinksOperations - :ivar service_objectives: ServiceObjectives operations - :vartype service_objectives: azure.mgmt.sql.operations.ServiceObjectivesOperations - :ivar elastic_pool_activities: ElasticPoolActivities operations - :vartype elastic_pool_activities: azure.mgmt.sql.operations.ElasticPoolActivitiesOperations - :ivar elastic_pool_database_activities: ElasticPoolDatabaseActivities operations - :vartype elastic_pool_database_activities: azure.mgmt.sql.operations.ElasticPoolDatabaseActivitiesOperations - :ivar service_tier_advisors: ServiceTierAdvisors operations - :vartype service_tier_advisors: azure.mgmt.sql.operations.ServiceTierAdvisorsOperations - :ivar transparent_data_encryptions: TransparentDataEncryptions operations - :vartype transparent_data_encryptions: azure.mgmt.sql.operations.TransparentDataEncryptionsOperations - :ivar transparent_data_encryption_activities: TransparentDataEncryptionActivities operations - :vartype transparent_data_encryption_activities: azure.mgmt.sql.operations.TransparentDataEncryptionActivitiesOperations - :ivar server_usages: ServerUsages operations - :vartype server_usages: azure.mgmt.sql.operations.ServerUsagesOperations - :ivar database_usages: DatabaseUsages operations - :vartype database_usages: azure.mgmt.sql.operations.DatabaseUsagesOperations - :ivar database_automatic_tuning: DatabaseAutomaticTuning operations - :vartype database_automatic_tuning: azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations - :ivar encryption_protectors: EncryptionProtectors operations - :vartype encryption_protectors: azure.mgmt.sql.operations.EncryptionProtectorsOperations - :ivar failover_groups: FailoverGroups operations - :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations - :ivar operations: Operations operations - :vartype operations: azure.mgmt.sql.operations.Operations - :ivar server_keys: ServerKeys operations - :vartype server_keys: azure.mgmt.sql.operations.ServerKeysOperations - :ivar sync_agents: SyncAgents operations - :vartype sync_agents: azure.mgmt.sql.operations.SyncAgentsOperations - :ivar subscription_usages: SubscriptionUsages operations - :vartype subscription_usages: azure.mgmt.sql.operations.SubscriptionUsagesOperations - :ivar virtual_clusters: VirtualClusters operations - :vartype virtual_clusters: azure.mgmt.sql.operations.VirtualClustersOperations - :ivar virtual_network_rules: VirtualNetworkRules operations - :vartype virtual_network_rules: azure.mgmt.sql.operations.VirtualNetworkRulesOperations + :ivar backup_short_term_retention_policies: BackupShortTermRetentionPolicies operations + :vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPolicies operations :vartype extended_database_blob_auditing_policies: azure.mgmt.sql.operations.ExtendedDatabaseBlobAuditingPoliciesOperations :ivar extended_server_blob_auditing_policies: ExtendedServerBlobAuditingPolicies operations @@ -185,10 +141,52 @@ class SqlManagementClient(SDKClient): :vartype server_blob_auditing_policies: azure.mgmt.sql.operations.ServerBlobAuditingPoliciesOperations :ivar database_blob_auditing_policies: DatabaseBlobAuditingPolicies operations :vartype database_blob_auditing_policies: azure.mgmt.sql.operations.DatabaseBlobAuditingPoliciesOperations + :ivar database_advisors: DatabaseAdvisors operations + :vartype database_advisors: azure.mgmt.sql.operations.DatabaseAdvisorsOperations + :ivar database_automatic_tuning: DatabaseAutomaticTuning operations + :vartype database_automatic_tuning: azure.mgmt.sql.operations.DatabaseAutomaticTuningOperations + :ivar database_columns: DatabaseColumns operations + :vartype database_columns: azure.mgmt.sql.operations.DatabaseColumnsOperations + :ivar database_extensions: DatabaseExtensions operations + :vartype database_extensions: azure.mgmt.sql.operations.DatabaseExtensionsOperations + :ivar database_operations: DatabaseOperations operations + :vartype database_operations: azure.mgmt.sql.operations.DatabaseOperations + :ivar database_recommended_actions: DatabaseRecommendedActions operations + :vartype database_recommended_actions: azure.mgmt.sql.operations.DatabaseRecommendedActionsOperations + :ivar databases: Databases operations + :vartype databases: azure.mgmt.sql.operations.DatabasesOperations + :ivar database_schemas: DatabaseSchemas operations + :vartype database_schemas: azure.mgmt.sql.operations.DatabaseSchemasOperations + :ivar database_security_alert_policies: DatabaseSecurityAlertPolicies operations + :vartype database_security_alert_policies: azure.mgmt.sql.operations.DatabaseSecurityAlertPoliciesOperations + :ivar database_tables: DatabaseTables operations + :vartype database_tables: azure.mgmt.sql.operations.DatabaseTablesOperations + :ivar database_usages: DatabaseUsages operations + :vartype database_usages: azure.mgmt.sql.operations.DatabaseUsagesOperations :ivar database_vulnerability_assessment_rule_baselines: DatabaseVulnerabilityAssessmentRuleBaselines operations :vartype database_vulnerability_assessment_rule_baselines: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentRuleBaselinesOperations :ivar database_vulnerability_assessments: DatabaseVulnerabilityAssessments operations :vartype database_vulnerability_assessments: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentsOperations + :ivar database_vulnerability_assessment_scans: DatabaseVulnerabilityAssessmentScans operations + :vartype database_vulnerability_assessment_scans: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar data_warehouse_user_activities: DataWarehouseUserActivities operations + :vartype data_warehouse_user_activities: azure.mgmt.sql.operations.DataWarehouseUserActivitiesOperations + :ivar deleted_servers: DeletedServers operations + :vartype deleted_servers: azure.mgmt.sql.operations.DeletedServersOperations + :ivar elastic_pool_operations: ElasticPoolOperations operations + :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperations + :ivar elastic_pools: ElasticPools operations + :vartype elastic_pools: azure.mgmt.sql.operations.ElasticPoolsOperations + :ivar encryption_protectors: EncryptionProtectors operations + :vartype encryption_protectors: azure.mgmt.sql.operations.EncryptionProtectorsOperations + :ivar failover_groups: FailoverGroups operations + :vartype failover_groups: azure.mgmt.sql.operations.FailoverGroupsOperations + :ivar firewall_rules: FirewallRules operations + :vartype firewall_rules: azure.mgmt.sql.operations.FirewallRulesOperations + :ivar instance_failover_groups: InstanceFailoverGroups operations + :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations + :ivar instance_pools: InstancePools operations + :vartype instance_pools: azure.mgmt.sql.operations.InstancePoolsOperations :ivar job_agents: JobAgents operations :vartype job_agents: azure.mgmt.sql.operations.JobAgentsOperations :ivar job_credentials: JobCredentials operations @@ -207,106 +205,150 @@ class SqlManagementClient(SDKClient): :vartype job_target_groups: azure.mgmt.sql.operations.JobTargetGroupsOperations :ivar job_versions: JobVersions operations :vartype job_versions: azure.mgmt.sql.operations.JobVersionsOperations + :ivar ledger_digest_uploads: LedgerDigestUploads operations + :vartype ledger_digest_uploads: azure.mgmt.sql.operations.LedgerDigestUploadsOperations + :ivar capabilities: Capabilities operations + :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations :ivar long_term_retention_backups: LongTermRetentionBackups operations :vartype long_term_retention_backups: azure.mgmt.sql.operations.LongTermRetentionBackupsOperations - :ivar backup_long_term_retention_policies: BackupLongTermRetentionPolicies operations - :vartype backup_long_term_retention_policies: azure.mgmt.sql.operations.BackupLongTermRetentionPoliciesOperations + :ivar long_term_retention_managed_instance_backups: LongTermRetentionManagedInstanceBackups operations + :vartype long_term_retention_managed_instance_backups: azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations + :ivar long_term_retention_policies: LongTermRetentionPolicies operations + :vartype long_term_retention_policies: azure.mgmt.sql.operations.LongTermRetentionPoliciesOperations + :ivar maintenance_window_options: MaintenanceWindowOptions operations + :vartype maintenance_window_options: azure.mgmt.sql.operations.MaintenanceWindowOptionsOperations + :ivar maintenance_windows: MaintenanceWindows operations + :vartype maintenance_windows: azure.mgmt.sql.operations.MaintenanceWindowsOperations :ivar managed_backup_short_term_retention_policies: ManagedBackupShortTermRetentionPolicies operations :vartype managed_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedBackupShortTermRetentionPoliciesOperations - :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies operations - :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations - :ivar server_automatic_tuning: ServerAutomaticTuning operations - :vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations - :ivar server_dns_aliases: ServerDnsAliases operations - :vartype server_dns_aliases: azure.mgmt.sql.operations.ServerDnsAliasesOperations - :ivar server_security_alert_policies: ServerSecurityAlertPolicies operations - :vartype server_security_alert_policies: azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations - :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabases operations - :vartype restorable_dropped_managed_databases: azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations - :ivar restore_points: RestorePoints operations - :vartype restore_points: azure.mgmt.sql.operations.RestorePointsOperations + :ivar managed_database_columns: ManagedDatabaseColumns operations + :vartype managed_database_columns: azure.mgmt.sql.operations.ManagedDatabaseColumnsOperations + :ivar managed_database_queries: ManagedDatabaseQueries operations + :vartype managed_database_queries: azure.mgmt.sql.operations.ManagedDatabaseQueriesOperations + :ivar managed_database_restore_details: ManagedDatabaseRestoreDetails operations + :vartype managed_database_restore_details: azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations + :ivar managed_databases: ManagedDatabases operations + :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations + :ivar managed_database_schemas: ManagedDatabaseSchemas operations + :vartype managed_database_schemas: azure.mgmt.sql.operations.ManagedDatabaseSchemasOperations :ivar managed_database_security_alert_policies: ManagedDatabaseSecurityAlertPolicies operations :vartype managed_database_security_alert_policies: azure.mgmt.sql.operations.ManagedDatabaseSecurityAlertPoliciesOperations - :ivar managed_server_security_alert_policies: ManagedServerSecurityAlertPolicies operations - :vartype managed_server_security_alert_policies: azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations - :ivar sensitivity_labels: SensitivityLabels operations - :vartype sensitivity_labels: azure.mgmt.sql.operations.SensitivityLabelsOperations - :ivar managed_instance_administrators: ManagedInstanceAdministrators operations - :vartype managed_instance_administrators: azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations - :ivar database_operations: DatabaseOperations operations - :vartype database_operations: azure.mgmt.sql.operations.DatabaseOperations - :ivar elastic_pool_operations: ElasticPoolOperations operations - :vartype elastic_pool_operations: azure.mgmt.sql.operations.ElasticPoolOperations - :ivar database_vulnerability_assessment_scans: DatabaseVulnerabilityAssessmentScans operations - :vartype database_vulnerability_assessment_scans: azure.mgmt.sql.operations.DatabaseVulnerabilityAssessmentScansOperations + :ivar managed_database_security_events: ManagedDatabaseSecurityEvents operations + :vartype managed_database_security_events: azure.mgmt.sql.operations.ManagedDatabaseSecurityEventsOperations + :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabels operations + :vartype managed_database_sensitivity_labels: azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations + :ivar managed_database_recommended_sensitivity_labels: ManagedDatabaseRecommendedSensitivityLabels operations + :vartype managed_database_recommended_sensitivity_labels: azure.mgmt.sql.operations.ManagedDatabaseRecommendedSensitivityLabelsOperations + :ivar managed_database_tables: ManagedDatabaseTables operations + :vartype managed_database_tables: azure.mgmt.sql.operations.ManagedDatabaseTablesOperations + :ivar managed_database_transparent_data_encryption: ManagedDatabaseTransparentDataEncryption operations + :vartype managed_database_transparent_data_encryption: azure.mgmt.sql.operations.ManagedDatabaseTransparentDataEncryptionOperations :ivar managed_database_vulnerability_assessment_rule_baselines: ManagedDatabaseVulnerabilityAssessmentRuleBaselines operations :vartype managed_database_vulnerability_assessment_rule_baselines: azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations - :ivar managed_database_vulnerability_assessment_scans: ManagedDatabaseVulnerabilityAssessmentScans operations - :vartype managed_database_vulnerability_assessment_scans: azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations :ivar managed_database_vulnerability_assessments: ManagedDatabaseVulnerabilityAssessments operations :vartype managed_database_vulnerability_assessments: azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentsOperations - :ivar instance_failover_groups: InstanceFailoverGroups operations - :vartype instance_failover_groups: azure.mgmt.sql.operations.InstanceFailoverGroupsOperations - :ivar tde_certificates: TdeCertificates operations - :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations - :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificates operations - :vartype managed_instance_tde_certificates: azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations - :ivar managed_instance_keys: ManagedInstanceKeys operations - :vartype managed_instance_keys: azure.mgmt.sql.operations.ManagedInstanceKeysOperations + :ivar managed_database_vulnerability_assessment_scans: ManagedDatabaseVulnerabilityAssessmentScans operations + :vartype managed_database_vulnerability_assessment_scans: azure.mgmt.sql.operations.ManagedDatabaseVulnerabilityAssessmentScansOperations + :ivar managed_instance_administrators: ManagedInstanceAdministrators operations + :vartype managed_instance_administrators: azure.mgmt.sql.operations.ManagedInstanceAdministratorsOperations + :ivar managed_instance_azure_ad_only_authentications: ManagedInstanceAzureADOnlyAuthentications operations + :vartype managed_instance_azure_ad_only_authentications: azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations :ivar managed_instance_encryption_protectors: ManagedInstanceEncryptionProtectors operations :vartype managed_instance_encryption_protectors: azure.mgmt.sql.operations.ManagedInstanceEncryptionProtectorsOperations - :ivar recoverable_managed_databases: RecoverableManagedDatabases operations - :vartype recoverable_managed_databases: azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations - :ivar backup_short_term_retention_policies: BackupShortTermRetentionPolicies operations - :vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations + :ivar managed_instance_keys: ManagedInstanceKeys operations + :vartype managed_instance_keys: azure.mgmt.sql.operations.ManagedInstanceKeysOperations + :ivar managed_instance_long_term_retention_policies: ManagedInstanceLongTermRetentionPolicies operations + :vartype managed_instance_long_term_retention_policies: azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations + :ivar managed_instance_operations: ManagedInstanceOperations operations + :vartype managed_instance_operations: azure.mgmt.sql.operations.ManagedInstanceOperations + :ivar managed_instance_private_endpoint_connections: ManagedInstancePrivateEndpointConnections operations + :vartype managed_instance_private_endpoint_connections: azure.mgmt.sql.operations.ManagedInstancePrivateEndpointConnectionsOperations + :ivar managed_instance_private_link_resources: ManagedInstancePrivateLinkResources operations + :vartype managed_instance_private_link_resources: azure.mgmt.sql.operations.ManagedInstancePrivateLinkResourcesOperations + :ivar managed_instances: ManagedInstances operations + :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations + :ivar managed_instance_tde_certificates: ManagedInstanceTdeCertificates operations + :vartype managed_instance_tde_certificates: azure.mgmt.sql.operations.ManagedInstanceTdeCertificatesOperations :ivar managed_instance_vulnerability_assessments: ManagedInstanceVulnerabilityAssessments operations :vartype managed_instance_vulnerability_assessments: azure.mgmt.sql.operations.ManagedInstanceVulnerabilityAssessmentsOperations - :ivar server_vulnerability_assessments: ServerVulnerabilityAssessments operations - :vartype server_vulnerability_assessments: azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations - :ivar managed_database_sensitivity_labels: ManagedDatabaseSensitivityLabels operations - :vartype managed_database_sensitivity_labels: azure.mgmt.sql.operations.ManagedDatabaseSensitivityLabelsOperations - :ivar instance_pools: InstancePools operations - :vartype instance_pools: azure.mgmt.sql.operations.InstancePoolsOperations - :ivar usages: Usages operations - :vartype usages: azure.mgmt.sql.operations.UsagesOperations + :ivar managed_restorable_dropped_database_backup_short_term_retention_policies: ManagedRestorableDroppedDatabaseBackupShortTermRetentionPolicies operations + :vartype managed_restorable_dropped_database_backup_short_term_retention_policies: azure.mgmt.sql.operations.ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations + :ivar managed_server_security_alert_policies: ManagedServerSecurityAlertPolicies operations + :vartype managed_server_security_alert_policies: azure.mgmt.sql.operations.ManagedServerSecurityAlertPoliciesOperations + :ivar operations: Operations operations + :vartype operations: azure.mgmt.sql.operations.Operations + :ivar operations_health: OperationsHealth operations + :vartype operations_health: azure.mgmt.sql.operations.OperationsHealthOperations + :ivar outbound_firewall_rules: OutboundFirewallRules operations + :vartype outbound_firewall_rules: azure.mgmt.sql.operations.OutboundFirewallRulesOperations :ivar private_endpoint_connections: PrivateEndpointConnections operations :vartype private_endpoint_connections: azure.mgmt.sql.operations.PrivateEndpointConnectionsOperations :ivar private_link_resources: PrivateLinkResources operations :vartype private_link_resources: azure.mgmt.sql.operations.PrivateLinkResourcesOperations - :ivar servers: Servers operations - :vartype servers: azure.mgmt.sql.operations.ServersOperations - :ivar capabilities: Capabilities operations - :vartype capabilities: azure.mgmt.sql.operations.CapabilitiesOperations - :ivar long_term_retention_managed_instance_backups: LongTermRetentionManagedInstanceBackups operations - :vartype long_term_retention_managed_instance_backups: azure.mgmt.sql.operations.LongTermRetentionManagedInstanceBackupsOperations - :ivar managed_instance_long_term_retention_policies: ManagedInstanceLongTermRetentionPolicies operations - :vartype managed_instance_long_term_retention_policies: azure.mgmt.sql.operations.ManagedInstanceLongTermRetentionPoliciesOperations - :ivar workload_groups: WorkloadGroups operations - :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations - :ivar workload_classifiers: WorkloadClassifiers operations - :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations - :ivar managed_instance_operations: ManagedInstanceOperations operations - :vartype managed_instance_operations: azure.mgmt.sql.operations.ManagedInstanceOperations + :ivar recoverable_managed_databases: RecoverableManagedDatabases operations + :vartype recoverable_managed_databases: azure.mgmt.sql.operations.RecoverableManagedDatabasesOperations + :ivar replication_links: ReplicationLinks operations + :vartype replication_links: azure.mgmt.sql.operations.ReplicationLinksOperations + :ivar restorable_dropped_databases: RestorableDroppedDatabases operations + :vartype restorable_dropped_databases: azure.mgmt.sql.operations.RestorableDroppedDatabasesOperations + :ivar restorable_dropped_managed_databases: RestorableDroppedManagedDatabases operations + :vartype restorable_dropped_managed_databases: azure.mgmt.sql.operations.RestorableDroppedManagedDatabasesOperations + :ivar restore_points: RestorePoints operations + :vartype restore_points: azure.mgmt.sql.operations.RestorePointsOperations + :ivar sensitivity_labels: SensitivityLabels operations + :vartype sensitivity_labels: azure.mgmt.sql.operations.SensitivityLabelsOperations + :ivar recommended_sensitivity_labels: RecommendedSensitivityLabels operations + :vartype recommended_sensitivity_labels: azure.mgmt.sql.operations.RecommendedSensitivityLabelsOperations + :ivar server_advisors: ServerAdvisors operations + :vartype server_advisors: azure.mgmt.sql.operations.ServerAdvisorsOperations + :ivar server_automatic_tuning: ServerAutomaticTuning operations + :vartype server_automatic_tuning: azure.mgmt.sql.operations.ServerAutomaticTuningOperations :ivar server_azure_ad_administrators: ServerAzureADAdministrators operations :vartype server_azure_ad_administrators: azure.mgmt.sql.operations.ServerAzureADAdministratorsOperations - :ivar sync_groups: SyncGroups operations - :vartype sync_groups: azure.mgmt.sql.operations.SyncGroupsOperations - :ivar sync_members: SyncMembers operations - :vartype sync_members: azure.mgmt.sql.operations.SyncMembersOperations - :ivar managed_databases: ManagedDatabases operations - :vartype managed_databases: azure.mgmt.sql.operations.ManagedDatabasesOperations - :ivar managed_database_restore_details: ManagedDatabaseRestoreDetails operations - :vartype managed_database_restore_details: azure.mgmt.sql.operations.ManagedDatabaseRestoreDetailsOperations :ivar server_azure_ad_only_authentications: ServerAzureADOnlyAuthentications operations :vartype server_azure_ad_only_authentications: azure.mgmt.sql.operations.ServerAzureADOnlyAuthenticationsOperations - :ivar managed_instances: ManagedInstances operations - :vartype managed_instances: azure.mgmt.sql.operations.ManagedInstancesOperations - :ivar managed_instance_azure_ad_only_authentications: ManagedInstanceAzureADOnlyAuthentications operations - :vartype managed_instance_azure_ad_only_authentications: azure.mgmt.sql.operations.ManagedInstanceAzureADOnlyAuthenticationsOperations - :ivar server_trust_groups: ServerTrustGroups operations - :vartype server_trust_groups: azure.mgmt.sql.operations.ServerTrustGroupsOperations :ivar server_dev_ops_audit_settings: ServerDevOpsAuditSettings operations :vartype server_dev_ops_audit_settings: azure.mgmt.sql.operations.ServerDevOpsAuditSettingsOperations + :ivar server_dns_aliases: ServerDnsAliases operations + :vartype server_dns_aliases: azure.mgmt.sql.operations.ServerDnsAliasesOperations + :ivar server_keys: ServerKeys operations + :vartype server_keys: azure.mgmt.sql.operations.ServerKeysOperations + :ivar server_operations: ServerOperations operations + :vartype server_operations: azure.mgmt.sql.operations.ServerOperations + :ivar servers: Servers operations + :vartype servers: azure.mgmt.sql.operations.ServersOperations + :ivar server_security_alert_policies: ServerSecurityAlertPolicies operations + :vartype server_security_alert_policies: azure.mgmt.sql.operations.ServerSecurityAlertPoliciesOperations + :ivar server_trust_groups: ServerTrustGroups operations + :vartype server_trust_groups: azure.mgmt.sql.operations.ServerTrustGroupsOperations + :ivar server_vulnerability_assessments: ServerVulnerabilityAssessments operations + :vartype server_vulnerability_assessments: azure.mgmt.sql.operations.ServerVulnerabilityAssessmentsOperations + :ivar sql_agent: SqlAgent operations + :vartype sql_agent: azure.mgmt.sql.operations.SqlAgentOperations + :ivar subscription_usages: SubscriptionUsages operations + :vartype subscription_usages: azure.mgmt.sql.operations.SubscriptionUsagesOperations + :ivar sync_agents: SyncAgents operations + :vartype sync_agents: azure.mgmt.sql.operations.SyncAgentsOperations + :ivar sync_groups: SyncGroups operations + :vartype sync_groups: azure.mgmt.sql.operations.SyncGroupsOperations + :ivar sync_members: SyncMembers operations + :vartype sync_members: azure.mgmt.sql.operations.SyncMembersOperations + :ivar tde_certificates: TdeCertificates operations + :vartype tde_certificates: azure.mgmt.sql.operations.TdeCertificatesOperations + :ivar time_zones: TimeZones operations + :vartype time_zones: azure.mgmt.sql.operations.TimeZonesOperations + :ivar transparent_data_encryptions: TransparentDataEncryptions operations + :vartype transparent_data_encryptions: azure.mgmt.sql.operations.TransparentDataEncryptionsOperations + :ivar usages: Usages operations + :vartype usages: azure.mgmt.sql.operations.UsagesOperations + :ivar virtual_clusters: VirtualClusters operations + :vartype virtual_clusters: azure.mgmt.sql.operations.VirtualClustersOperations + :ivar virtual_network_rules: VirtualNetworkRules operations + :vartype virtual_network_rules: azure.mgmt.sql.operations.VirtualNetworkRulesOperations + :ivar workload_classifiers: WorkloadClassifiers operations + :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations + :ivar workload_groups: WorkloadGroups operations + :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -324,80 +366,65 @@ def __init__( super(SqlManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} + self.api_version = '2021-02-01-preview' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) - self.recoverable_databases = RecoverableDatabasesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.server_connection_policies = ServerConnectionPoliciesOperations( - self._client, self.config, self._serialize, self._deserialize) - self.database_threat_detection_policies = DatabaseThreatDetectionPoliciesOperations( - 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( + self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.firewall_rules = FirewallRulesOperations( + self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.geo_backup_policies = GeoBackupPoliciesOperations( + self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.databases = DatabasesOperations( + self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.elastic_pools = ElasticPoolsOperations( + self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.recommended_elastic_pools = RecommendedElasticPoolsOperations( + self.database_advisors = DatabaseAdvisorsOperations( self._client, self.config, self._serialize, self._deserialize) - self.replication_links = ReplicationLinksOperations( + self.database_automatic_tuning = DatabaseAutomaticTuningOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_communication_links = ServerCommunicationLinksOperations( + self.database_columns = DatabaseColumnsOperations( self._client, self.config, self._serialize, self._deserialize) - self.service_objectives = ServiceObjectivesOperations( + self.database_extensions = DatabaseExtensionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.elastic_pool_activities = ElasticPoolActivitiesOperations( + self.database_operations = DatabaseOperations( self._client, self.config, self._serialize, self._deserialize) - self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( + self.database_recommended_actions = DatabaseRecommendedActionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.service_tier_advisors = ServiceTierAdvisorsOperations( + self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self.database_schemas = DatabaseSchemasOperations( self._client, self.config, self._serialize, self._deserialize) - self.transparent_data_encryption_activities = TransparentDataEncryptionActivitiesOperations( + self.database_security_alert_policies = DatabaseSecurityAlertPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_usages = ServerUsagesOperations( + self.database_tables = DatabaseTablesOperations( self._client, self.config, self._serialize, self._deserialize) self.database_usages = DatabaseUsagesOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_automatic_tuning = DatabaseAutomaticTuningOperations( - self._client, self.config, self._serialize, self._deserialize) - self.encryption_protectors = EncryptionProtectorsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.failover_groups = FailoverGroupsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( + self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_keys = ServerKeysOperations( + self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( self._client, self.config, self._serialize, self._deserialize) - self.sync_agents = SyncAgentsOperations( + self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( self._client, self.config, self._serialize, self._deserialize) - self.subscription_usages = SubscriptionUsagesOperations( + self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( self._client, self.config, self._serialize, self._deserialize) - self.virtual_clusters = VirtualClustersOperations( + self.deleted_servers = DeletedServersOperations( self._client, self.config, self._serialize, self._deserialize) - self.virtual_network_rules = VirtualNetworkRulesOperations( + self.elastic_pool_operations = ElasticPoolOperations( self._client, self.config, self._serialize, self._deserialize) - self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( + self.elastic_pools = ElasticPoolsOperations( self._client, self.config, self._serialize, self._deserialize) - self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( + self.encryption_protectors = EncryptionProtectorsOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( + self.failover_groups = FailoverGroupsOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( + self.firewall_rules = FirewallRulesOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self.instance_failover_groups = InstanceFailoverGroupsOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( + self.instance_pools = InstancePoolsOperations( self._client, self.config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations( self._client, self.config, self._serialize, self._deserialize) @@ -417,103 +444,147 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.job_versions = JobVersionsOperations( self._client, self.config, self._serialize, self._deserialize) + self.ledger_digest_uploads = LedgerDigestUploadsOperations( + 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.backup_long_term_retention_policies = BackupLongTermRetentionPoliciesOperations( + self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_backup_short_term_retention_policies = ManagedBackupShortTermRetentionPoliciesOperations( + self.long_term_retention_policies = LongTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_restorable_dropped_database_backup_short_term_retention_policies = ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( + self.maintenance_window_options = MaintenanceWindowOptionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_automatic_tuning = ServerAutomaticTuningOperations( + self.maintenance_windows = MaintenanceWindowsOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_dns_aliases = ServerDnsAliasesOperations( + self.managed_backup_short_term_retention_policies = ManagedBackupShortTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( + self.managed_database_columns = ManagedDatabaseColumnsOperations( self._client, self.config, self._serialize, self._deserialize) - self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( + self.managed_database_queries = ManagedDatabaseQueriesOperations( self._client, self.config, self._serialize, self._deserialize) - self.restore_points = RestorePointsOperations( + self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_database_security_alert_policies = ManagedDatabaseSecurityAlertPoliciesOperations( + self.managed_databases = ManagedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( + self.managed_database_schemas = ManagedDatabaseSchemasOperations( self._client, self.config, self._serialize, self._deserialize) - self.sensitivity_labels = SensitivityLabelsOperations( + self.managed_database_security_alert_policies = ManagedDatabaseSecurityAlertPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( + self.managed_database_security_events = ManagedDatabaseSecurityEventsOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_operations = DatabaseOperations( + self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( self._client, self.config, self._serialize, self._deserialize) - self.elastic_pool_operations = ElasticPoolOperations( + self.managed_database_recommended_sensitivity_labels = ManagedDatabaseRecommendedSensitivityLabelsOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self.managed_database_tables = ManagedDatabaseTablesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_database_vulnerability_assessment_rule_baselines = ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations( + self.managed_database_transparent_data_encryption = ManagedDatabaseTransparentDataEncryptionOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_database_vulnerability_assessment_scans = ManagedDatabaseVulnerabilityAssessmentScansOperations( + self.managed_database_vulnerability_assessment_rule_baselines = ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations( self._client, self.config, self._serialize, self._deserialize) self.managed_database_vulnerability_assessments = ManagedDatabaseVulnerabilityAssessmentsOperations( self._client, self.config, self._serialize, self._deserialize) - self.instance_failover_groups = InstanceFailoverGroupsOperations( + self.managed_database_vulnerability_assessment_scans = ManagedDatabaseVulnerabilityAssessmentScansOperations( self._client, self.config, self._serialize, self._deserialize) - self.tde_certificates = TdeCertificatesOperations( + self.managed_instance_administrators = ManagedInstanceAdministratorsOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_tde_certificates = ManagedInstanceTdeCertificatesOperations( + self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( self._client, self.config, self._serialize, self._deserialize) self.managed_instance_keys = ManagedInstanceKeysOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_encryption_protectors = ManagedInstanceEncryptionProtectorsOperations( + self.managed_instance_long_term_retention_policies = ManagedInstanceLongTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( + self.managed_instance_operations = ManagedInstanceOperations( self._client, self.config, self._serialize, self._deserialize) - self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( + self.managed_instance_private_endpoint_connections = ManagedInstancePrivateEndpointConnectionsOperations( + 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( self._client, self.config, self._serialize, self._deserialize) - self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( + self.managed_restorable_dropped_database_backup_short_term_retention_policies = ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_database_sensitivity_labels = ManagedDatabaseSensitivityLabelsOperations( + self.managed_server_security_alert_policies = ManagedServerSecurityAlertPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.instance_pools = InstancePoolsOperations( + self.operations = Operations( self._client, self.config, self._serialize, self._deserialize) - self.usages = UsagesOperations( + self.operations_health = OperationsHealthOperations( + self._client, self.config, self._serialize, self._deserialize) + self.outbound_firewall_rules = OutboundFirewallRulesOperations( self._client, self.config, self._serialize, self._deserialize) self.private_endpoint_connections = PrivateEndpointConnectionsOperations( self._client, self.config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( self._client, self.config, self._serialize, self._deserialize) - self.servers = ServersOperations( + self.recoverable_managed_databases = RecoverableManagedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.capabilities = CapabilitiesOperations( + self.replication_links = ReplicationLinksOperations( self._client, self.config, self._serialize, self._deserialize) - self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_long_term_retention_policies = ManagedInstanceLongTermRetentionPoliciesOperations( + self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.workload_groups = WorkloadGroupsOperations( + self.restore_points = RestorePointsOperations( self._client, self.config, self._serialize, self._deserialize) - self.workload_classifiers = WorkloadClassifiersOperations( + self.sensitivity_labels = SensitivityLabelsOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_operations = ManagedInstanceOperations( + self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_advisors = ServerAdvisorsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_automatic_tuning = ServerAutomaticTuningOperations( self._client, self.config, self._serialize, self._deserialize) self.server_azure_ad_administrators = ServerAzureADAdministratorsOperations( self._client, self.config, self._serialize, self._deserialize) + self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_dns_aliases = ServerDnsAliasesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_keys = ServerKeysOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_operations = ServerOperations( + self._client, self.config, self._serialize, self._deserialize) + self.servers = ServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_trust_groups = ServerTrustGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.server_vulnerability_assessments = ServerVulnerabilityAssessmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sql_agent = SqlAgentOperations( + self._client, self.config, self._serialize, self._deserialize) + self.subscription_usages = SubscriptionUsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sync_agents = SyncAgentsOperations( + self._client, self.config, self._serialize, self._deserialize) self.sync_groups = SyncGroupsOperations( self._client, self.config, self._serialize, self._deserialize) self.sync_members = SyncMembersOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_databases = ManagedDatabasesOperations( + self.tde_certificates = TdeCertificatesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_database_restore_details = ManagedDatabaseRestoreDetailsOperations( + self.time_zones = TimeZonesOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_azure_ad_only_authentications = ServerAzureADOnlyAuthenticationsOperations( + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instances = ManagedInstancesOperations( + self.usages = UsagesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( + self.virtual_clusters = VirtualClustersOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_trust_groups = ServerTrustGroupsOperations( + self.virtual_network_rules = VirtualNetworkRulesOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( + self.workload_classifiers = WorkloadClassifiersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workload_groups = WorkloadGroupsOperations( self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index 623c226d6496..09e34a192f69 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 @@ -10,32 +10,35 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import Advisor from ._models_py3 import AutomaticTuningOptions from ._models_py3 import AutomaticTuningServerOptions from ._models_py3 import AutoPauseDelayTimeRange - from ._models_py3 import BackupLongTermRetentionPolicy from ._models_py3 import BackupShortTermRetentionPolicy from ._models_py3 import CheckNameAvailabilityRequest from ._models_py3 import CheckNameAvailabilityResponse from ._models_py3 import CompleteDatabaseRestoreDefinition + from ._models_py3 import CopyLongTermRetentionBackupParameters from ._models_py3 import CreateDatabaseRestorePointDefinition from ._models_py3 import Database from ._models_py3 import DatabaseAutomaticTuning from ._models_py3 import DatabaseBlobAuditingPolicy + from ._models_py3 import DatabaseColumn + from ._models_py3 import DatabaseExtensions from ._models_py3 import DatabaseOperation + from ._models_py3 import DatabaseSchema from ._models_py3 import DatabaseSecurityAlertPolicy + from ._models_py3 import DatabaseTable from ._models_py3 import DatabaseUpdate from ._models_py3 import DatabaseUsage from ._models_py3 import DatabaseVulnerabilityAssessment from ._models_py3 import DatabaseVulnerabilityAssessmentRuleBaseline from ._models_py3 import DatabaseVulnerabilityAssessmentRuleBaselineItem from ._models_py3 import DatabaseVulnerabilityAssessmentScansExport - from ._models_py3 import DataMaskingPolicy - from ._models_py3 import DataMaskingRule + from ._models_py3 import DataWarehouseUserActivities + from ._models_py3 import DeletedServer from ._models_py3 import EditionCapability from ._models_py3 import ElasticPool - from ._models_py3 import ElasticPoolActivity - from ._models_py3 import ElasticPoolDatabaseActivity from ._models_py3 import ElasticPoolEditionCapability from ._models_py3 import ElasticPoolOperation from ._models_py3 import ElasticPoolPerDatabaseMaxPerformanceLevelCapability @@ -52,8 +55,9 @@ from ._models_py3 import FailoverGroupReadWriteEndpoint from ._models_py3 import FailoverGroupUpdate from ._models_py3 import FirewallRule - from ._models_py3 import GeoBackupPolicy + from ._models_py3 import FirewallRuleList from ._models_py3 import ImportExistingDatabaseDefinition + from ._models_py3 import ImportExportExtensionsOperationResult from ._models_py3 import ImportExportOperationResult from ._models_py3 import ImportNewDatabaseDefinition from ._models_py3 import InstanceFailoverGroup @@ -78,11 +82,18 @@ from ._models_py3 import JobTarget from ._models_py3 import JobTargetGroup from ._models_py3 import JobVersion + from ._models_py3 import LedgerDigestUploads from ._models_py3 import LicenseTypeCapability from ._models_py3 import LocationCapabilities + from ._models_py3 import LogicalDatabaseTransparentDataEncryption from ._models_py3 import LogSizeCapability from ._models_py3 import LongTermRetentionBackup + from ._models_py3 import LongTermRetentionBackupOperationResult + from ._models_py3 import LongTermRetentionPolicy from ._models_py3 import MaintenanceConfigurationCapability + from ._models_py3 import MaintenanceWindowOptions + from ._models_py3 import MaintenanceWindows + from ._models_py3 import MaintenanceWindowTimeRange from ._models_py3 import ManagedBackupShortTermRetentionPolicy from ._models_py3 import ManagedDatabase from ._models_py3 import ManagedDatabaseRestoreDetailsResult @@ -93,6 +104,7 @@ from ._models_py3 import ManagedInstanceAzureADOnlyAuthentication from ._models_py3 import ManagedInstanceEditionCapability from ._models_py3 import ManagedInstanceEncryptionProtector + from ._models_py3 import ManagedInstanceExternalAdministrator from ._models_py3 import ManagedInstanceFamilyCapability from ._models_py3 import ManagedInstanceKey from ._models_py3 import ManagedInstanceLongTermRetentionBackup @@ -103,27 +115,28 @@ from ._models_py3 import ManagedInstanceOperationSteps from ._models_py3 import ManagedInstancePairInfo from ._models_py3 import ManagedInstancePecProperty + from ._models_py3 import ManagedInstancePrivateEndpointConnection from ._models_py3 import ManagedInstancePrivateEndpointConnectionProperties from ._models_py3 import ManagedInstancePrivateEndpointProperty + from ._models_py3 import ManagedInstancePrivateLink + from ._models_py3 import ManagedInstancePrivateLinkProperties from ._models_py3 import ManagedInstancePrivateLinkServiceConnectionStateProperty + from ._models_py3 import ManagedInstanceQuery from ._models_py3 import ManagedInstanceUpdate from ._models_py3 import ManagedInstanceVcoresCapability from ._models_py3 import ManagedInstanceVersionCapability from ._models_py3 import ManagedInstanceVulnerabilityAssessment from ._models_py3 import ManagedServerSecurityAlertPolicy + from ._models_py3 import ManagedTransparentDataEncryption from ._models_py3 import MaxSizeCapability from ._models_py3 import MaxSizeRangeCapability - from ._models_py3 import Metric - from ._models_py3 import MetricAvailability - from ._models_py3 import MetricDefinition - from ._models_py3 import MetricName - from ._models_py3 import MetricValue from ._models_py3 import MinCapacityCapability from ._models_py3 import Name from ._models_py3 import NetworkIsolationSettings from ._models_py3 import Operation from ._models_py3 import OperationDisplay - from ._models_py3 import OperationImpact + from ._models_py3 import OperationsHealth + from ._models_py3 import OutboundFirewallRule from ._models_py3 import PartnerInfo from ._models_py3 import PartnerRegionInfo from ._models_py3 import PerformanceLevelCapability @@ -135,47 +148,56 @@ from ._models_py3 import PrivateLinkResourceProperties from ._models_py3 import PrivateLinkServiceConnectionStateProperty from ._models_py3 import ProxyResource + from ._models_py3 import ProxyResourceWithWritableName from ._models_py3 import QueryMetricInterval from ._models_py3 import QueryMetricProperties + from ._models_py3 import QueryStatistics from ._models_py3 import QueryStatisticsProperties from ._models_py3 import ReadScaleCapability - from ._models_py3 import RecommendedElasticPool - from ._models_py3 import RecommendedElasticPoolMetric - from ._models_py3 import RecommendedIndex - from ._models_py3 import RecoverableDatabase + from ._models_py3 import RecommendedAction + from ._models_py3 import RecommendedActionErrorInfo + from ._models_py3 import RecommendedActionImpactRecord + from ._models_py3 import RecommendedActionImplementationInfo + from ._models_py3 import RecommendedActionMetricInfo + from ._models_py3 import RecommendedActionStateInfo + from ._models_py3 import RecommendedSensitivityLabelUpdate + from ._models_py3 import RecommendedSensitivityLabelUpdateList from ._models_py3 import RecoverableManagedDatabase from ._models_py3 import ReplicationLink from ._models_py3 import Resource - from ._models_py3 import ResourceIdentity + from ._models_py3 import ResourceIdentityWithUserAssignedIdentities from ._models_py3 import ResourceMoveDefinition + from ._models_py3 import ResourceWithWritableName from ._models_py3 import RestorableDroppedDatabase from ._models_py3 import RestorableDroppedManagedDatabase from ._models_py3 import RestorePoint + from ._models_py3 import SecurityEvent + from ._models_py3 import SecurityEventsFilterParameters + from ._models_py3 import SecurityEventSqlInjectionAdditionalProperties from ._models_py3 import SensitivityLabel + from ._models_py3 import SensitivityLabelUpdate + from ._models_py3 import SensitivityLabelUpdateList from ._models_py3 import Server from ._models_py3 import ServerAutomaticTuning from ._models_py3 import ServerAzureADAdministrator from ._models_py3 import ServerAzureADOnlyAuthentication from ._models_py3 import ServerBlobAuditingPolicy - from ._models_py3 import ServerCommunicationLink - from ._models_py3 import ServerConnectionPolicy from ._models_py3 import ServerDevOpsAuditingSettings from ._models_py3 import ServerDnsAlias from ._models_py3 import ServerDnsAliasAcquisition + from ._models_py3 import ServerExternalAdministrator from ._models_py3 import ServerInfo from ._models_py3 import ServerKey + from ._models_py3 import ServerOperation from ._models_py3 import ServerPrivateEndpointConnection from ._models_py3 import ServerSecurityAlertPolicy from ._models_py3 import ServerTrustGroup from ._models_py3 import ServerUpdate - from ._models_py3 import ServerUsage from ._models_py3 import ServerVersionCapability from ._models_py3 import ServerVulnerabilityAssessment - from ._models_py3 import ServiceObjective from ._models_py3 import ServiceObjectiveCapability - from ._models_py3 import ServiceTierAdvisor from ._models_py3 import Sku - from ._models_py3 import SloUsageMetric + from ._models_py3 import SqlAgentConfiguration from ._models_py3 import StorageCapability from ._models_py3 import SubscriptionUsage from ._models_py3 import SyncAgent @@ -193,14 +215,15 @@ from ._models_py3 import SyncMember from ._models_py3 import SystemData from ._models_py3 import TdeCertificate + from ._models_py3 import TimeZone from ._models_py3 import TopQueries from ._models_py3 import TrackedResource - from ._models_py3 import TransparentDataEncryption - from ._models_py3 import TransparentDataEncryptionActivity - from ._models_py3 import UnlinkParameters + from ._models_py3 import UpdateLongTermRetentionBackupParameters + from ._models_py3 import UpdateManagedInstanceDnsServersOperation from ._models_py3 import UpsertManagedServerOperationParameters from ._models_py3 import UpsertManagedServerOperationStep from ._models_py3 import Usage + from ._models_py3 import UserIdentity from ._models_py3 import VirtualCluster from ._models_py3 import VirtualClusterUpdate from ._models_py3 import VirtualNetworkRule @@ -210,32 +233,35 @@ from ._models_py3 import WorkloadClassifier from ._models_py3 import WorkloadGroup except (SyntaxError, ImportError): + from ._models import Advisor from ._models import AutomaticTuningOptions from ._models import AutomaticTuningServerOptions from ._models import AutoPauseDelayTimeRange - from ._models import BackupLongTermRetentionPolicy from ._models import BackupShortTermRetentionPolicy from ._models import CheckNameAvailabilityRequest from ._models import CheckNameAvailabilityResponse from ._models import CompleteDatabaseRestoreDefinition + from ._models import CopyLongTermRetentionBackupParameters from ._models import CreateDatabaseRestorePointDefinition from ._models import Database from ._models import DatabaseAutomaticTuning from ._models import DatabaseBlobAuditingPolicy + from ._models import DatabaseColumn + from ._models import DatabaseExtensions from ._models import DatabaseOperation + from ._models import DatabaseSchema from ._models import DatabaseSecurityAlertPolicy + from ._models import DatabaseTable from ._models import DatabaseUpdate from ._models import DatabaseUsage from ._models import DatabaseVulnerabilityAssessment from ._models import DatabaseVulnerabilityAssessmentRuleBaseline from ._models import DatabaseVulnerabilityAssessmentRuleBaselineItem from ._models import DatabaseVulnerabilityAssessmentScansExport - from ._models import DataMaskingPolicy - from ._models import DataMaskingRule + from ._models import DataWarehouseUserActivities + from ._models import DeletedServer from ._models import EditionCapability from ._models import ElasticPool - from ._models import ElasticPoolActivity - from ._models import ElasticPoolDatabaseActivity from ._models import ElasticPoolEditionCapability from ._models import ElasticPoolOperation from ._models import ElasticPoolPerDatabaseMaxPerformanceLevelCapability @@ -252,8 +278,9 @@ from ._models import FailoverGroupReadWriteEndpoint from ._models import FailoverGroupUpdate from ._models import FirewallRule - from ._models import GeoBackupPolicy + from ._models import FirewallRuleList from ._models import ImportExistingDatabaseDefinition + from ._models import ImportExportExtensionsOperationResult from ._models import ImportExportOperationResult from ._models import ImportNewDatabaseDefinition from ._models import InstanceFailoverGroup @@ -278,11 +305,18 @@ from ._models import JobTarget from ._models import JobTargetGroup from ._models import JobVersion + from ._models import LedgerDigestUploads from ._models import LicenseTypeCapability from ._models import LocationCapabilities + from ._models import LogicalDatabaseTransparentDataEncryption from ._models import LogSizeCapability from ._models import LongTermRetentionBackup + from ._models import LongTermRetentionBackupOperationResult + from ._models import LongTermRetentionPolicy from ._models import MaintenanceConfigurationCapability + from ._models import MaintenanceWindowOptions + from ._models import MaintenanceWindows + from ._models import MaintenanceWindowTimeRange from ._models import ManagedBackupShortTermRetentionPolicy from ._models import ManagedDatabase from ._models import ManagedDatabaseRestoreDetailsResult @@ -293,6 +327,7 @@ from ._models import ManagedInstanceAzureADOnlyAuthentication from ._models import ManagedInstanceEditionCapability from ._models import ManagedInstanceEncryptionProtector + from ._models import ManagedInstanceExternalAdministrator from ._models import ManagedInstanceFamilyCapability from ._models import ManagedInstanceKey from ._models import ManagedInstanceLongTermRetentionBackup @@ -303,27 +338,28 @@ from ._models import ManagedInstanceOperationSteps from ._models import ManagedInstancePairInfo from ._models import ManagedInstancePecProperty + from ._models import ManagedInstancePrivateEndpointConnection from ._models import ManagedInstancePrivateEndpointConnectionProperties from ._models import ManagedInstancePrivateEndpointProperty + from ._models import ManagedInstancePrivateLink + from ._models import ManagedInstancePrivateLinkProperties from ._models import ManagedInstancePrivateLinkServiceConnectionStateProperty + from ._models import ManagedInstanceQuery from ._models import ManagedInstanceUpdate from ._models import ManagedInstanceVcoresCapability from ._models import ManagedInstanceVersionCapability from ._models import ManagedInstanceVulnerabilityAssessment from ._models import ManagedServerSecurityAlertPolicy + from ._models import ManagedTransparentDataEncryption from ._models import MaxSizeCapability from ._models import MaxSizeRangeCapability - from ._models import Metric - from ._models import MetricAvailability - from ._models import MetricDefinition - from ._models import MetricName - from ._models import MetricValue from ._models import MinCapacityCapability from ._models import Name from ._models import NetworkIsolationSettings from ._models import Operation from ._models import OperationDisplay - from ._models import OperationImpact + from ._models import OperationsHealth + from ._models import OutboundFirewallRule from ._models import PartnerInfo from ._models import PartnerRegionInfo from ._models import PerformanceLevelCapability @@ -335,47 +371,56 @@ from ._models import PrivateLinkResourceProperties from ._models import PrivateLinkServiceConnectionStateProperty from ._models import ProxyResource + from ._models import ProxyResourceWithWritableName from ._models import QueryMetricInterval from ._models import QueryMetricProperties + from ._models import QueryStatistics from ._models import QueryStatisticsProperties from ._models import ReadScaleCapability - from ._models import RecommendedElasticPool - from ._models import RecommendedElasticPoolMetric - from ._models import RecommendedIndex - from ._models import RecoverableDatabase + from ._models import RecommendedAction + from ._models import RecommendedActionErrorInfo + from ._models import RecommendedActionImpactRecord + from ._models import RecommendedActionImplementationInfo + from ._models import RecommendedActionMetricInfo + from ._models import RecommendedActionStateInfo + from ._models import RecommendedSensitivityLabelUpdate + from ._models import RecommendedSensitivityLabelUpdateList from ._models import RecoverableManagedDatabase from ._models import ReplicationLink from ._models import Resource - from ._models import ResourceIdentity + from ._models import ResourceIdentityWithUserAssignedIdentities from ._models import ResourceMoveDefinition + from ._models import ResourceWithWritableName from ._models import RestorableDroppedDatabase from ._models import RestorableDroppedManagedDatabase from ._models import RestorePoint + from ._models import SecurityEvent + from ._models import SecurityEventsFilterParameters + from ._models import SecurityEventSqlInjectionAdditionalProperties from ._models import SensitivityLabel + from ._models import SensitivityLabelUpdate + from ._models import SensitivityLabelUpdateList from ._models import Server from ._models import ServerAutomaticTuning from ._models import ServerAzureADAdministrator from ._models import ServerAzureADOnlyAuthentication from ._models import ServerBlobAuditingPolicy - from ._models import ServerCommunicationLink - from ._models import ServerConnectionPolicy from ._models import ServerDevOpsAuditingSettings from ._models import ServerDnsAlias from ._models import ServerDnsAliasAcquisition + from ._models import ServerExternalAdministrator from ._models import ServerInfo from ._models import ServerKey + from ._models import ServerOperation from ._models import ServerPrivateEndpointConnection from ._models import ServerSecurityAlertPolicy from ._models import ServerTrustGroup from ._models import ServerUpdate - from ._models import ServerUsage from ._models import ServerVersionCapability from ._models import ServerVulnerabilityAssessment - from ._models import ServiceObjective from ._models import ServiceObjectiveCapability - from ._models import ServiceTierAdvisor from ._models import Sku - from ._models import SloUsageMetric + from ._models import SqlAgentConfiguration from ._models import StorageCapability from ._models import SubscriptionUsage from ._models import SyncAgent @@ -393,14 +438,15 @@ from ._models import SyncMember from ._models import SystemData from ._models import TdeCertificate + from ._models import TimeZone from ._models import TopQueries from ._models import TrackedResource - from ._models import TransparentDataEncryption - from ._models import TransparentDataEncryptionActivity - from ._models import UnlinkParameters + from ._models import UpdateLongTermRetentionBackupParameters + from ._models import UpdateManagedInstanceDnsServersOperation from ._models import UpsertManagedServerOperationParameters from ._models import UpsertManagedServerOperationStep from ._models import Usage + from ._models import UserIdentity from ._models import VirtualCluster from ._models import VirtualClusterUpdate from ._models import VirtualNetworkRule @@ -411,13 +457,16 @@ from ._models import WorkloadGroup from ._paged_models import BackupShortTermRetentionPolicyPaged from ._paged_models import DatabaseBlobAuditingPolicyPaged +from ._paged_models import DatabaseColumnPaged from ._paged_models import DatabaseOperationPaged from ._paged_models import DatabasePaged +from ._paged_models import DatabaseSchemaPaged +from ._paged_models import DatabaseSecurityAlertPolicyPaged +from ._paged_models import DatabaseTablePaged from ._paged_models import DatabaseUsagePaged from ._paged_models import DatabaseVulnerabilityAssessmentPaged -from ._paged_models import DataMaskingRulePaged -from ._paged_models import ElasticPoolActivityPaged -from ._paged_models import ElasticPoolDatabaseActivityPaged +from ._paged_models import DataWarehouseUserActivitiesPaged +from ._paged_models import DeletedServerPaged from ._paged_models import ElasticPoolOperationPaged from ._paged_models import ElasticPoolPaged from ._paged_models import EncryptionProtectorPaged @@ -425,7 +474,7 @@ from ._paged_models import ExtendedServerBlobAuditingPolicyPaged from ._paged_models import FailoverGroupPaged from ._paged_models import FirewallRulePaged -from ._paged_models import GeoBackupPolicyPaged +from ._paged_models import ImportExportExtensionsOperationResultPaged from ._paged_models import InstanceFailoverGroupPaged from ._paged_models import InstancePoolPaged from ._paged_models import JobAgentPaged @@ -435,7 +484,10 @@ from ._paged_models import JobStepPaged from ._paged_models import JobTargetGroupPaged from ._paged_models import JobVersionPaged +from ._paged_models import LedgerDigestUploadsPaged +from ._paged_models import LogicalDatabaseTransparentDataEncryptionPaged from ._paged_models import LongTermRetentionBackupPaged +from ._paged_models import LongTermRetentionPolicyPaged from ._paged_models import ManagedBackupShortTermRetentionPolicyPaged from ._paged_models import ManagedDatabasePaged from ._paged_models import ManagedDatabaseSecurityAlertPolicyPaged @@ -447,36 +499,35 @@ from ._paged_models import ManagedInstanceLongTermRetentionPolicyPaged from ._paged_models import ManagedInstanceOperationPaged from ._paged_models import ManagedInstancePaged +from ._paged_models import ManagedInstancePrivateEndpointConnectionPaged +from ._paged_models import ManagedInstancePrivateLinkPaged from ._paged_models import ManagedInstanceVulnerabilityAssessmentPaged from ._paged_models import ManagedServerSecurityAlertPolicyPaged -from ._paged_models import MetricDefinitionPaged -from ._paged_models import MetricPaged +from ._paged_models import ManagedTransparentDataEncryptionPaged from ._paged_models import OperationPaged +from ._paged_models import OperationsHealthPaged +from ._paged_models import OutboundFirewallRulePaged from ._paged_models import PrivateEndpointConnectionPaged from ._paged_models import PrivateLinkResourcePaged -from ._paged_models import RecommendedElasticPoolMetricPaged -from ._paged_models import RecommendedElasticPoolPaged -from ._paged_models import RecoverableDatabasePaged +from ._paged_models import QueryStatisticsPaged from ._paged_models import RecoverableManagedDatabasePaged from ._paged_models import ReplicationLinkPaged from ._paged_models import RestorableDroppedDatabasePaged from ._paged_models import RestorableDroppedManagedDatabasePaged from ._paged_models import RestorePointPaged +from ._paged_models import SecurityEventPaged from ._paged_models import SensitivityLabelPaged from ._paged_models import ServerAzureADAdministratorPaged from ._paged_models import ServerAzureADOnlyAuthenticationPaged from ._paged_models import ServerBlobAuditingPolicyPaged -from ._paged_models import ServerCommunicationLinkPaged from ._paged_models import ServerDevOpsAuditingSettingsPaged from ._paged_models import ServerDnsAliasPaged from ._paged_models import ServerKeyPaged +from ._paged_models import ServerOperationPaged from ._paged_models import ServerPaged from ._paged_models import ServerSecurityAlertPolicyPaged from ._paged_models import ServerTrustGroupPaged -from ._paged_models import ServerUsagePaged from ._paged_models import ServerVulnerabilityAssessmentPaged -from ._paged_models import ServiceObjectivePaged -from ._paged_models import ServiceTierAdvisorPaged from ._paged_models import SubscriptionUsagePaged from ._paged_models import SyncAgentLinkedDatabasePaged from ._paged_models import SyncAgentPaged @@ -485,8 +536,8 @@ from ._paged_models import SyncGroupLogPropertiesPaged from ._paged_models import SyncGroupPaged from ._paged_models import SyncMemberPaged +from ._paged_models import TimeZonePaged from ._paged_models import TopQueriesPaged -from ._paged_models import TransparentDataEncryptionActivityPaged from ._paged_models import UsagePaged from ._paged_models import VirtualClusterPaged from ._paged_models import VirtualNetworkRulePaged @@ -494,39 +545,43 @@ from ._paged_models import WorkloadClassifierPaged from ._paged_models import WorkloadGroupPaged from ._sql_management_client_enums import ( - ServerConnectionType, - SecurityAlertPolicyState, - SecurityAlertPolicyEmailAccountAdmins, - SecurityAlertPolicyUseServerDefault, - DataMaskingState, - DataMaskingRuleState, - DataMaskingFunction, - GeoBackupPolicyState, - UnitType, - PrimaryAggregationType, - UnitDefinitionType, - ElasticPoolEdition, - ReplicationRole, - ReplicationState, - RecommendedIndexAction, - RecommendedIndexState, - RecommendedIndexType, - TransparentDataEncryptionStatus, - ServiceObjectiveName, - TransparentDataEncryptionActivityStatus, + BlobAuditingPolicyState, + AdvisorStatus, + AutoExecuteStatus, + AutoExecuteStatusInheritedFrom, + RecommendedActionCurrentState, + RecommendedActionInitiatedBy, + ImplementationMethod, + IsRetryable, AutomaticTuningMode, AutomaticTuningOptionModeDesired, AutomaticTuningOptionModeActual, AutomaticTuningDisabledReason, + ColumnDataType, + TableTemporalType, + StorageKeyType, + ManagementOperationState, + CreateMode, + SampleName, + DatabaseStatus, + CatalogCollationType, + DatabaseLicenseType, + DatabaseReadScale, + SecondaryType, + CurrentBackupStorageRedundancy, + RequestedBackupStorageRedundancy, + SecurityAlertsPolicyState, + CreatedByType, + VulnerabilityAssessmentScanTriggerType, + VulnerabilityAssessmentScanState, + ElasticPoolState, + ElasticPoolLicenseType, ServerKeyType, ReadWriteEndpointFailoverPolicy, ReadOnlyEndpointFailoverPolicy, FailoverGroupReplicationRole, - OperationOrigin, - SyncAgentState, - SyncMemberDbType, - VirtualNetworkRuleState, - BlobAuditingPolicyState, + InstanceFailoverGroupReplicationRole, + InstancePoolLicenseType, JobAgentState, JobExecutionLifecycle, ProvisioningState, @@ -536,92 +591,89 @@ JobStepActionSource, JobStepOutputType, JobTargetGroupMembershipType, - AutomaticTuningServerMode, - AutomaticTuningServerReason, - RestorePointType, - SensitivityLabelRank, - ManagementOperationState, - VulnerabilityAssessmentScanTriggerType, - VulnerabilityAssessmentScanState, - InstanceFailoverGroupReplicationRole, - InstancePoolLicenseType, - PrivateLinkServiceConnectionStateStatus, - PrivateLinkServiceConnectionStateActionsRequire, - PrivateEndpointProvisioningState, - IdentityType, - ServerPublicNetworkAccess, - CheckNameAvailabilityReason, + LedgerDigestUploadsState, MaxSizeUnit, LogSizeUnit, CapabilityStatus, PerformanceLevelUnit, PauseDelayTimeUnit, - SyncGroupLogType, - SyncConflictResolutionPolicy, - SyncGroupState, - SyncDirection, - SyncMemberState, + TargetBackupStorageRedundancy, + BackupStorageRedundancy, + DayOfWeek, + QueryTimeGrainType, + QueryMetricUnitType, ManagedDatabaseStatus, - CatalogCollationType, ManagedDatabaseCreateMode, + SecurityAlertPolicyState, + SecurityEventType, + SensitivityLabelRank, + SensitivityLabelUpdateKind, + RecommendedSensitivityLabelUpdateKind, + TransparentDataEncryptionState, + IdentityType, ManagedServerCreateMode, ManagedInstanceLicenseType, ManagedInstanceProxyOverride, StorageAccountType, - QueryTimeGrainType, - QueryMetricUnitType, - CreateMode, - SampleName, - DatabaseStatus, - DatabaseLicenseType, - DatabaseReadScale, - SecondaryType, - StorageKeyType, - ElasticPoolState, - ElasticPoolLicenseType, - CreatedByType, - LongTermRetentionDatabaseState, + AdministratorType, + PrincipalType, + OperationOrigin, + PrivateLinkServiceConnectionStateStatus, + PrivateLinkServiceConnectionStateActionsRequire, + PrivateEndpointProvisioningState, + RestorePointType, + AutomaticTuningServerMode, + AutomaticTuningServerReason, + ServerNetworkAccessFlag, + ServerWorkspaceFeature, + CheckNameAvailabilityReason, + SyncAgentState, + SyncMemberDbType, + SyncGroupLogType, + SyncConflictResolutionPolicy, + SyncGroupState, + SyncDirection, + SyncMemberState, + VirtualNetworkRuleState, + ReplicaType, VulnerabilityAssessmentPolicyBaselineName, - SensitivityLabelSource, CapabilityGroup, - DatabaseState1, - DatabaseState2, - DatabaseState3, - DatabaseState4, - DatabaseState5, - DatabaseState6, + DatabaseState, + SensitivityLabelSource, AggregationFunctionType, MetricType, - ReplicaType, ) __all__ = [ + 'Advisor', 'AutomaticTuningOptions', 'AutomaticTuningServerOptions', 'AutoPauseDelayTimeRange', - 'BackupLongTermRetentionPolicy', 'BackupShortTermRetentionPolicy', 'CheckNameAvailabilityRequest', 'CheckNameAvailabilityResponse', 'CompleteDatabaseRestoreDefinition', + 'CopyLongTermRetentionBackupParameters', 'CreateDatabaseRestorePointDefinition', 'Database', 'DatabaseAutomaticTuning', 'DatabaseBlobAuditingPolicy', + 'DatabaseColumn', + 'DatabaseExtensions', 'DatabaseOperation', + 'DatabaseSchema', 'DatabaseSecurityAlertPolicy', + 'DatabaseTable', 'DatabaseUpdate', 'DatabaseUsage', 'DatabaseVulnerabilityAssessment', 'DatabaseVulnerabilityAssessmentRuleBaseline', 'DatabaseVulnerabilityAssessmentRuleBaselineItem', 'DatabaseVulnerabilityAssessmentScansExport', - 'DataMaskingPolicy', - 'DataMaskingRule', + 'DataWarehouseUserActivities', + 'DeletedServer', 'EditionCapability', 'ElasticPool', - 'ElasticPoolActivity', - 'ElasticPoolDatabaseActivity', 'ElasticPoolEditionCapability', 'ElasticPoolOperation', 'ElasticPoolPerDatabaseMaxPerformanceLevelCapability', @@ -638,8 +690,9 @@ 'FailoverGroupReadWriteEndpoint', 'FailoverGroupUpdate', 'FirewallRule', - 'GeoBackupPolicy', + 'FirewallRuleList', 'ImportExistingDatabaseDefinition', + 'ImportExportExtensionsOperationResult', 'ImportExportOperationResult', 'ImportNewDatabaseDefinition', 'InstanceFailoverGroup', @@ -664,11 +717,18 @@ 'JobTarget', 'JobTargetGroup', 'JobVersion', + 'LedgerDigestUploads', 'LicenseTypeCapability', 'LocationCapabilities', + 'LogicalDatabaseTransparentDataEncryption', 'LogSizeCapability', 'LongTermRetentionBackup', + 'LongTermRetentionBackupOperationResult', + 'LongTermRetentionPolicy', 'MaintenanceConfigurationCapability', + 'MaintenanceWindowOptions', + 'MaintenanceWindows', + 'MaintenanceWindowTimeRange', 'ManagedBackupShortTermRetentionPolicy', 'ManagedDatabase', 'ManagedDatabaseRestoreDetailsResult', @@ -679,6 +739,7 @@ 'ManagedInstanceAzureADOnlyAuthentication', 'ManagedInstanceEditionCapability', 'ManagedInstanceEncryptionProtector', + 'ManagedInstanceExternalAdministrator', 'ManagedInstanceFamilyCapability', 'ManagedInstanceKey', 'ManagedInstanceLongTermRetentionBackup', @@ -689,27 +750,28 @@ 'ManagedInstanceOperationSteps', 'ManagedInstancePairInfo', 'ManagedInstancePecProperty', + 'ManagedInstancePrivateEndpointConnection', 'ManagedInstancePrivateEndpointConnectionProperties', 'ManagedInstancePrivateEndpointProperty', + 'ManagedInstancePrivateLink', + 'ManagedInstancePrivateLinkProperties', 'ManagedInstancePrivateLinkServiceConnectionStateProperty', + 'ManagedInstanceQuery', 'ManagedInstanceUpdate', 'ManagedInstanceVcoresCapability', 'ManagedInstanceVersionCapability', 'ManagedInstanceVulnerabilityAssessment', 'ManagedServerSecurityAlertPolicy', + 'ManagedTransparentDataEncryption', 'MaxSizeCapability', 'MaxSizeRangeCapability', - 'Metric', - 'MetricAvailability', - 'MetricDefinition', - 'MetricName', - 'MetricValue', 'MinCapacityCapability', 'Name', 'NetworkIsolationSettings', 'Operation', 'OperationDisplay', - 'OperationImpact', + 'OperationsHealth', + 'OutboundFirewallRule', 'PartnerInfo', 'PartnerRegionInfo', 'PerformanceLevelCapability', @@ -721,47 +783,56 @@ 'PrivateLinkResourceProperties', 'PrivateLinkServiceConnectionStateProperty', 'ProxyResource', + 'ProxyResourceWithWritableName', 'QueryMetricInterval', 'QueryMetricProperties', + 'QueryStatistics', 'QueryStatisticsProperties', 'ReadScaleCapability', - 'RecommendedElasticPool', - 'RecommendedElasticPoolMetric', - 'RecommendedIndex', - 'RecoverableDatabase', + 'RecommendedAction', + 'RecommendedActionErrorInfo', + 'RecommendedActionImpactRecord', + 'RecommendedActionImplementationInfo', + 'RecommendedActionMetricInfo', + 'RecommendedActionStateInfo', + 'RecommendedSensitivityLabelUpdate', + 'RecommendedSensitivityLabelUpdateList', 'RecoverableManagedDatabase', 'ReplicationLink', 'Resource', - 'ResourceIdentity', + 'ResourceIdentityWithUserAssignedIdentities', 'ResourceMoveDefinition', + 'ResourceWithWritableName', 'RestorableDroppedDatabase', 'RestorableDroppedManagedDatabase', 'RestorePoint', + 'SecurityEvent', + 'SecurityEventsFilterParameters', + 'SecurityEventSqlInjectionAdditionalProperties', 'SensitivityLabel', + 'SensitivityLabelUpdate', + 'SensitivityLabelUpdateList', 'Server', 'ServerAutomaticTuning', 'ServerAzureADAdministrator', 'ServerAzureADOnlyAuthentication', 'ServerBlobAuditingPolicy', - 'ServerCommunicationLink', - 'ServerConnectionPolicy', 'ServerDevOpsAuditingSettings', 'ServerDnsAlias', 'ServerDnsAliasAcquisition', + 'ServerExternalAdministrator', 'ServerInfo', 'ServerKey', + 'ServerOperation', 'ServerPrivateEndpointConnection', 'ServerSecurityAlertPolicy', 'ServerTrustGroup', 'ServerUpdate', - 'ServerUsage', 'ServerVersionCapability', 'ServerVulnerabilityAssessment', - 'ServiceObjective', 'ServiceObjectiveCapability', - 'ServiceTierAdvisor', 'Sku', - 'SloUsageMetric', + 'SqlAgentConfiguration', 'StorageCapability', 'SubscriptionUsage', 'SyncAgent', @@ -779,14 +850,15 @@ 'SyncMember', 'SystemData', 'TdeCertificate', + 'TimeZone', 'TopQueries', 'TrackedResource', - 'TransparentDataEncryption', - 'TransparentDataEncryptionActivity', - 'UnlinkParameters', + 'UpdateLongTermRetentionBackupParameters', + 'UpdateManagedInstanceDnsServersOperation', 'UpsertManagedServerOperationParameters', 'UpsertManagedServerOperationStep', 'Usage', + 'UserIdentity', 'VirtualCluster', 'VirtualClusterUpdate', 'VirtualNetworkRule', @@ -795,40 +867,30 @@ 'VulnerabilityAssessmentScanRecord', 'WorkloadClassifier', 'WorkloadGroup', - 'RecoverableDatabasePaged', - 'RestorableDroppedDatabasePaged', - 'DataMaskingRulePaged', - 'FirewallRulePaged', - 'GeoBackupPolicyPaged', - 'MetricPaged', - 'MetricDefinitionPaged', - 'DatabasePaged', - 'ElasticPoolPaged', - 'RecommendedElasticPoolPaged', - 'RecommendedElasticPoolMetricPaged', - 'ReplicationLinkPaged', - 'ServerCommunicationLinkPaged', - 'ServiceObjectivePaged', - 'ElasticPoolActivityPaged', - 'ElasticPoolDatabaseActivityPaged', - 'ServiceTierAdvisorPaged', - 'TransparentDataEncryptionActivityPaged', - 'ServerUsagePaged', - 'DatabaseUsagePaged', - 'EncryptionProtectorPaged', - 'FailoverGroupPaged', - 'OperationPaged', - 'ServerKeyPaged', - 'SyncAgentPaged', - 'SyncAgentLinkedDatabasePaged', - 'SubscriptionUsagePaged', - 'VirtualClusterPaged', - 'VirtualNetworkRulePaged', + 'BackupShortTermRetentionPolicyPaged', 'ExtendedDatabaseBlobAuditingPolicyPaged', 'ExtendedServerBlobAuditingPolicyPaged', 'ServerBlobAuditingPolicyPaged', 'DatabaseBlobAuditingPolicyPaged', + 'DatabaseColumnPaged', + 'ImportExportExtensionsOperationResultPaged', + 'DatabaseOperationPaged', + 'DatabasePaged', + 'DatabaseSchemaPaged', + 'DatabaseSecurityAlertPolicyPaged', + 'DatabaseTablePaged', + 'DatabaseUsagePaged', 'DatabaseVulnerabilityAssessmentPaged', + 'VulnerabilityAssessmentScanRecordPaged', + 'DataWarehouseUserActivitiesPaged', + 'DeletedServerPaged', + 'ElasticPoolOperationPaged', + 'ElasticPoolPaged', + 'EncryptionProtectorPaged', + 'FailoverGroupPaged', + 'FirewallRulePaged', + 'InstanceFailoverGroupPaged', + 'InstancePoolPaged', 'JobAgentPaged', 'JobCredentialPaged', 'JobExecutionPaged', @@ -836,82 +898,101 @@ 'JobStepPaged', 'JobTargetGroupPaged', 'JobVersionPaged', + 'LedgerDigestUploadsPaged', 'LongTermRetentionBackupPaged', + 'ManagedInstanceLongTermRetentionBackupPaged', + 'LongTermRetentionPolicyPaged', 'ManagedBackupShortTermRetentionPolicyPaged', - 'ServerDnsAliasPaged', - 'ServerSecurityAlertPolicyPaged', - 'RestorableDroppedManagedDatabasePaged', - 'RestorePointPaged', + 'QueryStatisticsPaged', + 'ManagedDatabasePaged', 'ManagedDatabaseSecurityAlertPolicyPaged', - 'ManagedServerSecurityAlertPolicyPaged', + 'SecurityEventPaged', 'SensitivityLabelPaged', + 'ManagedTransparentDataEncryptionPaged', 'ManagedInstanceAdministratorPaged', - 'DatabaseOperationPaged', - 'ElasticPoolOperationPaged', - 'VulnerabilityAssessmentScanRecordPaged', - 'InstanceFailoverGroupPaged', - 'ManagedInstanceKeyPaged', + 'ManagedInstanceAzureADOnlyAuthenticationPaged', 'ManagedInstanceEncryptionProtectorPaged', - 'RecoverableManagedDatabasePaged', - 'BackupShortTermRetentionPolicyPaged', + 'ManagedInstanceKeyPaged', + 'ManagedInstanceLongTermRetentionPolicyPaged', + 'ManagedInstanceOperationPaged', + 'ManagedInstancePrivateEndpointConnectionPaged', + 'ManagedInstancePrivateLinkPaged', + 'ManagedInstancePaged', + 'TopQueriesPaged', 'ManagedInstanceVulnerabilityAssessmentPaged', - 'ServerVulnerabilityAssessmentPaged', - 'InstancePoolPaged', - 'UsagePaged', + 'ManagedServerSecurityAlertPolicyPaged', + 'OperationPaged', + 'OperationsHealthPaged', + 'OutboundFirewallRulePaged', 'PrivateEndpointConnectionPaged', 'PrivateLinkResourcePaged', - 'ServerPaged', - 'ManagedInstanceLongTermRetentionBackupPaged', - 'ManagedInstanceLongTermRetentionPolicyPaged', - 'WorkloadGroupPaged', - 'WorkloadClassifierPaged', - 'ManagedInstanceOperationPaged', + 'RecoverableManagedDatabasePaged', + 'ReplicationLinkPaged', + 'RestorableDroppedDatabasePaged', + 'RestorableDroppedManagedDatabasePaged', + 'RestorePointPaged', 'ServerAzureADAdministratorPaged', + 'ServerAzureADOnlyAuthenticationPaged', + 'ServerDevOpsAuditingSettingsPaged', + 'ServerDnsAliasPaged', + 'ServerKeyPaged', + 'ServerOperationPaged', + 'ServerPaged', + 'ServerSecurityAlertPolicyPaged', + 'ServerTrustGroupPaged', + 'ServerVulnerabilityAssessmentPaged', + 'SubscriptionUsagePaged', + 'SyncAgentPaged', + 'SyncAgentLinkedDatabasePaged', 'SyncDatabaseIdPropertiesPaged', 'SyncFullSchemaPropertiesPaged', 'SyncGroupLogPropertiesPaged', 'SyncGroupPaged', 'SyncMemberPaged', - 'ManagedDatabasePaged', - 'ServerAzureADOnlyAuthenticationPaged', - 'ManagedInstancePaged', - 'TopQueriesPaged', - 'ManagedInstanceAzureADOnlyAuthenticationPaged', - 'ServerTrustGroupPaged', - 'ServerDevOpsAuditingSettingsPaged', - 'ServerConnectionType', - 'SecurityAlertPolicyState', - 'SecurityAlertPolicyEmailAccountAdmins', - 'SecurityAlertPolicyUseServerDefault', - 'DataMaskingState', - 'DataMaskingRuleState', - 'DataMaskingFunction', - 'GeoBackupPolicyState', - 'UnitType', - 'PrimaryAggregationType', - 'UnitDefinitionType', - 'ElasticPoolEdition', - 'ReplicationRole', - 'ReplicationState', - 'RecommendedIndexAction', - 'RecommendedIndexState', - 'RecommendedIndexType', - 'TransparentDataEncryptionStatus', - 'ServiceObjectiveName', - 'TransparentDataEncryptionActivityStatus', + 'TimeZonePaged', + 'LogicalDatabaseTransparentDataEncryptionPaged', + 'UsagePaged', + 'VirtualClusterPaged', + 'VirtualNetworkRulePaged', + 'WorkloadClassifierPaged', + 'WorkloadGroupPaged', + 'BlobAuditingPolicyState', + 'AdvisorStatus', + 'AutoExecuteStatus', + 'AutoExecuteStatusInheritedFrom', + 'RecommendedActionCurrentState', + 'RecommendedActionInitiatedBy', + 'ImplementationMethod', + 'IsRetryable', 'AutomaticTuningMode', 'AutomaticTuningOptionModeDesired', 'AutomaticTuningOptionModeActual', 'AutomaticTuningDisabledReason', + 'ColumnDataType', + 'TableTemporalType', + 'StorageKeyType', + 'ManagementOperationState', + 'CreateMode', + 'SampleName', + 'DatabaseStatus', + 'CatalogCollationType', + 'DatabaseLicenseType', + 'DatabaseReadScale', + 'SecondaryType', + 'CurrentBackupStorageRedundancy', + 'RequestedBackupStorageRedundancy', + 'SecurityAlertsPolicyState', + 'CreatedByType', + 'VulnerabilityAssessmentScanTriggerType', + 'VulnerabilityAssessmentScanState', + 'ElasticPoolState', + 'ElasticPoolLicenseType', 'ServerKeyType', 'ReadWriteEndpointFailoverPolicy', 'ReadOnlyEndpointFailoverPolicy', 'FailoverGroupReplicationRole', - 'OperationOrigin', - 'SyncAgentState', - 'SyncMemberDbType', - 'VirtualNetworkRuleState', - 'BlobAuditingPolicyState', + 'InstanceFailoverGroupReplicationRole', + 'InstancePoolLicenseType', 'JobAgentState', 'JobExecutionLifecycle', 'ProvisioningState', @@ -921,61 +1002,55 @@ 'JobStepActionSource', 'JobStepOutputType', 'JobTargetGroupMembershipType', - 'AutomaticTuningServerMode', - 'AutomaticTuningServerReason', - 'RestorePointType', - 'SensitivityLabelRank', - 'ManagementOperationState', - 'VulnerabilityAssessmentScanTriggerType', - 'VulnerabilityAssessmentScanState', - 'InstanceFailoverGroupReplicationRole', - 'InstancePoolLicenseType', - 'PrivateLinkServiceConnectionStateStatus', - 'PrivateLinkServiceConnectionStateActionsRequire', - 'PrivateEndpointProvisioningState', - 'IdentityType', - 'ServerPublicNetworkAccess', - 'CheckNameAvailabilityReason', + 'LedgerDigestUploadsState', 'MaxSizeUnit', 'LogSizeUnit', 'CapabilityStatus', 'PerformanceLevelUnit', 'PauseDelayTimeUnit', - 'SyncGroupLogType', - 'SyncConflictResolutionPolicy', - 'SyncGroupState', - 'SyncDirection', - 'SyncMemberState', + 'TargetBackupStorageRedundancy', + 'BackupStorageRedundancy', + 'DayOfWeek', + 'QueryTimeGrainType', + 'QueryMetricUnitType', 'ManagedDatabaseStatus', - 'CatalogCollationType', 'ManagedDatabaseCreateMode', + 'SecurityAlertPolicyState', + 'SecurityEventType', + 'SensitivityLabelRank', + 'SensitivityLabelUpdateKind', + 'RecommendedSensitivityLabelUpdateKind', + 'TransparentDataEncryptionState', + 'IdentityType', 'ManagedServerCreateMode', 'ManagedInstanceLicenseType', 'ManagedInstanceProxyOverride', 'StorageAccountType', - 'QueryTimeGrainType', - 'QueryMetricUnitType', - 'CreateMode', - 'SampleName', - 'DatabaseStatus', - 'DatabaseLicenseType', - 'DatabaseReadScale', - 'SecondaryType', - 'StorageKeyType', - 'ElasticPoolState', - 'ElasticPoolLicenseType', - 'CreatedByType', - 'LongTermRetentionDatabaseState', + 'AdministratorType', + 'PrincipalType', + 'OperationOrigin', + 'PrivateLinkServiceConnectionStateStatus', + 'PrivateLinkServiceConnectionStateActionsRequire', + 'PrivateEndpointProvisioningState', + 'RestorePointType', + 'AutomaticTuningServerMode', + 'AutomaticTuningServerReason', + 'ServerNetworkAccessFlag', + 'ServerWorkspaceFeature', + 'CheckNameAvailabilityReason', + 'SyncAgentState', + 'SyncMemberDbType', + 'SyncGroupLogType', + 'SyncConflictResolutionPolicy', + 'SyncGroupState', + 'SyncDirection', + 'SyncMemberState', + 'VirtualNetworkRuleState', + 'ReplicaType', 'VulnerabilityAssessmentPolicyBaselineName', - 'SensitivityLabelSource', 'CapabilityGroup', - 'DatabaseState1', - 'DatabaseState2', - 'DatabaseState3', - 'DatabaseState4', - 'DatabaseState5', - 'DatabaseState6', + 'DatabaseState', + 'SensitivityLabelSource', 'AggregationFunctionType', 'MetricType', - 'ReplicaType', ] 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 e1923c027292..c0f44185612e 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 @@ -12,6 +12,160 @@ from msrest.serialization import Model +class Resource(Model): + """ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(ProxyResource, self).__init__(**kwargs) + + +class Advisor(ProxyResource): + """Database, Server or Elastic Pool Advisor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar kind: Resource kind. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + :ivar advisor_status: Gets the status of availability of this advisor to + customers. Possible values are 'GA', 'PublicPreview', + 'LimitedPublicPreview' and 'PrivatePreview'. Possible values include: + 'GA', 'PublicPreview', 'LimitedPublicPreview', 'PrivatePreview' + :vartype advisor_status: str or ~azure.mgmt.sql.models.AdvisorStatus + :param auto_execute_status: Required. Gets the auto-execute status + (whether to let the system execute the recommendations) of this advisor. + Possible values are 'Enabled' and 'Disabled'. Possible values include: + 'Enabled', 'Disabled', 'Default' + :type auto_execute_status: str or ~azure.mgmt.sql.models.AutoExecuteStatus + :ivar auto_execute_status_inherited_from: Gets the resource from which + current value of auto-execute status is inherited. Auto-execute status can + be set on (and inherited from) different levels in the resource hierarchy. + Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' + and 'Default' (when status is not explicitly set on any level). Possible + values include: 'Default', 'Subscription', 'Server', 'ElasticPool', + 'Database' + :vartype auto_execute_status_inherited_from: str or + ~azure.mgmt.sql.models.AutoExecuteStatusInheritedFrom + :ivar recommendations_status: Gets that status of recommendations for this + advisor and reason for not having any recommendations. Possible values + include, but are not limited to, 'Ok' (Recommendations + available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' + (Database is doing well), etc. + :vartype recommendations_status: str + :ivar last_checked: Gets the time when the current resource was analyzed + for recommendations by this advisor. + :vartype last_checked: datetime + :ivar recommended_actions: Gets the recommended actions for this advisor. + :vartype recommended_actions: + list[~azure.mgmt.sql.models.RecommendedAction] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'readonly': True}, + 'advisor_status': {'readonly': True}, + 'auto_execute_status': {'required': True}, + 'auto_execute_status_inherited_from': {'readonly': True}, + 'recommendations_status': {'readonly': True}, + 'last_checked': {'readonly': True}, + 'recommended_actions': {'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'}, + 'advisor_status': {'key': 'properties.advisorStatus', 'type': 'AdvisorStatus'}, + 'auto_execute_status': {'key': 'properties.autoExecuteStatus', 'type': 'AutoExecuteStatus'}, + 'auto_execute_status_inherited_from': {'key': 'properties.autoExecuteStatusInheritedFrom', 'type': 'AutoExecuteStatusInheritedFrom'}, + 'recommendations_status': {'key': 'properties.recommendationsStatus', 'type': 'str'}, + 'last_checked': {'key': 'properties.lastChecked', 'type': 'iso-8601'}, + 'recommended_actions': {'key': 'properties.recommendedActions', 'type': '[RecommendedAction]'}, + } + + def __init__(self, **kwargs): + super(Advisor, self).__init__(**kwargs) + self.kind = None + self.location = None + self.advisor_status = None + self.auto_execute_status = kwargs.get('auto_execute_status', None) + self.auto_execute_status_inherited_from = None + self.recommendations_status = None + self.last_checked = None + self.recommended_actions = None + + class AutomaticTuningOptions(Model): """Automatic tuning properties for individual advisors. @@ -152,119 +306,6 @@ def __init__(self, **kwargs): self.do_not_pause_value = None -class Resource(Model): - """ARM resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _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'}, - } - - def __init__(self, **kwargs): - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ProxyResource(Resource): - """ARM proxy resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _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'}, - } - - def __init__(self, **kwargs): - super(ProxyResource, self).__init__(**kwargs) - - -class BackupLongTermRetentionPolicy(ProxyResource): - """A long term retention policy. - - 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 weekly_retention: The weekly retention policy for an LTR backup in - an ISO 8601 format. - :type weekly_retention: str - :param monthly_retention: The monthly retention policy for an LTR backup - in an ISO 8601 format. - :type monthly_retention: str - :param yearly_retention: The yearly retention policy for an LTR backup in - an ISO 8601 format. - :type yearly_retention: str - :param week_of_year: The week of year to take the yearly backup in an ISO - 8601 format. - :type week_of_year: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'weekly_retention': {'key': 'properties.weeklyRetention', 'type': 'str'}, - 'monthly_retention': {'key': 'properties.monthlyRetention', 'type': 'str'}, - 'yearly_retention': {'key': 'properties.yearlyRetention', 'type': 'str'}, - 'week_of_year': {'key': 'properties.weekOfYear', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(BackupLongTermRetentionPolicy, self).__init__(**kwargs) - self.weekly_retention = kwargs.get('weekly_retention', None) - self.monthly_retention = kwargs.get('monthly_retention', None) - self.yearly_retention = kwargs.get('yearly_retention', None) - self.week_of_year = kwargs.get('week_of_year', None) - - class BackupShortTermRetentionPolicy(ProxyResource): """A short term retention policy. @@ -403,6 +444,50 @@ def __init__(self, **kwargs): self.last_backup_name = kwargs.get('last_backup_name', None) +class CopyLongTermRetentionBackupParameters(Model): + """Contains the information necessary to perform long term retention backup + copy operation. + + :param target_subscription_id: The subscription that owns the target + server + :type target_subscription_id: str + :param target_resource_group: The resource group that owns the target + server + :type target_resource_group: str + :param target_server_resource_id: The resource Id of the target server + that owns the database + :type target_server_resource_id: str + :param target_server_fully_qualified_domain_name: The fully qualified + domain name of the target server + :type target_server_fully_qualified_domain_name: str + :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 + """ + + _attribute_map = { + 'target_subscription_id': {'key': 'properties.targetSubscriptionId', 'type': 'str'}, + 'target_resource_group': {'key': 'properties.targetResourceGroup', 'type': 'str'}, + 'target_server_resource_id': {'key': 'properties.targetServerResourceId', 'type': 'str'}, + 'target_server_fully_qualified_domain_name': {'key': 'properties.targetServerFullyQualifiedDomainName', 'type': 'str'}, + 'target_database_name': {'key': 'properties.targetDatabaseName', 'type': 'str'}, + 'target_backup_storage_redundancy': {'key': 'properties.targetBackupStorageRedundancy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CopyLongTermRetentionBackupParameters, self).__init__(**kwargs) + self.target_subscription_id = kwargs.get('target_subscription_id', None) + self.target_resource_group = kwargs.get('target_resource_group', None) + self.target_server_resource_id = kwargs.get('target_server_resource_id', None) + self.target_server_fully_qualified_domain_name = kwargs.get('target_server_fully_qualified_domain_name', None) + self.target_database_name = kwargs.get('target_database_name', None) + self.target_backup_storage_redundancy = kwargs.get('target_backup_storage_redundancy', None) + + class CreateDatabaseRestorePointDefinition(Model): """Contains the information necessary to perform a create database restore point operation. @@ -624,10 +709,16 @@ class Database(TrackedResource): :param auto_pause_delay: Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled :type auto_pause_delay: int - :param storage_account_type: The storage account type used to store - backups for this database. 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 database. Possible values include: 'Geo', 'Local', + 'Zone' + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be + used to store backups for this database. Possible values include: 'Geo', + 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused :type min_capacity: float @@ -641,6 +732,10 @@ class Database(TrackedResource): to the database. This configuration defines the period when the maintenance updates will occur. :type maintenance_configuration_id: str + :param is_ledger_on: Whether or not this database is a ledger database, + which means all tables in the database are ledger tables. Note: the value + of this property cannot be changed after the database has been created. + :type is_ledger_on: bool """ _validation = { @@ -660,6 +755,7 @@ class Database(TrackedResource): 'max_log_size_bytes': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, 'current_sku': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, 'paused_date': {'readonly': True}, 'resumed_date': {'readonly': True}, } @@ -702,11 +798,13 @@ class Database(TrackedResource): 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - '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'}, 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, + 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -743,11 +841,13 @@ def __init__(self, **kwargs): self.secondary_type = kwargs.get('secondary_type', None) self.current_sku = None self.auto_pause_delay = kwargs.get('auto_pause_delay', 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.min_capacity = kwargs.get('min_capacity', None) self.paused_date = None self.resumed_date = None self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) + self.is_ledger_on = kwargs.get('is_ledger_on', None) class DatabaseAutomaticTuning(ProxyResource): @@ -811,27 +911,6 @@ class DatabaseBlobAuditingPolicy(ProxyResource): :vartype type: str :ivar kind: Resource kind. :vartype kind: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -868,6 +947,10 @@ class DatabaseBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -896,16 +979,13 @@ class DatabaseBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -924,10 +1004,34 @@ class DatabaseBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int - """ - - _validation = { - 'id': {'readonly': True}, + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'kind': {'readonly': True}, @@ -939,29 +1043,138 @@ class DatabaseBlobAuditingPolicy(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } def __init__(self, **kwargs): super(DatabaseBlobAuditingPolicy, self).__init__(**kwargs) self.kind = None - self.state = kwargs.get('state', None) - self.storage_endpoint = kwargs.get('storage_endpoint', None) - self.storage_account_access_key = kwargs.get('storage_account_access_key', None) self.retention_days = kwargs.get('retention_days', None) self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None) - self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None) self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None) self.queue_delay_ms = kwargs.get('queue_delay_ms', None) + self.state = kwargs.get('state', None) + self.storage_endpoint = kwargs.get('storage_endpoint', None) + self.storage_account_access_key = kwargs.get('storage_account_access_key', None) + self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) + + +class DatabaseColumn(ProxyResource): + """A database column resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param column_type: The column data type. Possible values include: + 'image', 'text', 'uniqueidentifier', 'date', 'time', 'datetime2', + 'datetimeoffset', 'tinyint', 'smallint', 'int', 'smalldatetime', 'real', + 'money', 'datetime', 'float', 'sql_variant', 'ntext', 'bit', 'decimal', + 'numeric', 'smallmoney', 'bigint', 'hierarchyid', 'geometry', 'geography', + 'varbinary', 'varchar', 'binary', 'char', 'timestamp', 'nvarchar', + 'nchar', 'xml', 'sysname' + :type column_type: str or ~azure.mgmt.sql.models.ColumnDataType + :param temporal_type: The table temporal type. Possible values include: + 'NonTemporalTable', 'HistoryTable', 'SystemVersionedTemporalTable' + :type temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType + :param memory_optimized: Whether or not the column belongs to a memory + optimized table. + :type memory_optimized: bool + :param is_computed: Whether or not the column is computed. + :type is_computed: bool + """ + + _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'}, + 'column_type': {'key': 'properties.columnType', 'type': 'str'}, + 'temporal_type': {'key': 'properties.temporalType', 'type': 'str'}, + 'memory_optimized': {'key': 'properties.memoryOptimized', 'type': 'bool'}, + 'is_computed': {'key': 'properties.isComputed', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DatabaseColumn, self).__init__(**kwargs) + self.column_type = kwargs.get('column_type', None) + self.temporal_type = kwargs.get('temporal_type', None) + self.memory_optimized = kwargs.get('memory_optimized', None) + self.is_computed = kwargs.get('is_computed', None) + + +class DatabaseExtensions(ProxyResource): + """An export managed database operation result resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_mode: Required. Operation Mode. Default value: + "PolybaseImport" . + :vartype operation_mode: str + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' + :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :param storage_key: Required. Storage key. + :type storage_key: str + :param storage_uri: Required. Storage Uri. + :type storage_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_mode': {'required': True, 'constant': True}, + 'storage_key_type': {'required': True}, + 'storage_key': {'required': True}, + 'storage_uri': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_mode': {'key': 'properties.operationMode', 'type': 'str'}, + 'storage_key_type': {'key': 'properties.storageKeyType', 'type': 'str'}, + 'storage_key': {'key': 'properties.storageKey', 'type': 'str'}, + 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, + } + + operation_mode = "PolybaseImport" + + def __init__(self, **kwargs): + super(DatabaseExtensions, self).__init__(**kwargs) + self.storage_key_type = kwargs.get('storage_key_type', None) + self.storage_key = kwargs.get('storage_key', None) + self.storage_uri = kwargs.get('storage_uri', None) class DatabaseOperation(ProxyResource): @@ -1067,8 +1280,38 @@ def __init__(self, **kwargs): self.is_cancellable = None +class DatabaseSchema(ProxyResource): + """A database schema resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs): + super(DatabaseSchema, self).__init__(**kwargs) + + class DatabaseSecurityAlertPolicy(ProxyResource): - """Contains information about a database Threat Detection policy. + """A database security alert policy. Variables are only populated by the server, and will be ignored when sending a request. @@ -1081,72 +1324,63 @@ class DatabaseSecurityAlertPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: The geo-location where the resource lives - :type location: str - :ivar kind: Resource kind. - :vartype kind: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint and storageAccountAccessKey are required. - Possible values include: 'New', 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState - :param disabled_alerts: Specifies the semicolon-separated list of alerts - that are disabled, or empty string to disable no alerts. Possible values: - Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; - Data_Exfiltration; Unsafe_Action. - :type disabled_alerts: str - :param email_addresses: Specifies the semicolon-separated list of e-mail - addresses to which the alert is sent. - :type email_addresses: str + :ivar system_data: SystemData of SecurityAlertPolicyResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData + :param state: Required. Specifies the state of the policy, whether it is + enabled or disabled or a policy has not been applied yet on the specific + database. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState + :param disabled_alerts: Specifies an array of alerts that are disabled. + Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force + :type disabled_alerts: list[str] + :param email_addresses: Specifies an array of e-mail addresses to which + the alert is sent. + :type email_addresses: list[str] :param email_account_admins: Specifies that the alert is sent to the - account administrators. Possible values include: 'Enabled', 'Disabled' - :type email_account_admins: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyEmailAccountAdmins + account administrators. + :type email_account_admins: bool :param storage_endpoint: Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all - Threat Detection audit logs. If state is Enabled, storageEndpoint is - required. + Threat Detection audit logs. :type storage_endpoint: str :param storage_account_access_key: Specifies the identifier key of the - Threat Detection audit storage account. If state is Enabled, - storageAccountAccessKey is required. + Threat Detection audit storage account. :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the Threat Detection audit logs. :type retention_days: int - :param use_server_default: Specifies whether to use the default server - policy. Possible values include: 'Enabled', 'Disabled' - :type use_server_default: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyUseServerDefault + :ivar creation_time: Specifies the UTC creation time of the policy. + :vartype creation_time: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, 'state': {'required': True}, + 'creation_time': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'}, - 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': 'str'}, - 'email_addresses': {'key': 'properties.emailAddresses', 'type': 'str'}, - 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'SecurityAlertPolicyEmailAccountAdmins'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'SecurityAlertsPolicyState'}, + 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, + 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, + 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, - 'use_server_default': {'key': 'properties.useServerDefault', 'type': 'SecurityAlertPolicyUseServerDefault'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, } def __init__(self, **kwargs): super(DatabaseSecurityAlertPolicy, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.kind = None + self.system_data = None self.state = kwargs.get('state', None) self.disabled_alerts = kwargs.get('disabled_alerts', None) self.email_addresses = kwargs.get('email_addresses', None) @@ -1154,7 +1388,46 @@ def __init__(self, **kwargs): self.storage_endpoint = kwargs.get('storage_endpoint', None) self.storage_account_access_key = kwargs.get('storage_account_access_key', None) self.retention_days = kwargs.get('retention_days', None) - self.use_server_default = kwargs.get('use_server_default', None) + self.creation_time = None + + +class DatabaseTable(ProxyResource): + """A database table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param temporal_type: The table temporal type. Possible values include: + 'NonTemporalTable', 'HistoryTable', 'SystemVersionedTemporalTable' + :type temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType + :param memory_optimized: Whether or not the table is memory optimized. + :type memory_optimized: bool + """ + + _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'}, + 'temporal_type': {'key': 'properties.temporalType', 'type': 'str'}, + 'memory_optimized': {'key': 'properties.memoryOptimized', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(DatabaseTable, self).__init__(**kwargs) + self.temporal_type = kwargs.get('temporal_type', None) + self.memory_optimized = kwargs.get('memory_optimized', None) class DatabaseUpdate(Model): @@ -1287,10 +1560,16 @@ class DatabaseUpdate(Model): :param auto_pause_delay: Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled :type auto_pause_delay: int - :param storage_account_type: The storage account type used to store - backups for this database. 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 database. Possible values include: 'Geo', 'Local', + 'Zone' + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be + used to store backups for this database. Possible values include: 'Geo', + 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused :type min_capacity: float @@ -1304,6 +1583,10 @@ class DatabaseUpdate(Model): to the database. This configuration defines the period when the maintenance updates will occur. :type maintenance_configuration_id: str + :param is_ledger_on: Whether or not this database is a ledger database, + which means all tables in the database are ledger tables. Note: the value + of this property cannot be changed after the database has been created. + :type is_ledger_on: bool :param tags: Resource tags. :type tags: dict[str, str] """ @@ -1319,6 +1602,7 @@ class DatabaseUpdate(Model): 'max_log_size_bytes': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, 'current_sku': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, 'paused_date': {'readonly': True}, 'resumed_date': {'readonly': True}, } @@ -1354,11 +1638,13 @@ class DatabaseUpdate(Model): 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - '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'}, 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, + 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -1394,66 +1680,64 @@ def __init__(self, **kwargs): self.secondary_type = kwargs.get('secondary_type', None) self.current_sku = None self.auto_pause_delay = kwargs.get('auto_pause_delay', 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.min_capacity = kwargs.get('min_capacity', None) self.paused_date = None self.resumed_date = None self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) + self.is_ledger_on = kwargs.get('is_ledger_on', None) self.tags = kwargs.get('tags', None) -class DatabaseUsage(Model): - """The database usages. +class DatabaseUsage(ProxyResource): + """Usage metric of a database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the usage metric. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar resource_name: The name of the resource. - :vartype resource_name: str - :ivar display_name: The usage metric display name. + :ivar type: Resource type. + :vartype type: str + :ivar display_name: User-readable name of the metric. :vartype display_name: str - :ivar current_value: The current value of the usage metric. + :ivar current_value: Current value of the metric. :vartype current_value: float - :ivar limit: The current limit of the usage metric. + :ivar limit: Boundary value of the metric. :vartype limit: float - :ivar unit: The units of the usage metric. + :ivar unit: Unit of the metric. :vartype unit: str - :ivar next_reset_time: The next reset time for the usage metric (ISO8601 - format). - :vartype next_reset_time: datetime """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, - 'resource_name': {'readonly': True}, + 'type': {'readonly': True}, 'display_name': {'readonly': True}, 'current_value': {'readonly': True}, 'limit': {'readonly': True}, 'unit': {'readonly': True}, - 'next_reset_time': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'float'}, + 'limit': {'key': 'properties.limit', 'type': 'float'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, } def __init__(self, **kwargs): super(DatabaseUsage, self).__init__(**kwargs) - self.name = None - self.resource_name = None self.display_name = None self.current_value = None self.limit = None self.unit = None - self.next_reset_time = None class DatabaseVulnerabilityAssessment(ProxyResource): @@ -1473,9 +1757,9 @@ class DatabaseVulnerabilityAssessment(ProxyResource): is required if server level vulnerability assessment policy doesn't set :type storage_container_path: str :param storage_container_sas_key: A shared access signature (SAS Key) that - has read and write access to the blob container specified in - 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't - specified, StorageContainerSasKey is required. + has write access to the blob container specified in 'storageContainerPath' + parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. :type storage_container_sas_key: str :param storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If @@ -1608,189 +1892,90 @@ def __init__(self, **kwargs): self.exported_report_location = None -class DataMaskingPolicy(ProxyResource): - """Represents a database data masking policy. +class DataWarehouseUserActivities(ProxyResource): + """User activities of a data warehouse. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param data_masking_state: Required. The state of the data masking policy. - Possible values include: 'Disabled', 'Enabled' - :type data_masking_state: str or ~azure.mgmt.sql.models.DataMaskingState - :param exempt_principals: The list of the exempt principals. Specifies the - semicolon-separated list of database users for which the data masking - policy does not apply. The specified users receive data results without - masking for all of the database queries. - :type exempt_principals: str - :ivar application_principals: The list of the application principals. This - is a legacy parameter and is no longer used. - :vartype application_principals: str - :ivar masking_level: The masking level. This is a legacy parameter and is - no longer used. - :vartype masking_level: str - :ivar location: The location of the data masking policy. - :vartype location: str - :ivar kind: The kind of data masking policy. Metadata, used for Azure - portal. - :vartype kind: str + :ivar active_queries_count: Count of running and suspended queries. + :vartype active_queries_count: int """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'data_masking_state': {'required': True}, - 'application_principals': {'readonly': True}, - 'masking_level': {'readonly': True}, - 'location': {'readonly': True}, - 'kind': {'readonly': True}, + 'active_queries_count': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'data_masking_state': {'key': 'properties.dataMaskingState', 'type': 'DataMaskingState'}, - 'exempt_principals': {'key': 'properties.exemptPrincipals', 'type': 'str'}, - 'application_principals': {'key': 'properties.applicationPrincipals', 'type': 'str'}, - 'masking_level': {'key': 'properties.maskingLevel', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, + 'active_queries_count': {'key': 'properties.activeQueriesCount', 'type': 'int'}, } def __init__(self, **kwargs): - super(DataMaskingPolicy, self).__init__(**kwargs) - self.data_masking_state = kwargs.get('data_masking_state', None) - self.exempt_principals = kwargs.get('exempt_principals', None) - self.application_principals = None - self.masking_level = None - self.location = None - self.kind = None + super(DataWarehouseUserActivities, self).__init__(**kwargs) + self.active_queries_count = None -class DataMaskingRule(ProxyResource): - """Represents a database data masking rule. +class DeletedServer(ProxyResource): + """A deleted server. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar data_masking_rule_id: The rule Id. - :vartype data_masking_rule_id: str - :param alias_name: The alias name. This is a legacy parameter and is no - longer used. - :type alias_name: str - :param rule_state: The rule state. Used to delete a rule. To delete an - existing rule, specify the schemaName, tableName, columnName, - maskingFunction, and specify ruleState as disabled. However, if the rule - doesn't already exist, the rule will be created with ruleState set to - enabled, regardless of the provided value of ruleState. Possible values - include: 'Disabled', 'Enabled' - :type rule_state: str or ~azure.mgmt.sql.models.DataMaskingRuleState - :param schema_name: Required. The schema name on which the data masking - rule is applied. - :type schema_name: str - :param table_name: Required. The table name on which the data masking rule - is applied. - :type table_name: str - :param column_name: Required. The column name on which the data masking - rule is applied. - :type column_name: str - :param masking_function: Required. The masking function that is used for - the data masking rule. Possible values include: 'Default', 'CCN', 'Email', - 'Number', 'SSN', 'Text' - :type masking_function: str or ~azure.mgmt.sql.models.DataMaskingFunction - :param number_from: The numberFrom property of the masking rule. Required - if maskingFunction is set to Number, otherwise this parameter will be - ignored. - :type number_from: str - :param number_to: The numberTo property of the data masking rule. Required - if maskingFunction is set to Number, otherwise this parameter will be - ignored. - :type number_to: str - :param prefix_size: If maskingFunction is set to Text, the number of - characters to show unmasked in the beginning of the string. Otherwise, - this parameter will be ignored. - :type prefix_size: str - :param suffix_size: If maskingFunction is set to Text, the number of - characters to show unmasked at the end of the string. Otherwise, this - parameter will be ignored. - :type suffix_size: str - :param replacement_string: If maskingFunction is set to Text, the - character to use for masking the unexposed part of the string. Otherwise, - this parameter will be ignored. - :type replacement_string: str - :ivar location: The location of the data masking rule. - :vartype location: str - :ivar kind: The kind of Data Masking Rule. Metadata, used for Azure - portal. - :vartype kind: str + :ivar version: The version of the deleted server. + :vartype version: str + :ivar deletion_time: The deletion time of the deleted server. + :vartype deletion_time: datetime + :ivar original_id: The original ID of the server before deletion. + :vartype original_id: str + :ivar fully_qualified_domain_name: The fully qualified domain name of the + server. + :vartype fully_qualified_domain_name: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'data_masking_rule_id': {'readonly': True}, - 'schema_name': {'required': True}, - 'table_name': {'required': True}, - 'column_name': {'required': True}, - 'masking_function': {'required': True}, - 'location': {'readonly': True}, - 'kind': {'readonly': True}, + 'version': {'readonly': True}, + 'deletion_time': {'readonly': True}, + 'original_id': {'readonly': True}, + 'fully_qualified_domain_name': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'data_masking_rule_id': {'key': 'properties.id', 'type': 'str'}, - 'alias_name': {'key': 'properties.aliasName', 'type': 'str'}, - 'rule_state': {'key': 'properties.ruleState', 'type': 'DataMaskingRuleState'}, - 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, - 'table_name': {'key': 'properties.tableName', 'type': 'str'}, - 'column_name': {'key': 'properties.columnName', 'type': 'str'}, - 'masking_function': {'key': 'properties.maskingFunction', 'type': 'DataMaskingFunction'}, - 'number_from': {'key': 'properties.numberFrom', 'type': 'str'}, - 'number_to': {'key': 'properties.numberTo', 'type': 'str'}, - 'prefix_size': {'key': 'properties.prefixSize', 'type': 'str'}, - 'suffix_size': {'key': 'properties.suffixSize', 'type': 'str'}, - 'replacement_string': {'key': 'properties.replacementString', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'iso-8601'}, + 'original_id': {'key': 'properties.originalId', 'type': 'str'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, } def __init__(self, **kwargs): - super(DataMaskingRule, self).__init__(**kwargs) - self.data_masking_rule_id = None - self.alias_name = kwargs.get('alias_name', None) - self.rule_state = kwargs.get('rule_state', None) - self.schema_name = kwargs.get('schema_name', None) - self.table_name = kwargs.get('table_name', None) - self.column_name = kwargs.get('column_name', None) - self.masking_function = kwargs.get('masking_function', None) - self.number_from = kwargs.get('number_from', None) - self.number_to = kwargs.get('number_to', None) - self.prefix_size = kwargs.get('prefix_size', None) - self.suffix_size = kwargs.get('suffix_size', None) - self.replacement_string = kwargs.get('replacement_string', None) - self.location = None - self.kind = None + super(DeletedServer, self).__init__(**kwargs) + self.version = None + self.deletion_time = None + self.original_id = None + self.fully_qualified_domain_name = None class EditionCapability(Model): @@ -1947,258 +2132,6 @@ def __init__(self, **kwargs): self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) -class ElasticPoolActivity(ProxyResource): - """Represents the activity on an elastic pool. - - 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 location: The geo-location where the resource lives - :type location: str - :ivar end_time: The time the operation finished (ISO8601 format). - :vartype end_time: datetime - :ivar error_code: The error code if available. - :vartype error_code: int - :ivar error_message: The error message if available. - :vartype error_message: str - :ivar error_severity: The error severity if available. - :vartype error_severity: int - :ivar operation: The operation name. - :vartype operation: str - :ivar operation_id: The unique operation ID. - :vartype operation_id: str - :ivar percent_complete: The percentage complete if available. - :vartype percent_complete: int - :ivar requested_database_dtu_max: The requested max DTU per database if - available. - :vartype requested_database_dtu_max: int - :ivar requested_database_dtu_min: The requested min DTU per database if - available. - :vartype requested_database_dtu_min: int - :ivar requested_dtu: The requested DTU for the pool if available. - :vartype requested_dtu: int - :ivar requested_elastic_pool_name: The requested name for the elastic pool - if available. - :vartype requested_elastic_pool_name: str - :ivar requested_storage_limit_in_gb: The requested storage limit for the - pool in GB if available. - :vartype requested_storage_limit_in_gb: long - :ivar elastic_pool_name: The name of the elastic pool. - :vartype elastic_pool_name: str - :ivar server_name: The name of the server the elastic pool is in. - :vartype server_name: str - :ivar start_time: The time the operation started (ISO8601 format). - :vartype start_time: datetime - :ivar state: The current state of the operation. - :vartype state: str - :ivar requested_storage_limit_in_mb: The requested storage limit in MB. - :vartype requested_storage_limit_in_mb: int - :ivar requested_database_dtu_guarantee: The requested per database DTU - guarantee. - :vartype requested_database_dtu_guarantee: int - :ivar requested_database_dtu_cap: The requested per database DTU cap. - :vartype requested_database_dtu_cap: int - :ivar requested_dtu_guarantee: The requested DTU guarantee. - :vartype requested_dtu_guarantee: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'end_time': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_message': {'readonly': True}, - 'error_severity': {'readonly': True}, - 'operation': {'readonly': True}, - 'operation_id': {'readonly': True}, - 'percent_complete': {'readonly': True}, - 'requested_database_dtu_max': {'readonly': True}, - 'requested_database_dtu_min': {'readonly': True}, - 'requested_dtu': {'readonly': True}, - 'requested_elastic_pool_name': {'readonly': True}, - 'requested_storage_limit_in_gb': {'readonly': True}, - 'elastic_pool_name': {'readonly': True}, - 'server_name': {'readonly': True}, - 'start_time': {'readonly': True}, - 'state': {'readonly': True}, - 'requested_storage_limit_in_mb': {'readonly': True}, - 'requested_database_dtu_guarantee': {'readonly': True}, - 'requested_database_dtu_cap': {'readonly': True}, - 'requested_dtu_guarantee': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, - 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, - 'error_severity': {'key': 'properties.errorSeverity', 'type': 'int'}, - 'operation': {'key': 'properties.operation', 'type': 'str'}, - 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, - 'requested_database_dtu_max': {'key': 'properties.requestedDatabaseDtuMax', 'type': 'int'}, - 'requested_database_dtu_min': {'key': 'properties.requestedDatabaseDtuMin', 'type': 'int'}, - 'requested_dtu': {'key': 'properties.requestedDtu', 'type': 'int'}, - 'requested_elastic_pool_name': {'key': 'properties.requestedElasticPoolName', 'type': 'str'}, - 'requested_storage_limit_in_gb': {'key': 'properties.requestedStorageLimitInGB', 'type': 'long'}, - 'elastic_pool_name': {'key': 'properties.elasticPoolName', 'type': 'str'}, - 'server_name': {'key': 'properties.serverName', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'requested_storage_limit_in_mb': {'key': 'properties.requestedStorageLimitInMB', 'type': 'int'}, - 'requested_database_dtu_guarantee': {'key': 'properties.requestedDatabaseDtuGuarantee', 'type': 'int'}, - 'requested_database_dtu_cap': {'key': 'properties.requestedDatabaseDtuCap', 'type': 'int'}, - 'requested_dtu_guarantee': {'key': 'properties.requestedDtuGuarantee', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(ElasticPoolActivity, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.end_time = None - self.error_code = None - self.error_message = None - self.error_severity = None - self.operation = None - self.operation_id = None - self.percent_complete = None - self.requested_database_dtu_max = None - self.requested_database_dtu_min = None - self.requested_dtu = None - self.requested_elastic_pool_name = None - self.requested_storage_limit_in_gb = None - self.elastic_pool_name = None - self.server_name = None - self.start_time = None - self.state = None - self.requested_storage_limit_in_mb = None - self.requested_database_dtu_guarantee = None - self.requested_database_dtu_cap = None - self.requested_dtu_guarantee = None - - -class ElasticPoolDatabaseActivity(ProxyResource): - """Represents the activity on an elastic pool. - - 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 location: The geo-location where the resource lives - :type location: str - :ivar database_name: The database name. - :vartype database_name: str - :ivar end_time: The time the operation finished (ISO8601 format). - :vartype end_time: datetime - :ivar error_code: The error code if available. - :vartype error_code: int - :ivar error_message: The error message if available. - :vartype error_message: str - :ivar error_severity: The error severity if available. - :vartype error_severity: int - :ivar operation: The operation name. - :vartype operation: str - :ivar operation_id: The unique operation ID. - :vartype operation_id: str - :ivar percent_complete: The percentage complete if available. - :vartype percent_complete: int - :ivar requested_elastic_pool_name: The name for the elastic pool the - database is moving into if available. - :vartype requested_elastic_pool_name: str - :ivar current_elastic_pool_name: The name of the current elastic pool the - database is in if available. - :vartype current_elastic_pool_name: str - :ivar current_service_objective: The name of the current service objective - if available. - :vartype current_service_objective: str - :ivar requested_service_objective: The name of the requested service - objective if available. - :vartype requested_service_objective: str - :ivar server_name: The name of the server the elastic pool is in. - :vartype server_name: str - :ivar start_time: The time the operation started (ISO8601 format). - :vartype start_time: datetime - :ivar state: The current state of the operation. - :vartype state: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'database_name': {'readonly': True}, - 'end_time': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_message': {'readonly': True}, - 'error_severity': {'readonly': True}, - 'operation': {'readonly': True}, - 'operation_id': {'readonly': True}, - 'percent_complete': {'readonly': True}, - 'requested_elastic_pool_name': {'readonly': True}, - 'current_elastic_pool_name': {'readonly': True}, - 'current_service_objective': {'readonly': True}, - 'requested_service_objective': {'readonly': True}, - 'server_name': {'readonly': True}, - 'start_time': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, - 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, - 'error_severity': {'key': 'properties.errorSeverity', 'type': 'int'}, - 'operation': {'key': 'properties.operation', 'type': 'str'}, - 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, - 'requested_elastic_pool_name': {'key': 'properties.requestedElasticPoolName', 'type': 'str'}, - 'current_elastic_pool_name': {'key': 'properties.currentElasticPoolName', 'type': 'str'}, - 'current_service_objective': {'key': 'properties.currentServiceObjective', 'type': 'str'}, - 'requested_service_objective': {'key': 'properties.requestedServiceObjective', 'type': 'str'}, - 'server_name': {'key': 'properties.serverName', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ElasticPoolDatabaseActivity, self).__init__(**kwargs) - self.location = kwargs.get('location', None) - self.database_name = None - self.end_time = None - self.error_code = None - self.error_message = None - self.error_severity = None - self.operation = None - self.operation_id = None - self.percent_complete = None - self.requested_elastic_pool_name = None - self.current_elastic_pool_name = None - self.current_service_objective = None - self.requested_service_objective = None - self.server_name = None - self.start_time = None - self.state = None - - class ElasticPoolEditionCapability(Model): """The elastic pool edition capability. @@ -2620,6 +2553,9 @@ class EncryptionProtector(ProxyResource): :vartype uri: str :ivar thumbprint: Thumbprint of the server key. :vartype thumbprint: str + :param auto_rotation_enabled: Key auto rotation opt-in flag. Either true + or false. + :type auto_rotation_enabled: bool """ _validation = { @@ -2645,6 +2581,7 @@ class EncryptionProtector(ProxyResource): 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -2656,6 +2593,7 @@ def __init__(self, **kwargs): self.server_key_type = kwargs.get('server_key_type', None) self.uri = None self.thumbprint = None + self.auto_rotation_enabled = kwargs.get('auto_rotation_enabled', None) class ExportDatabaseDefinition(Model): @@ -2728,27 +2666,6 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): :param predicate_expression: Specifies condition of where clause when creating an audit. :type predicate_expression: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -2785,6 +2702,10 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -2813,16 +2734,13 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -2841,6 +2759,30 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str """ _validation = { @@ -2855,29 +2797,29 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'predicate_expression': {'key': 'properties.predicateExpression', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } def __init__(self, **kwargs): super(ExtendedDatabaseBlobAuditingPolicy, self).__init__(**kwargs) self.predicate_expression = kwargs.get('predicate_expression', None) - self.state = kwargs.get('state', None) - self.storage_endpoint = kwargs.get('storage_endpoint', None) - self.storage_account_access_key = kwargs.get('storage_account_access_key', None) self.retention_days = kwargs.get('retention_days', None) self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None) - self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None) self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None) self.queue_delay_ms = kwargs.get('queue_delay_ms', None) + self.state = kwargs.get('state', None) + self.storage_endpoint = kwargs.get('storage_endpoint', None) + self.storage_account_access_key = kwargs.get('storage_account_access_key', None) + self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) class ExtendedServerBlobAuditingPolicy(ProxyResource): @@ -2894,30 +2836,25 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :param is_devops_audit_enabled: Specifies the state of devops audit. If + state is Enabled, devops logs will be sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as + 'Enabled', 'IsAzureMonitorTargetEnabled' as true and + 'IsDevopsAuditEnabled' as true + When using REST API to configure auditing, Diagnostic Settings with + 'DevOpsOperationsAudit' diagnostic logs category on the master database + should also be created. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST + API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings + PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + :type is_devops_audit_enabled: bool :param predicate_expression: Specifies condition of where clause when creating an audit. :type predicate_expression: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -2954,6 +2891,10 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -2982,16 +2923,13 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -3010,11 +2948,35 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, 'state': {'required': True}, } @@ -3023,30 +2985,32 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'is_devops_audit_enabled': {'key': 'properties.isDevopsAuditEnabled', 'type': 'bool'}, 'predicate_expression': {'key': 'properties.predicateExpression', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } def __init__(self, **kwargs): super(ExtendedServerBlobAuditingPolicy, self).__init__(**kwargs) + self.is_devops_audit_enabled = kwargs.get('is_devops_audit_enabled', None) self.predicate_expression = kwargs.get('predicate_expression', None) - self.state = kwargs.get('state', None) - self.storage_endpoint = kwargs.get('storage_endpoint', None) - self.storage_account_access_key = kwargs.get('storage_account_access_key', None) self.retention_days = kwargs.get('retention_days', None) self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None) - self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None) self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None) self.queue_delay_ms = kwargs.get('queue_delay_ms', None) + self.state = kwargs.get('state', None) + self.storage_endpoint = kwargs.get('storage_endpoint', None) + self.storage_account_access_key = kwargs.get('storage_account_access_key', None) + self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) class FailoverGroup(ProxyResource): @@ -3208,114 +3172,121 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) -class FirewallRule(ProxyResource): - """Represents a server firewall rule. +class ResourceWithWritableName(Model): + """ARM resource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str - :ivar name: Resource name. - :vartype name: str + :param name: Resource name. + :type name: str :ivar type: Resource type. :vartype type: str - :ivar kind: Kind of server that contains this firewall rule. - :vartype kind: str - :ivar location: Location of the server that contains this firewall rule. - :vartype location: str - :param start_ip_address: Required. The start IP address of the firewall - rule. Must be IPv4 format. Use value '0.0.0.0' to represent all - Azure-internal IP addresses. - :type start_ip_address: str - :param end_ip_address: Required. The end IP address of the firewall rule. - Must be IPv4 format. Must be greater than or equal to startIpAddress. Use - value '0.0.0.0' to represent all Azure-internal IP addresses. - :type end_ip_address: str """ _validation = { 'id': {'readonly': True}, - 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'location': {'readonly': True}, - 'start_ip_address': {'required': True}, - 'end_ip_address': {'required': 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'}, - 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, - 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, } def __init__(self, **kwargs): - super(FirewallRule, self).__init__(**kwargs) - self.kind = None - self.location = None - self.start_ip_address = kwargs.get('start_ip_address', None) - self.end_ip_address = kwargs.get('end_ip_address', None) + super(ResourceWithWritableName, self).__init__(**kwargs) + self.id = None + self.name = kwargs.get('name', None) + self.type = None -class GeoBackupPolicy(ProxyResource): - """A database geo backup policy. +class ProxyResourceWithWritableName(ResourceWithWritableName): + """ARM proxy resource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. + :vartype id: str + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResourceWithWritableName, self).__init__(**kwargs) + + +class FirewallRule(ProxyResourceWithWritableName): + """A server firewall rule. + + 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 + :param name: Resource name. + :type name: str :ivar type: Resource type. :vartype type: str - :param state: Required. The state of the geo backup policy. Possible - values include: 'Disabled', 'Enabled' - :type state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState - :ivar storage_type: The storage type of the geo backup policy. - :vartype storage_type: str - :ivar kind: Kind of geo backup policy. This is metadata used for the - Azure portal experience. - :vartype kind: str - :ivar location: Backup policy location. - :vartype location: str + :param start_ip_address: The start IP address of the firewall rule. Must + be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses. + :type start_ip_address: str + :param end_ip_address: The end IP address of the firewall rule. Must be + IPv4 format. Must be greater than or equal to startIpAddress. Use value + '0.0.0.0' for all Azure-internal IP addresses. + :type end_ip_address: str """ _validation = { 'id': {'readonly': True}, - 'name': {'readonly': True}, 'type': {'readonly': True}, - 'state': {'required': True}, - 'storage_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'location': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'GeoBackupPolicyState'}, - 'storage_type': {'key': 'properties.storageType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, } def __init__(self, **kwargs): - super(GeoBackupPolicy, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.storage_type = None - self.kind = None - self.location = None + super(FirewallRule, self).__init__(**kwargs) + self.start_ip_address = kwargs.get('start_ip_address', None) + self.end_ip_address = kwargs.get('end_ip_address', None) + + +class FirewallRuleList(Model): + """A list of server firewall rules. + + :param values: + :type values: list[~azure.mgmt.sql.models.FirewallRule] + """ + + _attribute_map = { + 'values': {'key': 'values', 'type': '[FirewallRule]'}, + } + + def __init__(self, **kwargs): + super(FirewallRuleList, self).__init__(**kwargs) + self.values = kwargs.get('values', None) class ImportExistingDatabaseDefinition(Model): @@ -3372,6 +3343,71 @@ def __init__(self, **kwargs): self.network_isolation = kwargs.get('network_isolation', None) +class ImportExportExtensionsOperationResult(ProxyResource): + """An Extension operation result resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar request_id: Request Id. + :vartype request_id: str + :ivar request_type: Request type. + :vartype request_type: str + :ivar last_modified_time: Last modified time. + :vartype last_modified_time: str + :ivar server_name: Server name. + :vartype server_name: str + :ivar database_name: Database name. + :vartype database_name: str + :ivar status: Operation status. + :vartype status: str + :ivar error_message: Error message. + :vartype error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'request_id': {'readonly': True}, + 'request_type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'server_name': {'readonly': True}, + 'database_name': {'readonly': True}, + 'status': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'request_id': {'key': 'properties.requestId', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, + 'server_name': {'key': 'properties.serverName', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ImportExportExtensionsOperationResult, self).__init__(**kwargs) + self.request_id = None + self.request_type = None + self.last_modified_time = None + self.server_name = None + self.database_name = None + self.status = None + self.error_message = None + + class ImportExportOperationResult(ProxyResource): """An ImportExport operation result resource. @@ -4148,10 +4184,10 @@ class JobSchedule(Model): """Scheduling properties of a job. :param start_time: Schedule start time. Default value: - "0001-01-01T00:00:00Z" . + "0001-01-01T00:00:00+00:00" . :type start_time: datetime - :param end_time: Schedule end time. Default value: "9999-12-31T11:59:59Z" - . + :param end_time: Schedule end time. Default value: + "9999-12-31T11:59:59+00:00" . :type end_time: datetime :param type: Schedule interval type. Possible values include: 'Once', 'Recurring'. Default value: "Once" . @@ -4159,7 +4195,7 @@ class JobSchedule(Model): :param enabled: Whether or not the schedule is enabled. :type enabled: bool :param interval: Value of the schedule's recurring interval, if the - schedule type is recurring. ISO8601 duration format. + ScheduleType is recurring. ISO8601 duration format. :type interval: str """ @@ -4173,8 +4209,8 @@ class JobSchedule(Model): def __init__(self, **kwargs): super(JobSchedule, self).__init__(**kwargs) - self.start_time = kwargs.get('start_time', "0001-01-01T00:00:00Z") - self.end_time = kwargs.get('end_time', "9999-12-31T11:59:59Z") + self.start_time = kwargs.get('start_time', "0001-01-01T00:00:00+00:00") + self.end_time = kwargs.get('end_time', "9999-12-31T11:59:59+00:00") self.type = kwargs.get('type', "Once") self.enabled = kwargs.get('enabled', None) self.interval = kwargs.get('interval', None) @@ -4488,6 +4524,48 @@ def __init__(self, **kwargs): super(JobVersion, self).__init__(**kwargs) +class LedgerDigestUploads(ProxyResource): + """Azure SQL Database ledger digest upload settings. + + 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 digest_storage_endpoint: The digest storage endpoint, which must be + either an Azure blob storage endpoint or an URI for Azure Confidential + Ledger. + :type digest_storage_endpoint: str + :ivar state: Specifies the state of ledger digest upload. Possible values + include: 'Enabled', 'Disabled' + :vartype state: str or ~azure.mgmt.sql.models.LedgerDigestUploadsState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'digest_storage_endpoint': {'key': 'properties.digestStorageEndpoint', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'LedgerDigestUploadsState'}, + } + + def __init__(self, **kwargs): + super(LedgerDigestUploads, self).__init__(**kwargs) + self.digest_storage_endpoint = kwargs.get('digest_storage_endpoint', None) + self.state = None + + class LicenseTypeCapability(Model): """The license type capability. @@ -4567,6 +4645,44 @@ def __init__(self, **kwargs): 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. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Required. 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}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'TransparentDataEncryptionState'}, + } + + def __init__(self, **kwargs): + super(LogicalDatabaseTransparentDataEncryption, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + + class LogSizeCapability(Model): """The log size capability. @@ -4621,6 +4737,14 @@ class LongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: datetime + :ivar backup_storage_redundancy: The storage redundancy type of the + backup. Possible values include: 'Geo', 'Local', 'Zone' + :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' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy """ _validation = { @@ -4633,6 +4757,7 @@ class LongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'readonly': True}, 'backup_time': {'readonly': True}, 'backup_expiration_time': {'readonly': True}, + 'backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -4645,6 +4770,8 @@ class LongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'key': 'properties.databaseDeletionTime', 'type': 'iso-8601'}, 'backup_time': {'key': 'properties.backupTime', 'type': 'iso-8601'}, 'backup_expiration_time': {'key': 'properties.backupExpirationTime', 'type': 'iso-8601'}, + 'backup_storage_redundancy': {'key': 'properties.backupStorageRedundancy', 'type': 'str'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, } def __init__(self, **kwargs): @@ -4655,15 +4782,134 @@ def __init__(self, **kwargs): self.database_deletion_time = None self.backup_time = None self.backup_expiration_time = None + self.backup_storage_redundancy = None + self.requested_backup_storage_redundancy = kwargs.get('requested_backup_storage_redundancy', None) -class MaintenanceConfigurationCapability(Model): - """The maintenance configuration capability. +class LongTermRetentionBackupOperationResult(ProxyResource): + """A LongTermRetentionBackup operation result resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Maintenance configuration name + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar request_id: Request Id. + :vartype request_id: str + :ivar operation_type: Operation type. + :vartype operation_type: str + :ivar from_backup_resource_id: Source backup resource id + :vartype from_backup_resource_id: str + :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' + :vartype target_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar status: Operation status + :vartype status: str + :ivar message: Progress message + :vartype message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'request_id': {'readonly': True}, + 'operation_type': {'readonly': True}, + 'from_backup_resource_id': {'readonly': True}, + 'to_backup_resource_id': {'readonly': True}, + 'target_backup_storage_redundancy': {'readonly': True}, + 'status': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'request_id': {'key': 'properties.requestId', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'from_backup_resource_id': {'key': 'properties.fromBackupResourceId', 'type': 'str'}, + 'to_backup_resource_id': {'key': 'properties.toBackupResourceId', 'type': 'str'}, + 'target_backup_storage_redundancy': {'key': 'properties.targetBackupStorageRedundancy', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LongTermRetentionBackupOperationResult, self).__init__(**kwargs) + self.request_id = None + self.operation_type = None + self.from_backup_resource_id = None + self.to_backup_resource_id = None + self.target_backup_storage_redundancy = None + self.status = None + self.message = None + + +class LongTermRetentionPolicy(ProxyResource): + """A long term retention policy. + + 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 weekly_retention: The weekly retention policy for an LTR backup in + an ISO 8601 format. + :type weekly_retention: str + :param monthly_retention: The monthly retention policy for an LTR backup + in an ISO 8601 format. + :type monthly_retention: str + :param yearly_retention: The yearly retention policy for an LTR backup in + an ISO 8601 format. + :type yearly_retention: str + :param week_of_year: The week of year to take the yearly backup in an ISO + 8601 format. + :type week_of_year: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'weekly_retention': {'key': 'properties.weeklyRetention', 'type': 'str'}, + 'monthly_retention': {'key': 'properties.monthlyRetention', 'type': 'str'}, + 'yearly_retention': {'key': 'properties.yearlyRetention', 'type': 'str'}, + 'week_of_year': {'key': 'properties.weekOfYear', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(LongTermRetentionPolicy, self).__init__(**kwargs) + self.weekly_retention = kwargs.get('weekly_retention', None) + self.monthly_retention = kwargs.get('monthly_retention', None) + self.yearly_retention = kwargs.get('yearly_retention', None) + self.week_of_year = kwargs.get('week_of_year', None) + + +class MaintenanceConfigurationCapability(Model): + """The maintenance configuration capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Maintenance configuration name :vartype name: str :ivar zone_redundant: Whether or not zone redundancy is supported for the maintenance configuration. @@ -4696,6 +4942,131 @@ def __init__(self, **kwargs): self.reason = kwargs.get('reason', None) +class MaintenanceWindowOptions(ProxyResource): + """Maintenance window options. + + 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 is_enabled: Whether maintenance windows are enabled for the + database. + :type is_enabled: bool + :param maintenance_window_cycles: Available maintenance cycles e.g. + {Saturday, 0, 48*60}, {Wednesday, 0, 24*60}. + :type maintenance_window_cycles: + list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] + :param min_duration_in_minutes: Minimum duration of maintenance window. + :type min_duration_in_minutes: int + :param default_duration_in_minutes: Default duration for maintenance + window. + :type default_duration_in_minutes: int + :param min_cycles: Minimum number of maintenance windows cycles to be set + on the database. + :type min_cycles: int + :param time_granularity_in_minutes: Time granularity in minutes for + maintenance windows. + :type time_granularity_in_minutes: int + :param allow_multiple_maintenance_windows_per_cycle: Whether we allow + multiple maintenance windows per cycle. + :type allow_multiple_maintenance_windows_per_cycle: bool + """ + + _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'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'maintenance_window_cycles': {'key': 'properties.maintenanceWindowCycles', 'type': '[MaintenanceWindowTimeRange]'}, + 'min_duration_in_minutes': {'key': 'properties.minDurationInMinutes', 'type': 'int'}, + 'default_duration_in_minutes': {'key': 'properties.defaultDurationInMinutes', 'type': 'int'}, + 'min_cycles': {'key': 'properties.minCycles', 'type': 'int'}, + 'time_granularity_in_minutes': {'key': 'properties.timeGranularityInMinutes', 'type': 'int'}, + 'allow_multiple_maintenance_windows_per_cycle': {'key': 'properties.allowMultipleMaintenanceWindowsPerCycle', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(MaintenanceWindowOptions, self).__init__(**kwargs) + self.is_enabled = kwargs.get('is_enabled', None) + self.maintenance_window_cycles = kwargs.get('maintenance_window_cycles', None) + self.min_duration_in_minutes = kwargs.get('min_duration_in_minutes', None) + self.default_duration_in_minutes = kwargs.get('default_duration_in_minutes', None) + self.min_cycles = kwargs.get('min_cycles', None) + self.time_granularity_in_minutes = kwargs.get('time_granularity_in_minutes', None) + self.allow_multiple_maintenance_windows_per_cycle = kwargs.get('allow_multiple_maintenance_windows_per_cycle', None) + + +class MaintenanceWindows(ProxyResource): + """Maintenance windows. + + 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 time_ranges: + :type time_ranges: list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] + """ + + _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'}, + 'time_ranges': {'key': 'properties.timeRanges', 'type': '[MaintenanceWindowTimeRange]'}, + } + + def __init__(self, **kwargs): + super(MaintenanceWindows, self).__init__(**kwargs) + self.time_ranges = kwargs.get('time_ranges', None) + + +class MaintenanceWindowTimeRange(Model): + """Maintenance window time range. + + :param day_of_week: Day of maintenance window. Possible values include: + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', + 'Saturday' + :type day_of_week: str or ~azure.mgmt.sql.models.DayOfWeek + :param start_time: Start time minutes offset from 12am. + :type start_time: str + :param duration: Duration of maintenance window in minutes. + :type duration: str + """ + + _attribute_map = { + 'day_of_week': {'key': 'dayOfWeek', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MaintenanceWindowTimeRange, self).__init__(**kwargs) + self.day_of_week = kwargs.get('day_of_week', None) + self.start_time = kwargs.get('start_time', None) + self.duration = kwargs.get('duration', None) + + class ManagedBackupShortTermRetentionPolicy(ProxyResource): """A short term retention policy. @@ -4972,7 +5343,7 @@ class ManagedDatabaseSecurityAlertPolicy(ProxyResource): :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState :param disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, - Access_Anomaly, Data_Exfiltration, Unsafe_Action + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force :type disabled_alerts: list[str] :param email_addresses: Specifies an array of e-mail addresses to which the alert is sent. @@ -5172,12 +5543,15 @@ class ManagedInstance(TrackedResource): :type tags: dict[str, str] :param identity: The Azure Active Directory identity of the managed instance. - :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', - 'Updating', 'Unknown', 'Succeeded', 'Failed' + 'Updating', 'Unknown', 'Succeeded', 'Failed', 'Accepted', 'Created', + 'Deleted', 'Unrecognized', 'Running', 'Canceled', 'NotSpecified', + 'Registering', 'TimedOut' :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. @@ -5267,6 +5641,15 @@ class ManagedInstance(TrackedResource): ~azure.mgmt.sql.models.StorageAccountType :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 used by default. + :type primary_user_assigned_identity_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory administrator of the + server. + :type administrators: + ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator """ _validation = { @@ -5287,7 +5670,7 @@ class ManagedInstance(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, @@ -5313,6 +5696,9 @@ class ManagedInstance(TrackedResource): 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'storage_account_type': {'key': 'properties.storageAccountType', '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'}, } def __init__(self, **kwargs): @@ -5343,6 +5729,9 @@ def __init__(self, **kwargs): self.minimal_tls_version = kwargs.get('minimal_tls_version', None) self.storage_account_type = kwargs.get('storage_account_type', 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) class ManagedInstanceAdministrator(ProxyResource): @@ -5516,6 +5905,9 @@ class ManagedInstanceEncryptionProtector(ProxyResource): :vartype uri: str :ivar thumbprint: Thumbprint of the server key. :vartype thumbprint: str + :param auto_rotation_enabled: Key auto rotation opt-in flag. Either true + or false. + :type auto_rotation_enabled: bool """ _validation = { @@ -5537,6 +5929,7 @@ class ManagedInstanceEncryptionProtector(ProxyResource): 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -5546,6 +5939,46 @@ def __init__(self, **kwargs): self.server_key_type = kwargs.get('server_key_type', None) self.uri = None self.thumbprint = None + self.auto_rotation_enabled = kwargs.get('auto_rotation_enabled', None) + + +class ManagedInstanceExternalAdministrator(Model): + """Properties of a active directory administrator. + + :param administrator_type: Type of the sever administrator. Possible + values include: 'ActiveDirectory' + :type administrator_type: str or ~azure.mgmt.sql.models.AdministratorType + :param principal_type: Principal Type of the sever administrator. Possible + values include: 'User', 'Group', 'Application' + :type principal_type: str or ~azure.mgmt.sql.models.PrincipalType + :param login: Login name of the server administrator. + :type login: str + :param sid: SID (object ID) of the server administrator. + :type sid: str + :param tenant_id: Tenant ID of the administrator. + :type tenant_id: str + :param azure_ad_only_authentication: Azure Active Directory only + Authentication enabled. + :type azure_ad_only_authentication: bool + """ + + _attribute_map = { + 'administrator_type': {'key': 'administratorType', 'type': 'str'}, + 'principal_type': {'key': 'principalType', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'azure_ad_only_authentication': {'key': 'azureADOnlyAuthentication', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ManagedInstanceExternalAdministrator, self).__init__(**kwargs) + self.administrator_type = kwargs.get('administrator_type', None) + self.principal_type = kwargs.get('principal_type', None) + self.login = kwargs.get('login', None) + self.sid = kwargs.get('sid', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.azure_ad_only_authentication = kwargs.get('azure_ad_only_authentication', None) class ManagedInstanceFamilyCapability(Model): @@ -5626,6 +6059,9 @@ class ManagedInstanceKey(ProxyResource): :vartype thumbprint: str :ivar creation_date: The key creation date. :vartype creation_date: datetime + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or + false. + :vartype auto_rotation_enabled: bool """ _validation = { @@ -5636,6 +6072,7 @@ class ManagedInstanceKey(ProxyResource): 'server_key_type': {'required': True}, 'thumbprint': {'readonly': True}, 'creation_date': {'readonly': True}, + 'auto_rotation_enabled': {'readonly': True}, } _attribute_map = { @@ -5647,6 +6084,7 @@ class ManagedInstanceKey(ProxyResource): 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, } def __init__(self, **kwargs): @@ -5656,6 +6094,7 @@ def __init__(self, **kwargs): self.uri = kwargs.get('uri', None) self.thumbprint = None self.creation_date = None + self.auto_rotation_enabled = None class ManagedInstanceLongTermRetentionBackup(ProxyResource): @@ -5684,6 +6123,10 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: datetime + :ivar backup_storage_redundancy: The storage redundancy type of the + backup. Possible values include: 'Geo', 'Local', 'Zone' + :vartype backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy """ _validation = { @@ -5696,6 +6139,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'readonly': True}, 'backup_time': {'readonly': True}, 'backup_expiration_time': {'readonly': True}, + 'backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -5708,6 +6152,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'key': 'properties.databaseDeletionTime', 'type': 'iso-8601'}, 'backup_time': {'key': 'properties.backupTime', 'type': 'iso-8601'}, 'backup_expiration_time': {'key': 'properties.backupExpirationTime', 'type': 'iso-8601'}, + 'backup_storage_redundancy': {'key': 'properties.backupStorageRedundancy', 'type': 'str'}, } def __init__(self, **kwargs): @@ -5718,6 +6163,7 @@ def __init__(self, **kwargs): self.database_deletion_time = None self.backup_time = None self.backup_expiration_time = None + self.backup_storage_redundancy = None class ManagedInstanceLongTermRetentionPolicy(ProxyResource): @@ -6028,6 +6474,52 @@ def __init__(self, **kwargs): self.properties = None +class ManagedInstancePrivateEndpointConnection(ProxyResource): + """A private endpoint connection. + + 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 private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: + ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty + :param private_link_service_connection_state: Connection State of the + Private Endpoint Connection. + :type private_link_service_connection_state: + ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the Private Endpoint Connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ManagedInstancePrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ManagedInstancePrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedInstancePrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = kwargs.get('private_endpoint', None) + self.private_link_service_connection_state = kwargs.get('private_link_service_connection_state', None) + self.provisioning_state = None + + class ManagedInstancePrivateEndpointConnectionProperties(Model): """Properties of a private endpoint connection. @@ -6078,40 +6570,138 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) -class ManagedInstancePrivateLinkServiceConnectionStateProperty(Model): - """ManagedInstancePrivateLinkServiceConnectionStateProperty. +class ManagedInstancePrivateLink(ProxyResource): + """A private link resource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :param status: Required. The private link service connection status. - :type status: str - :param description: Required. The private link service connection - description. - :type description: str - :ivar actions_required: The private link service connection description. - :vartype actions_required: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: The private link resource group id. + :vartype properties: + ~azure.mgmt.sql.models.ManagedInstancePrivateLinkProperties """ _validation = { - 'status': {'required': True}, - 'description': {'required': True}, - 'actions_required': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'readonly': True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ManagedInstancePrivateLinkProperties'}, } def __init__(self, **kwargs): - super(ManagedInstancePrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) - self.status = kwargs.get('status', None) - self.description = kwargs.get('description', None) - self.actions_required = None + super(ManagedInstancePrivateLink, self).__init__(**kwargs) + self.properties = None + + +class ManagedInstancePrivateLinkProperties(Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ManagedInstancePrivateLinkProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + + +class ManagedInstancePrivateLinkServiceConnectionStateProperty(Model): + """ManagedInstancePrivateLinkServiceConnectionStateProperty. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The private link service connection description. + :vartype actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedInstancePrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.description = kwargs.get('description', None) + self.actions_required = None + + +class ManagedInstanceQuery(ProxyResource): + """Database query. + + 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 query_text: Query text. + :type query_text: str + """ + + _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'}, + 'query_text': {'key': 'properties.queryText', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManagedInstanceQuery, self).__init__(**kwargs) + self.query_text = kwargs.get('query_text', None) class ManagedInstanceUpdate(Model): @@ -6123,9 +6713,12 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku :param identity: Managed instance identity - :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', - 'Updating', 'Unknown', 'Succeeded', 'Failed' + 'Updating', 'Unknown', 'Succeeded', 'Failed', 'Accepted', 'Created', + 'Deleted', 'Unrecognized', 'Running', 'Canceled', 'NotSpecified', + 'Registering', 'TimedOut' :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. @@ -6215,6 +6808,15 @@ class ManagedInstanceUpdate(Model): ~azure.mgmt.sql.models.StorageAccountType :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 used by default. + :type primary_user_assigned_identity_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory administrator of the + server. + :type administrators: + ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :param tags: Resource tags. :type tags: dict[str, str] """ @@ -6229,7 +6831,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, @@ -6254,6 +6856,9 @@ class ManagedInstanceUpdate(Model): 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'storage_account_type': {'key': 'properties.storageAccountType', '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'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -6285,6 +6890,9 @@ def __init__(self, **kwargs): self.minimal_tls_version = kwargs.get('minimal_tls_version', None) self.storage_account_type = kwargs.get('storage_account_type', 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.tags = kwargs.get('tags', None) @@ -6421,9 +7029,9 @@ class ManagedInstanceVulnerabilityAssessment(ProxyResource): https://myStorage.blob.core.windows.net/VaScans/). :type storage_container_path: str :param storage_container_sas_key: A shared access signature (SAS Key) that - has read and write access to the blob container specified in - 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't - specified, StorageContainerSasKey is required. + has write access to the blob container specified in 'storageContainerPath' + parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. :type storage_container_sas_key: str :param storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If @@ -6474,13 +7082,15 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar system_data: SystemData of SecurityAlertPolicyResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData :param state: Required. Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific - database. Possible values include: 'New', 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState + database. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState :param disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, - Access_Anomaly, Data_Exfiltration, Unsafe_Action + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force :type disabled_alerts: list[str] :param email_addresses: Specifies an array of e-mail addresses to which the alert is sent. @@ -6506,6 +7116,7 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'state': {'required': True}, 'creation_time': {'readonly': True}, } @@ -6514,7 +7125,8 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'SecurityAlertsPolicyState'}, 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, @@ -6526,6 +7138,7 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): def __init__(self, **kwargs): super(ManagedServerSecurityAlertPolicy, self).__init__(**kwargs) + self.system_data = None self.state = kwargs.get('state', None) self.disabled_alerts = kwargs.get('disabled_alerts', None) self.email_addresses = kwargs.get('email_addresses', None) @@ -6536,6 +7149,44 @@ def __init__(self, **kwargs): self.creation_time = None +class ManagedTransparentDataEncryption(ProxyResource): + """A managed database transparent data encryption state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Required. 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}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'TransparentDataEncryptionState'}, + } + + def __init__(self, **kwargs): + super(ManagedTransparentDataEncryption, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + + class MaxSizeCapability(Model): """The maximum size capability. @@ -6614,209 +7265,6 @@ def __init__(self, **kwargs): self.reason = kwargs.get('reason', None) -class Metric(Model): - """Database metrics. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: datetime - :ivar end_time: The end time for the metric (ISO-8601 format). - :vartype end_time: datetime - :ivar time_grain: The time step to be used to summarize the metric values. - :vartype time_grain: str - :ivar unit: The unit of the metric. Possible values include: 'count', - 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond' - :vartype unit: str or ~azure.mgmt.sql.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.sql.models.MetricName - :ivar metric_values: The metric values for the specified time window and - timestep. - :vartype metric_values: list[~azure.mgmt.sql.models.MetricValue] - """ - - _validation = { - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'time_grain': {'readonly': True}, - 'unit': {'readonly': True}, - 'name': {'readonly': True}, - 'metric_values': {'readonly': True}, - } - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'time_grain': {'key': 'timeGrain', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'MetricName'}, - 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, - } - - def __init__(self, **kwargs): - super(Metric, self).__init__(**kwargs) - self.start_time = None - self.end_time = None - self.time_grain = None - self.unit = None - self.name = None - self.metric_values = None - - -class MetricAvailability(Model): - """A metric availability value. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar retention: The length of retention for the database metric. - :vartype retention: str - :ivar time_grain: The granularity of the database metric. - :vartype time_grain: str - """ - - _validation = { - 'retention': {'readonly': True}, - 'time_grain': {'readonly': True}, - } - - _attribute_map = { - 'retention': {'key': 'retention', 'type': 'str'}, - 'time_grain': {'key': 'timeGrain', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricAvailability, self).__init__(**kwargs) - self.retention = None - self.time_grain = None - - -class MetricDefinition(Model): - """A database metric definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.sql.models.MetricName - :ivar primary_aggregation_type: The primary aggregation type defining how - metric values are displayed. Possible values include: 'None', 'Average', - 'Count', 'Minimum', 'Maximum', 'Total' - :vartype primary_aggregation_type: str or - ~azure.mgmt.sql.models.PrimaryAggregationType - :ivar resource_uri: The resource uri of the database. - :vartype resource_uri: str - :ivar unit: The unit of the metric. Possible values include: 'Count', - 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.sql.models.UnitDefinitionType - :ivar metric_availabilities: The list of database metric availabilities - for the metric. - :vartype metric_availabilities: - list[~azure.mgmt.sql.models.MetricAvailability] - """ - - _validation = { - 'name': {'readonly': True}, - 'primary_aggregation_type': {'readonly': True}, - 'resource_uri': {'readonly': True}, - 'unit': {'readonly': True}, - 'metric_availabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'MetricName'}, - 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, - } - - def __init__(self, **kwargs): - super(MetricDefinition, self).__init__(**kwargs) - self.name = None - self.primary_aggregation_type = None - self.resource_uri = None - self.unit = None - self.metric_availabilities = None - - -class MetricName(Model): - """A database metric name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The name of the database metric. - :vartype value: str - :ivar localized_value: The friendly name of the database metric. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(MetricName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class MetricValue(Model): - """Represents database metrics. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar count: The number of values for the metric. - :vartype count: float - :ivar average: The average value of the metric. - :vartype average: float - :ivar maximum: The max value of the metric. - :vartype maximum: float - :ivar minimum: The min value of the metric. - :vartype minimum: float - :ivar timestamp: The metric timestamp (ISO-8601 format). - :vartype timestamp: datetime - :ivar total: The total value of the metric. - :vartype total: float - """ - - _validation = { - 'count': {'readonly': True}, - 'average': {'readonly': True}, - 'maximum': {'readonly': True}, - 'minimum': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'total': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'average': {'key': 'average', 'type': 'float'}, - 'maximum': {'key': 'maximum', 'type': 'float'}, - 'minimum': {'key': 'minimum', 'type': 'float'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'total': {'key': 'total', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(MetricValue, self).__init__(**kwargs) - self.count = None - self.average = None - self.maximum = None - self.minimum = None - self.timestamp = None - self.total = None - - class MinCapacityCapability(Model): """The min capacity capability. @@ -6976,43 +7424,84 @@ def __init__(self, **kwargs): self.description = None -class OperationImpact(Model): - """The impact of an operation, both in absolute and relative terms. +class OperationsHealth(ProxyResource): + """Operations health status in a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the impact dimension. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar unit: The unit in which estimated impact to dimension is measured. - :vartype unit: str - :ivar change_value_absolute: The absolute impact to dimension. - :vartype change_value_absolute: float - :ivar change_value_relative: The relative impact to dimension (null if not - applicable) - :vartype change_value_relative: float + :ivar type: Resource type. + :vartype type: str + :ivar operations_health_name: Operation name for the service + :vartype operations_health_name: str + :ivar health: Operation health status of the service. + :vartype health: str + :ivar description: Health status description. + :vartype description: str """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, - 'unit': {'readonly': True}, - 'change_value_absolute': {'readonly': True}, - 'change_value_relative': {'readonly': True}, - } + 'type': {'readonly': True}, + 'operations_health_name': {'readonly': True}, + 'health': {'readonly': True}, + 'description': {'readonly': True}, + } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'change_value_absolute': {'key': 'changeValueAbsolute', 'type': 'float'}, - 'change_value_relative': {'key': 'changeValueRelative', 'type': 'float'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operations_health_name': {'key': 'properties.name', 'type': 'str'}, + 'health': {'key': 'properties.health', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, } def __init__(self, **kwargs): - super(OperationImpact, self).__init__(**kwargs) - self.name = None - self.unit = None - self.change_value_absolute = None - self.change_value_relative = None + super(OperationsHealth, self).__init__(**kwargs) + self.operations_health_name = None + self.health = None + self.description = None + + +class OutboundFirewallRule(ProxyResource): + """An Azure SQL DB Server Outbound Firewall Rule. + + 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 provisioning_state: The state of the outbound rule. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OutboundFirewallRule, self).__init__(**kwargs) + self.provisioning_state = None class PartnerInfo(Model): @@ -7290,22 +7779,27 @@ class PrivateLinkResourceProperties(Model): :vartype group_id: str :ivar required_members: The private link resource required member names. :vartype required_members: list[str] + :ivar required_zone_names: The private link resource required zone names. + :vartype required_zone_names: list[str] """ _validation = { 'group_id': {'readonly': True}, 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, } _attribute_map = { 'group_id': {'key': 'groupId', 'type': 'str'}, 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, } def __init__(self, **kwargs): super(PrivateLinkResourceProperties, self).__init__(**kwargs) self.group_id = None self.required_members = None + self.required_zone_names = None class PrivateLinkServiceConnectionStateProperty(Model): @@ -7456,6 +7950,61 @@ def __init__(self, **kwargs): self.stdev = None +class QueryStatistics(ProxyResource): + """QueryStatistics. + + 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 database_name: Database name of the database in which this query was + executed. + :vartype database_name: str + :ivar query_id: Unique query id (unique within one database). + :vartype query_id: str + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: str + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: str + :param intervals: List of intervals with appropriate metric data + :type intervals: list[~azure.mgmt.sql.models.QueryMetricInterval] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'database_name': {'readonly': True}, + 'query_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'query_id': {'key': 'properties.queryId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'str'}, + 'end_time': {'key': 'properties.endTime', 'type': 'str'}, + 'intervals': {'key': 'properties.intervals', 'type': '[QueryMetricInterval]'}, + } + + def __init__(self, **kwargs): + super(QueryStatistics, self).__init__(**kwargs) + self.database_name = None + self.query_id = None + self.start_time = None + self.end_time = None + self.intervals = kwargs.get('intervals', None) + + class QueryStatisticsProperties(Model): """Properties of a query execution statistics. @@ -7532,270 +8081,484 @@ def __init__(self, **kwargs): self.reason = kwargs.get('reason', None) -class RecommendedElasticPool(ProxyResource): - """Represents a recommended elastic pool. +class RecommendedAction(ProxyResource): + """Database, Server or Elastic Pool Recommended Action. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar database_edition: The edition of the recommended elastic pool. The - ElasticPoolEdition enumeration contains all the valid editions. Possible - values include: 'Basic', 'Standard', 'Premium', 'GeneralPurpose', - 'BusinessCritical' - :vartype database_edition: str or - ~azure.mgmt.sql.models.ElasticPoolEdition - :param dtu: The DTU for the recommended elastic pool. - :type dtu: float - :param database_dtu_min: The minimum DTU for the database. - :type database_dtu_min: float - :param database_dtu_max: The maximum DTU for the database. - :type database_dtu_max: float - :param storage_mb: Gets storage size in megabytes. - :type storage_mb: float - :ivar observation_period_start: The observation period start (ISO8601 - format). - :vartype observation_period_start: datetime - :ivar observation_period_end: The observation period start (ISO8601 - format). - :vartype observation_period_end: datetime - :ivar max_observed_dtu: Gets maximum observed DTU. - :vartype max_observed_dtu: float - :ivar max_observed_storage_mb: Gets maximum observed storage in megabytes. - :vartype max_observed_storage_mb: float - :ivar databases: The list of databases in this pool. Expanded property - :vartype databases: list[~azure.mgmt.sql.models.TrackedResource] - :ivar metrics: The list of databases housed in the server. Expanded - property - :vartype metrics: - list[~azure.mgmt.sql.models.RecommendedElasticPoolMetric] + :ivar kind: Resource kind. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + :ivar recommendation_reason: Gets the reason for recommending this action. + e.g., DuplicateIndex + :vartype recommendation_reason: str + :ivar valid_since: Gets the time since when this recommended action is + valid. + :vartype valid_since: datetime + :ivar last_refresh: Gets time when this recommended action was last + refreshed. + :vartype last_refresh: datetime + :param state: Required. Gets the info of the current state the recommended + action is in. + :type state: ~azure.mgmt.sql.models.RecommendedActionStateInfo + :ivar is_executable_action: Gets if this recommended action is actionable + by user + :vartype is_executable_action: bool + :ivar is_revertable_action: Gets if changes applied by this recommended + action can be reverted by user + :vartype is_revertable_action: bool + :ivar is_archived_action: Gets if this recommended action was suggested + some time ago but user chose to ignore this and system added a new + recommended action again. + :vartype is_archived_action: bool + :ivar execute_action_start_time: Gets the time when system started + applying this recommended action on the user resource. e.g., index + creation start time + :vartype execute_action_start_time: datetime + :ivar execute_action_duration: Gets the time taken for applying this + recommended action on user resource. e.g., time taken for index creation + :vartype execute_action_duration: str + :ivar revert_action_start_time: Gets the time when system started + reverting changes of this recommended action on user resource. e.g., time + when index drop is executed. + :vartype revert_action_start_time: datetime + :ivar revert_action_duration: Gets the time taken for reverting changes of + this recommended action on user resource. e.g., time taken for dropping + the created index. + :vartype revert_action_duration: str + :ivar execute_action_initiated_by: Gets if approval for applying this + recommended action was given by user/system. Possible values include: + 'User', 'System' + :vartype execute_action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar execute_action_initiated_time: Gets the time when this recommended + action was approved for execution. + :vartype execute_action_initiated_time: datetime + :ivar revert_action_initiated_by: Gets if approval for reverting this + recommended action was given by user/system. Possible values include: + 'User', 'System' + :vartype revert_action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar revert_action_initiated_time: Gets the time when this recommended + action was approved for revert. + :vartype revert_action_initiated_time: datetime + :ivar score: Gets the impact of this recommended action. Possible values + are 1 - Low impact, 2 - Medium Impact and 3 - High Impact + :vartype score: int + :ivar implementation_details: Gets the implementation details of this + recommended action for user to apply it manually. + :vartype implementation_details: + ~azure.mgmt.sql.models.RecommendedActionImplementationInfo + :ivar error_details: Gets the error details if and why this recommended + action is put to error state. + :vartype error_details: ~azure.mgmt.sql.models.RecommendedActionErrorInfo + :ivar estimated_impact: Gets the estimated impact info for this + recommended action e.g., Estimated CPU gain, Estimated Disk Space change + :vartype estimated_impact: + list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar observed_impact: Gets the observed/actual impact info for this + recommended action e.g., Actual CPU gain, Actual Disk Space change + :vartype observed_impact: + list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar time_series: Gets the time series info of metrics for this + recommended action e.g., CPU consumption time series + :vartype time_series: + list[~azure.mgmt.sql.models.RecommendedActionMetricInfo] + :ivar linked_objects: Gets the linked objects, if any. + :vartype linked_objects: list[str] + :ivar details: Gets additional details specific to this recommended + action. + :vartype details: dict[str, object] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'database_edition': {'readonly': True}, - 'observation_period_start': {'readonly': True}, - 'observation_period_end': {'readonly': True}, - 'max_observed_dtu': {'readonly': True}, - 'max_observed_storage_mb': {'readonly': True}, - 'databases': {'readonly': True}, - 'metrics': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'readonly': True}, + 'recommendation_reason': {'readonly': True}, + 'valid_since': {'readonly': True}, + 'last_refresh': {'readonly': True}, + 'state': {'required': True}, + 'is_executable_action': {'readonly': True}, + 'is_revertable_action': {'readonly': True}, + 'is_archived_action': {'readonly': True}, + 'execute_action_start_time': {'readonly': True}, + 'execute_action_duration': {'readonly': True}, + 'revert_action_start_time': {'readonly': True}, + 'revert_action_duration': {'readonly': True}, + 'execute_action_initiated_by': {'readonly': True}, + 'execute_action_initiated_time': {'readonly': True}, + 'revert_action_initiated_by': {'readonly': True}, + 'revert_action_initiated_time': {'readonly': True}, + 'score': {'readonly': True}, + 'implementation_details': {'readonly': True}, + 'error_details': {'readonly': True}, + 'estimated_impact': {'readonly': True}, + 'observed_impact': {'readonly': True}, + 'time_series': {'readonly': True}, + 'linked_objects': {'readonly': True}, + 'details': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, - 'dtu': {'key': 'properties.dtu', 'type': 'float'}, - 'database_dtu_min': {'key': 'properties.databaseDtuMin', 'type': 'float'}, - 'database_dtu_max': {'key': 'properties.databaseDtuMax', 'type': 'float'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'float'}, - 'observation_period_start': {'key': 'properties.observationPeriodStart', 'type': 'iso-8601'}, - 'observation_period_end': {'key': 'properties.observationPeriodEnd', 'type': 'iso-8601'}, - 'max_observed_dtu': {'key': 'properties.maxObservedDtu', 'type': 'float'}, - 'max_observed_storage_mb': {'key': 'properties.maxObservedStorageMB', 'type': 'float'}, - 'databases': {'key': 'properties.databases', 'type': '[TrackedResource]'}, - 'metrics': {'key': 'properties.metrics', 'type': '[RecommendedElasticPoolMetric]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'recommendation_reason': {'key': 'properties.recommendationReason', 'type': 'str'}, + 'valid_since': {'key': 'properties.validSince', 'type': 'iso-8601'}, + 'last_refresh': {'key': 'properties.lastRefresh', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'RecommendedActionStateInfo'}, + 'is_executable_action': {'key': 'properties.isExecutableAction', 'type': 'bool'}, + 'is_revertable_action': {'key': 'properties.isRevertableAction', 'type': 'bool'}, + 'is_archived_action': {'key': 'properties.isArchivedAction', 'type': 'bool'}, + 'execute_action_start_time': {'key': 'properties.executeActionStartTime', 'type': 'iso-8601'}, + 'execute_action_duration': {'key': 'properties.executeActionDuration', 'type': 'str'}, + 'revert_action_start_time': {'key': 'properties.revertActionStartTime', 'type': 'iso-8601'}, + 'revert_action_duration': {'key': 'properties.revertActionDuration', 'type': 'str'}, + 'execute_action_initiated_by': {'key': 'properties.executeActionInitiatedBy', 'type': 'RecommendedActionInitiatedBy'}, + 'execute_action_initiated_time': {'key': 'properties.executeActionInitiatedTime', 'type': 'iso-8601'}, + 'revert_action_initiated_by': {'key': 'properties.revertActionInitiatedBy', 'type': 'RecommendedActionInitiatedBy'}, + 'revert_action_initiated_time': {'key': 'properties.revertActionInitiatedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'int'}, + 'implementation_details': {'key': 'properties.implementationDetails', 'type': 'RecommendedActionImplementationInfo'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'RecommendedActionErrorInfo'}, + 'estimated_impact': {'key': 'properties.estimatedImpact', 'type': '[RecommendedActionImpactRecord]'}, + 'observed_impact': {'key': 'properties.observedImpact', 'type': '[RecommendedActionImpactRecord]'}, + 'time_series': {'key': 'properties.timeSeries', 'type': '[RecommendedActionMetricInfo]'}, + 'linked_objects': {'key': 'properties.linkedObjects', 'type': '[str]'}, + 'details': {'key': 'properties.details', 'type': '{object}'}, + } + + def __init__(self, **kwargs): + super(RecommendedAction, self).__init__(**kwargs) + self.kind = None + self.location = None + self.recommendation_reason = None + self.valid_since = None + self.last_refresh = None + self.state = kwargs.get('state', None) + self.is_executable_action = None + self.is_revertable_action = None + self.is_archived_action = None + self.execute_action_start_time = None + self.execute_action_duration = None + self.revert_action_start_time = None + self.revert_action_duration = None + self.execute_action_initiated_by = None + self.execute_action_initiated_time = None + self.revert_action_initiated_by = None + self.revert_action_initiated_time = None + self.score = None + self.implementation_details = None + self.error_details = None + self.estimated_impact = None + self.observed_impact = None + self.time_series = None + self.linked_objects = None + self.details = None + + +class RecommendedActionErrorInfo(Model): + """Contains error information for an Azure SQL Database, Server or Elastic + Pool Recommended Action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar error_code: Gets the reason why the recommended action was put to + error state. e.g., DatabaseHasQdsOff, IndexAlreadyExists + :vartype error_code: str + :ivar is_retryable: Gets whether the error could be ignored and + recommended action could be retried. Possible values are: Yes/No. Possible + values include: 'Yes', 'No' + :vartype is_retryable: str or ~azure.mgmt.sql.models.IsRetryable + """ + + _validation = { + 'error_code': {'readonly': True}, + 'is_retryable': {'readonly': True}, + } + + _attribute_map = { + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'is_retryable': {'key': 'isRetryable', 'type': 'IsRetryable'}, } def __init__(self, **kwargs): - super(RecommendedElasticPool, self).__init__(**kwargs) - self.database_edition = None - self.dtu = kwargs.get('dtu', None) - self.database_dtu_min = kwargs.get('database_dtu_min', None) - self.database_dtu_max = kwargs.get('database_dtu_max', None) - self.storage_mb = kwargs.get('storage_mb', None) - self.observation_period_start = None - self.observation_period_end = None - self.max_observed_dtu = None - self.max_observed_storage_mb = None - self.databases = None - self.metrics = None + super(RecommendedActionErrorInfo, self).__init__(**kwargs) + self.error_code = None + self.is_retryable = None + +class RecommendedActionImpactRecord(Model): + """Contains information of estimated or observed impact on various metrics for + an Azure SQL Database, Server or Elastic Pool Recommended Action. -class RecommendedElasticPoolMetric(Model): - """Represents recommended elastic pool metric. + Variables are only populated by the server, and will be ignored when + sending a request. - :param date_time_property: The time of metric (ISO8601 format). - :type date_time_property: datetime - :param dtu: Gets or sets the DTUs (Database Transaction Units). See - https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - :type dtu: float - :param size_gb: Gets or sets size in gigabytes. - :type size_gb: float + :ivar dimension_name: Gets the name of the impact dimension. e.g., + CPUChange, DiskSpaceChange, NumberOfQueriesAffected. + :vartype dimension_name: str + :ivar unit: Gets the name of the impact dimension. e.g., CPUChange, + DiskSpaceChange, NumberOfQueriesAffected. + :vartype unit: str + :ivar absolute_value: Gets the absolute value of this dimension if + applicable. e.g., Number of Queries affected + :vartype absolute_value: float + :ivar change_value_absolute: Gets the absolute change in the value of this + dimension. e.g., Absolute Disk space change in Megabytes + :vartype change_value_absolute: float + :ivar change_value_relative: Gets the relative change in the value of this + dimension. e.g., Relative Disk space change in Percentage + :vartype change_value_relative: float """ + _validation = { + 'dimension_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'absolute_value': {'readonly': True}, + 'change_value_absolute': {'readonly': True}, + 'change_value_relative': {'readonly': True}, + } + _attribute_map = { - 'date_time_property': {'key': 'dateTime', 'type': 'iso-8601'}, - 'dtu': {'key': 'dtu', 'type': 'float'}, - 'size_gb': {'key': 'sizeGB', 'type': 'float'}, + 'dimension_name': {'key': 'dimensionName', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'absolute_value': {'key': 'absoluteValue', 'type': 'float'}, + 'change_value_absolute': {'key': 'changeValueAbsolute', 'type': 'float'}, + 'change_value_relative': {'key': 'changeValueRelative', 'type': 'float'}, } def __init__(self, **kwargs): - super(RecommendedElasticPoolMetric, self).__init__(**kwargs) - self.date_time_property = kwargs.get('date_time_property', None) - self.dtu = kwargs.get('dtu', None) - self.size_gb = kwargs.get('size_gb', None) + super(RecommendedActionImpactRecord, self).__init__(**kwargs) + self.dimension_name = None + self.unit = None + self.absolute_value = None + self.change_value_absolute = None + self.change_value_relative = None -class RecommendedIndex(ProxyResource): - """Represents a database recommended index. +class RecommendedActionImplementationInfo(Model): + """Contains information for manual implementation for an Azure SQL Database, + Server or Elastic Pool Recommended Action. 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 action: The proposed index action. You can create a missing index, - drop an unused index, or rebuild an existing index to improve its - performance. Possible values include: 'Create', 'Drop', 'Rebuild' - :vartype action: str or ~azure.mgmt.sql.models.RecommendedIndexAction - :ivar state: The current recommendation state. Possible values include: - 'Active', 'Pending', 'Executing', 'Verifying', 'Pending Revert', - 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - :vartype state: str or ~azure.mgmt.sql.models.RecommendedIndexState - :ivar created: The UTC datetime showing when this resource was created - (ISO8601 format). - :vartype created: datetime - :ivar last_modified: The UTC datetime of when was this resource last - changed (ISO8601 format). + :ivar method: Gets the method in which this recommended action can be + manually implemented. e.g., TSql, AzurePowerShell. Possible values + include: 'TSql', 'AzurePowerShell' + :vartype method: str or ~azure.mgmt.sql.models.ImplementationMethod + :ivar script: Gets the manual implementation script. e.g., T-SQL script + that could be executed on the database. + :vartype script: str + """ + + _validation = { + 'method': {'readonly': True}, + 'script': {'readonly': True}, + } + + _attribute_map = { + 'method': {'key': 'method', 'type': 'ImplementationMethod'}, + 'script': {'key': 'script', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(RecommendedActionImplementationInfo, self).__init__(**kwargs) + self.method = None + self.script = None + + +class RecommendedActionMetricInfo(Model): + """Contains time series of various impacted metrics for an Azure SQL Database, + Server or Elastic Pool Recommended Action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar metric_name: Gets the name of the metric. e.g., CPU, Number of + Queries. + :vartype metric_name: str + :ivar unit: Gets the unit in which metric is measured. e.g., DTU, + Frequency + :vartype unit: str + :ivar time_grain: Gets the duration of time interval for the value given + by this MetricInfo. e.g., PT1H (1 hour) + :vartype time_grain: str + :ivar start_time: Gets the start time of time interval given by this + MetricInfo. + :vartype start_time: datetime + :ivar value: Gets the value of the metric in the time interval given by + this MetricInfo. + :vartype value: float + """ + + _validation = { + 'metric_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'start_time': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs): + super(RecommendedActionMetricInfo, self).__init__(**kwargs) + self.metric_name = None + self.unit = None + self.time_grain = None + self.start_time = None + self.value = None + + +class RecommendedActionStateInfo(Model): + """Contains information of current state for an Azure SQL Database, Server or + Elastic Pool Recommended Action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param current_value: Required. Current state the recommended action is + in. Some commonly used states are: Active -> recommended action is + active and no action has been taken yet. Pending -> recommended action + is approved for and is awaiting execution. Executing -> recommended + action is being applied on the user database. Verifying -> recommended + action was applied and is being verified of its usefulness by the system. + Success -> recommended action was applied and improvement found during + verification. Pending Revert -> verification found little or no + improvement so recommended action is queued for revert or user has + manually reverted. Reverting -> changes made while applying recommended + action are being reverted on the user database. Reverted -> + successfully reverted the changes made by recommended action on user + database. Ignored -> user explicitly ignored/discarded the recommended + action. Possible values include: 'Active', 'Pending', 'Executing', + 'Verifying', 'PendingRevert', 'RevertCancelled', 'Reverting', 'Reverted', + 'Ignored', 'Expired', 'Monitoring', 'Resolved', 'Success', 'Error' + :type current_value: str or + ~azure.mgmt.sql.models.RecommendedActionCurrentState + :ivar action_initiated_by: Gets who initiated the execution of this + recommended action. Possible Value are: User -> When user explicity + notified system to apply the recommended action. System -> When + auto-execute status of this advisor was set to 'Enabled', in which case + the system applied it. Possible values include: 'User', 'System' + :vartype action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar last_modified: Gets the time when the state was last modified :vartype last_modified: datetime - :ivar index_type: The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, - CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', - 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED COLUMNSTORE' - :vartype index_type: str or ~azure.mgmt.sql.models.RecommendedIndexType - :ivar schema: The schema where table to build index over resides - :vartype schema: str - :ivar table: The table on which to build index. - :vartype table: str - :ivar columns: Columns over which to build index - :vartype columns: list[str] - :ivar included_columns: The list of column names to be included in the - index - :vartype included_columns: list[str] - :ivar index_script: The full build index script - :vartype index_script: str - :ivar estimated_impact: The estimated impact of doing recommended index - action. - :vartype estimated_impact: list[~azure.mgmt.sql.models.OperationImpact] - :ivar reported_impact: The values reported after index action is complete. - :vartype reported_impact: list[~azure.mgmt.sql.models.OperationImpact] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'action': {'readonly': True}, - 'state': {'readonly': True}, - 'created': {'readonly': True}, + 'current_value': {'required': True}, + 'action_initiated_by': {'readonly': True}, 'last_modified': {'readonly': True}, - 'index_type': {'readonly': True}, - 'schema': {'readonly': True}, - 'table': {'readonly': True}, - 'columns': {'readonly': True}, - 'included_columns': {'readonly': True}, - 'index_script': {'readonly': True}, - 'estimated_impact': {'readonly': True}, - 'reported_impact': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'action': {'key': 'properties.action', 'type': 'RecommendedIndexAction'}, - 'state': {'key': 'properties.state', 'type': 'RecommendedIndexState'}, - 'created': {'key': 'properties.created', 'type': 'iso-8601'}, - 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, - 'index_type': {'key': 'properties.indexType', 'type': 'RecommendedIndexType'}, - 'schema': {'key': 'properties.schema', 'type': 'str'}, - 'table': {'key': 'properties.table', 'type': 'str'}, - 'columns': {'key': 'properties.columns', 'type': '[str]'}, - 'included_columns': {'key': 'properties.includedColumns', 'type': '[str]'}, - 'index_script': {'key': 'properties.indexScript', 'type': 'str'}, - 'estimated_impact': {'key': 'properties.estimatedImpact', 'type': '[OperationImpact]'}, - 'reported_impact': {'key': 'properties.reportedImpact', 'type': '[OperationImpact]'}, + 'current_value': {'key': 'currentValue', 'type': 'str'}, + 'action_initiated_by': {'key': 'actionInitiatedBy', 'type': 'RecommendedActionInitiatedBy'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, } def __init__(self, **kwargs): - super(RecommendedIndex, self).__init__(**kwargs) - self.action = None - self.state = None - self.created = None + super(RecommendedActionStateInfo, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.action_initiated_by = None self.last_modified = None - self.index_type = None - self.schema = None - self.table = None - self.columns = None - self.included_columns = None - self.index_script = None - self.estimated_impact = None - self.reported_impact = None -class RecoverableDatabase(ProxyResource): - """A recoverable database. +class RecommendedSensitivityLabelUpdate(ProxyResource): + """A recommended sensitivity label update operation. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar edition: The edition of the database - :vartype edition: str - :ivar service_level_objective: The service level objective name of the - database - :vartype service_level_objective: str - :ivar elastic_pool_name: The elastic pool name of the database - :vartype elastic_pool_name: str - :ivar last_available_backup_date: The last available backup date of the - database (ISO8601 format) - :vartype last_available_backup_date: datetime + :param op: Required. Possible values include: 'enable', 'disable' + :type op: str or + ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind + :param schema: Required. Schema name of the column to update. + :type schema: str + :param table: Required. Table name of the column to update. + :type table: str + :param column: Required. Column name to update. + :type column: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'edition': {'readonly': True}, - 'service_level_objective': {'readonly': True}, - 'elastic_pool_name': {'readonly': True}, - 'last_available_backup_date': {'readonly': True}, + 'op': {'required': True}, + 'schema': {'required': True}, + 'table': {'required': True}, + 'column': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'edition': {'key': 'properties.edition', 'type': 'str'}, - 'service_level_objective': {'key': 'properties.serviceLevelObjective', 'type': 'str'}, - 'elastic_pool_name': {'key': 'properties.elasticPoolName', 'type': 'str'}, - 'last_available_backup_date': {'key': 'properties.lastAvailableBackupDate', 'type': 'iso-8601'}, + 'op': {'key': 'properties.op', 'type': 'RecommendedSensitivityLabelUpdateKind'}, + 'schema': {'key': 'properties.schema', 'type': 'str'}, + 'table': {'key': 'properties.table', 'type': 'str'}, + 'column': {'key': 'properties.column', 'type': 'str'}, } def __init__(self, **kwargs): - super(RecoverableDatabase, self).__init__(**kwargs) - self.edition = None - self.service_level_objective = None - self.elastic_pool_name = None - self.last_available_backup_date = None + super(RecommendedSensitivityLabelUpdate, self).__init__(**kwargs) + self.op = kwargs.get('op', None) + self.schema = kwargs.get('schema', None) + self.table = kwargs.get('table', None) + self.column = kwargs.get('column', None) + + +class RecommendedSensitivityLabelUpdateList(Model): + """A list of recommended sensitivity label update operations. + + :param operations: + :type operations: + list[~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[RecommendedSensitivityLabelUpdate]'}, + } + + def __init__(self, **kwargs): + super(RecommendedSensitivityLabelUpdateList, self).__init__(**kwargs) + self.operations = kwargs.get('operations', None) class RecoverableManagedDatabase(ProxyResource): @@ -7834,7 +8597,7 @@ def __init__(self, **kwargs): class ReplicationLink(ProxyResource): - """Represents a database replication link. + """A replication link. Variables are only populated by the server, and will be ignored when sending a request. @@ -7845,92 +8608,91 @@ class ReplicationLink(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar location: Location of the server that contains this firewall rule. - :vartype location: str - :ivar is_termination_allowed: Legacy value indicating whether termination - is allowed. Currently always returns true. - :vartype is_termination_allowed: bool - :ivar replication_mode: Replication mode of this replication link. - :vartype replication_mode: str - :ivar partner_server: The name of the server hosting the partner database. + :ivar partner_server: Resource partner server. :vartype partner_server: str - :ivar partner_database: The name of the partner database. + :ivar partner_database: Resource partner database. :vartype partner_database: str - :ivar partner_location: The Azure Region of the partner database. + :ivar partner_location: Resource partner location. :vartype partner_location: str - :ivar role: The role of the database in the replication link. Possible - values include: 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', - 'Copy' - :vartype role: str or ~azure.mgmt.sql.models.ReplicationRole - :ivar partner_role: The role of the partner database in the replication - link. Possible values include: 'Primary', 'Secondary', - 'NonReadableSecondary', 'Source', 'Copy' - :vartype partner_role: str or ~azure.mgmt.sql.models.ReplicationRole - :ivar start_time: The start time for the replication link. + :ivar role: Local replication role. + :vartype role: str + :ivar partner_role: Partner replication role. + :vartype partner_role: str + :ivar replication_mode: Replication mode. + :vartype replication_mode: str + :ivar start_time: Time at which the link was created. :vartype start_time: datetime - :ivar percent_complete: The percentage of seeding complete for the - replication link. + :ivar percent_complete: Seeding completion percentage for the link. :vartype percent_complete: int - :ivar replication_state: The replication state for the replication link. - Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', 'SUSPENDED' - :vartype replication_state: str or ~azure.mgmt.sql.models.ReplicationState + :ivar replication_state: Replication state (PENDING, SEEDING, CATCHUP, + SUSPENDED). + :vartype replication_state: str + :ivar is_termination_allowed: Whether the user is currently allowed to + terminate the link. + :vartype is_termination_allowed: bool + :ivar link_type: Link type (GEO, NAMED). + :vartype link_type: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'is_termination_allowed': {'readonly': True}, - 'replication_mode': {'readonly': True}, 'partner_server': {'readonly': True}, 'partner_database': {'readonly': True}, 'partner_location': {'readonly': True}, 'role': {'readonly': True}, 'partner_role': {'readonly': True}, + 'replication_mode': {'readonly': True}, 'start_time': {'readonly': True}, 'percent_complete': {'readonly': True}, 'replication_state': {'readonly': True}, + 'is_termination_allowed': {'readonly': True}, + 'link_type': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'is_termination_allowed': {'key': 'properties.isTerminationAllowed', 'type': 'bool'}, - 'replication_mode': {'key': 'properties.replicationMode', 'type': 'str'}, 'partner_server': {'key': 'properties.partnerServer', 'type': 'str'}, 'partner_database': {'key': 'properties.partnerDatabase', 'type': 'str'}, 'partner_location': {'key': 'properties.partnerLocation', 'type': 'str'}, - 'role': {'key': 'properties.role', 'type': 'ReplicationRole'}, - 'partner_role': {'key': 'properties.partnerRole', 'type': 'ReplicationRole'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'partner_role': {'key': 'properties.partnerRole', 'type': 'str'}, + 'replication_mode': {'key': 'properties.replicationMode', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, 'replication_state': {'key': 'properties.replicationState', 'type': 'str'}, + 'is_termination_allowed': {'key': 'properties.isTerminationAllowed', 'type': 'bool'}, + 'link_type': {'key': 'properties.linkType', 'type': 'str'}, } def __init__(self, **kwargs): super(ReplicationLink, self).__init__(**kwargs) - self.location = None - self.is_termination_allowed = None - self.replication_mode = None self.partner_server = None self.partner_database = None self.partner_location = None self.role = None self.partner_role = None + self.replication_mode = None self.start_time = None self.percent_complete = None self.replication_state = None + self.is_termination_allowed = None + self.link_type = None -class ResourceIdentity(Model): +class ResourceIdentityWithUserAssignedIdentities(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 user_assigned_identities: The resource ids of the user assigned + identities to use + :type user_assigned_identities: dict[str, + ~azure.mgmt.sql.models.UserIdentity] :ivar principal_id: The Azure Active Directory principal id. :vartype principal_id: str :param type: The identity type. Set this to 'SystemAssigned' in order to @@ -7948,13 +8710,15 @@ class ResourceIdentity(Model): } _attribute_map = { + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentity}'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } def __init__(self, **kwargs): - super(ResourceIdentity, self).__init__(**kwargs) + super(ResourceIdentityWithUserAssignedIdentities, self).__init__(**kwargs) + self.user_assigned_identities = kwargs.get('user_assigned_identities', None) self.principal_id = None self.type = kwargs.get('type', None) self.tenant_id = None @@ -7983,7 +8747,7 @@ def __init__(self, **kwargs): class RestorableDroppedDatabase(ProxyResource): - """A restorable dropped database. + """A restorable dropped database resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -7994,69 +8758,73 @@ class RestorableDroppedDatabase(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar location: The geo-location where the resource lives - :vartype location: str - :ivar database_name: The name of the database + :param sku: The name and tier of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar database_name: The name of the database. :vartype database_name: str - :ivar edition: The edition of the database - :vartype edition: str - :ivar max_size_bytes: The max size in bytes of the database - :vartype max_size_bytes: str - :ivar service_level_objective: The service level objective name of the - database - :vartype service_level_objective: str - :ivar elastic_pool_name: The elastic pool name of the database - :vartype elastic_pool_name: str - :ivar creation_date: The creation date of the database (ISO8601 format) + :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 - :ivar deletion_date: The deletion date of the database (ISO8601 format) + :ivar deletion_date: The deletion date of the database (ISO8601 format). :vartype deletion_date: datetime :ivar earliest_restore_date: The earliest restore date of the database - (ISO8601 format) + (ISO8601 format). :vartype earliest_restore_date: 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.enum """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, 'database_name': {'readonly': True}, - 'edition': {'readonly': True}, 'max_size_bytes': {'readonly': True}, - 'service_level_objective': {'readonly': True}, - 'elastic_pool_name': {'readonly': True}, + 'elastic_pool_id': {'readonly': True}, 'creation_date': {'readonly': True}, 'deletion_date': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, + 'backup_storage_redundancy': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, - 'edition': {'key': 'properties.edition', 'type': 'str'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'str'}, - 'service_level_objective': {'key': 'properties.serviceLevelObjective', 'type': 'str'}, - 'elastic_pool_name': {'key': 'properties.elasticPoolName', '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'}, + 'backup_storage_redundancy': {'key': 'properties.backupStorageRedundancy', 'type': 'str'}, } def __init__(self, **kwargs): super(RestorableDroppedDatabase, self).__init__(**kwargs) - self.location = None + self.sku = kwargs.get('sku', None) + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) self.database_name = None - self.edition = None self.max_size_bytes = None - self.service_level_objective = None - self.elastic_pool_name = None + self.elastic_pool_id = None self.creation_date = None self.deletion_date = None self.earliest_restore_date = None + self.backup_storage_redundancy = None class RestorableDroppedManagedDatabase(TrackedResource): @@ -8178,6 +8946,159 @@ def __init__(self, **kwargs): self.restore_point_label = None +class SecurityEvent(ProxyResource): + """A security event. + + 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 event_time: The time when the security event occurred. + :vartype event_time: datetime + :ivar security_event_type: The type of the security event. Possible values + include: 'Undefined', 'SqlInjectionVulnerability', 'SqlInjectionExploit' + :vartype security_event_type: str or + ~azure.mgmt.sql.models.SecurityEventType + :ivar subscription: The subscription name + :vartype subscription: str + :ivar server: The server name + :vartype server: str + :ivar database: The database name + :vartype database: str + :ivar client_ip: The IP address of the client who executed the statement. + :vartype client_ip: str + :ivar application_name: The application used to execute the statement. + :vartype application_name: str + :ivar principal_name: The principal user who executed the statement + :vartype principal_name: str + :ivar security_event_sql_injection_additional_properties: The sql + injection additional properties, populated only if the type of the + security event is sql injection. + :vartype security_event_sql_injection_additional_properties: + ~azure.mgmt.sql.models.SecurityEventSqlInjectionAdditionalProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'event_time': {'readonly': True}, + 'security_event_type': {'readonly': True}, + 'subscription': {'readonly': True}, + 'server': {'readonly': True}, + 'database': {'readonly': True}, + 'client_ip': {'readonly': True}, + 'application_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'security_event_sql_injection_additional_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'event_time': {'key': 'properties.eventTime', 'type': 'iso-8601'}, + 'security_event_type': {'key': 'properties.securityEventType', 'type': 'SecurityEventType'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'server': {'key': 'properties.server', 'type': 'str'}, + 'database': {'key': 'properties.database', 'type': 'str'}, + 'client_ip': {'key': 'properties.clientIp', 'type': 'str'}, + 'application_name': {'key': 'properties.applicationName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'security_event_sql_injection_additional_properties': {'key': 'properties.securityEventSqlInjectionAdditionalProperties', 'type': 'SecurityEventSqlInjectionAdditionalProperties'}, + } + + def __init__(self, **kwargs): + super(SecurityEvent, self).__init__(**kwargs) + self.event_time = None + self.security_event_type = None + self.subscription = None + self.server = None + self.database = None + self.client_ip = None + self.application_name = None + self.principal_name = None + self.security_event_sql_injection_additional_properties = None + + +class SecurityEventsFilterParameters(Model): + """The properties that are supported in the $filter operation. + + :param event_time: Filter on the event time. + :type event_time: datetime + :param show_server_records: Whether to show server records or not. + :type show_server_records: bool + """ + + _attribute_map = { + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'show_server_records': {'key': 'showServerRecords', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SecurityEventsFilterParameters, self).__init__(**kwargs) + self.event_time = kwargs.get('event_time', None) + self.show_server_records = kwargs.get('show_server_records', None) + + +class SecurityEventSqlInjectionAdditionalProperties(Model): + """The properties of a security event sql injection additional properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar threat_id: The threat ID. + :vartype threat_id: str + :ivar statement: The statement + :vartype statement: str + :ivar statement_highlight_offset: The statement highlight offset + :vartype statement_highlight_offset: int + :ivar statement_highlight_length: The statement highlight length + :vartype statement_highlight_length: int + :ivar error_code: The sql error code + :vartype error_code: int + :ivar error_severity: The sql error severity + :vartype error_severity: int + :ivar error_message: The sql error message + :vartype error_message: str + """ + + _validation = { + 'threat_id': {'readonly': True}, + 'statement': {'readonly': True}, + 'statement_highlight_offset': {'readonly': True}, + 'statement_highlight_length': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_severity': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'threat_id': {'key': 'threatId', 'type': 'str'}, + 'statement': {'key': 'statement', 'type': 'str'}, + 'statement_highlight_offset': {'key': 'statementHighlightOffset', 'type': 'int'}, + 'statement_highlight_length': {'key': 'statementHighlightLength', 'type': 'int'}, + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_severity': {'key': 'errorSeverity', 'type': 'int'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SecurityEventSqlInjectionAdditionalProperties, self).__init__(**kwargs) + self.threat_id = None + self.statement = None + self.statement_highlight_offset = None + self.statement_highlight_length = None + self.error_code = None + self.error_severity = None + self.error_message = None + + class SensitivityLabel(ProxyResource): """A sensitivity label. @@ -8190,6 +9111,14 @@ class SensitivityLabel(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar managed_by: Resource that manages the sensitivity label. + :vartype managed_by: str + :ivar schema_name: The schema name. + :vartype schema_name: str + :ivar table_name: The table name. + :vartype table_name: str + :ivar column_name: The column name. + :vartype column_name: str :param label_name: The label name. :type label_name: str :param label_id: The label ID. @@ -8211,6 +9140,10 @@ class SensitivityLabel(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'managed_by': {'readonly': True}, + 'schema_name': {'readonly': True}, + 'table_name': {'readonly': True}, + 'column_name': {'readonly': True}, 'is_disabled': {'readonly': True}, } @@ -8218,6 +9151,10 @@ class SensitivityLabel(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'column_name': {'key': 'properties.columnName', 'type': 'str'}, 'label_name': {'key': 'properties.labelName', 'type': 'str'}, 'label_id': {'key': 'properties.labelId', 'type': 'str'}, 'information_type': {'key': 'properties.informationType', 'type': 'str'}, @@ -8228,6 +9165,10 @@ class SensitivityLabel(ProxyResource): def __init__(self, **kwargs): super(SensitivityLabel, self).__init__(**kwargs) + self.managed_by = None + self.schema_name = None + self.table_name = None + self.column_name = None self.label_name = kwargs.get('label_name', None) self.label_id = kwargs.get('label_id', None) self.information_type = kwargs.get('information_type', None) @@ -8236,6 +9177,79 @@ def __init__(self, **kwargs): self.rank = kwargs.get('rank', None) +class SensitivityLabelUpdate(ProxyResource): + """A sensitivity label update operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param op: Required. Possible values include: 'set', 'remove' + :type op: str or ~azure.mgmt.sql.models.SensitivityLabelUpdateKind + :param schema: Required. Schema name of the column to update. + :type schema: str + :param table: Required. Table name of the column to update. + :type table: str + :param column: Required. Column name to update. + :type column: str + :param sensitivity_label: The sensitivity label information to apply on a + column. + :type sensitivity_label: ~azure.mgmt.sql.models.SensitivityLabel + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'op': {'required': True}, + 'schema': {'required': True}, + 'table': {'required': True}, + 'column': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'op': {'key': 'properties.op', 'type': 'SensitivityLabelUpdateKind'}, + 'schema': {'key': 'properties.schema', 'type': 'str'}, + 'table': {'key': 'properties.table', 'type': 'str'}, + 'column': {'key': 'properties.column', 'type': 'str'}, + 'sensitivity_label': {'key': 'properties.sensitivityLabel', 'type': 'SensitivityLabel'}, + } + + def __init__(self, **kwargs): + super(SensitivityLabelUpdate, self).__init__(**kwargs) + self.op = kwargs.get('op', None) + self.schema = kwargs.get('schema', None) + self.table = kwargs.get('table', None) + self.column = kwargs.get('column', None) + self.sensitivity_label = kwargs.get('sensitivity_label', None) + + +class SensitivityLabelUpdateList(Model): + """A list of sensitivity label update operations. + + :param operations: + :type operations: list[~azure.mgmt.sql.models.SensitivityLabelUpdate] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[SensitivityLabelUpdate]'}, + } + + def __init__(self, **kwargs): + super(SensitivityLabelUpdateList, self).__init__(**kwargs) + self.operations = kwargs.get('operations', None) + + class Server(TrackedResource): """An Azure SQL Database server. @@ -8255,7 +9269,8 @@ class Server(TrackedResource): :param tags: Resource tags. :type tags: dict[str, str] :param identity: The Azure Active Directory identity of the server. - :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :ivar kind: Kind of sql server. This is metadata used for the Azure portal experience. :vartype kind: str @@ -8283,7 +9298,28 @@ class Server(TrackedResource): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag + :ivar workspace_feature: Whether or not existing server has a workspace + created and if it allows connection from workspace. Possible values + include: 'Connected', 'Disconnected' + :vartype workspace_feature: str or + ~azure.mgmt.sql.models.ServerWorkspaceFeature + :param primary_user_assigned_identity_id: The resource id of a user + assigned identity to be used by default. + :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory identity of the server. + :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag """ _validation = { @@ -8295,6 +9331,7 @@ class Server(TrackedResource): 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'workspace_feature': {'readonly': True}, } _attribute_map = { @@ -8303,7 +9340,7 @@ class Server(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'kind': {'key': 'kind', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -8313,6 +9350,12 @@ class Server(TrackedResource): 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, + 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, } def __init__(self, **kwargs): @@ -8327,6 +9370,12 @@ def __init__(self, **kwargs): self.private_endpoint_connections = None self.minimal_tls_version = kwargs.get('minimal_tls_version', None) self.public_network_access = kwargs.get('public_network_access', None) + self.workspace_feature = None + self.primary_user_assigned_identity_id = kwargs.get('primary_user_assigned_identity_id', None) + self.federated_client_id = kwargs.get('federated_client_id', None) + self.key_id = kwargs.get('key_id', None) + self.administrators = kwargs.get('administrators', None) + self.restrict_outbound_network_access = kwargs.get('restrict_outbound_network_access', None) class ServerAutomaticTuning(ProxyResource): @@ -8488,27 +9537,22 @@ class ServerBlobAuditingPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str + :param is_devops_audit_enabled: Specifies the state of devops audit. If + state is Enabled, devops logs will be sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as + 'Enabled', 'IsAzureMonitorTargetEnabled' as true and + 'IsDevopsAuditEnabled' as true + When using REST API to configure auditing, Diagnostic Settings with + 'DevOpsOperationsAudit' diagnostic logs category on the master database + should also be created. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST + API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings + PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + :type is_devops_audit_enabled: bool :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -8545,6 +9589,10 @@ class ServerBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -8573,16 +9621,13 @@ class ServerBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -8601,6 +9646,30 @@ class ServerBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str """ _validation = { @@ -8614,129 +9683,30 @@ class ServerBlobAuditingPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'is_devops_audit_enabled': {'key': 'properties.isDevopsAuditEnabled', 'type': 'bool'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } def __init__(self, **kwargs): super(ServerBlobAuditingPolicy, self).__init__(**kwargs) - self.state = kwargs.get('state', None) - self.storage_endpoint = kwargs.get('storage_endpoint', None) - self.storage_account_access_key = kwargs.get('storage_account_access_key', None) + self.is_devops_audit_enabled = kwargs.get('is_devops_audit_enabled', None) self.retention_days = kwargs.get('retention_days', None) self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None) - self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None) self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None) self.queue_delay_ms = kwargs.get('queue_delay_ms', None) - - -class ServerCommunicationLink(ProxyResource): - """Server communication link. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar state: The state. - :vartype state: str - :param partner_server: Required. The name of the partner server. - :type partner_server: str - :ivar location: Communication link location. - :vartype location: str - :ivar kind: Communication link kind. This property is used for Azure - Portal metadata. - :vartype kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'state': {'readonly': True}, - 'partner_server': {'required': True}, - 'location': {'readonly': True}, - 'kind': {'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'}, - 'partner_server': {'key': 'properties.partnerServer', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ServerCommunicationLink, self).__init__(**kwargs) - self.state = None - self.partner_server = kwargs.get('partner_server', None) - self.location = None - self.kind = None - - -class ServerConnectionPolicy(ProxyResource): - """A server secure connection policy. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar kind: Metadata used for the Azure portal experience. - :vartype kind: str - :ivar location: Resource location. - :vartype location: str - :param connection_type: Required. The server connection type. Possible - values include: 'Default', 'Proxy', 'Redirect' - :type connection_type: str or ~azure.mgmt.sql.models.ServerConnectionType - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'location': {'readonly': True}, - 'connection_type': {'required': 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'}, - 'connection_type': {'key': 'properties.connectionType', 'type': 'ServerConnectionType'}, - } - - def __init__(self, **kwargs): - super(ServerConnectionPolicy, self).__init__(**kwargs) - self.kind = None - self.location = None - self.connection_type = kwargs.get('connection_type', None) + self.state = kwargs.get('state', None) + self.storage_endpoint = kwargs.get('storage_endpoint', None) + self.storage_account_access_key = kwargs.get('storage_account_access_key', None) + self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) class ServerDevOpsAuditingSettings(ProxyResource): @@ -8862,13 +9832,19 @@ def __init__(self, **kwargs): class ServerDnsAliasAcquisition(Model): - """A server DNS alias acquisition request. + """A server dns alias acquisition request. + + All required parameters must be populated in order to send to Azure. - :param old_server_dns_alias_id: The id of the server alias that will be - acquired to point to this server instead. + :param old_server_dns_alias_id: Required. The id of the server alias that + will be acquired to point to this server instead. :type old_server_dns_alias_id: str """ + _validation = { + 'old_server_dns_alias_id': {'required': True}, + } + _attribute_map = { 'old_server_dns_alias_id': {'key': 'oldServerDnsAliasId', 'type': 'str'}, } @@ -8878,6 +9854,45 @@ def __init__(self, **kwargs): self.old_server_dns_alias_id = kwargs.get('old_server_dns_alias_id', None) +class ServerExternalAdministrator(Model): + """Properties of a active directory administrator. + + :param administrator_type: Type of the sever administrator. Possible + values include: 'ActiveDirectory' + :type administrator_type: str or ~azure.mgmt.sql.models.AdministratorType + :param principal_type: Principal Type of the sever administrator. Possible + values include: 'User', 'Group', 'Application' + :type principal_type: str or ~azure.mgmt.sql.models.PrincipalType + :param login: Login name of the server administrator. + :type login: str + :param sid: SID (object ID) of the server administrator. + :type sid: str + :param tenant_id: Tenant ID of the administrator. + :type tenant_id: str + :param azure_ad_only_authentication: Azure Active Directory only + Authentication enabled. + :type azure_ad_only_authentication: bool + """ + + _attribute_map = { + 'administrator_type': {'key': 'administratorType', 'type': 'str'}, + 'principal_type': {'key': 'principalType', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'azure_ad_only_authentication': {'key': 'azureADOnlyAuthentication', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServerExternalAdministrator, self).__init__(**kwargs) + self.administrator_type = kwargs.get('administrator_type', None) + self.principal_type = kwargs.get('principal_type', None) + self.login = kwargs.get('login', None) + self.sid = kwargs.get('sid', None) + self.tenant_id = kwargs.get('tenant_id', None) + self.azure_ad_only_authentication = kwargs.get('azure_ad_only_authentication', None) + + class ServerInfo(Model): """Server info for the server trust group. @@ -8914,9 +9929,9 @@ class ServerKey(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param kind: Kind of encryption protector. This is metadata used for the + :ivar kind: Kind of encryption protector. This is metadata used for the Azure portal experience. - :type kind: str + :vartype kind: str :ivar location: Resource location. :vartype location: str :ivar subregion: Subregion of the server key. @@ -8925,21 +9940,29 @@ class ServerKey(ProxyResource): 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :param uri: The URI of the server key. + :param uri: The URI of the server key. If the ServerKeyType is + AzureKeyVault, then the URI is required. :type uri: str - :param thumbprint: Thumbprint of the server key. - :type thumbprint: str - :param creation_date: The server key creation date. - :type creation_date: datetime + :ivar thumbprint: Thumbprint of the server key. + :vartype thumbprint: str + :ivar creation_date: The server key creation date. + :vartype creation_date: datetime + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or + false. + :vartype auto_rotation_enabled: bool """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'kind': {'readonly': True}, 'location': {'readonly': True}, 'subregion': {'readonly': True}, 'server_key_type': {'required': True}, + 'thumbprint': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'auto_rotation_enabled': {'readonly': True}, } _attribute_map = { @@ -8953,17 +9976,116 @@ class ServerKey(ProxyResource): 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(ServerKey, self).__init__(**kwargs) + self.kind = None + self.location = None + self.subregion = None + self.server_key_type = kwargs.get('server_key_type', None) + self.uri = kwargs.get('uri', None) + self.thumbprint = None + self.creation_date = None + self.auto_rotation_enabled = None + + +class ServerOperation(ProxyResource): + """A server operation. + + 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 operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar server_name: The name of the server. + :vartype server_name: str + :ivar start_time: The operation start time. + :vartype start_time: datetime + :ivar state: The operation state. Possible values include: 'Pending', + 'InProgress', 'Succeeded', 'Failed', 'CancelInProgress', 'Cancelled' + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + :ivar estimated_completion_time: The estimated completion time of the + operation. + :vartype estimated_completion_time: datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation': {'readonly': True}, + 'operation_friendly_name': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'server_name': {'readonly': True}, + 'start_time': {'readonly': True}, + 'state': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_description': {'readonly': True}, + 'error_severity': {'readonly': True}, + 'is_user_error': {'readonly': True}, + 'estimated_completion_time': {'readonly': True}, + 'description': {'readonly': True}, + 'is_cancellable': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation': {'key': 'properties.operation', 'type': 'str'}, + 'operation_friendly_name': {'key': 'properties.operationFriendlyName', 'type': 'str'}, + 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, + 'server_name': {'key': 'properties.serverName', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, + 'error_description': {'key': 'properties.errorDescription', 'type': 'str'}, + 'error_severity': {'key': 'properties.errorSeverity', 'type': 'int'}, + 'is_user_error': {'key': 'properties.isUserError', 'type': 'bool'}, + 'estimated_completion_time': {'key': 'properties.estimatedCompletionTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, } def __init__(self, **kwargs): - super(ServerKey, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.location = None - self.subregion = None - self.server_key_type = kwargs.get('server_key_type', None) - self.uri = kwargs.get('uri', None) - self.thumbprint = kwargs.get('thumbprint', None) - self.creation_date = kwargs.get('creation_date', None) + super(ServerOperation, self).__init__(**kwargs) + self.operation = None + self.operation_friendly_name = None + self.percent_complete = None + self.server_name = None + self.start_time = None + self.state = None + self.error_code = None + self.error_description = None + self.error_severity = None + self.is_user_error = None + self.estimated_completion_time = None + self.description = None + self.is_cancellable = None class ServerPrivateEndpointConnection(Model): @@ -9009,13 +10131,15 @@ class ServerSecurityAlertPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar system_data: SystemData of SecurityAlertPolicyResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData :param state: Required. Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific - database. Possible values include: 'New', 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState + database. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState :param disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, - Access_Anomaly, Data_Exfiltration, Unsafe_Action + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force :type disabled_alerts: list[str] :param email_addresses: Specifies an array of e-mail addresses to which the alert is sent. @@ -9041,6 +10165,7 @@ class ServerSecurityAlertPolicy(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'state': {'required': True}, 'creation_time': {'readonly': True}, } @@ -9049,7 +10174,8 @@ class ServerSecurityAlertPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'SecurityAlertsPolicyState'}, 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, @@ -9061,6 +10187,7 @@ class ServerSecurityAlertPolicy(ProxyResource): def __init__(self, **kwargs): super(ServerSecurityAlertPolicy, self).__init__(**kwargs) + self.system_data = None self.state = kwargs.get('state', None) self.disabled_alerts = kwargs.get('disabled_alerts', None) self.email_addresses = kwargs.get('email_addresses', None) @@ -9120,6 +10247,9 @@ class ServerUpdate(Model): Variables are only populated by the server, and will be ignored when sending a request. + :param identity: Server identity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :param administrator_login: Administrator username for the server. Once created it cannot be changed. :type administrator_login: str @@ -9144,7 +10274,28 @@ class ServerUpdate(Model): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag + :ivar workspace_feature: Whether or not existing server has a workspace + created and if it allows connection from workspace. Possible values + include: 'Connected', 'Disconnected' + :vartype workspace_feature: str or + ~azure.mgmt.sql.models.ServerWorkspaceFeature + :param primary_user_assigned_identity_id: The resource id of a user + assigned identity to be used by default. + :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory identity of the server. + :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :param tags: Resource tags. :type tags: dict[str, str] """ @@ -9153,9 +10304,11 @@ class ServerUpdate(Model): 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'workspace_feature': {'readonly': True}, } _attribute_map = { + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, @@ -9164,11 +10317,18 @@ class ServerUpdate(Model): 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, + 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } def __init__(self, **kwargs): super(ServerUpdate, self).__init__(**kwargs) + self.identity = kwargs.get('identity', None) self.administrator_login = kwargs.get('administrator_login', None) self.administrator_login_password = kwargs.get('administrator_login_password', None) self.version = kwargs.get('version', None) @@ -9177,63 +10337,15 @@ def __init__(self, **kwargs): self.private_endpoint_connections = None self.minimal_tls_version = kwargs.get('minimal_tls_version', None) self.public_network_access = kwargs.get('public_network_access', None) + self.workspace_feature = None + self.primary_user_assigned_identity_id = kwargs.get('primary_user_assigned_identity_id', None) + self.federated_client_id = kwargs.get('federated_client_id', None) + self.key_id = kwargs.get('key_id', None) + self.administrators = kwargs.get('administrators', None) + self.restrict_outbound_network_access = kwargs.get('restrict_outbound_network_access', None) self.tags = kwargs.get('tags', None) -class ServerUsage(Model): - """Represents server metrics. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Name of the server usage metric. - :vartype name: str - :ivar resource_name: The name of the resource. - :vartype resource_name: str - :ivar display_name: The metric display name. - :vartype display_name: str - :ivar current_value: The current value of the metric. - :vartype current_value: float - :ivar limit: The current limit of the metric. - :vartype limit: float - :ivar unit: The units of the metric. - :vartype unit: str - :ivar next_reset_time: The next reset time for the metric (ISO8601 - format). - :vartype next_reset_time: datetime - """ - - _validation = { - 'name': {'readonly': True}, - 'resource_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - 'next_reset_time': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(ServerUsage, self).__init__(**kwargs) - self.name = None - self.resource_name = None - self.display_name = None - self.current_value = None - self.limit = None - self.unit = None - self.next_reset_time = None - - class ServerVersionCapability(Model): """The server capability. @@ -9299,9 +10411,9 @@ class ServerVulnerabilityAssessment(ProxyResource): https://myStorage.blob.core.windows.net/VaScans/). :type storage_container_path: str :param storage_container_sas_key: A shared access signature (SAS Key) that - has read and write access to the blob container specified in - 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't - specified, StorageContainerSasKey is required. + has write access to the blob container specified in 'storageContainerPath' + parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. :type storage_container_sas_key: str :param storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If @@ -9338,63 +10450,6 @@ def __init__(self, **kwargs): self.recurring_scans = kwargs.get('recurring_scans', None) -class ServiceObjective(ProxyResource): - """Represents a database service objective. - - 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 service_objective_name: The name for the service objective. - :vartype service_objective_name: str - :ivar is_default: Gets whether the service level objective is the default - service objective. - :vartype is_default: bool - :ivar is_system: Gets whether the service level objective is a system - service objective. - :vartype is_system: bool - :ivar description: The description for the service level objective. - :vartype description: str - :ivar enabled: Gets whether the service level objective is enabled. - :vartype enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'service_objective_name': {'readonly': True}, - 'is_default': {'readonly': True}, - 'is_system': {'readonly': True}, - 'description': {'readonly': True}, - 'enabled': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'service_objective_name': {'key': 'properties.serviceObjectiveName', 'type': 'str'}, - 'is_default': {'key': 'properties.isDefault', 'type': 'bool'}, - 'is_system': {'key': 'properties.isSystem', 'type': 'bool'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(ServiceObjective, self).__init__(**kwargs) - self.service_objective_name = None - self.is_default = None - self.is_system = None - self.description = None - self.enabled = None - - class ServiceObjectiveCapability(Model): """The service objectives capability. @@ -9492,151 +10547,6 @@ def __init__(self, **kwargs): self.reason = kwargs.get('reason', None) -class ServiceTierAdvisor(ProxyResource): - """Represents a Service Tier Advisor. - - 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 observation_period_start: The observation period start (ISO8601 - format). - :vartype observation_period_start: datetime - :ivar observation_period_end: The observation period start (ISO8601 - format). - :vartype observation_period_end: datetime - :ivar active_time_ratio: The activeTimeRatio for service tier advisor. - :vartype active_time_ratio: float - :ivar min_dtu: Gets or sets minDtu for service tier advisor. - :vartype min_dtu: float - :ivar avg_dtu: Gets or sets avgDtu for service tier advisor. - :vartype avg_dtu: float - :ivar max_dtu: Gets or sets maxDtu for service tier advisor. - :vartype max_dtu: float - :ivar max_size_in_gb: Gets or sets maxSizeInGB for service tier advisor. - :vartype max_size_in_gb: float - :ivar service_level_objective_usage_metrics: Gets or sets - serviceLevelObjectiveUsageMetrics for the service tier advisor. - :vartype service_level_objective_usage_metrics: - list[~azure.mgmt.sql.models.SloUsageMetric] - :ivar current_service_level_objective: Gets or sets - currentServiceLevelObjective for service tier advisor. - :vartype current_service_level_objective: str - :ivar current_service_level_objective_id: Gets or sets - currentServiceLevelObjectiveId for service tier advisor. - :vartype current_service_level_objective_id: str - :ivar usage_based_recommendation_service_level_objective: Gets or sets - usageBasedRecommendationServiceLevelObjective for service tier advisor. - :vartype usage_based_recommendation_service_level_objective: str - :ivar usage_based_recommendation_service_level_objective_id: Gets or sets - usageBasedRecommendationServiceLevelObjectiveId for service tier advisor. - :vartype usage_based_recommendation_service_level_objective_id: str - :ivar database_size_based_recommendation_service_level_objective: Gets or - sets databaseSizeBasedRecommendationServiceLevelObjective for service tier - advisor. - :vartype database_size_based_recommendation_service_level_objective: str - :ivar database_size_based_recommendation_service_level_objective_id: Gets - or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service - tier advisor. - :vartype database_size_based_recommendation_service_level_objective_id: - str - :ivar disaster_plan_based_recommendation_service_level_objective: Gets or - sets disasterPlanBasedRecommendationServiceLevelObjective for service tier - advisor. - :vartype disaster_plan_based_recommendation_service_level_objective: str - :ivar disaster_plan_based_recommendation_service_level_objective_id: Gets - or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service - tier advisor. - :vartype disaster_plan_based_recommendation_service_level_objective_id: - str - :ivar overall_recommendation_service_level_objective: Gets or sets - overallRecommendationServiceLevelObjective for service tier advisor. - :vartype overall_recommendation_service_level_objective: str - :ivar overall_recommendation_service_level_objective_id: Gets or sets - overallRecommendationServiceLevelObjectiveId for service tier advisor. - :vartype overall_recommendation_service_level_objective_id: str - :ivar confidence: Gets or sets confidence for service tier advisor. - :vartype confidence: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'observation_period_start': {'readonly': True}, - 'observation_period_end': {'readonly': True}, - 'active_time_ratio': {'readonly': True}, - 'min_dtu': {'readonly': True}, - 'avg_dtu': {'readonly': True}, - 'max_dtu': {'readonly': True}, - 'max_size_in_gb': {'readonly': True}, - 'service_level_objective_usage_metrics': {'readonly': True}, - 'current_service_level_objective': {'readonly': True}, - 'current_service_level_objective_id': {'readonly': True}, - 'usage_based_recommendation_service_level_objective': {'readonly': True}, - 'usage_based_recommendation_service_level_objective_id': {'readonly': True}, - 'database_size_based_recommendation_service_level_objective': {'readonly': True}, - 'database_size_based_recommendation_service_level_objective_id': {'readonly': True}, - 'disaster_plan_based_recommendation_service_level_objective': {'readonly': True}, - 'disaster_plan_based_recommendation_service_level_objective_id': {'readonly': True}, - 'overall_recommendation_service_level_objective': {'readonly': True}, - 'overall_recommendation_service_level_objective_id': {'readonly': True}, - 'confidence': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'observation_period_start': {'key': 'properties.observationPeriodStart', 'type': 'iso-8601'}, - 'observation_period_end': {'key': 'properties.observationPeriodEnd', 'type': 'iso-8601'}, - 'active_time_ratio': {'key': 'properties.activeTimeRatio', 'type': 'float'}, - 'min_dtu': {'key': 'properties.minDtu', 'type': 'float'}, - 'avg_dtu': {'key': 'properties.avgDtu', 'type': 'float'}, - 'max_dtu': {'key': 'properties.maxDtu', 'type': 'float'}, - 'max_size_in_gb': {'key': 'properties.maxSizeInGB', 'type': 'float'}, - 'service_level_objective_usage_metrics': {'key': 'properties.serviceLevelObjectiveUsageMetrics', 'type': '[SloUsageMetric]'}, - 'current_service_level_objective': {'key': 'properties.currentServiceLevelObjective', 'type': 'str'}, - 'current_service_level_objective_id': {'key': 'properties.currentServiceLevelObjectiveId', 'type': 'str'}, - 'usage_based_recommendation_service_level_objective': {'key': 'properties.usageBasedRecommendationServiceLevelObjective', 'type': 'str'}, - 'usage_based_recommendation_service_level_objective_id': {'key': 'properties.usageBasedRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'database_size_based_recommendation_service_level_objective': {'key': 'properties.databaseSizeBasedRecommendationServiceLevelObjective', 'type': 'str'}, - 'database_size_based_recommendation_service_level_objective_id': {'key': 'properties.databaseSizeBasedRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'disaster_plan_based_recommendation_service_level_objective': {'key': 'properties.disasterPlanBasedRecommendationServiceLevelObjective', 'type': 'str'}, - 'disaster_plan_based_recommendation_service_level_objective_id': {'key': 'properties.disasterPlanBasedRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'overall_recommendation_service_level_objective': {'key': 'properties.overallRecommendationServiceLevelObjective', 'type': 'str'}, - 'overall_recommendation_service_level_objective_id': {'key': 'properties.overallRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'confidence': {'key': 'properties.confidence', 'type': 'float'}, - } - - def __init__(self, **kwargs): - super(ServiceTierAdvisor, self).__init__(**kwargs) - self.observation_period_start = None - self.observation_period_end = None - self.active_time_ratio = None - self.min_dtu = None - self.avg_dtu = None - self.max_dtu = None - self.max_size_in_gb = None - self.service_level_objective_usage_metrics = None - self.current_service_level_objective = None - self.current_service_level_objective_id = None - self.usage_based_recommendation_service_level_objective = None - self.usage_based_recommendation_service_level_objective_id = None - self.database_size_based_recommendation_service_level_objective = None - self.database_size_based_recommendation_service_level_objective_id = None - self.disaster_plan_based_recommendation_service_level_objective = None - self.disaster_plan_based_recommendation_service_level_objective_id = None - self.overall_recommendation_service_level_objective = None - self.overall_recommendation_service_level_objective_id = None - self.confidence = None - - class Sku(Model): """An ARM Resource SKU. @@ -9678,49 +10588,39 @@ def __init__(self, **kwargs): self.capacity = kwargs.get('capacity', None) -class SloUsageMetric(Model): - """A Slo Usage Metric. +class SqlAgentConfiguration(ProxyResource): + """A recoverable managed database resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar service_level_objective: The serviceLevelObjective for SLO usage - metric. Possible values include: 'System', 'System0', 'System1', - 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', - 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', - 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', - 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', - 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', - 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', - 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', - 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - :vartype service_level_objective: str or - ~azure.mgmt.sql.models.ServiceObjectiveName - :ivar service_level_objective_id: The serviceLevelObjectiveId for SLO - usage metric. - :vartype service_level_objective_id: str - :ivar in_range_time_ratio: Gets or sets inRangeTimeRatio for SLO usage - metric. - :vartype in_range_time_ratio: float + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: The state of Sql Agent. Possible values include: 'Enabled', + 'Disabled' + :type state: str or ~azure.mgmt.sql.models.enum """ _validation = { - 'service_level_objective': {'readonly': True}, - 'service_level_objective_id': {'readonly': True}, - 'in_range_time_ratio': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'service_level_objective': {'key': 'serviceLevelObjective', 'type': 'str'}, - 'service_level_objective_id': {'key': 'serviceLevelObjectiveId', 'type': 'str'}, - 'in_range_time_ratio': {'key': 'inRangeTimeRatio', 'type': 'float'}, + '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(SloUsageMetric, self).__init__(**kwargs) - self.service_level_objective = None - self.service_level_objective_id = None - self.in_range_time_ratio = None + super(SqlAgentConfiguration, self).__init__(**kwargs) + self.state = kwargs.get('state', None) class StorageCapability(Model): @@ -10116,6 +11016,8 @@ class SyncGroup(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :param sku: The name and capacity of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku :param interval: Sync interval of the sync group. :type interval: int :ivar last_sync_time: Last sync time of the sync group. @@ -10138,6 +11040,11 @@ class SyncGroup(ProxyResource): :vartype sync_state: str or ~azure.mgmt.sql.models.SyncGroupState :param schema: Sync schema of the sync group. :type schema: ~azure.mgmt.sql.models.SyncGroupSchema + :param enable_conflict_logging: If conflict logging is enabled. + :type enable_conflict_logging: bool + :param conflict_logging_retention_in_days: Conflict logging retention + period. + :type conflict_logging_retention_in_days: int :param use_private_link_connection: If use private link connection is enabled. :type use_private_link_connection: bool @@ -10159,6 +11066,7 @@ class SyncGroup(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'interval': {'key': 'properties.interval', 'type': 'int'}, 'last_sync_time': {'key': 'properties.lastSyncTime', 'type': 'iso-8601'}, 'conflict_resolution_policy': {'key': 'properties.conflictResolutionPolicy', 'type': 'str'}, @@ -10167,12 +11075,15 @@ class SyncGroup(ProxyResource): 'hub_database_password': {'key': 'properties.hubDatabasePassword', 'type': 'str'}, 'sync_state': {'key': 'properties.syncState', 'type': 'str'}, 'schema': {'key': 'properties.schema', 'type': 'SyncGroupSchema'}, + 'enable_conflict_logging': {'key': 'properties.enableConflictLogging', 'type': 'bool'}, + 'conflict_logging_retention_in_days': {'key': 'properties.conflictLoggingRetentionInDays', 'type': 'int'}, 'use_private_link_connection': {'key': 'properties.usePrivateLinkConnection', 'type': 'bool'}, 'private_endpoint_name': {'key': 'properties.privateEndpointName', 'type': 'str'}, } def __init__(self, **kwargs): super(SyncGroup, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) self.interval = kwargs.get('interval', None) self.last_sync_time = None self.conflict_resolution_policy = kwargs.get('conflict_resolution_policy', None) @@ -10181,6 +11092,8 @@ def __init__(self, **kwargs): self.hub_database_password = kwargs.get('hub_database_password', None) self.sync_state = None self.schema = kwargs.get('schema', None) + self.enable_conflict_logging = kwargs.get('enable_conflict_logging', None) + self.conflict_logging_retention_in_days = kwargs.get('conflict_logging_retention_in_days', None) self.use_private_link_connection = kwargs.get('use_private_link_connection', None) self.private_endpoint_name = None @@ -10395,38 +11308,22 @@ def __init__(self, **kwargs): class SystemData(Model): """Metadata pertaining to creation and last modification of the resource. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar created_by: A string identifier for the identity that created the - resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource: - . Possible values include: 'User', - 'Application', 'ManagedIdentity', 'Key' - :vartype created_by_type: str or ~azure.mgmt.sql.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: datetime - :ivar last_modified_by: A string identifier for the identity that last - modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the - resource: . Possible values include: - 'User', 'Application', 'ManagedIdentity', 'Key' - :vartype last_modified_by_type: str or - ~azure.mgmt.sql.models.CreatedByType - :ivar last_modified_at: The timestamp of last modification (UTC). - :vartype last_modified_at: datetime - """ - - _validation = { - 'created_by': {'readonly': True}, - 'created_by_type': {'readonly': True}, - 'created_at': {'readonly': True}, - 'last_modified_by': {'readonly': True}, - 'last_modified_by_type': {'readonly': True}, - 'last_modified_at': {'readonly': True}, - } + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, @@ -10439,12 +11336,12 @@ class SystemData(Model): def __init__(self, **kwargs): super(SystemData, self).__init__(**kwargs) - self.created_by = None - self.created_by_type = None - self.created_at = None - self.last_modified_by = None - self.last_modified_by_type = None - self.last_modified_at = None + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) class TdeCertificate(ProxyResource): @@ -10489,6 +11386,46 @@ def __init__(self, **kwargs): self.cert_password = kwargs.get('cert_password', None) +class TimeZone(ProxyResource): + """Time Zone. + + 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 time_zone_id: The time zone id + :vartype time_zone_id: str + :ivar display_name: The time zone display name + :vartype display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time_zone_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time_zone_id': {'key': 'properties.timeZoneId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(TimeZone, self).__init__(**kwargs) + self.time_zone_id = None + self.display_name = None + + class TopQueries(Model): """TopQueries. @@ -10544,49 +11481,27 @@ def __init__(self, **kwargs): self.queries = kwargs.get('queries', 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. +class UpdateLongTermRetentionBackupParameters(Model): + """Contains the information necessary to perform long term retention backup + update operation. - :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 + :param requested_backup_storage_redundancy: The storage redundancy type of + the copied backup. Possible values include: 'Geo', 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy """ - _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': 'TransparentDataEncryptionStatus'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, } def __init__(self, **kwargs): - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = kwargs.get('status', None) + super(UpdateLongTermRetentionBackupParameters, self).__init__(**kwargs) + self.requested_backup_storage_redundancy = kwargs.get('requested_backup_storage_redundancy', None) -class TransparentDataEncryptionActivity(ProxyResource): - """Represents a database transparent data encryption Scan. +class UpdateManagedInstanceDnsServersOperation(ProxyResource): + """A recoverable managed database resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -10597,57 +11512,28 @@ class TransparentDataEncryptionActivity(ProxyResource): :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 + :ivar status: The status of the DNS refresh operation. Possible values + include: 'Succeeded', 'Failed' + :vartype status: str or ~azure.mgmt.sql.models.enum """ _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 + super(UpdateManagedInstanceDnsServersOperation, self).__init__(**kwargs) self.status = None - self.percent_complete = None - - -class UnlinkParameters(Model): - """Represents the parameters for Unlink Replication Link request. - - :param forced_termination: Determines whether link will be terminated in a - forced or a friendly way. - :type forced_termination: bool - """ - - _attribute_map = { - 'forced_termination': {'key': 'forcedTermination', 'type': 'bool'}, - } - - def __init__(self, **kwargs): - super(UnlinkParameters, self).__init__(**kwargs) - self.forced_termination = kwargs.get('forced_termination', None) class UpsertManagedServerOperationParameters(Model): @@ -10756,6 +11642,34 @@ def __init__(self, **kwargs): self.requested_limit = None +class UserIdentity(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(UserIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualCluster(TrackedResource): """An Azure SQL virtual cluster. @@ -10781,6 +11695,9 @@ class VirtualCluster(TrackedResource): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_configuration_id: Specifies maintenance configuration + id to apply to this virtual cluster. + :type maintenance_configuration_id: str """ _validation = { @@ -10801,6 +11718,7 @@ class VirtualCluster(TrackedResource): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, } def __init__(self, **kwargs): @@ -10808,6 +11726,7 @@ def __init__(self, **kwargs): self.subnet_id = None self.family = kwargs.get('family', None) self.child_resources = None + self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) class VirtualClusterUpdate(Model): @@ -10823,6 +11742,9 @@ class VirtualClusterUpdate(Model): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_configuration_id: Specifies maintenance configuration + id to apply to this virtual cluster. + :type maintenance_configuration_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -10836,6 +11758,7 @@ class VirtualClusterUpdate(Model): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } @@ -10844,6 +11767,7 @@ def __init__(self, **kwargs): self.subnet_id = None self.family = kwargs.get('family', None) self.child_resources = None + self.maintenance_configuration_id = kwargs.get('maintenance_configuration_id', None) self.tags = kwargs.get('tags', None) @@ -10868,7 +11792,7 @@ class VirtualNetworkRule(ProxyResource): the virtual network has vnet service endpoint enabled. :type ignore_missing_vnet_service_endpoint: bool :ivar state: Virtual Network Rule State. Possible values include: - 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + 'Initializing', 'InProgress', 'Ready', 'Failed', 'Deleting', 'Unknown' :vartype state: str or ~azure.mgmt.sql.models.VirtualNetworkRuleState """ 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 4346f7f65c48..06e6a1f8d865 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 @@ -12,6 +12,160 @@ from msrest.serialization import Model +class Resource(Model): + """ARM resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + + +class ProxyResource(Resource): + """ARM proxy resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(ProxyResource, self).__init__(**kwargs) + + +class Advisor(ProxyResource): + """Database, Server or Elastic Pool Advisor. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar kind: Resource kind. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + :ivar advisor_status: Gets the status of availability of this advisor to + customers. Possible values are 'GA', 'PublicPreview', + 'LimitedPublicPreview' and 'PrivatePreview'. Possible values include: + 'GA', 'PublicPreview', 'LimitedPublicPreview', 'PrivatePreview' + :vartype advisor_status: str or ~azure.mgmt.sql.models.AdvisorStatus + :param auto_execute_status: Required. Gets the auto-execute status + (whether to let the system execute the recommendations) of this advisor. + Possible values are 'Enabled' and 'Disabled'. Possible values include: + 'Enabled', 'Disabled', 'Default' + :type auto_execute_status: str or ~azure.mgmt.sql.models.AutoExecuteStatus + :ivar auto_execute_status_inherited_from: Gets the resource from which + current value of auto-execute status is inherited. Auto-execute status can + be set on (and inherited from) different levels in the resource hierarchy. + Possible values are 'Subscription', 'Server', 'ElasticPool', 'Database' + and 'Default' (when status is not explicitly set on any level). Possible + values include: 'Default', 'Subscription', 'Server', 'ElasticPool', + 'Database' + :vartype auto_execute_status_inherited_from: str or + ~azure.mgmt.sql.models.AutoExecuteStatusInheritedFrom + :ivar recommendations_status: Gets that status of recommendations for this + advisor and reason for not having any recommendations. Possible values + include, but are not limited to, 'Ok' (Recommendations + available),LowActivity (not enough workload to analyze), 'DbSeemsTuned' + (Database is doing well), etc. + :vartype recommendations_status: str + :ivar last_checked: Gets the time when the current resource was analyzed + for recommendations by this advisor. + :vartype last_checked: datetime + :ivar recommended_actions: Gets the recommended actions for this advisor. + :vartype recommended_actions: + list[~azure.mgmt.sql.models.RecommendedAction] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'readonly': True}, + 'advisor_status': {'readonly': True}, + 'auto_execute_status': {'required': True}, + 'auto_execute_status_inherited_from': {'readonly': True}, + 'recommendations_status': {'readonly': True}, + 'last_checked': {'readonly': True}, + 'recommended_actions': {'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'}, + 'advisor_status': {'key': 'properties.advisorStatus', 'type': 'AdvisorStatus'}, + 'auto_execute_status': {'key': 'properties.autoExecuteStatus', 'type': 'AutoExecuteStatus'}, + 'auto_execute_status_inherited_from': {'key': 'properties.autoExecuteStatusInheritedFrom', 'type': 'AutoExecuteStatusInheritedFrom'}, + 'recommendations_status': {'key': 'properties.recommendationsStatus', 'type': 'str'}, + 'last_checked': {'key': 'properties.lastChecked', 'type': 'iso-8601'}, + 'recommended_actions': {'key': 'properties.recommendedActions', 'type': '[RecommendedAction]'}, + } + + def __init__(self, *, auto_execute_status, **kwargs) -> None: + super(Advisor, self).__init__(**kwargs) + self.kind = None + self.location = None + self.advisor_status = None + self.auto_execute_status = auto_execute_status + self.auto_execute_status_inherited_from = None + self.recommendations_status = None + self.last_checked = None + self.recommended_actions = None + + class AutomaticTuningOptions(Model): """Automatic tuning properties for individual advisors. @@ -152,119 +306,6 @@ def __init__(self, **kwargs) -> None: self.do_not_pause_value = None -class Resource(Model): - """ARM resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _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'}, - } - - def __init__(self, **kwargs) -> None: - super(Resource, self).__init__(**kwargs) - self.id = None - self.name = None - self.type = None - - -class ProxyResource(Resource): - """ARM proxy resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - """ - - _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'}, - } - - def __init__(self, **kwargs) -> None: - super(ProxyResource, self).__init__(**kwargs) - - -class BackupLongTermRetentionPolicy(ProxyResource): - """A long term retention policy. - - 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 weekly_retention: The weekly retention policy for an LTR backup in - an ISO 8601 format. - :type weekly_retention: str - :param monthly_retention: The monthly retention policy for an LTR backup - in an ISO 8601 format. - :type monthly_retention: str - :param yearly_retention: The yearly retention policy for an LTR backup in - an ISO 8601 format. - :type yearly_retention: str - :param week_of_year: The week of year to take the yearly backup in an ISO - 8601 format. - :type week_of_year: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'weekly_retention': {'key': 'properties.weeklyRetention', 'type': 'str'}, - 'monthly_retention': {'key': 'properties.monthlyRetention', 'type': 'str'}, - 'yearly_retention': {'key': 'properties.yearlyRetention', 'type': 'str'}, - 'week_of_year': {'key': 'properties.weekOfYear', 'type': 'int'}, - } - - def __init__(self, *, weekly_retention: str=None, monthly_retention: str=None, yearly_retention: str=None, week_of_year: int=None, **kwargs) -> None: - super(BackupLongTermRetentionPolicy, self).__init__(**kwargs) - self.weekly_retention = weekly_retention - self.monthly_retention = monthly_retention - self.yearly_retention = yearly_retention - self.week_of_year = week_of_year - - class BackupShortTermRetentionPolicy(ProxyResource): """A short term retention policy. @@ -403,6 +444,50 @@ def __init__(self, *, last_backup_name: str, **kwargs) -> None: self.last_backup_name = last_backup_name +class CopyLongTermRetentionBackupParameters(Model): + """Contains the information necessary to perform long term retention backup + copy operation. + + :param target_subscription_id: The subscription that owns the target + server + :type target_subscription_id: str + :param target_resource_group: The resource group that owns the target + server + :type target_resource_group: str + :param target_server_resource_id: The resource Id of the target server + that owns the database + :type target_server_resource_id: str + :param target_server_fully_qualified_domain_name: The fully qualified + domain name of the target server + :type target_server_fully_qualified_domain_name: str + :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 + """ + + _attribute_map = { + 'target_subscription_id': {'key': 'properties.targetSubscriptionId', 'type': 'str'}, + 'target_resource_group': {'key': 'properties.targetResourceGroup', 'type': 'str'}, + 'target_server_resource_id': {'key': 'properties.targetServerResourceId', 'type': 'str'}, + 'target_server_fully_qualified_domain_name': {'key': 'properties.targetServerFullyQualifiedDomainName', 'type': 'str'}, + 'target_database_name': {'key': 'properties.targetDatabaseName', 'type': 'str'}, + 'target_backup_storage_redundancy': {'key': 'properties.targetBackupStorageRedundancy', 'type': 'str'}, + } + + def __init__(self, *, target_subscription_id: str=None, target_resource_group: str=None, target_server_resource_id: str=None, target_server_fully_qualified_domain_name: str=None, target_database_name: str=None, target_backup_storage_redundancy=None, **kwargs) -> None: + super(CopyLongTermRetentionBackupParameters, self).__init__(**kwargs) + self.target_subscription_id = target_subscription_id + self.target_resource_group = target_resource_group + self.target_server_resource_id = target_server_resource_id + self.target_server_fully_qualified_domain_name = target_server_fully_qualified_domain_name + self.target_database_name = target_database_name + self.target_backup_storage_redundancy = target_backup_storage_redundancy + + class CreateDatabaseRestorePointDefinition(Model): """Contains the information necessary to perform a create database restore point operation. @@ -624,10 +709,16 @@ class Database(TrackedResource): :param auto_pause_delay: Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled :type auto_pause_delay: int - :param storage_account_type: The storage account type used to store - backups for this database. 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 database. Possible values include: 'Geo', 'Local', + 'Zone' + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be + used to store backups for this database. Possible values include: 'Geo', + 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused :type min_capacity: float @@ -641,6 +732,10 @@ class Database(TrackedResource): to the database. This configuration defines the period when the maintenance updates will occur. :type maintenance_configuration_id: str + :param is_ledger_on: Whether or not this database is a ledger database, + which means all tables in the database are ledger tables. Note: the value + of this property cannot be changed after the database has been created. + :type is_ledger_on: bool """ _validation = { @@ -660,6 +755,7 @@ class Database(TrackedResource): 'max_log_size_bytes': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, 'current_sku': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, 'paused_date': {'readonly': True}, 'resumed_date': {'readonly': True}, } @@ -702,14 +798,16 @@ class Database(TrackedResource): 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - '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'}, 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, + 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, } - def __init__(self, *, location: str, tags=None, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, high_availability_replica_count: int=None, secondary_type=None, auto_pause_delay: int=None, storage_account_type=None, min_capacity: float=None, maintenance_configuration_id: str=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, high_availability_replica_count: int=None, secondary_type=None, auto_pause_delay: int=None, requested_backup_storage_redundancy=None, min_capacity: float=None, maintenance_configuration_id: str=None, is_ledger_on: bool=None, **kwargs) -> None: super(Database, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.kind = None @@ -743,11 +841,13 @@ def __init__(self, *, location: str, tags=None, sku=None, create_mode=None, coll self.secondary_type = secondary_type self.current_sku = None self.auto_pause_delay = auto_pause_delay - self.storage_account_type = storage_account_type + self.current_backup_storage_redundancy = None + self.requested_backup_storage_redundancy = requested_backup_storage_redundancy self.min_capacity = min_capacity self.paused_date = None self.resumed_date = None self.maintenance_configuration_id = maintenance_configuration_id + self.is_ledger_on = is_ledger_on class DatabaseAutomaticTuning(ProxyResource): @@ -811,27 +911,6 @@ class DatabaseBlobAuditingPolicy(ProxyResource): :vartype type: str :ivar kind: Resource kind. :vartype kind: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -868,6 +947,10 @@ class DatabaseBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -896,16 +979,13 @@ class DatabaseBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -924,44 +1004,177 @@ class DatabaseBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'state': {'required': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'kind': {'readonly': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } - def __init__(self, *, state, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, **kwargs) -> None: + def __init__(self, *, state, retention_days: int=None, audit_actions_and_groups=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, storage_endpoint: str=None, storage_account_access_key: str=None, storage_account_subscription_id: str=None, **kwargs) -> None: super(DatabaseBlobAuditingPolicy, self).__init__(**kwargs) self.kind = None - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key self.retention_days = retention_days self.audit_actions_and_groups = audit_actions_and_groups - self.storage_account_subscription_id = storage_account_subscription_id self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled self.queue_delay_ms = queue_delay_ms + self.state = state + self.storage_endpoint = storage_endpoint + self.storage_account_access_key = storage_account_access_key + self.storage_account_subscription_id = storage_account_subscription_id + + +class DatabaseColumn(ProxyResource): + """A database column resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param column_type: The column data type. Possible values include: + 'image', 'text', 'uniqueidentifier', 'date', 'time', 'datetime2', + 'datetimeoffset', 'tinyint', 'smallint', 'int', 'smalldatetime', 'real', + 'money', 'datetime', 'float', 'sql_variant', 'ntext', 'bit', 'decimal', + 'numeric', 'smallmoney', 'bigint', 'hierarchyid', 'geometry', 'geography', + 'varbinary', 'varchar', 'binary', 'char', 'timestamp', 'nvarchar', + 'nchar', 'xml', 'sysname' + :type column_type: str or ~azure.mgmt.sql.models.ColumnDataType + :param temporal_type: The table temporal type. Possible values include: + 'NonTemporalTable', 'HistoryTable', 'SystemVersionedTemporalTable' + :type temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType + :param memory_optimized: Whether or not the column belongs to a memory + optimized table. + :type memory_optimized: bool + :param is_computed: Whether or not the column is computed. + :type is_computed: bool + """ + + _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'}, + 'column_type': {'key': 'properties.columnType', 'type': 'str'}, + 'temporal_type': {'key': 'properties.temporalType', 'type': 'str'}, + 'memory_optimized': {'key': 'properties.memoryOptimized', 'type': 'bool'}, + 'is_computed': {'key': 'properties.isComputed', 'type': 'bool'}, + } + + def __init__(self, *, column_type=None, temporal_type=None, memory_optimized: bool=None, is_computed: bool=None, **kwargs) -> None: + super(DatabaseColumn, self).__init__(**kwargs) + self.column_type = column_type + self.temporal_type = temporal_type + self.memory_optimized = memory_optimized + self.is_computed = is_computed + + +class DatabaseExtensions(ProxyResource): + """An export managed database operation result resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar operation_mode: Required. Operation Mode. Default value: + "PolybaseImport" . + :vartype operation_mode: str + :param storage_key_type: Required. Storage key type. Possible values + include: 'SharedAccessKey', 'StorageAccessKey' + :type storage_key_type: str or ~azure.mgmt.sql.models.StorageKeyType + :param storage_key: Required. Storage key. + :type storage_key: str + :param storage_uri: Required. Storage Uri. + :type storage_uri: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation_mode': {'required': True, 'constant': True}, + 'storage_key_type': {'required': True}, + 'storage_key': {'required': True}, + 'storage_uri': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation_mode': {'key': 'properties.operationMode', 'type': 'str'}, + 'storage_key_type': {'key': 'properties.storageKeyType', 'type': 'str'}, + 'storage_key': {'key': 'properties.storageKey', 'type': 'str'}, + 'storage_uri': {'key': 'properties.storageUri', 'type': 'str'}, + } + + operation_mode = "PolybaseImport" + + def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, **kwargs) -> None: + super(DatabaseExtensions, self).__init__(**kwargs) + self.storage_key_type = storage_key_type + self.storage_key = storage_key + self.storage_uri = storage_uri class DatabaseOperation(ProxyResource): @@ -1067,8 +1280,38 @@ def __init__(self, **kwargs) -> None: self.is_cancellable = None +class DatabaseSchema(ProxyResource): + """A database schema resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + """ + + _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'}, + } + + def __init__(self, **kwargs) -> None: + super(DatabaseSchema, self).__init__(**kwargs) + + class DatabaseSecurityAlertPolicy(ProxyResource): - """Contains information about a database Threat Detection policy. + """A database security alert policy. Variables are only populated by the server, and will be ignored when sending a request. @@ -1081,72 +1324,63 @@ class DatabaseSecurityAlertPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param location: The geo-location where the resource lives - :type location: str - :ivar kind: Resource kind. - :vartype kind: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint and storageAccountAccessKey are required. - Possible values include: 'New', 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState - :param disabled_alerts: Specifies the semicolon-separated list of alerts - that are disabled, or empty string to disable no alerts. Possible values: - Sql_Injection; Sql_Injection_Vulnerability; Access_Anomaly; - Data_Exfiltration; Unsafe_Action. - :type disabled_alerts: str - :param email_addresses: Specifies the semicolon-separated list of e-mail - addresses to which the alert is sent. - :type email_addresses: str + :ivar system_data: SystemData of SecurityAlertPolicyResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData + :param state: Required. Specifies the state of the policy, whether it is + enabled or disabled or a policy has not been applied yet on the specific + database. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState + :param disabled_alerts: Specifies an array of alerts that are disabled. + Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force + :type disabled_alerts: list[str] + :param email_addresses: Specifies an array of e-mail addresses to which + the alert is sent. + :type email_addresses: list[str] :param email_account_admins: Specifies that the alert is sent to the - account administrators. Possible values include: 'Enabled', 'Disabled' - :type email_account_admins: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyEmailAccountAdmins + account administrators. + :type email_account_admins: bool :param storage_endpoint: Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). This blob storage will hold all - Threat Detection audit logs. If state is Enabled, storageEndpoint is - required. + Threat Detection audit logs. :type storage_endpoint: str :param storage_account_access_key: Specifies the identifier key of the - Threat Detection audit storage account. If state is Enabled, - storageAccountAccessKey is required. + Threat Detection audit storage account. :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the Threat Detection audit logs. :type retention_days: int - :param use_server_default: Specifies whether to use the default server - policy. Possible values include: 'Enabled', 'Disabled' - :type use_server_default: str or - ~azure.mgmt.sql.models.SecurityAlertPolicyUseServerDefault + :ivar creation_time: Specifies the UTC creation time of the policy. + :vartype creation_time: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'readonly': True}, + 'system_data': {'readonly': True}, 'state': {'required': True}, + 'creation_time': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'}, - 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': 'str'}, - 'email_addresses': {'key': 'properties.emailAddresses', 'type': 'str'}, - 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'SecurityAlertPolicyEmailAccountAdmins'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'SecurityAlertsPolicyState'}, + 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, + 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, + 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, - 'use_server_default': {'key': 'properties.useServerDefault', 'type': 'SecurityAlertPolicyUseServerDefault'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, } - def __init__(self, *, state, location: str=None, disabled_alerts: str=None, email_addresses: str=None, email_account_admins=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, use_server_default=None, **kwargs) -> None: + def __init__(self, *, state, disabled_alerts=None, email_addresses=None, email_account_admins: bool=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, **kwargs) -> None: super(DatabaseSecurityAlertPolicy, self).__init__(**kwargs) - self.location = location - self.kind = None + self.system_data = None self.state = state self.disabled_alerts = disabled_alerts self.email_addresses = email_addresses @@ -1154,7 +1388,46 @@ def __init__(self, *, state, location: str=None, disabled_alerts: str=None, emai self.storage_endpoint = storage_endpoint self.storage_account_access_key = storage_account_access_key self.retention_days = retention_days - self.use_server_default = use_server_default + self.creation_time = None + + +class DatabaseTable(ProxyResource): + """A database table resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param temporal_type: The table temporal type. Possible values include: + 'NonTemporalTable', 'HistoryTable', 'SystemVersionedTemporalTable' + :type temporal_type: str or ~azure.mgmt.sql.models.TableTemporalType + :param memory_optimized: Whether or not the table is memory optimized. + :type memory_optimized: bool + """ + + _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'}, + 'temporal_type': {'key': 'properties.temporalType', 'type': 'str'}, + 'memory_optimized': {'key': 'properties.memoryOptimized', 'type': 'bool'}, + } + + def __init__(self, *, temporal_type=None, memory_optimized: bool=None, **kwargs) -> None: + super(DatabaseTable, self).__init__(**kwargs) + self.temporal_type = temporal_type + self.memory_optimized = memory_optimized class DatabaseUpdate(Model): @@ -1287,10 +1560,16 @@ class DatabaseUpdate(Model): :param auto_pause_delay: Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled :type auto_pause_delay: int - :param storage_account_type: The storage account type used to store - backups for this database. 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 database. Possible values include: 'Geo', 'Local', + 'Zone' + :vartype current_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.CurrentBackupStorageRedundancy + :param requested_backup_storage_redundancy: The storage account type to be + used to store backups for this database. Possible values include: 'Geo', + 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy :param min_capacity: Minimal capacity that database will always have allocated, if not paused :type min_capacity: float @@ -1304,6 +1583,10 @@ class DatabaseUpdate(Model): to the database. This configuration defines the period when the maintenance updates will occur. :type maintenance_configuration_id: str + :param is_ledger_on: Whether or not this database is a ledger database, + which means all tables in the database are ledger tables. Note: the value + of this property cannot be changed after the database has been created. + :type is_ledger_on: bool :param tags: Resource tags. :type tags: dict[str, str] """ @@ -1319,6 +1602,7 @@ class DatabaseUpdate(Model): 'max_log_size_bytes': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, 'current_sku': {'readonly': True}, + 'current_backup_storage_redundancy': {'readonly': True}, 'paused_date': {'readonly': True}, 'resumed_date': {'readonly': True}, } @@ -1354,15 +1638,17 @@ class DatabaseUpdate(Model): 'secondary_type': {'key': 'properties.secondaryType', 'type': 'str'}, 'current_sku': {'key': 'properties.currentSku', 'type': 'Sku'}, 'auto_pause_delay': {'key': 'properties.autoPauseDelay', 'type': 'int'}, - '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'}, 'min_capacity': {'key': 'properties.minCapacity', 'type': 'float'}, 'paused_date': {'key': 'properties.pausedDate', 'type': 'iso-8601'}, 'resumed_date': {'key': 'properties.resumedDate', 'type': 'iso-8601'}, 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, + 'is_ledger_on': {'key': 'properties.isLedgerOn', 'type': 'bool'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, high_availability_replica_count: int=None, secondary_type=None, auto_pause_delay: int=None, storage_account_type=None, min_capacity: float=None, maintenance_configuration_id: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, create_mode=None, collation: str=None, max_size_bytes: int=None, sample_name=None, elastic_pool_id: str=None, source_database_id: str=None, restore_point_in_time=None, source_database_deletion_date=None, recovery_services_recovery_point_id: str=None, long_term_retention_backup_resource_id: str=None, recoverable_database_id: str=None, restorable_dropped_database_id: str=None, catalog_collation=None, zone_redundant: bool=None, license_type=None, read_scale=None, high_availability_replica_count: int=None, secondary_type=None, auto_pause_delay: int=None, requested_backup_storage_redundancy=None, min_capacity: float=None, maintenance_configuration_id: str=None, is_ledger_on: bool=None, tags=None, **kwargs) -> None: super(DatabaseUpdate, self).__init__(**kwargs) self.sku = sku self.create_mode = create_mode @@ -1394,66 +1680,64 @@ def __init__(self, *, sku=None, create_mode=None, collation: str=None, max_size_ self.secondary_type = secondary_type self.current_sku = None self.auto_pause_delay = auto_pause_delay - self.storage_account_type = storage_account_type + self.current_backup_storage_redundancy = None + self.requested_backup_storage_redundancy = requested_backup_storage_redundancy self.min_capacity = min_capacity self.paused_date = None self.resumed_date = None self.maintenance_configuration_id = maintenance_configuration_id + self.is_ledger_on = is_ledger_on self.tags = tags -class DatabaseUsage(Model): - """The database usages. +class DatabaseUsage(ProxyResource): + """Usage metric of a database. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the usage metric. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar resource_name: The name of the resource. - :vartype resource_name: str - :ivar display_name: The usage metric display name. + :ivar type: Resource type. + :vartype type: str + :ivar display_name: User-readable name of the metric. :vartype display_name: str - :ivar current_value: The current value of the usage metric. + :ivar current_value: Current value of the metric. :vartype current_value: float - :ivar limit: The current limit of the usage metric. + :ivar limit: Boundary value of the metric. :vartype limit: float - :ivar unit: The units of the usage metric. + :ivar unit: Unit of the metric. :vartype unit: str - :ivar next_reset_time: The next reset time for the usage metric (ISO8601 - format). - :vartype next_reset_time: datetime """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, - 'resource_name': {'readonly': True}, + 'type': {'readonly': True}, 'display_name': {'readonly': True}, 'current_value': {'readonly': True}, 'limit': {'readonly': True}, 'unit': {'readonly': True}, - 'next_reset_time': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + 'type': {'key': 'type', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + 'current_value': {'key': 'properties.currentValue', 'type': 'float'}, + 'limit': {'key': 'properties.limit', 'type': 'float'}, + 'unit': {'key': 'properties.unit', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(DatabaseUsage, self).__init__(**kwargs) - self.name = None - self.resource_name = None self.display_name = None self.current_value = None self.limit = None self.unit = None - self.next_reset_time = None class DatabaseVulnerabilityAssessment(ProxyResource): @@ -1473,9 +1757,9 @@ class DatabaseVulnerabilityAssessment(ProxyResource): is required if server level vulnerability assessment policy doesn't set :type storage_container_path: str :param storage_container_sas_key: A shared access signature (SAS Key) that - has read and write access to the blob container specified in - 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't - specified, StorageContainerSasKey is required. + has write access to the blob container specified in 'storageContainerPath' + parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. :type storage_container_sas_key: str :param storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If @@ -1608,189 +1892,90 @@ def __init__(self, **kwargs) -> None: self.exported_report_location = None -class DataMaskingPolicy(ProxyResource): - """Represents a database data masking policy. +class DataWarehouseUserActivities(ProxyResource): + """User activities of a data warehouse. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :param data_masking_state: Required. The state of the data masking policy. - Possible values include: 'Disabled', 'Enabled' - :type data_masking_state: str or ~azure.mgmt.sql.models.DataMaskingState - :param exempt_principals: The list of the exempt principals. Specifies the - semicolon-separated list of database users for which the data masking - policy does not apply. The specified users receive data results without - masking for all of the database queries. - :type exempt_principals: str - :ivar application_principals: The list of the application principals. This - is a legacy parameter and is no longer used. - :vartype application_principals: str - :ivar masking_level: The masking level. This is a legacy parameter and is - no longer used. - :vartype masking_level: str - :ivar location: The location of the data masking policy. - :vartype location: str - :ivar kind: The kind of data masking policy. Metadata, used for Azure - portal. - :vartype kind: str + :ivar active_queries_count: Count of running and suspended queries. + :vartype active_queries_count: int """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'data_masking_state': {'required': True}, - 'application_principals': {'readonly': True}, - 'masking_level': {'readonly': True}, - 'location': {'readonly': True}, - 'kind': {'readonly': True}, + 'active_queries_count': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'data_masking_state': {'key': 'properties.dataMaskingState', 'type': 'DataMaskingState'}, - 'exempt_principals': {'key': 'properties.exemptPrincipals', 'type': 'str'}, - 'application_principals': {'key': 'properties.applicationPrincipals', 'type': 'str'}, - 'masking_level': {'key': 'properties.maskingLevel', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, + 'active_queries_count': {'key': 'properties.activeQueriesCount', 'type': 'int'}, } - def __init__(self, *, data_masking_state, exempt_principals: str=None, **kwargs) -> None: - super(DataMaskingPolicy, self).__init__(**kwargs) - self.data_masking_state = data_masking_state - self.exempt_principals = exempt_principals - self.application_principals = None - self.masking_level = None - self.location = None - self.kind = None + def __init__(self, **kwargs) -> None: + super(DataWarehouseUserActivities, self).__init__(**kwargs) + self.active_queries_count = None -class DataMaskingRule(ProxyResource): - """Represents a database data masking rule. +class DeletedServer(ProxyResource): + """A deleted server. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar data_masking_rule_id: The rule Id. - :vartype data_masking_rule_id: str - :param alias_name: The alias name. This is a legacy parameter and is no - longer used. - :type alias_name: str - :param rule_state: The rule state. Used to delete a rule. To delete an - existing rule, specify the schemaName, tableName, columnName, - maskingFunction, and specify ruleState as disabled. However, if the rule - doesn't already exist, the rule will be created with ruleState set to - enabled, regardless of the provided value of ruleState. Possible values - include: 'Disabled', 'Enabled' - :type rule_state: str or ~azure.mgmt.sql.models.DataMaskingRuleState - :param schema_name: Required. The schema name on which the data masking - rule is applied. - :type schema_name: str - :param table_name: Required. The table name on which the data masking rule - is applied. - :type table_name: str - :param column_name: Required. The column name on which the data masking - rule is applied. - :type column_name: str - :param masking_function: Required. The masking function that is used for - the data masking rule. Possible values include: 'Default', 'CCN', 'Email', - 'Number', 'SSN', 'Text' - :type masking_function: str or ~azure.mgmt.sql.models.DataMaskingFunction - :param number_from: The numberFrom property of the masking rule. Required - if maskingFunction is set to Number, otherwise this parameter will be - ignored. - :type number_from: str - :param number_to: The numberTo property of the data masking rule. Required - if maskingFunction is set to Number, otherwise this parameter will be - ignored. - :type number_to: str - :param prefix_size: If maskingFunction is set to Text, the number of - characters to show unmasked in the beginning of the string. Otherwise, - this parameter will be ignored. - :type prefix_size: str - :param suffix_size: If maskingFunction is set to Text, the number of - characters to show unmasked at the end of the string. Otherwise, this - parameter will be ignored. - :type suffix_size: str - :param replacement_string: If maskingFunction is set to Text, the - character to use for masking the unexposed part of the string. Otherwise, - this parameter will be ignored. - :type replacement_string: str - :ivar location: The location of the data masking rule. - :vartype location: str - :ivar kind: The kind of Data Masking Rule. Metadata, used for Azure - portal. - :vartype kind: str - """ - - _validation = { + :ivar version: The version of the deleted server. + :vartype version: str + :ivar deletion_time: The deletion time of the deleted server. + :vartype deletion_time: datetime + :ivar original_id: The original ID of the server before deletion. + :vartype original_id: str + :ivar fully_qualified_domain_name: The fully qualified domain name of the + server. + :vartype fully_qualified_domain_name: str + """ + + _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'data_masking_rule_id': {'readonly': True}, - 'schema_name': {'required': True}, - 'table_name': {'required': True}, - 'column_name': {'required': True}, - 'masking_function': {'required': True}, - 'location': {'readonly': True}, - 'kind': {'readonly': True}, + 'version': {'readonly': True}, + 'deletion_time': {'readonly': True}, + 'original_id': {'readonly': True}, + 'fully_qualified_domain_name': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'data_masking_rule_id': {'key': 'properties.id', 'type': 'str'}, - 'alias_name': {'key': 'properties.aliasName', 'type': 'str'}, - 'rule_state': {'key': 'properties.ruleState', 'type': 'DataMaskingRuleState'}, - 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, - 'table_name': {'key': 'properties.tableName', 'type': 'str'}, - 'column_name': {'key': 'properties.columnName', 'type': 'str'}, - 'masking_function': {'key': 'properties.maskingFunction', 'type': 'DataMaskingFunction'}, - 'number_from': {'key': 'properties.numberFrom', 'type': 'str'}, - 'number_to': {'key': 'properties.numberTo', 'type': 'str'}, - 'prefix_size': {'key': 'properties.prefixSize', 'type': 'str'}, - 'suffix_size': {'key': 'properties.suffixSize', 'type': 'str'}, - 'replacement_string': {'key': 'properties.replacementString', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, + 'version': {'key': 'properties.version', 'type': 'str'}, + 'deletion_time': {'key': 'properties.deletionTime', 'type': 'iso-8601'}, + 'original_id': {'key': 'properties.originalId', 'type': 'str'}, + 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, } - def __init__(self, *, schema_name: str, table_name: str, column_name: str, masking_function, alias_name: str=None, rule_state=None, number_from: str=None, number_to: str=None, prefix_size: str=None, suffix_size: str=None, replacement_string: str=None, **kwargs) -> None: - super(DataMaskingRule, self).__init__(**kwargs) - self.data_masking_rule_id = None - self.alias_name = alias_name - self.rule_state = rule_state - self.schema_name = schema_name - self.table_name = table_name - self.column_name = column_name - self.masking_function = masking_function - self.number_from = number_from - self.number_to = number_to - self.prefix_size = prefix_size - self.suffix_size = suffix_size - self.replacement_string = replacement_string - self.location = None - self.kind = None + def __init__(self, **kwargs) -> None: + super(DeletedServer, self).__init__(**kwargs) + self.version = None + self.deletion_time = None + self.original_id = None + self.fully_qualified_domain_name = None class EditionCapability(Model): @@ -1947,258 +2132,6 @@ def __init__(self, *, location: str, tags=None, sku=None, max_size_bytes: int=No self.maintenance_configuration_id = maintenance_configuration_id -class ElasticPoolActivity(ProxyResource): - """Represents the activity on an elastic pool. - - 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 location: The geo-location where the resource lives - :type location: str - :ivar end_time: The time the operation finished (ISO8601 format). - :vartype end_time: datetime - :ivar error_code: The error code if available. - :vartype error_code: int - :ivar error_message: The error message if available. - :vartype error_message: str - :ivar error_severity: The error severity if available. - :vartype error_severity: int - :ivar operation: The operation name. - :vartype operation: str - :ivar operation_id: The unique operation ID. - :vartype operation_id: str - :ivar percent_complete: The percentage complete if available. - :vartype percent_complete: int - :ivar requested_database_dtu_max: The requested max DTU per database if - available. - :vartype requested_database_dtu_max: int - :ivar requested_database_dtu_min: The requested min DTU per database if - available. - :vartype requested_database_dtu_min: int - :ivar requested_dtu: The requested DTU for the pool if available. - :vartype requested_dtu: int - :ivar requested_elastic_pool_name: The requested name for the elastic pool - if available. - :vartype requested_elastic_pool_name: str - :ivar requested_storage_limit_in_gb: The requested storage limit for the - pool in GB if available. - :vartype requested_storage_limit_in_gb: long - :ivar elastic_pool_name: The name of the elastic pool. - :vartype elastic_pool_name: str - :ivar server_name: The name of the server the elastic pool is in. - :vartype server_name: str - :ivar start_time: The time the operation started (ISO8601 format). - :vartype start_time: datetime - :ivar state: The current state of the operation. - :vartype state: str - :ivar requested_storage_limit_in_mb: The requested storage limit in MB. - :vartype requested_storage_limit_in_mb: int - :ivar requested_database_dtu_guarantee: The requested per database DTU - guarantee. - :vartype requested_database_dtu_guarantee: int - :ivar requested_database_dtu_cap: The requested per database DTU cap. - :vartype requested_database_dtu_cap: int - :ivar requested_dtu_guarantee: The requested DTU guarantee. - :vartype requested_dtu_guarantee: int - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'end_time': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_message': {'readonly': True}, - 'error_severity': {'readonly': True}, - 'operation': {'readonly': True}, - 'operation_id': {'readonly': True}, - 'percent_complete': {'readonly': True}, - 'requested_database_dtu_max': {'readonly': True}, - 'requested_database_dtu_min': {'readonly': True}, - 'requested_dtu': {'readonly': True}, - 'requested_elastic_pool_name': {'readonly': True}, - 'requested_storage_limit_in_gb': {'readonly': True}, - 'elastic_pool_name': {'readonly': True}, - 'server_name': {'readonly': True}, - 'start_time': {'readonly': True}, - 'state': {'readonly': True}, - 'requested_storage_limit_in_mb': {'readonly': True}, - 'requested_database_dtu_guarantee': {'readonly': True}, - 'requested_database_dtu_cap': {'readonly': True}, - 'requested_dtu_guarantee': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, - 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, - 'error_severity': {'key': 'properties.errorSeverity', 'type': 'int'}, - 'operation': {'key': 'properties.operation', 'type': 'str'}, - 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, - 'requested_database_dtu_max': {'key': 'properties.requestedDatabaseDtuMax', 'type': 'int'}, - 'requested_database_dtu_min': {'key': 'properties.requestedDatabaseDtuMin', 'type': 'int'}, - 'requested_dtu': {'key': 'properties.requestedDtu', 'type': 'int'}, - 'requested_elastic_pool_name': {'key': 'properties.requestedElasticPoolName', 'type': 'str'}, - 'requested_storage_limit_in_gb': {'key': 'properties.requestedStorageLimitInGB', 'type': 'long'}, - 'elastic_pool_name': {'key': 'properties.elasticPoolName', 'type': 'str'}, - 'server_name': {'key': 'properties.serverName', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - 'requested_storage_limit_in_mb': {'key': 'properties.requestedStorageLimitInMB', 'type': 'int'}, - 'requested_database_dtu_guarantee': {'key': 'properties.requestedDatabaseDtuGuarantee', 'type': 'int'}, - 'requested_database_dtu_cap': {'key': 'properties.requestedDatabaseDtuCap', 'type': 'int'}, - 'requested_dtu_guarantee': {'key': 'properties.requestedDtuGuarantee', 'type': 'int'}, - } - - def __init__(self, *, location: str=None, **kwargs) -> None: - super(ElasticPoolActivity, self).__init__(**kwargs) - self.location = location - self.end_time = None - self.error_code = None - self.error_message = None - self.error_severity = None - self.operation = None - self.operation_id = None - self.percent_complete = None - self.requested_database_dtu_max = None - self.requested_database_dtu_min = None - self.requested_dtu = None - self.requested_elastic_pool_name = None - self.requested_storage_limit_in_gb = None - self.elastic_pool_name = None - self.server_name = None - self.start_time = None - self.state = None - self.requested_storage_limit_in_mb = None - self.requested_database_dtu_guarantee = None - self.requested_database_dtu_cap = None - self.requested_dtu_guarantee = None - - -class ElasticPoolDatabaseActivity(ProxyResource): - """Represents the activity on an elastic pool. - - 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 location: The geo-location where the resource lives - :type location: str - :ivar database_name: The database name. - :vartype database_name: str - :ivar end_time: The time the operation finished (ISO8601 format). - :vartype end_time: datetime - :ivar error_code: The error code if available. - :vartype error_code: int - :ivar error_message: The error message if available. - :vartype error_message: str - :ivar error_severity: The error severity if available. - :vartype error_severity: int - :ivar operation: The operation name. - :vartype operation: str - :ivar operation_id: The unique operation ID. - :vartype operation_id: str - :ivar percent_complete: The percentage complete if available. - :vartype percent_complete: int - :ivar requested_elastic_pool_name: The name for the elastic pool the - database is moving into if available. - :vartype requested_elastic_pool_name: str - :ivar current_elastic_pool_name: The name of the current elastic pool the - database is in if available. - :vartype current_elastic_pool_name: str - :ivar current_service_objective: The name of the current service objective - if available. - :vartype current_service_objective: str - :ivar requested_service_objective: The name of the requested service - objective if available. - :vartype requested_service_objective: str - :ivar server_name: The name of the server the elastic pool is in. - :vartype server_name: str - :ivar start_time: The time the operation started (ISO8601 format). - :vartype start_time: datetime - :ivar state: The current state of the operation. - :vartype state: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'database_name': {'readonly': True}, - 'end_time': {'readonly': True}, - 'error_code': {'readonly': True}, - 'error_message': {'readonly': True}, - 'error_severity': {'readonly': True}, - 'operation': {'readonly': True}, - 'operation_id': {'readonly': True}, - 'percent_complete': {'readonly': True}, - 'requested_elastic_pool_name': {'readonly': True}, - 'current_elastic_pool_name': {'readonly': True}, - 'current_service_objective': {'readonly': True}, - 'requested_service_objective': {'readonly': True}, - 'server_name': {'readonly': True}, - 'start_time': {'readonly': True}, - 'state': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, - 'end_time': {'key': 'properties.endTime', 'type': 'iso-8601'}, - 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, - 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, - 'error_severity': {'key': 'properties.errorSeverity', 'type': 'int'}, - 'operation': {'key': 'properties.operation', 'type': 'str'}, - 'operation_id': {'key': 'properties.operationId', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, - 'requested_elastic_pool_name': {'key': 'properties.requestedElasticPoolName', 'type': 'str'}, - 'current_elastic_pool_name': {'key': 'properties.currentElasticPoolName', 'type': 'str'}, - 'current_service_objective': {'key': 'properties.currentServiceObjective', 'type': 'str'}, - 'requested_service_objective': {'key': 'properties.requestedServiceObjective', 'type': 'str'}, - 'server_name': {'key': 'properties.serverName', 'type': 'str'}, - 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, - 'state': {'key': 'properties.state', 'type': 'str'}, - } - - def __init__(self, *, location: str=None, **kwargs) -> None: - super(ElasticPoolDatabaseActivity, self).__init__(**kwargs) - self.location = location - self.database_name = None - self.end_time = None - self.error_code = None - self.error_message = None - self.error_severity = None - self.operation = None - self.operation_id = None - self.percent_complete = None - self.requested_elastic_pool_name = None - self.current_elastic_pool_name = None - self.current_service_objective = None - self.requested_service_objective = None - self.server_name = None - self.start_time = None - self.state = None - - class ElasticPoolEditionCapability(Model): """The elastic pool edition capability. @@ -2620,6 +2553,9 @@ class EncryptionProtector(ProxyResource): :vartype uri: str :ivar thumbprint: Thumbprint of the server key. :vartype thumbprint: str + :param auto_rotation_enabled: Key auto rotation opt-in flag. Either true + or false. + :type auto_rotation_enabled: bool """ _validation = { @@ -2645,9 +2581,10 @@ class EncryptionProtector(ProxyResource): 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, } - def __init__(self, *, server_key_type, server_key_name: str=None, **kwargs) -> None: + def __init__(self, *, server_key_type, server_key_name: str=None, auto_rotation_enabled: bool=None, **kwargs) -> None: super(EncryptionProtector, self).__init__(**kwargs) self.kind = None self.location = None @@ -2656,6 +2593,7 @@ def __init__(self, *, server_key_type, server_key_name: str=None, **kwargs) -> N self.server_key_type = server_key_type self.uri = None self.thumbprint = None + self.auto_rotation_enabled = auto_rotation_enabled class ExportDatabaseDefinition(Model): @@ -2728,27 +2666,6 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): :param predicate_expression: Specifies condition of where clause when creating an audit. :type predicate_expression: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -2785,6 +2702,10 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -2813,16 +2734,13 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -2841,6 +2759,30 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str """ _validation = { @@ -2855,29 +2797,29 @@ class ExtendedDatabaseBlobAuditingPolicy(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'predicate_expression': {'key': 'properties.predicateExpression', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } - def __init__(self, *, state, predicate_expression: str=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, **kwargs) -> None: + def __init__(self, *, state, predicate_expression: str=None, retention_days: int=None, audit_actions_and_groups=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, storage_endpoint: str=None, storage_account_access_key: str=None, storage_account_subscription_id: str=None, **kwargs) -> None: super(ExtendedDatabaseBlobAuditingPolicy, self).__init__(**kwargs) self.predicate_expression = predicate_expression - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key self.retention_days = retention_days self.audit_actions_and_groups = audit_actions_and_groups - self.storage_account_subscription_id = storage_account_subscription_id self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled self.queue_delay_ms = queue_delay_ms + self.state = state + self.storage_endpoint = storage_endpoint + self.storage_account_access_key = storage_account_access_key + self.storage_account_subscription_id = storage_account_subscription_id class ExtendedServerBlobAuditingPolicy(ProxyResource): @@ -2894,30 +2836,25 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :param is_devops_audit_enabled: Specifies the state of devops audit. If + state is Enabled, devops logs will be sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as + 'Enabled', 'IsAzureMonitorTargetEnabled' as true and + 'IsDevopsAuditEnabled' as true + When using REST API to configure auditing, Diagnostic Settings with + 'DevOpsOperationsAudit' diagnostic logs category on the master database + should also be created. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST + API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings + PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + :type is_devops_audit_enabled: bool :param predicate_expression: Specifies condition of where clause when creating an audit. :type predicate_expression: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -2954,6 +2891,10 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -2982,16 +2923,13 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -3010,6 +2948,30 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str """ _validation = { @@ -3023,30 +2985,32 @@ class ExtendedServerBlobAuditingPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'is_devops_audit_enabled': {'key': 'properties.isDevopsAuditEnabled', 'type': 'bool'}, 'predicate_expression': {'key': 'properties.predicateExpression', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } - def __init__(self, *, state, predicate_expression: str=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, **kwargs) -> None: + def __init__(self, *, state, is_devops_audit_enabled: bool=None, predicate_expression: str=None, retention_days: int=None, audit_actions_and_groups=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, storage_endpoint: str=None, storage_account_access_key: str=None, storage_account_subscription_id: str=None, **kwargs) -> None: super(ExtendedServerBlobAuditingPolicy, self).__init__(**kwargs) + self.is_devops_audit_enabled = is_devops_audit_enabled self.predicate_expression = predicate_expression - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key self.retention_days = retention_days self.audit_actions_and_groups = audit_actions_and_groups - self.storage_account_subscription_id = storage_account_subscription_id self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled self.queue_delay_ms = queue_delay_ms + self.state = state + self.storage_endpoint = storage_endpoint + self.storage_account_access_key = storage_account_access_key + self.storage_account_subscription_id = storage_account_subscription_id class FailoverGroup(ProxyResource): @@ -3208,114 +3172,121 @@ def __init__(self, *, read_write_endpoint=None, read_only_endpoint=None, databas self.tags = tags -class FirewallRule(ProxyResource): - """Represents a server firewall rule. +class ResourceWithWritableName(Model): + """ARM resource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - :ivar id: Resource ID. :vartype id: str - :ivar name: Resource name. - :vartype name: str + :param name: Resource name. + :type name: str :ivar type: Resource type. :vartype type: str - :ivar kind: Kind of server that contains this firewall rule. - :vartype kind: str - :ivar location: Location of the server that contains this firewall rule. - :vartype location: str - :param start_ip_address: Required. The start IP address of the firewall - rule. Must be IPv4 format. Use value '0.0.0.0' to represent all - Azure-internal IP addresses. - :type start_ip_address: str - :param end_ip_address: Required. The end IP address of the firewall rule. - Must be IPv4 format. Must be greater than or equal to startIpAddress. Use - value '0.0.0.0' to represent all Azure-internal IP addresses. - :type end_ip_address: str """ _validation = { 'id': {'readonly': True}, - 'name': {'readonly': True}, 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'location': {'readonly': True}, - 'start_ip_address': {'required': True}, - 'end_ip_address': {'required': 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'}, - 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, - 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, } - def __init__(self, *, start_ip_address: str, end_ip_address: str, **kwargs) -> None: - super(FirewallRule, self).__init__(**kwargs) - self.kind = None - self.location = None - self.start_ip_address = start_ip_address - self.end_ip_address = end_ip_address + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ResourceWithWritableName, self).__init__(**kwargs) + self.id = None + self.name = name + self.type = None -class GeoBackupPolicy(ProxyResource): - """A database geo backup policy. +class ProxyResourceWithWritableName(ResourceWithWritableName): + """ARM proxy resource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. + :vartype id: str + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(ProxyResourceWithWritableName, self).__init__(name=name, **kwargs) + + +class FirewallRule(ProxyResourceWithWritableName): + """A server firewall rule. + + 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 + :param name: Resource name. + :type name: str :ivar type: Resource type. :vartype type: str - :param state: Required. The state of the geo backup policy. Possible - values include: 'Disabled', 'Enabled' - :type state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState - :ivar storage_type: The storage type of the geo backup policy. - :vartype storage_type: str - :ivar kind: Kind of geo backup policy. This is metadata used for the - Azure portal experience. - :vartype kind: str - :ivar location: Backup policy location. - :vartype location: str + :param start_ip_address: The start IP address of the firewall rule. Must + be IPv4 format. Use value '0.0.0.0' for all Azure-internal IP addresses. + :type start_ip_address: str + :param end_ip_address: The end IP address of the firewall rule. Must be + IPv4 format. Must be greater than or equal to startIpAddress. Use value + '0.0.0.0' for all Azure-internal IP addresses. + :type end_ip_address: str """ _validation = { 'id': {'readonly': True}, - 'name': {'readonly': True}, 'type': {'readonly': True}, - 'state': {'required': True}, - 'storage_type': {'readonly': True}, - 'kind': {'readonly': True}, - 'location': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'GeoBackupPolicyState'}, - 'storage_type': {'key': 'properties.storageType', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, } - def __init__(self, *, state, **kwargs) -> None: - super(GeoBackupPolicy, self).__init__(**kwargs) - self.state = state - self.storage_type = None - self.kind = None - self.location = None + def __init__(self, *, name: str=None, start_ip_address: str=None, end_ip_address: str=None, **kwargs) -> None: + super(FirewallRule, self).__init__(name=name, **kwargs) + self.start_ip_address = start_ip_address + self.end_ip_address = end_ip_address + + +class FirewallRuleList(Model): + """A list of server firewall rules. + + :param values: + :type values: list[~azure.mgmt.sql.models.FirewallRule] + """ + + _attribute_map = { + 'values': {'key': 'values', 'type': '[FirewallRule]'}, + } + + def __init__(self, *, values=None, **kwargs) -> None: + super(FirewallRuleList, self).__init__(**kwargs) + self.values = values class ImportExistingDatabaseDefinition(Model): @@ -3372,6 +3343,71 @@ def __init__(self, *, storage_key_type, storage_key: str, storage_uri: str, admi self.network_isolation = network_isolation +class ImportExportExtensionsOperationResult(ProxyResource): + """An Extension operation result resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar request_id: Request Id. + :vartype request_id: str + :ivar request_type: Request type. + :vartype request_type: str + :ivar last_modified_time: Last modified time. + :vartype last_modified_time: str + :ivar server_name: Server name. + :vartype server_name: str + :ivar database_name: Database name. + :vartype database_name: str + :ivar status: Operation status. + :vartype status: str + :ivar error_message: Error message. + :vartype error_message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'request_id': {'readonly': True}, + 'request_type': {'readonly': True}, + 'last_modified_time': {'readonly': True}, + 'server_name': {'readonly': True}, + 'database_name': {'readonly': True}, + 'status': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'request_id': {'key': 'properties.requestId', 'type': 'str'}, + 'request_type': {'key': 'properties.requestType', 'type': 'str'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'str'}, + 'server_name': {'key': 'properties.serverName', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'error_message': {'key': 'properties.errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(ImportExportExtensionsOperationResult, self).__init__(**kwargs) + self.request_id = None + self.request_type = None + self.last_modified_time = None + self.server_name = None + self.database_name = None + self.status = None + self.error_message = None + + class ImportExportOperationResult(ProxyResource): """An ImportExport operation result resource. @@ -4148,10 +4184,10 @@ class JobSchedule(Model): """Scheduling properties of a job. :param start_time: Schedule start time. Default value: - "0001-01-01T00:00:00Z" . + "0001-01-01T00:00:00+00:00" . :type start_time: datetime - :param end_time: Schedule end time. Default value: "9999-12-31T11:59:59Z" - . + :param end_time: Schedule end time. Default value: + "9999-12-31T11:59:59+00:00" . :type end_time: datetime :param type: Schedule interval type. Possible values include: 'Once', 'Recurring'. Default value: "Once" . @@ -4159,7 +4195,7 @@ class JobSchedule(Model): :param enabled: Whether or not the schedule is enabled. :type enabled: bool :param interval: Value of the schedule's recurring interval, if the - schedule type is recurring. ISO8601 duration format. + ScheduleType is recurring. ISO8601 duration format. :type interval: str """ @@ -4171,7 +4207,7 @@ class JobSchedule(Model): 'interval': {'key': 'interval', 'type': 'str'}, } - def __init__(self, *, start_time="0001-01-01T00:00:00Z", end_time="9999-12-31T11:59:59Z", type="Once", enabled: bool=None, interval: str=None, **kwargs) -> None: + def __init__(self, *, start_time="0001-01-01T00:00:00+00:00", end_time="9999-12-31T11:59:59+00:00", type="Once", enabled: bool=None, interval: str=None, **kwargs) -> None: super(JobSchedule, self).__init__(**kwargs) self.start_time = start_time self.end_time = end_time @@ -4488,6 +4524,48 @@ def __init__(self, **kwargs) -> None: super(JobVersion, self).__init__(**kwargs) +class LedgerDigestUploads(ProxyResource): + """Azure SQL Database ledger digest upload settings. + + 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 digest_storage_endpoint: The digest storage endpoint, which must be + either an Azure blob storage endpoint or an URI for Azure Confidential + Ledger. + :type digest_storage_endpoint: str + :ivar state: Specifies the state of ledger digest upload. Possible values + include: 'Enabled', 'Disabled' + :vartype state: str or ~azure.mgmt.sql.models.LedgerDigestUploadsState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'digest_storage_endpoint': {'key': 'properties.digestStorageEndpoint', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'LedgerDigestUploadsState'}, + } + + def __init__(self, *, digest_storage_endpoint: str=None, **kwargs) -> None: + super(LedgerDigestUploads, self).__init__(**kwargs) + self.digest_storage_endpoint = digest_storage_endpoint + self.state = None + + class LicenseTypeCapability(Model): """The license type capability. @@ -4567,6 +4645,44 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: 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. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Required. 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}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'TransparentDataEncryptionState'}, + } + + def __init__(self, *, state, **kwargs) -> None: + super(LogicalDatabaseTransparentDataEncryption, self).__init__(**kwargs) + self.state = state + + class LogSizeCapability(Model): """The log size capability. @@ -4621,6 +4737,14 @@ class LongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: datetime + :ivar backup_storage_redundancy: The storage redundancy type of the + backup. Possible values include: 'Geo', 'Local', 'Zone' + :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' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy """ _validation = { @@ -4633,6 +4757,7 @@ class LongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'readonly': True}, 'backup_time': {'readonly': True}, 'backup_expiration_time': {'readonly': True}, + 'backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -4645,9 +4770,11 @@ class LongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'key': 'properties.databaseDeletionTime', 'type': 'iso-8601'}, 'backup_time': {'key': 'properties.backupTime', 'type': 'iso-8601'}, 'backup_expiration_time': {'key': 'properties.backupExpirationTime', 'type': 'iso-8601'}, + 'backup_storage_redundancy': {'key': 'properties.backupStorageRedundancy', 'type': 'str'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, requested_backup_storage_redundancy=None, **kwargs) -> None: super(LongTermRetentionBackup, self).__init__(**kwargs) self.server_name = None self.server_create_time = None @@ -4655,16 +4782,135 @@ def __init__(self, **kwargs) -> None: self.database_deletion_time = None self.backup_time = None self.backup_expiration_time = None + self.backup_storage_redundancy = None + self.requested_backup_storage_redundancy = requested_backup_storage_redundancy -class MaintenanceConfigurationCapability(Model): - """The maintenance configuration capability. +class LongTermRetentionBackupOperationResult(ProxyResource): + """A LongTermRetentionBackup operation result resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: Maintenance configuration name - :vartype name: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar request_id: Request Id. + :vartype request_id: str + :ivar operation_type: Operation type. + :vartype operation_type: str + :ivar from_backup_resource_id: Source backup resource id + :vartype from_backup_resource_id: str + :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' + :vartype target_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy + :ivar status: Operation status + :vartype status: str + :ivar message: Progress message + :vartype message: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'request_id': {'readonly': True}, + 'operation_type': {'readonly': True}, + 'from_backup_resource_id': {'readonly': True}, + 'to_backup_resource_id': {'readonly': True}, + 'target_backup_storage_redundancy': {'readonly': True}, + 'status': {'readonly': True}, + 'message': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'request_id': {'key': 'properties.requestId', 'type': 'str'}, + 'operation_type': {'key': 'properties.operationType', 'type': 'str'}, + 'from_backup_resource_id': {'key': 'properties.fromBackupResourceId', 'type': 'str'}, + 'to_backup_resource_id': {'key': 'properties.toBackupResourceId', 'type': 'str'}, + 'target_backup_storage_redundancy': {'key': 'properties.targetBackupStorageRedundancy', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + 'message': {'key': 'properties.message', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(LongTermRetentionBackupOperationResult, self).__init__(**kwargs) + self.request_id = None + self.operation_type = None + self.from_backup_resource_id = None + self.to_backup_resource_id = None + self.target_backup_storage_redundancy = None + self.status = None + self.message = None + + +class LongTermRetentionPolicy(ProxyResource): + """A long term retention policy. + + 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 weekly_retention: The weekly retention policy for an LTR backup in + an ISO 8601 format. + :type weekly_retention: str + :param monthly_retention: The monthly retention policy for an LTR backup + in an ISO 8601 format. + :type monthly_retention: str + :param yearly_retention: The yearly retention policy for an LTR backup in + an ISO 8601 format. + :type yearly_retention: str + :param week_of_year: The week of year to take the yearly backup in an ISO + 8601 format. + :type week_of_year: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'weekly_retention': {'key': 'properties.weeklyRetention', 'type': 'str'}, + 'monthly_retention': {'key': 'properties.monthlyRetention', 'type': 'str'}, + 'yearly_retention': {'key': 'properties.yearlyRetention', 'type': 'str'}, + 'week_of_year': {'key': 'properties.weekOfYear', 'type': 'int'}, + } + + def __init__(self, *, weekly_retention: str=None, monthly_retention: str=None, yearly_retention: str=None, week_of_year: int=None, **kwargs) -> None: + super(LongTermRetentionPolicy, self).__init__(**kwargs) + self.weekly_retention = weekly_retention + self.monthly_retention = monthly_retention + self.yearly_retention = yearly_retention + self.week_of_year = week_of_year + + +class MaintenanceConfigurationCapability(Model): + """The maintenance configuration capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Maintenance configuration name + :vartype name: str :ivar zone_redundant: Whether or not zone redundancy is supported for the maintenance configuration. :vartype zone_redundant: bool @@ -4696,6 +4942,131 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: self.reason = reason +class MaintenanceWindowOptions(ProxyResource): + """Maintenance window options. + + 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 is_enabled: Whether maintenance windows are enabled for the + database. + :type is_enabled: bool + :param maintenance_window_cycles: Available maintenance cycles e.g. + {Saturday, 0, 48*60}, {Wednesday, 0, 24*60}. + :type maintenance_window_cycles: + list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] + :param min_duration_in_minutes: Minimum duration of maintenance window. + :type min_duration_in_minutes: int + :param default_duration_in_minutes: Default duration for maintenance + window. + :type default_duration_in_minutes: int + :param min_cycles: Minimum number of maintenance windows cycles to be set + on the database. + :type min_cycles: int + :param time_granularity_in_minutes: Time granularity in minutes for + maintenance windows. + :type time_granularity_in_minutes: int + :param allow_multiple_maintenance_windows_per_cycle: Whether we allow + multiple maintenance windows per cycle. + :type allow_multiple_maintenance_windows_per_cycle: bool + """ + + _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'}, + 'is_enabled': {'key': 'properties.isEnabled', 'type': 'bool'}, + 'maintenance_window_cycles': {'key': 'properties.maintenanceWindowCycles', 'type': '[MaintenanceWindowTimeRange]'}, + 'min_duration_in_minutes': {'key': 'properties.minDurationInMinutes', 'type': 'int'}, + 'default_duration_in_minutes': {'key': 'properties.defaultDurationInMinutes', 'type': 'int'}, + 'min_cycles': {'key': 'properties.minCycles', 'type': 'int'}, + 'time_granularity_in_minutes': {'key': 'properties.timeGranularityInMinutes', 'type': 'int'}, + 'allow_multiple_maintenance_windows_per_cycle': {'key': 'properties.allowMultipleMaintenanceWindowsPerCycle', 'type': 'bool'}, + } + + def __init__(self, *, is_enabled: bool=None, maintenance_window_cycles=None, min_duration_in_minutes: int=None, default_duration_in_minutes: int=None, min_cycles: int=None, time_granularity_in_minutes: int=None, allow_multiple_maintenance_windows_per_cycle: bool=None, **kwargs) -> None: + super(MaintenanceWindowOptions, self).__init__(**kwargs) + self.is_enabled = is_enabled + self.maintenance_window_cycles = maintenance_window_cycles + self.min_duration_in_minutes = min_duration_in_minutes + self.default_duration_in_minutes = default_duration_in_minutes + self.min_cycles = min_cycles + self.time_granularity_in_minutes = time_granularity_in_minutes + self.allow_multiple_maintenance_windows_per_cycle = allow_multiple_maintenance_windows_per_cycle + + +class MaintenanceWindows(ProxyResource): + """Maintenance windows. + + 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 time_ranges: + :type time_ranges: list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] + """ + + _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'}, + 'time_ranges': {'key': 'properties.timeRanges', 'type': '[MaintenanceWindowTimeRange]'}, + } + + def __init__(self, *, time_ranges=None, **kwargs) -> None: + super(MaintenanceWindows, self).__init__(**kwargs) + self.time_ranges = time_ranges + + +class MaintenanceWindowTimeRange(Model): + """Maintenance window time range. + + :param day_of_week: Day of maintenance window. Possible values include: + 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', + 'Saturday' + :type day_of_week: str or ~azure.mgmt.sql.models.DayOfWeek + :param start_time: Start time minutes offset from 12am. + :type start_time: str + :param duration: Duration of maintenance window in minutes. + :type duration: str + """ + + _attribute_map = { + 'day_of_week': {'key': 'dayOfWeek', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'duration': {'key': 'duration', 'type': 'str'}, + } + + def __init__(self, *, day_of_week=None, start_time: str=None, duration: str=None, **kwargs) -> None: + super(MaintenanceWindowTimeRange, self).__init__(**kwargs) + self.day_of_week = day_of_week + self.start_time = start_time + self.duration = duration + + class ManagedBackupShortTermRetentionPolicy(ProxyResource): """A short term retention policy. @@ -4972,7 +5343,7 @@ class ManagedDatabaseSecurityAlertPolicy(ProxyResource): :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState :param disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, - Access_Anomaly, Data_Exfiltration, Unsafe_Action + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force :type disabled_alerts: list[str] :param email_addresses: Specifies an array of e-mail addresses to which the alert is sent. @@ -5172,12 +5543,15 @@ class ManagedInstance(TrackedResource): :type tags: dict[str, str] :param identity: The Azure Active Directory identity of the managed instance. - :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :param sku: Managed instance SKU. Allowed values for sku.name: GP_Gen4, GP_Gen5, BC_Gen4, BC_Gen5 :type sku: ~azure.mgmt.sql.models.Sku :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', - 'Updating', 'Unknown', 'Succeeded', 'Failed' + 'Updating', 'Unknown', 'Succeeded', 'Failed', 'Accepted', 'Created', + 'Deleted', 'Unrecognized', 'Running', 'Canceled', 'NotSpecified', + 'Registering', 'TimedOut' :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. @@ -5267,6 +5641,15 @@ class ManagedInstance(TrackedResource): ~azure.mgmt.sql.models.StorageAccountType :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 used by default. + :type primary_user_assigned_identity_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory administrator of the + server. + :type administrators: + ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator """ _validation = { @@ -5287,7 +5670,7 @@ class ManagedInstance(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'sku': {'key': 'sku', 'type': 'Sku'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, @@ -5313,9 +5696,12 @@ class ManagedInstance(TrackedResource): 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'storage_account_type': {'key': 'properties.storageAccountType', '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'}, } - def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, storage_account_type=None, zone_redundant: bool=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, storage_account_type=None, zone_redundant: bool=None, primary_user_assigned_identity_id: str=None, key_id: str=None, administrators=None, **kwargs) -> None: super(ManagedInstance, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.sku = sku @@ -5343,6 +5729,9 @@ def __init__(self, *, location: str, tags=None, identity=None, sku=None, managed self.minimal_tls_version = minimal_tls_version self.storage_account_type = storage_account_type self.zone_redundant = zone_redundant + self.primary_user_assigned_identity_id = primary_user_assigned_identity_id + self.key_id = key_id + self.administrators = administrators class ManagedInstanceAdministrator(ProxyResource): @@ -5516,6 +5905,9 @@ class ManagedInstanceEncryptionProtector(ProxyResource): :vartype uri: str :ivar thumbprint: Thumbprint of the server key. :vartype thumbprint: str + :param auto_rotation_enabled: Key auto rotation opt-in flag. Either true + or false. + :type auto_rotation_enabled: bool """ _validation = { @@ -5537,15 +5929,56 @@ class ManagedInstanceEncryptionProtector(ProxyResource): 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, } - def __init__(self, *, server_key_type, server_key_name: str=None, **kwargs) -> None: + def __init__(self, *, server_key_type, server_key_name: str=None, auto_rotation_enabled: bool=None, **kwargs) -> None: super(ManagedInstanceEncryptionProtector, self).__init__(**kwargs) self.kind = None self.server_key_name = server_key_name self.server_key_type = server_key_type self.uri = None self.thumbprint = None + self.auto_rotation_enabled = auto_rotation_enabled + + +class ManagedInstanceExternalAdministrator(Model): + """Properties of a active directory administrator. + + :param administrator_type: Type of the sever administrator. Possible + values include: 'ActiveDirectory' + :type administrator_type: str or ~azure.mgmt.sql.models.AdministratorType + :param principal_type: Principal Type of the sever administrator. Possible + values include: 'User', 'Group', 'Application' + :type principal_type: str or ~azure.mgmt.sql.models.PrincipalType + :param login: Login name of the server administrator. + :type login: str + :param sid: SID (object ID) of the server administrator. + :type sid: str + :param tenant_id: Tenant ID of the administrator. + :type tenant_id: str + :param azure_ad_only_authentication: Azure Active Directory only + Authentication enabled. + :type azure_ad_only_authentication: bool + """ + + _attribute_map = { + 'administrator_type': {'key': 'administratorType', 'type': 'str'}, + 'principal_type': {'key': 'principalType', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'azure_ad_only_authentication': {'key': 'azureADOnlyAuthentication', 'type': 'bool'}, + } + + def __init__(self, *, administrator_type=None, principal_type=None, login: str=None, sid: str=None, tenant_id: str=None, azure_ad_only_authentication: bool=None, **kwargs) -> None: + super(ManagedInstanceExternalAdministrator, self).__init__(**kwargs) + self.administrator_type = administrator_type + self.principal_type = principal_type + self.login = login + self.sid = sid + self.tenant_id = tenant_id + self.azure_ad_only_authentication = azure_ad_only_authentication class ManagedInstanceFamilyCapability(Model): @@ -5626,6 +6059,9 @@ class ManagedInstanceKey(ProxyResource): :vartype thumbprint: str :ivar creation_date: The key creation date. :vartype creation_date: datetime + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or + false. + :vartype auto_rotation_enabled: bool """ _validation = { @@ -5636,6 +6072,7 @@ class ManagedInstanceKey(ProxyResource): 'server_key_type': {'required': True}, 'thumbprint': {'readonly': True}, 'creation_date': {'readonly': True}, + 'auto_rotation_enabled': {'readonly': True}, } _attribute_map = { @@ -5647,6 +6084,7 @@ class ManagedInstanceKey(ProxyResource): 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, } def __init__(self, *, server_key_type, uri: str=None, **kwargs) -> None: @@ -5656,6 +6094,7 @@ def __init__(self, *, server_key_type, uri: str=None, **kwargs) -> None: self.uri = uri self.thumbprint = None self.creation_date = None + self.auto_rotation_enabled = None class ManagedInstanceLongTermRetentionBackup(ProxyResource): @@ -5684,6 +6123,10 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): :ivar backup_expiration_time: The time the long term retention backup will expire. :vartype backup_expiration_time: datetime + :ivar backup_storage_redundancy: The storage redundancy type of the + backup. Possible values include: 'Geo', 'Local', 'Zone' + :vartype backup_storage_redundancy: str or + ~azure.mgmt.sql.models.BackupStorageRedundancy """ _validation = { @@ -5696,6 +6139,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'readonly': True}, 'backup_time': {'readonly': True}, 'backup_expiration_time': {'readonly': True}, + 'backup_storage_redundancy': {'readonly': True}, } _attribute_map = { @@ -5708,6 +6152,7 @@ class ManagedInstanceLongTermRetentionBackup(ProxyResource): 'database_deletion_time': {'key': 'properties.databaseDeletionTime', 'type': 'iso-8601'}, 'backup_time': {'key': 'properties.backupTime', 'type': 'iso-8601'}, 'backup_expiration_time': {'key': 'properties.backupExpirationTime', 'type': 'iso-8601'}, + 'backup_storage_redundancy': {'key': 'properties.backupStorageRedundancy', 'type': 'str'}, } def __init__(self, **kwargs) -> None: @@ -5718,6 +6163,7 @@ def __init__(self, **kwargs) -> None: self.database_deletion_time = None self.backup_time = None self.backup_expiration_time = None + self.backup_storage_redundancy = None class ManagedInstanceLongTermRetentionPolicy(ProxyResource): @@ -6028,6 +6474,52 @@ def __init__(self, **kwargs) -> None: self.properties = None +class ManagedInstancePrivateEndpointConnection(ProxyResource): + """A private endpoint connection. + + 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 private_endpoint: Private endpoint which the connection belongs to. + :type private_endpoint: + ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty + :param private_link_service_connection_state: Connection State of the + Private Endpoint Connection. + :type private_link_service_connection_state: + ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty + :ivar provisioning_state: State of the Private Endpoint Connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'ManagedInstancePrivateEndpointProperty'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'ManagedInstancePrivateLinkServiceConnectionStateProperty'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(ManagedInstancePrivateEndpointConnection, self).__init__(**kwargs) + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + class ManagedInstancePrivateEndpointConnectionProperties(Model): """Properties of a private endpoint connection. @@ -6078,42 +6570,140 @@ def __init__(self, *, id: str=None, **kwargs) -> None: self.id = id -class ManagedInstancePrivateLinkServiceConnectionStateProperty(Model): - """ManagedInstancePrivateLinkServiceConnectionStateProperty. +class ManagedInstancePrivateLink(ProxyResource): + """A private link resource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to Azure. - - :param status: Required. The private link service connection status. - :type status: str - :param description: Required. The private link service connection - description. - :type description: str - :ivar actions_required: The private link service connection description. - :vartype actions_required: str + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :ivar properties: The private link resource group id. + :vartype properties: + ~azure.mgmt.sql.models.ManagedInstancePrivateLinkProperties """ _validation = { - 'status': {'required': True}, - 'description': {'required': True}, - 'actions_required': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'properties': {'readonly': True}, } _attribute_map = { - 'status': {'key': 'status', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ManagedInstancePrivateLinkProperties'}, } - def __init__(self, *, status: str, description: str, **kwargs) -> None: - super(ManagedInstancePrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) - self.status = status - self.description = description + def __init__(self, **kwargs) -> None: + super(ManagedInstancePrivateLink, self).__init__(**kwargs) + self.properties = None + + +class ManagedInstancePrivateLinkProperties(Model): + """Properties of a private link resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar group_id: The private link resource group id. + :vartype group_id: str + :ivar required_members: The private link resource required member names. + :vartype required_members: list[str] + """ + + _validation = { + 'group_id': {'readonly': True}, + 'required_members': {'readonly': True}, + } + + _attribute_map = { + 'group_id': {'key': 'groupId', 'type': 'str'}, + 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(ManagedInstancePrivateLinkProperties, self).__init__(**kwargs) + self.group_id = None + self.required_members = None + + +class ManagedInstancePrivateLinkServiceConnectionStateProperty(Model): + """ManagedInstancePrivateLinkServiceConnectionStateProperty. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The private link service connection status. + :type status: str + :param description: Required. The private link service connection + description. + :type description: str + :ivar actions_required: The private link service connection description. + :vartype actions_required: str + """ + + _validation = { + 'status': {'required': True}, + 'description': {'required': True}, + 'actions_required': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, + } + + def __init__(self, *, status: str, description: str, **kwargs) -> None: + super(ManagedInstancePrivateLinkServiceConnectionStateProperty, self).__init__(**kwargs) + self.status = status + self.description = description self.actions_required = None +class ManagedInstanceQuery(ProxyResource): + """Database query. + + 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 query_text: Query text. + :type query_text: str + """ + + _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'}, + 'query_text': {'key': 'properties.queryText', 'type': 'str'}, + } + + def __init__(self, *, query_text: str=None, **kwargs) -> None: + super(ManagedInstanceQuery, self).__init__(**kwargs) + self.query_text = query_text + + class ManagedInstanceUpdate(Model): """An update request for an Azure SQL Database managed instance. @@ -6123,9 +6713,12 @@ class ManagedInstanceUpdate(Model): :param sku: Managed instance sku :type sku: ~azure.mgmt.sql.models.Sku :param identity: Managed instance identity - :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', - 'Updating', 'Unknown', 'Succeeded', 'Failed' + 'Updating', 'Unknown', 'Succeeded', 'Failed', 'Accepted', 'Created', + 'Deleted', 'Unrecognized', 'Running', 'Canceled', 'NotSpecified', + 'Registering', 'TimedOut' :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum :param managed_instance_create_mode: Specifies the mode of database creation. @@ -6215,6 +6808,15 @@ class ManagedInstanceUpdate(Model): ~azure.mgmt.sql.models.StorageAccountType :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 used by default. + :type primary_user_assigned_identity_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory administrator of the + server. + :type administrators: + ~azure.mgmt.sql.models.ManagedInstanceExternalAdministrator :param tags: Resource tags. :type tags: dict[str, str] """ @@ -6229,7 +6831,7 @@ class ManagedInstanceUpdate(Model): _attribute_map = { 'sku': {'key': 'sku', 'type': 'Sku'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'managed_instance_create_mode': {'key': 'properties.managedInstanceCreateMode', 'type': 'str'}, 'fully_qualified_domain_name': {'key': 'properties.fullyQualifiedDomainName', 'type': 'str'}, @@ -6254,10 +6856,13 @@ class ManagedInstanceUpdate(Model): 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'storage_account_type': {'key': 'properties.storageAccountType', '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'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, sku=None, identity=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, storage_account_type=None, zone_redundant: bool=None, tags=None, **kwargs) -> None: + def __init__(self, *, sku=None, identity=None, managed_instance_create_mode=None, administrator_login: str=None, administrator_login_password: str=None, subnet_id: str=None, license_type=None, v_cores: int=None, storage_size_in_gb: int=None, collation: str=None, dns_zone_partner: str=None, public_data_endpoint_enabled: bool=None, source_managed_instance_id: str=None, restore_point_in_time=None, proxy_override=None, timezone_id: str=None, instance_pool_id: str=None, maintenance_configuration_id: str=None, minimal_tls_version: str=None, storage_account_type=None, zone_redundant: bool=None, primary_user_assigned_identity_id: str=None, key_id: str=None, administrators=None, tags=None, **kwargs) -> None: super(ManagedInstanceUpdate, self).__init__(**kwargs) self.sku = sku self.identity = identity @@ -6285,6 +6890,9 @@ def __init__(self, *, sku=None, identity=None, managed_instance_create_mode=None self.minimal_tls_version = minimal_tls_version self.storage_account_type = storage_account_type 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.tags = tags @@ -6421,9 +7029,9 @@ class ManagedInstanceVulnerabilityAssessment(ProxyResource): https://myStorage.blob.core.windows.net/VaScans/). :type storage_container_path: str :param storage_container_sas_key: A shared access signature (SAS Key) that - has read and write access to the blob container specified in - 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't - specified, StorageContainerSasKey is required. + has write access to the blob container specified in 'storageContainerPath' + parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. :type storage_container_sas_key: str :param storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If @@ -6474,13 +7082,15 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar system_data: SystemData of SecurityAlertPolicyResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData :param state: Required. Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific - database. Possible values include: 'New', 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState + database. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState :param disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, - Access_Anomaly, Data_Exfiltration, Unsafe_Action + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force :type disabled_alerts: list[str] :param email_addresses: Specifies an array of e-mail addresses to which the alert is sent. @@ -6506,6 +7116,7 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'state': {'required': True}, 'creation_time': {'readonly': True}, } @@ -6514,7 +7125,8 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'SecurityAlertsPolicyState'}, 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, @@ -6526,6 +7138,7 @@ class ManagedServerSecurityAlertPolicy(ProxyResource): def __init__(self, *, state, disabled_alerts=None, email_addresses=None, email_account_admins: bool=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, **kwargs) -> None: super(ManagedServerSecurityAlertPolicy, self).__init__(**kwargs) + self.system_data = None self.state = state self.disabled_alerts = disabled_alerts self.email_addresses = email_addresses @@ -6536,6 +7149,44 @@ def __init__(self, *, state, disabled_alerts=None, email_addresses=None, email_a self.creation_time = None +class ManagedTransparentDataEncryption(ProxyResource): + """A managed database transparent data encryption state. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Required. 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}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'TransparentDataEncryptionState'}, + } + + def __init__(self, *, state, **kwargs) -> None: + super(ManagedTransparentDataEncryption, self).__init__(**kwargs) + self.state = state + + class MaxSizeCapability(Model): """The maximum size capability. @@ -6614,209 +7265,6 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: self.reason = reason -class Metric(Model): - """Database metrics. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar start_time: The start time for the metric (ISO-8601 format). - :vartype start_time: datetime - :ivar end_time: The end time for the metric (ISO-8601 format). - :vartype end_time: datetime - :ivar time_grain: The time step to be used to summarize the metric values. - :vartype time_grain: str - :ivar unit: The unit of the metric. Possible values include: 'count', - 'bytes', 'seconds', 'percent', 'countPerSecond', 'bytesPerSecond' - :vartype unit: str or ~azure.mgmt.sql.models.UnitType - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.sql.models.MetricName - :ivar metric_values: The metric values for the specified time window and - timestep. - :vartype metric_values: list[~azure.mgmt.sql.models.MetricValue] - """ - - _validation = { - 'start_time': {'readonly': True}, - 'end_time': {'readonly': True}, - 'time_grain': {'readonly': True}, - 'unit': {'readonly': True}, - 'name': {'readonly': True}, - 'metric_values': {'readonly': True}, - } - - _attribute_map = { - 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, - 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, - 'time_grain': {'key': 'timeGrain', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'MetricName'}, - 'metric_values': {'key': 'metricValues', 'type': '[MetricValue]'}, - } - - def __init__(self, **kwargs) -> None: - super(Metric, self).__init__(**kwargs) - self.start_time = None - self.end_time = None - self.time_grain = None - self.unit = None - self.name = None - self.metric_values = None - - -class MetricAvailability(Model): - """A metric availability value. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar retention: The length of retention for the database metric. - :vartype retention: str - :ivar time_grain: The granularity of the database metric. - :vartype time_grain: str - """ - - _validation = { - 'retention': {'readonly': True}, - 'time_grain': {'readonly': True}, - } - - _attribute_map = { - 'retention': {'key': 'retention', 'type': 'str'}, - 'time_grain': {'key': 'timeGrain', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MetricAvailability, self).__init__(**kwargs) - self.retention = None - self.time_grain = None - - -class MetricDefinition(Model): - """A database metric definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: The name information for the metric. - :vartype name: ~azure.mgmt.sql.models.MetricName - :ivar primary_aggregation_type: The primary aggregation type defining how - metric values are displayed. Possible values include: 'None', 'Average', - 'Count', 'Minimum', 'Maximum', 'Total' - :vartype primary_aggregation_type: str or - ~azure.mgmt.sql.models.PrimaryAggregationType - :ivar resource_uri: The resource uri of the database. - :vartype resource_uri: str - :ivar unit: The unit of the metric. Possible values include: 'Count', - 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' - :vartype unit: str or ~azure.mgmt.sql.models.UnitDefinitionType - :ivar metric_availabilities: The list of database metric availabilities - for the metric. - :vartype metric_availabilities: - list[~azure.mgmt.sql.models.MetricAvailability] - """ - - _validation = { - 'name': {'readonly': True}, - 'primary_aggregation_type': {'readonly': True}, - 'resource_uri': {'readonly': True}, - 'unit': {'readonly': True}, - 'metric_availabilities': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'MetricName'}, - 'primary_aggregation_type': {'key': 'primaryAggregationType', 'type': 'str'}, - 'resource_uri': {'key': 'resourceUri', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'metric_availabilities': {'key': 'metricAvailabilities', 'type': '[MetricAvailability]'}, - } - - def __init__(self, **kwargs) -> None: - super(MetricDefinition, self).__init__(**kwargs) - self.name = None - self.primary_aggregation_type = None - self.resource_uri = None - self.unit = None - self.metric_availabilities = None - - -class MetricName(Model): - """A database metric name. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar value: The name of the database metric. - :vartype value: str - :ivar localized_value: The friendly name of the database metric. - :vartype localized_value: str - """ - - _validation = { - 'value': {'readonly': True}, - 'localized_value': {'readonly': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': 'str'}, - 'localized_value': {'key': 'localizedValue', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(MetricName, self).__init__(**kwargs) - self.value = None - self.localized_value = None - - -class MetricValue(Model): - """Represents database metrics. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar count: The number of values for the metric. - :vartype count: float - :ivar average: The average value of the metric. - :vartype average: float - :ivar maximum: The max value of the metric. - :vartype maximum: float - :ivar minimum: The min value of the metric. - :vartype minimum: float - :ivar timestamp: The metric timestamp (ISO-8601 format). - :vartype timestamp: datetime - :ivar total: The total value of the metric. - :vartype total: float - """ - - _validation = { - 'count': {'readonly': True}, - 'average': {'readonly': True}, - 'maximum': {'readonly': True}, - 'minimum': {'readonly': True}, - 'timestamp': {'readonly': True}, - 'total': {'readonly': True}, - } - - _attribute_map = { - 'count': {'key': 'count', 'type': 'float'}, - 'average': {'key': 'average', 'type': 'float'}, - 'maximum': {'key': 'maximum', 'type': 'float'}, - 'minimum': {'key': 'minimum', 'type': 'float'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'total': {'key': 'total', 'type': 'float'}, - } - - def __init__(self, **kwargs) -> None: - super(MetricValue, self).__init__(**kwargs) - self.count = None - self.average = None - self.maximum = None - self.minimum = None - self.timestamp = None - self.total = None - - class MinCapacityCapability(Model): """The min capacity capability. @@ -6976,43 +7424,84 @@ def __init__(self, **kwargs) -> None: self.description = None -class OperationImpact(Model): - """The impact of an operation, both in absolute and relative terms. +class OperationsHealth(ProxyResource): + """Operations health status in a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The name of the impact dimension. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar unit: The unit in which estimated impact to dimension is measured. - :vartype unit: str - :ivar change_value_absolute: The absolute impact to dimension. - :vartype change_value_absolute: float - :ivar change_value_relative: The relative impact to dimension (null if not - applicable) - :vartype change_value_relative: float + :ivar type: Resource type. + :vartype type: str + :ivar operations_health_name: Operation name for the service + :vartype operations_health_name: str + :ivar health: Operation health status of the service. + :vartype health: str + :ivar description: Health status description. + :vartype description: str """ _validation = { + 'id': {'readonly': True}, 'name': {'readonly': True}, - 'unit': {'readonly': True}, - 'change_value_absolute': {'readonly': True}, - 'change_value_relative': {'readonly': True}, + 'type': {'readonly': True}, + 'operations_health_name': {'readonly': True}, + 'health': {'readonly': True}, + 'description': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'change_value_absolute': {'key': 'changeValueAbsolute', 'type': 'float'}, - 'change_value_relative': {'key': 'changeValueRelative', 'type': 'float'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operations_health_name': {'key': 'properties.name', 'type': 'str'}, + 'health': {'key': 'properties.health', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, } def __init__(self, **kwargs) -> None: - super(OperationImpact, self).__init__(**kwargs) - self.name = None - self.unit = None - self.change_value_absolute = None - self.change_value_relative = None + super(OperationsHealth, self).__init__(**kwargs) + self.operations_health_name = None + self.health = None + self.description = None + + +class OutboundFirewallRule(ProxyResource): + """An Azure SQL DB Server Outbound Firewall Rule. + + 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 provisioning_state: The state of the outbound rule. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(OutboundFirewallRule, self).__init__(**kwargs) + self.provisioning_state = None class PartnerInfo(Model): @@ -7290,22 +7779,27 @@ class PrivateLinkResourceProperties(Model): :vartype group_id: str :ivar required_members: The private link resource required member names. :vartype required_members: list[str] + :ivar required_zone_names: The private link resource required zone names. + :vartype required_zone_names: list[str] """ _validation = { 'group_id': {'readonly': True}, 'required_members': {'readonly': True}, + 'required_zone_names': {'readonly': True}, } _attribute_map = { 'group_id': {'key': 'groupId', 'type': 'str'}, 'required_members': {'key': 'requiredMembers', 'type': '[str]'}, + 'required_zone_names': {'key': 'requiredZoneNames', 'type': '[str]'}, } def __init__(self, **kwargs) -> None: super(PrivateLinkResourceProperties, self).__init__(**kwargs) self.group_id = None self.required_members = None + self.required_zone_names = None class PrivateLinkServiceConnectionStateProperty(Model): @@ -7456,6 +7950,61 @@ def __init__(self, **kwargs) -> None: self.stdev = None +class QueryStatistics(ProxyResource): + """QueryStatistics. + + 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 database_name: Database name of the database in which this query was + executed. + :vartype database_name: str + :ivar query_id: Unique query id (unique within one database). + :vartype query_id: str + :ivar start_time: The start time for the metric (ISO-8601 format). + :vartype start_time: str + :ivar end_time: The end time for the metric (ISO-8601 format). + :vartype end_time: str + :param intervals: List of intervals with appropriate metric data + :type intervals: list[~azure.mgmt.sql.models.QueryMetricInterval] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'database_name': {'readonly': True}, + 'query_id': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + 'query_id': {'key': 'properties.queryId', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'str'}, + 'end_time': {'key': 'properties.endTime', 'type': 'str'}, + 'intervals': {'key': 'properties.intervals', 'type': '[QueryMetricInterval]'}, + } + + def __init__(self, *, intervals=None, **kwargs) -> None: + super(QueryStatistics, self).__init__(**kwargs) + self.database_name = None + self.query_id = None + self.start_time = None + self.end_time = None + self.intervals = intervals + + class QueryStatisticsProperties(Model): """Properties of a query execution statistics. @@ -7532,270 +8081,484 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: self.reason = reason -class RecommendedElasticPool(ProxyResource): - """Represents a recommended elastic pool. +class RecommendedAction(ProxyResource): + """Database, Server or Elastic Pool Recommended Action. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar database_edition: The edition of the recommended elastic pool. The - ElasticPoolEdition enumeration contains all the valid editions. Possible - values include: 'Basic', 'Standard', 'Premium', 'GeneralPurpose', - 'BusinessCritical' - :vartype database_edition: str or - ~azure.mgmt.sql.models.ElasticPoolEdition - :param dtu: The DTU for the recommended elastic pool. - :type dtu: float - :param database_dtu_min: The minimum DTU for the database. - :type database_dtu_min: float - :param database_dtu_max: The maximum DTU for the database. - :type database_dtu_max: float - :param storage_mb: Gets storage size in megabytes. - :type storage_mb: float - :ivar observation_period_start: The observation period start (ISO8601 - format). - :vartype observation_period_start: datetime - :ivar observation_period_end: The observation period start (ISO8601 - format). - :vartype observation_period_end: datetime - :ivar max_observed_dtu: Gets maximum observed DTU. - :vartype max_observed_dtu: float - :ivar max_observed_storage_mb: Gets maximum observed storage in megabytes. - :vartype max_observed_storage_mb: float - :ivar databases: The list of databases in this pool. Expanded property - :vartype databases: list[~azure.mgmt.sql.models.TrackedResource] - :ivar metrics: The list of databases housed in the server. Expanded - property - :vartype metrics: - list[~azure.mgmt.sql.models.RecommendedElasticPoolMetric] + :ivar kind: Resource kind. + :vartype kind: str + :ivar location: Resource location. + :vartype location: str + :ivar recommendation_reason: Gets the reason for recommending this action. + e.g., DuplicateIndex + :vartype recommendation_reason: str + :ivar valid_since: Gets the time since when this recommended action is + valid. + :vartype valid_since: datetime + :ivar last_refresh: Gets time when this recommended action was last + refreshed. + :vartype last_refresh: datetime + :param state: Required. Gets the info of the current state the recommended + action is in. + :type state: ~azure.mgmt.sql.models.RecommendedActionStateInfo + :ivar is_executable_action: Gets if this recommended action is actionable + by user + :vartype is_executable_action: bool + :ivar is_revertable_action: Gets if changes applied by this recommended + action can be reverted by user + :vartype is_revertable_action: bool + :ivar is_archived_action: Gets if this recommended action was suggested + some time ago but user chose to ignore this and system added a new + recommended action again. + :vartype is_archived_action: bool + :ivar execute_action_start_time: Gets the time when system started + applying this recommended action on the user resource. e.g., index + creation start time + :vartype execute_action_start_time: datetime + :ivar execute_action_duration: Gets the time taken for applying this + recommended action on user resource. e.g., time taken for index creation + :vartype execute_action_duration: str + :ivar revert_action_start_time: Gets the time when system started + reverting changes of this recommended action on user resource. e.g., time + when index drop is executed. + :vartype revert_action_start_time: datetime + :ivar revert_action_duration: Gets the time taken for reverting changes of + this recommended action on user resource. e.g., time taken for dropping + the created index. + :vartype revert_action_duration: str + :ivar execute_action_initiated_by: Gets if approval for applying this + recommended action was given by user/system. Possible values include: + 'User', 'System' + :vartype execute_action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar execute_action_initiated_time: Gets the time when this recommended + action was approved for execution. + :vartype execute_action_initiated_time: datetime + :ivar revert_action_initiated_by: Gets if approval for reverting this + recommended action was given by user/system. Possible values include: + 'User', 'System' + :vartype revert_action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar revert_action_initiated_time: Gets the time when this recommended + action was approved for revert. + :vartype revert_action_initiated_time: datetime + :ivar score: Gets the impact of this recommended action. Possible values + are 1 - Low impact, 2 - Medium Impact and 3 - High Impact + :vartype score: int + :ivar implementation_details: Gets the implementation details of this + recommended action for user to apply it manually. + :vartype implementation_details: + ~azure.mgmt.sql.models.RecommendedActionImplementationInfo + :ivar error_details: Gets the error details if and why this recommended + action is put to error state. + :vartype error_details: ~azure.mgmt.sql.models.RecommendedActionErrorInfo + :ivar estimated_impact: Gets the estimated impact info for this + recommended action e.g., Estimated CPU gain, Estimated Disk Space change + :vartype estimated_impact: + list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar observed_impact: Gets the observed/actual impact info for this + recommended action e.g., Actual CPU gain, Actual Disk Space change + :vartype observed_impact: + list[~azure.mgmt.sql.models.RecommendedActionImpactRecord] + :ivar time_series: Gets the time series info of metrics for this + recommended action e.g., CPU consumption time series + :vartype time_series: + list[~azure.mgmt.sql.models.RecommendedActionMetricInfo] + :ivar linked_objects: Gets the linked objects, if any. + :vartype linked_objects: list[str] + :ivar details: Gets additional details specific to this recommended + action. + :vartype details: dict[str, object] """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'database_edition': {'readonly': True}, - 'observation_period_start': {'readonly': True}, - 'observation_period_end': {'readonly': True}, - 'max_observed_dtu': {'readonly': True}, - 'max_observed_storage_mb': {'readonly': True}, - 'databases': {'readonly': True}, - 'metrics': {'readonly': True}, + 'kind': {'readonly': True}, + 'location': {'readonly': True}, + 'recommendation_reason': {'readonly': True}, + 'valid_since': {'readonly': True}, + 'last_refresh': {'readonly': True}, + 'state': {'required': True}, + 'is_executable_action': {'readonly': True}, + 'is_revertable_action': {'readonly': True}, + 'is_archived_action': {'readonly': True}, + 'execute_action_start_time': {'readonly': True}, + 'execute_action_duration': {'readonly': True}, + 'revert_action_start_time': {'readonly': True}, + 'revert_action_duration': {'readonly': True}, + 'execute_action_initiated_by': {'readonly': True}, + 'execute_action_initiated_time': {'readonly': True}, + 'revert_action_initiated_by': {'readonly': True}, + 'revert_action_initiated_time': {'readonly': True}, + 'score': {'readonly': True}, + 'implementation_details': {'readonly': True}, + 'error_details': {'readonly': True}, + 'estimated_impact': {'readonly': True}, + 'observed_impact': {'readonly': True}, + 'time_series': {'readonly': True}, + 'linked_objects': {'readonly': True}, + 'details': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'database_edition': {'key': 'properties.databaseEdition', 'type': 'str'}, - 'dtu': {'key': 'properties.dtu', 'type': 'float'}, - 'database_dtu_min': {'key': 'properties.databaseDtuMin', 'type': 'float'}, - 'database_dtu_max': {'key': 'properties.databaseDtuMax', 'type': 'float'}, - 'storage_mb': {'key': 'properties.storageMB', 'type': 'float'}, - 'observation_period_start': {'key': 'properties.observationPeriodStart', 'type': 'iso-8601'}, - 'observation_period_end': {'key': 'properties.observationPeriodEnd', 'type': 'iso-8601'}, - 'max_observed_dtu': {'key': 'properties.maxObservedDtu', 'type': 'float'}, - 'max_observed_storage_mb': {'key': 'properties.maxObservedStorageMB', 'type': 'float'}, - 'databases': {'key': 'properties.databases', 'type': '[TrackedResource]'}, - 'metrics': {'key': 'properties.metrics', 'type': '[RecommendedElasticPoolMetric]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'recommendation_reason': {'key': 'properties.recommendationReason', 'type': 'str'}, + 'valid_since': {'key': 'properties.validSince', 'type': 'iso-8601'}, + 'last_refresh': {'key': 'properties.lastRefresh', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'RecommendedActionStateInfo'}, + 'is_executable_action': {'key': 'properties.isExecutableAction', 'type': 'bool'}, + 'is_revertable_action': {'key': 'properties.isRevertableAction', 'type': 'bool'}, + 'is_archived_action': {'key': 'properties.isArchivedAction', 'type': 'bool'}, + 'execute_action_start_time': {'key': 'properties.executeActionStartTime', 'type': 'iso-8601'}, + 'execute_action_duration': {'key': 'properties.executeActionDuration', 'type': 'str'}, + 'revert_action_start_time': {'key': 'properties.revertActionStartTime', 'type': 'iso-8601'}, + 'revert_action_duration': {'key': 'properties.revertActionDuration', 'type': 'str'}, + 'execute_action_initiated_by': {'key': 'properties.executeActionInitiatedBy', 'type': 'RecommendedActionInitiatedBy'}, + 'execute_action_initiated_time': {'key': 'properties.executeActionInitiatedTime', 'type': 'iso-8601'}, + 'revert_action_initiated_by': {'key': 'properties.revertActionInitiatedBy', 'type': 'RecommendedActionInitiatedBy'}, + 'revert_action_initiated_time': {'key': 'properties.revertActionInitiatedTime', 'type': 'iso-8601'}, + 'score': {'key': 'properties.score', 'type': 'int'}, + 'implementation_details': {'key': 'properties.implementationDetails', 'type': 'RecommendedActionImplementationInfo'}, + 'error_details': {'key': 'properties.errorDetails', 'type': 'RecommendedActionErrorInfo'}, + 'estimated_impact': {'key': 'properties.estimatedImpact', 'type': '[RecommendedActionImpactRecord]'}, + 'observed_impact': {'key': 'properties.observedImpact', 'type': '[RecommendedActionImpactRecord]'}, + 'time_series': {'key': 'properties.timeSeries', 'type': '[RecommendedActionMetricInfo]'}, + 'linked_objects': {'key': 'properties.linkedObjects', 'type': '[str]'}, + 'details': {'key': 'properties.details', 'type': '{object}'}, } - def __init__(self, *, dtu: float=None, database_dtu_min: float=None, database_dtu_max: float=None, storage_mb: float=None, **kwargs) -> None: - super(RecommendedElasticPool, self).__init__(**kwargs) - self.database_edition = None - self.dtu = dtu - self.database_dtu_min = database_dtu_min - self.database_dtu_max = database_dtu_max - self.storage_mb = storage_mb - self.observation_period_start = None - self.observation_period_end = None - self.max_observed_dtu = None - self.max_observed_storage_mb = None - self.databases = None - self.metrics = None + def __init__(self, *, state, **kwargs) -> None: + super(RecommendedAction, self).__init__(**kwargs) + self.kind = None + self.location = None + self.recommendation_reason = None + self.valid_since = None + self.last_refresh = None + self.state = state + self.is_executable_action = None + self.is_revertable_action = None + self.is_archived_action = None + self.execute_action_start_time = None + self.execute_action_duration = None + self.revert_action_start_time = None + self.revert_action_duration = None + self.execute_action_initiated_by = None + self.execute_action_initiated_time = None + self.revert_action_initiated_by = None + self.revert_action_initiated_time = None + self.score = None + self.implementation_details = None + self.error_details = None + self.estimated_impact = None + self.observed_impact = None + self.time_series = None + self.linked_objects = None + self.details = None + +class RecommendedActionErrorInfo(Model): + """Contains error information for an Azure SQL Database, Server or Elastic + Pool Recommended Action. -class RecommendedElasticPoolMetric(Model): - """Represents recommended elastic pool metric. + Variables are only populated by the server, and will be ignored when + sending a request. - :param date_time_property: The time of metric (ISO8601 format). - :type date_time_property: datetime - :param dtu: Gets or sets the DTUs (Database Transaction Units). See - https://azure.microsoft.com/documentation/articles/sql-database-what-is-a-dtu/ - :type dtu: float - :param size_gb: Gets or sets size in gigabytes. - :type size_gb: float + :ivar error_code: Gets the reason why the recommended action was put to + error state. e.g., DatabaseHasQdsOff, IndexAlreadyExists + :vartype error_code: str + :ivar is_retryable: Gets whether the error could be ignored and + recommended action could be retried. Possible values are: Yes/No. Possible + values include: 'Yes', 'No' + :vartype is_retryable: str or ~azure.mgmt.sql.models.IsRetryable """ + _validation = { + 'error_code': {'readonly': True}, + 'is_retryable': {'readonly': True}, + } + _attribute_map = { - 'date_time_property': {'key': 'dateTime', 'type': 'iso-8601'}, - 'dtu': {'key': 'dtu', 'type': 'float'}, - 'size_gb': {'key': 'sizeGB', 'type': 'float'}, + 'error_code': {'key': 'errorCode', 'type': 'str'}, + 'is_retryable': {'key': 'isRetryable', 'type': 'IsRetryable'}, } - def __init__(self, *, date_time_property=None, dtu: float=None, size_gb: float=None, **kwargs) -> None: - super(RecommendedElasticPoolMetric, self).__init__(**kwargs) - self.date_time_property = date_time_property - self.dtu = dtu - self.size_gb = size_gb + def __init__(self, **kwargs) -> None: + super(RecommendedActionErrorInfo, self).__init__(**kwargs) + self.error_code = None + self.is_retryable = None -class RecommendedIndex(ProxyResource): - """Represents a database recommended index. +class RecommendedActionImpactRecord(Model): + """Contains information of estimated or observed impact on various metrics for + an Azure SQL Database, Server or Elastic Pool Recommended Action. 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 action: The proposed index action. You can create a missing index, - drop an unused index, or rebuild an existing index to improve its - performance. Possible values include: 'Create', 'Drop', 'Rebuild' - :vartype action: str or ~azure.mgmt.sql.models.RecommendedIndexAction - :ivar state: The current recommendation state. Possible values include: - 'Active', 'Pending', 'Executing', 'Verifying', 'Pending Revert', - 'Reverting', 'Reverted', 'Ignored', 'Expired', 'Blocked', 'Success' - :vartype state: str or ~azure.mgmt.sql.models.RecommendedIndexState - :ivar created: The UTC datetime showing when this resource was created - (ISO8601 format). - :vartype created: datetime - :ivar last_modified: The UTC datetime of when was this resource last - changed (ISO8601 format). + :ivar dimension_name: Gets the name of the impact dimension. e.g., + CPUChange, DiskSpaceChange, NumberOfQueriesAffected. + :vartype dimension_name: str + :ivar unit: Gets the name of the impact dimension. e.g., CPUChange, + DiskSpaceChange, NumberOfQueriesAffected. + :vartype unit: str + :ivar absolute_value: Gets the absolute value of this dimension if + applicable. e.g., Number of Queries affected + :vartype absolute_value: float + :ivar change_value_absolute: Gets the absolute change in the value of this + dimension. e.g., Absolute Disk space change in Megabytes + :vartype change_value_absolute: float + :ivar change_value_relative: Gets the relative change in the value of this + dimension. e.g., Relative Disk space change in Percentage + :vartype change_value_relative: float + """ + + _validation = { + 'dimension_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'absolute_value': {'readonly': True}, + 'change_value_absolute': {'readonly': True}, + 'change_value_relative': {'readonly': True}, + } + + _attribute_map = { + 'dimension_name': {'key': 'dimensionName', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'absolute_value': {'key': 'absoluteValue', 'type': 'float'}, + 'change_value_absolute': {'key': 'changeValueAbsolute', 'type': 'float'}, + 'change_value_relative': {'key': 'changeValueRelative', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(RecommendedActionImpactRecord, self).__init__(**kwargs) + self.dimension_name = None + self.unit = None + self.absolute_value = None + self.change_value_absolute = None + self.change_value_relative = None + + +class RecommendedActionImplementationInfo(Model): + """Contains information for manual implementation for an Azure SQL Database, + Server or Elastic Pool Recommended Action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar method: Gets the method in which this recommended action can be + manually implemented. e.g., TSql, AzurePowerShell. Possible values + include: 'TSql', 'AzurePowerShell' + :vartype method: str or ~azure.mgmt.sql.models.ImplementationMethod + :ivar script: Gets the manual implementation script. e.g., T-SQL script + that could be executed on the database. + :vartype script: str + """ + + _validation = { + 'method': {'readonly': True}, + 'script': {'readonly': True}, + } + + _attribute_map = { + 'method': {'key': 'method', 'type': 'ImplementationMethod'}, + 'script': {'key': 'script', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(RecommendedActionImplementationInfo, self).__init__(**kwargs) + self.method = None + self.script = None + + +class RecommendedActionMetricInfo(Model): + """Contains time series of various impacted metrics for an Azure SQL Database, + Server or Elastic Pool Recommended Action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar metric_name: Gets the name of the metric. e.g., CPU, Number of + Queries. + :vartype metric_name: str + :ivar unit: Gets the unit in which metric is measured. e.g., DTU, + Frequency + :vartype unit: str + :ivar time_grain: Gets the duration of time interval for the value given + by this MetricInfo. e.g., PT1H (1 hour) + :vartype time_grain: str + :ivar start_time: Gets the start time of time interval given by this + MetricInfo. + :vartype start_time: datetime + :ivar value: Gets the value of the metric in the time interval given by + this MetricInfo. + :vartype value: float + """ + + _validation = { + 'metric_name': {'readonly': True}, + 'unit': {'readonly': True}, + 'time_grain': {'readonly': True}, + 'start_time': {'readonly': True}, + 'value': {'readonly': True}, + } + + _attribute_map = { + 'metric_name': {'key': 'metricName', 'type': 'str'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'time_grain': {'key': 'timeGrain', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'value': {'key': 'value', 'type': 'float'}, + } + + def __init__(self, **kwargs) -> None: + super(RecommendedActionMetricInfo, self).__init__(**kwargs) + self.metric_name = None + self.unit = None + self.time_grain = None + self.start_time = None + self.value = None + + +class RecommendedActionStateInfo(Model): + """Contains information of current state for an Azure SQL Database, Server or + Elastic Pool Recommended Action. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :param current_value: Required. Current state the recommended action is + in. Some commonly used states are: Active -> recommended action is + active and no action has been taken yet. Pending -> recommended action + is approved for and is awaiting execution. Executing -> recommended + action is being applied on the user database. Verifying -> recommended + action was applied and is being verified of its usefulness by the system. + Success -> recommended action was applied and improvement found during + verification. Pending Revert -> verification found little or no + improvement so recommended action is queued for revert or user has + manually reverted. Reverting -> changes made while applying recommended + action are being reverted on the user database. Reverted -> + successfully reverted the changes made by recommended action on user + database. Ignored -> user explicitly ignored/discarded the recommended + action. Possible values include: 'Active', 'Pending', 'Executing', + 'Verifying', 'PendingRevert', 'RevertCancelled', 'Reverting', 'Reverted', + 'Ignored', 'Expired', 'Monitoring', 'Resolved', 'Success', 'Error' + :type current_value: str or + ~azure.mgmt.sql.models.RecommendedActionCurrentState + :ivar action_initiated_by: Gets who initiated the execution of this + recommended action. Possible Value are: User -> When user explicity + notified system to apply the recommended action. System -> When + auto-execute status of this advisor was set to 'Enabled', in which case + the system applied it. Possible values include: 'User', 'System' + :vartype action_initiated_by: str or + ~azure.mgmt.sql.models.RecommendedActionInitiatedBy + :ivar last_modified: Gets the time when the state was last modified :vartype last_modified: datetime - :ivar index_type: The type of index (CLUSTERED, NONCLUSTERED, COLUMNSTORE, - CLUSTERED COLUMNSTORE). Possible values include: 'CLUSTERED', - 'NONCLUSTERED', 'COLUMNSTORE', 'CLUSTERED COLUMNSTORE' - :vartype index_type: str or ~azure.mgmt.sql.models.RecommendedIndexType - :ivar schema: The schema where table to build index over resides - :vartype schema: str - :ivar table: The table on which to build index. - :vartype table: str - :ivar columns: Columns over which to build index - :vartype columns: list[str] - :ivar included_columns: The list of column names to be included in the - index - :vartype included_columns: list[str] - :ivar index_script: The full build index script - :vartype index_script: str - :ivar estimated_impact: The estimated impact of doing recommended index - action. - :vartype estimated_impact: list[~azure.mgmt.sql.models.OperationImpact] - :ivar reported_impact: The values reported after index action is complete. - :vartype reported_impact: list[~azure.mgmt.sql.models.OperationImpact] """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'action': {'readonly': True}, - 'state': {'readonly': True}, - 'created': {'readonly': True}, + 'current_value': {'required': True}, + 'action_initiated_by': {'readonly': True}, 'last_modified': {'readonly': True}, - 'index_type': {'readonly': True}, - 'schema': {'readonly': True}, - 'table': {'readonly': True}, - 'columns': {'readonly': True}, - 'included_columns': {'readonly': True}, - 'index_script': {'readonly': True}, - 'estimated_impact': {'readonly': True}, - 'reported_impact': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'action': {'key': 'properties.action', 'type': 'RecommendedIndexAction'}, - 'state': {'key': 'properties.state', 'type': 'RecommendedIndexState'}, - 'created': {'key': 'properties.created', 'type': 'iso-8601'}, - 'last_modified': {'key': 'properties.lastModified', 'type': 'iso-8601'}, - 'index_type': {'key': 'properties.indexType', 'type': 'RecommendedIndexType'}, - 'schema': {'key': 'properties.schema', 'type': 'str'}, - 'table': {'key': 'properties.table', 'type': 'str'}, - 'columns': {'key': 'properties.columns', 'type': '[str]'}, - 'included_columns': {'key': 'properties.includedColumns', 'type': '[str]'}, - 'index_script': {'key': 'properties.indexScript', 'type': 'str'}, - 'estimated_impact': {'key': 'properties.estimatedImpact', 'type': '[OperationImpact]'}, - 'reported_impact': {'key': 'properties.reportedImpact', 'type': '[OperationImpact]'}, + 'current_value': {'key': 'currentValue', 'type': 'str'}, + 'action_initiated_by': {'key': 'actionInitiatedBy', 'type': 'RecommendedActionInitiatedBy'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, } - def __init__(self, **kwargs) -> None: - super(RecommendedIndex, self).__init__(**kwargs) - self.action = None - self.state = None - self.created = None + def __init__(self, *, current_value, **kwargs) -> None: + super(RecommendedActionStateInfo, self).__init__(**kwargs) + self.current_value = current_value + self.action_initiated_by = None self.last_modified = None - self.index_type = None - self.schema = None - self.table = None - self.columns = None - self.included_columns = None - self.index_script = None - self.estimated_impact = None - self.reported_impact = None -class RecoverableDatabase(ProxyResource): - """A recoverable database. +class RecommendedSensitivityLabelUpdate(ProxyResource): + """A recommended sensitivity label update operation. Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: Resource ID. :vartype id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar edition: The edition of the database - :vartype edition: str - :ivar service_level_objective: The service level objective name of the - database - :vartype service_level_objective: str - :ivar elastic_pool_name: The elastic pool name of the database - :vartype elastic_pool_name: str - :ivar last_available_backup_date: The last available backup date of the - database (ISO8601 format) - :vartype last_available_backup_date: datetime + :param op: Required. Possible values include: 'enable', 'disable' + :type op: str or + ~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdateKind + :param schema: Required. Schema name of the column to update. + :type schema: str + :param table: Required. Table name of the column to update. + :type table: str + :param column: Required. Column name to update. + :type column: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'edition': {'readonly': True}, - 'service_level_objective': {'readonly': True}, - 'elastic_pool_name': {'readonly': True}, - 'last_available_backup_date': {'readonly': True}, + 'op': {'required': True}, + 'schema': {'required': True}, + 'table': {'required': True}, + 'column': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'edition': {'key': 'properties.edition', 'type': 'str'}, - 'service_level_objective': {'key': 'properties.serviceLevelObjective', 'type': 'str'}, - 'elastic_pool_name': {'key': 'properties.elasticPoolName', 'type': 'str'}, - 'last_available_backup_date': {'key': 'properties.lastAvailableBackupDate', 'type': 'iso-8601'}, + 'op': {'key': 'properties.op', 'type': 'RecommendedSensitivityLabelUpdateKind'}, + 'schema': {'key': 'properties.schema', 'type': 'str'}, + 'table': {'key': 'properties.table', 'type': 'str'}, + 'column': {'key': 'properties.column', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(RecoverableDatabase, self).__init__(**kwargs) - self.edition = None - self.service_level_objective = None - self.elastic_pool_name = None - self.last_available_backup_date = None + def __init__(self, *, op, schema: str, table: str, column: str, **kwargs) -> None: + super(RecommendedSensitivityLabelUpdate, self).__init__(**kwargs) + self.op = op + self.schema = schema + self.table = table + self.column = column + + +class RecommendedSensitivityLabelUpdateList(Model): + """A list of recommended sensitivity label update operations. + + :param operations: + :type operations: + list[~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[RecommendedSensitivityLabelUpdate]'}, + } + + def __init__(self, *, operations=None, **kwargs) -> None: + super(RecommendedSensitivityLabelUpdateList, self).__init__(**kwargs) + self.operations = operations class RecoverableManagedDatabase(ProxyResource): @@ -7834,7 +8597,7 @@ def __init__(self, **kwargs) -> None: class ReplicationLink(ProxyResource): - """Represents a database replication link. + """A replication link. Variables are only populated by the server, and will be ignored when sending a request. @@ -7845,92 +8608,91 @@ class ReplicationLink(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar location: Location of the server that contains this firewall rule. - :vartype location: str - :ivar is_termination_allowed: Legacy value indicating whether termination - is allowed. Currently always returns true. - :vartype is_termination_allowed: bool - :ivar replication_mode: Replication mode of this replication link. - :vartype replication_mode: str - :ivar partner_server: The name of the server hosting the partner database. + :ivar partner_server: Resource partner server. :vartype partner_server: str - :ivar partner_database: The name of the partner database. + :ivar partner_database: Resource partner database. :vartype partner_database: str - :ivar partner_location: The Azure Region of the partner database. + :ivar partner_location: Resource partner location. :vartype partner_location: str - :ivar role: The role of the database in the replication link. Possible - values include: 'Primary', 'Secondary', 'NonReadableSecondary', 'Source', - 'Copy' - :vartype role: str or ~azure.mgmt.sql.models.ReplicationRole - :ivar partner_role: The role of the partner database in the replication - link. Possible values include: 'Primary', 'Secondary', - 'NonReadableSecondary', 'Source', 'Copy' - :vartype partner_role: str or ~azure.mgmt.sql.models.ReplicationRole - :ivar start_time: The start time for the replication link. + :ivar role: Local replication role. + :vartype role: str + :ivar partner_role: Partner replication role. + :vartype partner_role: str + :ivar replication_mode: Replication mode. + :vartype replication_mode: str + :ivar start_time: Time at which the link was created. :vartype start_time: datetime - :ivar percent_complete: The percentage of seeding complete for the - replication link. + :ivar percent_complete: Seeding completion percentage for the link. :vartype percent_complete: int - :ivar replication_state: The replication state for the replication link. - Possible values include: 'PENDING', 'SEEDING', 'CATCH_UP', 'SUSPENDED' - :vartype replication_state: str or ~azure.mgmt.sql.models.ReplicationState + :ivar replication_state: Replication state (PENDING, SEEDING, CATCHUP, + SUSPENDED). + :vartype replication_state: str + :ivar is_termination_allowed: Whether the user is currently allowed to + terminate the link. + :vartype is_termination_allowed: bool + :ivar link_type: Link type (GEO, NAMED). + :vartype link_type: str """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'is_termination_allowed': {'readonly': True}, - 'replication_mode': {'readonly': True}, 'partner_server': {'readonly': True}, 'partner_database': {'readonly': True}, 'partner_location': {'readonly': True}, 'role': {'readonly': True}, 'partner_role': {'readonly': True}, + 'replication_mode': {'readonly': True}, 'start_time': {'readonly': True}, 'percent_complete': {'readonly': True}, 'replication_state': {'readonly': True}, + 'is_termination_allowed': {'readonly': True}, + 'link_type': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'is_termination_allowed': {'key': 'properties.isTerminationAllowed', 'type': 'bool'}, - 'replication_mode': {'key': 'properties.replicationMode', 'type': 'str'}, 'partner_server': {'key': 'properties.partnerServer', 'type': 'str'}, 'partner_database': {'key': 'properties.partnerDatabase', 'type': 'str'}, 'partner_location': {'key': 'properties.partnerLocation', 'type': 'str'}, - 'role': {'key': 'properties.role', 'type': 'ReplicationRole'}, - 'partner_role': {'key': 'properties.partnerRole', 'type': 'ReplicationRole'}, + 'role': {'key': 'properties.role', 'type': 'str'}, + 'partner_role': {'key': 'properties.partnerRole', 'type': 'str'}, + 'replication_mode': {'key': 'properties.replicationMode', 'type': 'str'}, 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, 'replication_state': {'key': 'properties.replicationState', 'type': 'str'}, + 'is_termination_allowed': {'key': 'properties.isTerminationAllowed', 'type': 'bool'}, + 'link_type': {'key': 'properties.linkType', 'type': 'str'}, } def __init__(self, **kwargs) -> None: super(ReplicationLink, self).__init__(**kwargs) - self.location = None - self.is_termination_allowed = None - self.replication_mode = None self.partner_server = None self.partner_database = None self.partner_location = None self.role = None self.partner_role = None + self.replication_mode = None self.start_time = None self.percent_complete = None self.replication_state = None + self.is_termination_allowed = None + self.link_type = None -class ResourceIdentity(Model): +class ResourceIdentityWithUserAssignedIdentities(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 user_assigned_identities: The resource ids of the user assigned + identities to use + :type user_assigned_identities: dict[str, + ~azure.mgmt.sql.models.UserIdentity] :ivar principal_id: The Azure Active Directory principal id. :vartype principal_id: str :param type: The identity type. Set this to 'SystemAssigned' in order to @@ -7948,13 +8710,15 @@ class ResourceIdentity(Model): } _attribute_map = { + 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{UserIdentity}'}, 'principal_id': {'key': 'principalId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, } - def __init__(self, *, type=None, **kwargs) -> None: - super(ResourceIdentity, self).__init__(**kwargs) + def __init__(self, *, user_assigned_identities=None, type=None, **kwargs) -> None: + super(ResourceIdentityWithUserAssignedIdentities, self).__init__(**kwargs) + self.user_assigned_identities = user_assigned_identities self.principal_id = None self.type = type self.tenant_id = None @@ -7983,7 +8747,7 @@ def __init__(self, *, id: str, **kwargs) -> None: class RestorableDroppedDatabase(ProxyResource): - """A restorable dropped database. + """A restorable dropped database resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -7994,69 +8758,73 @@ class RestorableDroppedDatabase(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :ivar location: The geo-location where the resource lives - :vartype location: str - :ivar database_name: The name of the database + :param sku: The name and tier of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :ivar database_name: The name of the database. :vartype database_name: str - :ivar edition: The edition of the database - :vartype edition: str - :ivar max_size_bytes: The max size in bytes of the database - :vartype max_size_bytes: str - :ivar service_level_objective: The service level objective name of the - database - :vartype service_level_objective: str - :ivar elastic_pool_name: The elastic pool name of the database - :vartype elastic_pool_name: str - :ivar creation_date: The creation date of the database (ISO8601 format) + :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 - :ivar deletion_date: The deletion date of the database (ISO8601 format) + :ivar deletion_date: The deletion date of the database (ISO8601 format). :vartype deletion_date: datetime :ivar earliest_restore_date: The earliest restore date of the database - (ISO8601 format) + (ISO8601 format). :vartype earliest_restore_date: 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.enum """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'location': {'readonly': True}, 'database_name': {'readonly': True}, - 'edition': {'readonly': True}, 'max_size_bytes': {'readonly': True}, - 'service_level_objective': {'readonly': True}, - 'elastic_pool_name': {'readonly': True}, + 'elastic_pool_id': {'readonly': True}, 'creation_date': {'readonly': True}, 'deletion_date': {'readonly': True}, 'earliest_restore_date': {'readonly': True}, + 'backup_storage_redundancy': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, - 'edition': {'key': 'properties.edition', 'type': 'str'}, - 'max_size_bytes': {'key': 'properties.maxSizeBytes', 'type': 'str'}, - 'service_level_objective': {'key': 'properties.serviceLevelObjective', 'type': 'str'}, - 'elastic_pool_name': {'key': 'properties.elasticPoolName', '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'}, + 'backup_storage_redundancy': {'key': 'properties.backupStorageRedundancy', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, sku=None, location: str=None, tags=None, **kwargs) -> None: super(RestorableDroppedDatabase, self).__init__(**kwargs) - self.location = None + self.sku = sku + self.location = location + self.tags = tags self.database_name = None - self.edition = None self.max_size_bytes = None - self.service_level_objective = None - self.elastic_pool_name = None + self.elastic_pool_id = None self.creation_date = None self.deletion_date = None self.earliest_restore_date = None + self.backup_storage_redundancy = None class RestorableDroppedManagedDatabase(TrackedResource): @@ -8178,6 +8946,159 @@ def __init__(self, **kwargs) -> None: self.restore_point_label = None +class SecurityEvent(ProxyResource): + """A security event. + + 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 event_time: The time when the security event occurred. + :vartype event_time: datetime + :ivar security_event_type: The type of the security event. Possible values + include: 'Undefined', 'SqlInjectionVulnerability', 'SqlInjectionExploit' + :vartype security_event_type: str or + ~azure.mgmt.sql.models.SecurityEventType + :ivar subscription: The subscription name + :vartype subscription: str + :ivar server: The server name + :vartype server: str + :ivar database: The database name + :vartype database: str + :ivar client_ip: The IP address of the client who executed the statement. + :vartype client_ip: str + :ivar application_name: The application used to execute the statement. + :vartype application_name: str + :ivar principal_name: The principal user who executed the statement + :vartype principal_name: str + :ivar security_event_sql_injection_additional_properties: The sql + injection additional properties, populated only if the type of the + security event is sql injection. + :vartype security_event_sql_injection_additional_properties: + ~azure.mgmt.sql.models.SecurityEventSqlInjectionAdditionalProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'event_time': {'readonly': True}, + 'security_event_type': {'readonly': True}, + 'subscription': {'readonly': True}, + 'server': {'readonly': True}, + 'database': {'readonly': True}, + 'client_ip': {'readonly': True}, + 'application_name': {'readonly': True}, + 'principal_name': {'readonly': True}, + 'security_event_sql_injection_additional_properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'event_time': {'key': 'properties.eventTime', 'type': 'iso-8601'}, + 'security_event_type': {'key': 'properties.securityEventType', 'type': 'SecurityEventType'}, + 'subscription': {'key': 'properties.subscription', 'type': 'str'}, + 'server': {'key': 'properties.server', 'type': 'str'}, + 'database': {'key': 'properties.database', 'type': 'str'}, + 'client_ip': {'key': 'properties.clientIp', 'type': 'str'}, + 'application_name': {'key': 'properties.applicationName', 'type': 'str'}, + 'principal_name': {'key': 'properties.principalName', 'type': 'str'}, + 'security_event_sql_injection_additional_properties': {'key': 'properties.securityEventSqlInjectionAdditionalProperties', 'type': 'SecurityEventSqlInjectionAdditionalProperties'}, + } + + def __init__(self, **kwargs) -> None: + super(SecurityEvent, self).__init__(**kwargs) + self.event_time = None + self.security_event_type = None + self.subscription = None + self.server = None + self.database = None + self.client_ip = None + self.application_name = None + self.principal_name = None + self.security_event_sql_injection_additional_properties = None + + +class SecurityEventsFilterParameters(Model): + """The properties that are supported in the $filter operation. + + :param event_time: Filter on the event time. + :type event_time: datetime + :param show_server_records: Whether to show server records or not. + :type show_server_records: bool + """ + + _attribute_map = { + 'event_time': {'key': 'eventTime', 'type': 'iso-8601'}, + 'show_server_records': {'key': 'showServerRecords', 'type': 'bool'}, + } + + def __init__(self, *, event_time=None, show_server_records: bool=None, **kwargs) -> None: + super(SecurityEventsFilterParameters, self).__init__(**kwargs) + self.event_time = event_time + self.show_server_records = show_server_records + + +class SecurityEventSqlInjectionAdditionalProperties(Model): + """The properties of a security event sql injection additional properties. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar threat_id: The threat ID. + :vartype threat_id: str + :ivar statement: The statement + :vartype statement: str + :ivar statement_highlight_offset: The statement highlight offset + :vartype statement_highlight_offset: int + :ivar statement_highlight_length: The statement highlight length + :vartype statement_highlight_length: int + :ivar error_code: The sql error code + :vartype error_code: int + :ivar error_severity: The sql error severity + :vartype error_severity: int + :ivar error_message: The sql error message + :vartype error_message: str + """ + + _validation = { + 'threat_id': {'readonly': True}, + 'statement': {'readonly': True}, + 'statement_highlight_offset': {'readonly': True}, + 'statement_highlight_length': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_severity': {'readonly': True}, + 'error_message': {'readonly': True}, + } + + _attribute_map = { + 'threat_id': {'key': 'threatId', 'type': 'str'}, + 'statement': {'key': 'statement', 'type': 'str'}, + 'statement_highlight_offset': {'key': 'statementHighlightOffset', 'type': 'int'}, + 'statement_highlight_length': {'key': 'statementHighlightLength', 'type': 'int'}, + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'error_severity': {'key': 'errorSeverity', 'type': 'int'}, + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SecurityEventSqlInjectionAdditionalProperties, self).__init__(**kwargs) + self.threat_id = None + self.statement = None + self.statement_highlight_offset = None + self.statement_highlight_length = None + self.error_code = None + self.error_severity = None + self.error_message = None + + class SensitivityLabel(ProxyResource): """A sensitivity label. @@ -8190,6 +9111,14 @@ class SensitivityLabel(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar managed_by: Resource that manages the sensitivity label. + :vartype managed_by: str + :ivar schema_name: The schema name. + :vartype schema_name: str + :ivar table_name: The table name. + :vartype table_name: str + :ivar column_name: The column name. + :vartype column_name: str :param label_name: The label name. :type label_name: str :param label_id: The label ID. @@ -8211,6 +9140,10 @@ class SensitivityLabel(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'managed_by': {'readonly': True}, + 'schema_name': {'readonly': True}, + 'table_name': {'readonly': True}, + 'column_name': {'readonly': True}, 'is_disabled': {'readonly': True}, } @@ -8218,6 +9151,10 @@ class SensitivityLabel(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'managed_by': {'key': 'managedBy', 'type': 'str'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'column_name': {'key': 'properties.columnName', 'type': 'str'}, 'label_name': {'key': 'properties.labelName', 'type': 'str'}, 'label_id': {'key': 'properties.labelId', 'type': 'str'}, 'information_type': {'key': 'properties.informationType', 'type': 'str'}, @@ -8228,6 +9165,10 @@ class SensitivityLabel(ProxyResource): def __init__(self, *, label_name: str=None, label_id: str=None, information_type: str=None, information_type_id: str=None, rank=None, **kwargs) -> None: super(SensitivityLabel, self).__init__(**kwargs) + self.managed_by = None + self.schema_name = None + self.table_name = None + self.column_name = None self.label_name = label_name self.label_id = label_id self.information_type = information_type @@ -8236,6 +9177,79 @@ def __init__(self, *, label_name: str=None, label_id: str=None, information_type self.rank = rank +class SensitivityLabelUpdate(ProxyResource): + """A sensitivity label update operation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param op: Required. Possible values include: 'set', 'remove' + :type op: str or ~azure.mgmt.sql.models.SensitivityLabelUpdateKind + :param schema: Required. Schema name of the column to update. + :type schema: str + :param table: Required. Table name of the column to update. + :type table: str + :param column: Required. Column name to update. + :type column: str + :param sensitivity_label: The sensitivity label information to apply on a + column. + :type sensitivity_label: ~azure.mgmt.sql.models.SensitivityLabel + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'op': {'required': True}, + 'schema': {'required': True}, + 'table': {'required': True}, + 'column': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'op': {'key': 'properties.op', 'type': 'SensitivityLabelUpdateKind'}, + 'schema': {'key': 'properties.schema', 'type': 'str'}, + 'table': {'key': 'properties.table', 'type': 'str'}, + 'column': {'key': 'properties.column', 'type': 'str'}, + 'sensitivity_label': {'key': 'properties.sensitivityLabel', 'type': 'SensitivityLabel'}, + } + + def __init__(self, *, op, schema: str, table: str, column: str, sensitivity_label=None, **kwargs) -> None: + super(SensitivityLabelUpdate, self).__init__(**kwargs) + self.op = op + self.schema = schema + self.table = table + self.column = column + self.sensitivity_label = sensitivity_label + + +class SensitivityLabelUpdateList(Model): + """A list of sensitivity label update operations. + + :param operations: + :type operations: list[~azure.mgmt.sql.models.SensitivityLabelUpdate] + """ + + _attribute_map = { + 'operations': {'key': 'operations', 'type': '[SensitivityLabelUpdate]'}, + } + + def __init__(self, *, operations=None, **kwargs) -> None: + super(SensitivityLabelUpdateList, self).__init__(**kwargs) + self.operations = operations + + class Server(TrackedResource): """An Azure SQL Database server. @@ -8255,7 +9269,8 @@ class Server(TrackedResource): :param tags: Resource tags. :type tags: dict[str, str] :param identity: The Azure Active Directory identity of the server. - :type identity: ~azure.mgmt.sql.models.ResourceIdentity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :ivar kind: Kind of sql server. This is metadata used for the Azure portal experience. :vartype kind: str @@ -8283,7 +9298,28 @@ class Server(TrackedResource): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag + :ivar workspace_feature: Whether or not existing server has a workspace + created and if it allows connection from workspace. Possible values + include: 'Connected', 'Disconnected' + :vartype workspace_feature: str or + ~azure.mgmt.sql.models.ServerWorkspaceFeature + :param primary_user_assigned_identity_id: The resource id of a user + assigned identity to be used by default. + :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory identity of the server. + :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag """ _validation = { @@ -8295,6 +9331,7 @@ class Server(TrackedResource): 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'workspace_feature': {'readonly': True}, } _attribute_map = { @@ -8303,7 +9340,7 @@ class Server(TrackedResource): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ResourceIdentity'}, + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'kind': {'key': 'kind', 'type': 'str'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, @@ -8313,9 +9350,15 @@ class Server(TrackedResource): 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, + 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, primary_user_assigned_identity_id: str=None, federated_client_id: str=None, key_id: str=None, administrators=None, restrict_outbound_network_access=None, **kwargs) -> None: super(Server, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.kind = None @@ -8327,6 +9370,12 @@ def __init__(self, *, location: str, tags=None, identity=None, administrator_log self.private_endpoint_connections = None self.minimal_tls_version = minimal_tls_version self.public_network_access = public_network_access + self.workspace_feature = None + self.primary_user_assigned_identity_id = primary_user_assigned_identity_id + self.federated_client_id = federated_client_id + self.key_id = key_id + self.administrators = administrators + self.restrict_outbound_network_access = restrict_outbound_network_access class ServerAutomaticTuning(ProxyResource): @@ -8488,27 +9537,22 @@ class ServerBlobAuditingPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param state: Required. Specifies the state of the policy. If state is - Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. - Possible values include: 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState - :param storage_endpoint: Specifies the blob storage endpoint (e.g. - https://MyAccount.blob.core.windows.net). If state is Enabled, - storageEndpoint or isAzureMonitorTargetEnabled is required. - :type storage_endpoint: str - :param storage_account_access_key: Specifies the identifier key of the - auditing storage account. - If state is Enabled and storageEndpoint is specified, not specifying the - storageAccountAccessKey will use SQL server system-assigned managed - identity to access the storage. - Prerequisites for using managed identity authentication: - 1. Assign SQL Server a system-assigned managed identity in Azure Active - Directory (AAD). - 2. Grant SQL Server identity access to the storage account by adding - 'Storage Blob Data Contributor' RBAC role to the server identity. - For more information, see [Auditing to storage using Managed Identity - authentication](https://go.microsoft.com/fwlink/?linkid=2114355) - :type storage_account_access_key: str + :param is_devops_audit_enabled: Specifies the state of devops audit. If + state is Enabled, devops logs will be sent to Azure Monitor. + In order to send the events to Azure Monitor, specify 'State' as + 'Enabled', 'IsAzureMonitorTargetEnabled' as true and + 'IsDevopsAuditEnabled' as true + When using REST API to configure auditing, Diagnostic Settings with + 'DevOpsOperationsAudit' diagnostic logs category on the master database + should also be created. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + For more information, see [Diagnostic Settings REST + API](https://go.microsoft.com/fwlink/?linkid=2033207) + or [Diagnostic Settings + PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + :type is_devops_audit_enabled: bool :param retention_days: Specifies the number of days to keep in the audit logs in the storage account. :type retention_days: int @@ -8545,6 +9589,10 @@ class ServerBlobAuditingPolicy(ProxyResource): USER_CHANGE_PASSWORD_GROUP BATCH_STARTED_GROUP BATCH_COMPLETED_GROUP + DBCC_GROUP + DATABASE_OWNERSHIP_CHANGE_GROUP + DATABASE_CHANGE_GROUP + LEDGER_OPERATION_GROUP These are groups that cover all sql statements and stored procedures executed against the database, and should not be used in combination with other groups as this will result in duplicate audit logs. @@ -8573,16 +9621,13 @@ class ServerBlobAuditingPolicy(ProxyResource): For more information, see [Database-Level Audit Actions](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-actions) :type audit_actions_and_groups: list[str] - :param storage_account_subscription_id: Specifies the blob storage - subscription Id. - :type storage_account_subscription_id: str :param is_storage_secondary_key_in_use: Specifies whether storageAccountAccessKey value is the storage's secondary key. :type is_storage_secondary_key_in_use: bool :param is_azure_monitor_target_enabled: Specifies whether audit events are sent to Azure Monitor. - In order to send the events to Azure Monitor, specify 'state' as 'Enabled' - and 'isAzureMonitorTargetEnabled' as true. + In order to send the events to Azure Monitor, specify 'State' as 'Enabled' + and 'IsAzureMonitorTargetEnabled' as true. When using REST API to configure auditing, Diagnostic Settings with 'SQLSecurityAuditEvents' diagnostic logs category on the database should be also created. @@ -8601,6 +9646,30 @@ class ServerBlobAuditingPolicy(ProxyResource): The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. :type queue_delay_ms: int + :param state: Required. Specifies the state of the audit. If state is + Enabled, storageEndpoint or isAzureMonitorTargetEnabled are required. + Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.BlobAuditingPolicyState + :param storage_endpoint: Specifies the blob storage endpoint (e.g. + https://MyAccount.blob.core.windows.net). If state is Enabled, + storageEndpoint or isAzureMonitorTargetEnabled is required. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + auditing storage account. + If state is Enabled and storageEndpoint is specified, not specifying the + storageAccountAccessKey will use SQL server system-assigned managed + identity to access the storage. + Prerequisites for using managed identity authentication: + 1. Assign SQL Server a system-assigned managed identity in Azure Active + Directory (AAD). + 2. Grant SQL Server identity access to the storage account by adding + 'Storage Blob Data Contributor' RBAC role to the server identity. + For more information, see [Auditing to storage using Managed Identity + authentication](https://go.microsoft.com/fwlink/?linkid=2114355) + :type storage_account_access_key: str + :param storage_account_subscription_id: Specifies the blob storage + subscription Id. + :type storage_account_subscription_id: str """ _validation = { @@ -8614,129 +9683,30 @@ class ServerBlobAuditingPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, - 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, - 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'is_devops_audit_enabled': {'key': 'properties.isDevopsAuditEnabled', 'type': 'bool'}, 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, 'audit_actions_and_groups': {'key': 'properties.auditActionsAndGroups', 'type': '[str]'}, - 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, 'is_storage_secondary_key_in_use': {'key': 'properties.isStorageSecondaryKeyInUse', 'type': 'bool'}, 'is_azure_monitor_target_enabled': {'key': 'properties.isAzureMonitorTargetEnabled', 'type': 'bool'}, 'queue_delay_ms': {'key': 'properties.queueDelayMs', 'type': 'int'}, + 'state': {'key': 'properties.state', 'type': 'BlobAuditingPolicyState'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'storage_account_subscription_id': {'key': 'properties.storageAccountSubscriptionId', 'type': 'str'}, } - def __init__(self, *, state, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, audit_actions_and_groups=None, storage_account_subscription_id: str=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, **kwargs) -> None: + def __init__(self, *, state, is_devops_audit_enabled: bool=None, retention_days: int=None, audit_actions_and_groups=None, is_storage_secondary_key_in_use: bool=None, is_azure_monitor_target_enabled: bool=None, queue_delay_ms: int=None, storage_endpoint: str=None, storage_account_access_key: str=None, storage_account_subscription_id: str=None, **kwargs) -> None: super(ServerBlobAuditingPolicy, self).__init__(**kwargs) - self.state = state - self.storage_endpoint = storage_endpoint - self.storage_account_access_key = storage_account_access_key + self.is_devops_audit_enabled = is_devops_audit_enabled self.retention_days = retention_days self.audit_actions_and_groups = audit_actions_and_groups - self.storage_account_subscription_id = storage_account_subscription_id self.is_storage_secondary_key_in_use = is_storage_secondary_key_in_use self.is_azure_monitor_target_enabled = is_azure_monitor_target_enabled self.queue_delay_ms = queue_delay_ms - - -class ServerCommunicationLink(ProxyResource): - """Server communication link. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar state: The state. - :vartype state: str - :param partner_server: Required. The name of the partner server. - :type partner_server: str - :ivar location: Communication link location. - :vartype location: str - :ivar kind: Communication link kind. This property is used for Azure - Portal metadata. - :vartype kind: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'state': {'readonly': True}, - 'partner_server': {'required': True}, - 'location': {'readonly': True}, - 'kind': {'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'}, - 'partner_server': {'key': 'properties.partnerServer', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'kind': {'key': 'kind', 'type': 'str'}, - } - - def __init__(self, *, partner_server: str, **kwargs) -> None: - super(ServerCommunicationLink, self).__init__(**kwargs) - self.state = None - self.partner_server = partner_server - self.location = None - self.kind = None - - -class ServerConnectionPolicy(ProxyResource): - """A server secure connection policy. - - Variables are only populated by the server, and will be ignored when - sending a request. - - All required parameters must be populated in order to send to Azure. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar kind: Metadata used for the Azure portal experience. - :vartype kind: str - :ivar location: Resource location. - :vartype location: str - :param connection_type: Required. The server connection type. Possible - values include: 'Default', 'Proxy', 'Redirect' - :type connection_type: str or ~azure.mgmt.sql.models.ServerConnectionType - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'kind': {'readonly': True}, - 'location': {'readonly': True}, - 'connection_type': {'required': 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'}, - 'connection_type': {'key': 'properties.connectionType', 'type': 'ServerConnectionType'}, - } - - def __init__(self, *, connection_type, **kwargs) -> None: - super(ServerConnectionPolicy, self).__init__(**kwargs) - self.kind = None - self.location = None - self.connection_type = connection_type + self.state = state + self.storage_endpoint = storage_endpoint + self.storage_account_access_key = storage_account_access_key + self.storage_account_subscription_id = storage_account_subscription_id class ServerDevOpsAuditingSettings(ProxyResource): @@ -8862,22 +9832,67 @@ def __init__(self, **kwargs) -> None: class ServerDnsAliasAcquisition(Model): - """A server DNS alias acquisition request. + """A server dns alias acquisition request. + + All required parameters must be populated in order to send to Azure. - :param old_server_dns_alias_id: The id of the server alias that will be - acquired to point to this server instead. + :param old_server_dns_alias_id: Required. The id of the server alias that + will be acquired to point to this server instead. :type old_server_dns_alias_id: str """ + _validation = { + 'old_server_dns_alias_id': {'required': True}, + } + _attribute_map = { 'old_server_dns_alias_id': {'key': 'oldServerDnsAliasId', 'type': 'str'}, } - def __init__(self, *, old_server_dns_alias_id: str=None, **kwargs) -> None: + def __init__(self, *, old_server_dns_alias_id: str, **kwargs) -> None: super(ServerDnsAliasAcquisition, self).__init__(**kwargs) self.old_server_dns_alias_id = old_server_dns_alias_id +class ServerExternalAdministrator(Model): + """Properties of a active directory administrator. + + :param administrator_type: Type of the sever administrator. Possible + values include: 'ActiveDirectory' + :type administrator_type: str or ~azure.mgmt.sql.models.AdministratorType + :param principal_type: Principal Type of the sever administrator. Possible + values include: 'User', 'Group', 'Application' + :type principal_type: str or ~azure.mgmt.sql.models.PrincipalType + :param login: Login name of the server administrator. + :type login: str + :param sid: SID (object ID) of the server administrator. + :type sid: str + :param tenant_id: Tenant ID of the administrator. + :type tenant_id: str + :param azure_ad_only_authentication: Azure Active Directory only + Authentication enabled. + :type azure_ad_only_authentication: bool + """ + + _attribute_map = { + 'administrator_type': {'key': 'administratorType', 'type': 'str'}, + 'principal_type': {'key': 'principalType', 'type': 'str'}, + 'login': {'key': 'login', 'type': 'str'}, + 'sid': {'key': 'sid', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + 'azure_ad_only_authentication': {'key': 'azureADOnlyAuthentication', 'type': 'bool'}, + } + + def __init__(self, *, administrator_type=None, principal_type=None, login: str=None, sid: str=None, tenant_id: str=None, azure_ad_only_authentication: bool=None, **kwargs) -> None: + super(ServerExternalAdministrator, self).__init__(**kwargs) + self.administrator_type = administrator_type + self.principal_type = principal_type + self.login = login + self.sid = sid + self.tenant_id = tenant_id + self.azure_ad_only_authentication = azure_ad_only_authentication + + class ServerInfo(Model): """Server info for the server trust group. @@ -8914,9 +9929,9 @@ class ServerKey(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param kind: Kind of encryption protector. This is metadata used for the + :ivar kind: Kind of encryption protector. This is metadata used for the Azure portal experience. - :type kind: str + :vartype kind: str :ivar location: Resource location. :vartype location: str :ivar subregion: Subregion of the server key. @@ -8925,21 +9940,29 @@ class ServerKey(ProxyResource): 'ServiceManaged', 'AzureKeyVault'. Possible values include: 'ServiceManaged', 'AzureKeyVault' :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :param uri: The URI of the server key. + :param uri: The URI of the server key. If the ServerKeyType is + AzureKeyVault, then the URI is required. :type uri: str - :param thumbprint: Thumbprint of the server key. - :type thumbprint: str - :param creation_date: The server key creation date. - :type creation_date: datetime + :ivar thumbprint: Thumbprint of the server key. + :vartype thumbprint: str + :ivar creation_date: The server key creation date. + :vartype creation_date: datetime + :ivar auto_rotation_enabled: Key auto rotation opt-in flag. Either true or + false. + :vartype auto_rotation_enabled: bool """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'kind': {'readonly': True}, 'location': {'readonly': True}, 'subregion': {'readonly': True}, 'server_key_type': {'required': True}, + 'thumbprint': {'readonly': True}, + 'creation_date': {'readonly': True}, + 'auto_rotation_enabled': {'readonly': True}, } _attribute_map = { @@ -8953,17 +9976,116 @@ class ServerKey(ProxyResource): 'uri': {'key': 'properties.uri', 'type': 'str'}, 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + 'auto_rotation_enabled': {'key': 'properties.autoRotationEnabled', 'type': 'bool'}, + } + + def __init__(self, *, server_key_type, uri: str=None, **kwargs) -> None: + super(ServerKey, self).__init__(**kwargs) + self.kind = None + self.location = None + self.subregion = None + self.server_key_type = server_key_type + self.uri = uri + self.thumbprint = None + self.creation_date = None + self.auto_rotation_enabled = None + + +class ServerOperation(ProxyResource): + """A server operation. + + 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 operation: The name of operation. + :vartype operation: str + :ivar operation_friendly_name: The friendly name of operation. + :vartype operation_friendly_name: str + :ivar percent_complete: The percentage of the operation completed. + :vartype percent_complete: int + :ivar server_name: The name of the server. + :vartype server_name: str + :ivar start_time: The operation start time. + :vartype start_time: datetime + :ivar state: The operation state. Possible values include: 'Pending', + 'InProgress', 'Succeeded', 'Failed', 'CancelInProgress', 'Cancelled' + :vartype state: str or ~azure.mgmt.sql.models.ManagementOperationState + :ivar error_code: The operation error code. + :vartype error_code: int + :ivar error_description: The operation error description. + :vartype error_description: str + :ivar error_severity: The operation error severity. + :vartype error_severity: int + :ivar is_user_error: Whether or not the error is a user error. + :vartype is_user_error: bool + :ivar estimated_completion_time: The estimated completion time of the + operation. + :vartype estimated_completion_time: datetime + :ivar description: The operation description. + :vartype description: str + :ivar is_cancellable: Whether the operation can be cancelled. + :vartype is_cancellable: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'operation': {'readonly': True}, + 'operation_friendly_name': {'readonly': True}, + 'percent_complete': {'readonly': True}, + 'server_name': {'readonly': True}, + 'start_time': {'readonly': True}, + 'state': {'readonly': True}, + 'error_code': {'readonly': True}, + 'error_description': {'readonly': True}, + 'error_severity': {'readonly': True}, + 'is_user_error': {'readonly': True}, + 'estimated_completion_time': {'readonly': True}, + 'description': {'readonly': True}, + 'is_cancellable': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'operation': {'key': 'properties.operation', 'type': 'str'}, + 'operation_friendly_name': {'key': 'properties.operationFriendlyName', 'type': 'str'}, + 'percent_complete': {'key': 'properties.percentComplete', 'type': 'int'}, + 'server_name': {'key': 'properties.serverName', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'iso-8601'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + 'error_code': {'key': 'properties.errorCode', 'type': 'int'}, + 'error_description': {'key': 'properties.errorDescription', 'type': 'str'}, + 'error_severity': {'key': 'properties.errorSeverity', 'type': 'int'}, + 'is_user_error': {'key': 'properties.isUserError', 'type': 'bool'}, + 'estimated_completion_time': {'key': 'properties.estimatedCompletionTime', 'type': 'iso-8601'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'bool'}, } - def __init__(self, *, server_key_type, kind: str=None, uri: str=None, thumbprint: str=None, creation_date=None, **kwargs) -> None: - super(ServerKey, self).__init__(**kwargs) - self.kind = kind - self.location = None - self.subregion = None - self.server_key_type = server_key_type - self.uri = uri - self.thumbprint = thumbprint - self.creation_date = creation_date + def __init__(self, **kwargs) -> None: + super(ServerOperation, self).__init__(**kwargs) + self.operation = None + self.operation_friendly_name = None + self.percent_complete = None + self.server_name = None + self.start_time = None + self.state = None + self.error_code = None + self.error_description = None + self.error_severity = None + self.is_user_error = None + self.estimated_completion_time = None + self.description = None + self.is_cancellable = None class ServerPrivateEndpointConnection(Model): @@ -9009,13 +10131,15 @@ class ServerSecurityAlertPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :ivar system_data: SystemData of SecurityAlertPolicyResource. + :vartype system_data: ~azure.mgmt.sql.models.SystemData :param state: Required. Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on the specific - database. Possible values include: 'New', 'Enabled', 'Disabled' - :type state: str or ~azure.mgmt.sql.models.SecurityAlertPolicyState + database. Possible values include: 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.SecurityAlertsPolicyState :param disabled_alerts: Specifies an array of alerts that are disabled. Allowed values are: Sql_Injection, Sql_Injection_Vulnerability, - Access_Anomaly, Data_Exfiltration, Unsafe_Action + Access_Anomaly, Data_Exfiltration, Unsafe_Action, Brute_Force :type disabled_alerts: list[str] :param email_addresses: Specifies an array of e-mail addresses to which the alert is sent. @@ -9041,6 +10165,7 @@ class ServerSecurityAlertPolicy(ProxyResource): 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'system_data': {'readonly': True}, 'state': {'required': True}, 'creation_time': {'readonly': True}, } @@ -9049,7 +10174,8 @@ class ServerSecurityAlertPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'state': {'key': 'properties.state', 'type': 'SecurityAlertPolicyState'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'state': {'key': 'properties.state', 'type': 'SecurityAlertsPolicyState'}, 'disabled_alerts': {'key': 'properties.disabledAlerts', 'type': '[str]'}, 'email_addresses': {'key': 'properties.emailAddresses', 'type': '[str]'}, 'email_account_admins': {'key': 'properties.emailAccountAdmins', 'type': 'bool'}, @@ -9061,6 +10187,7 @@ class ServerSecurityAlertPolicy(ProxyResource): def __init__(self, *, state, disabled_alerts=None, email_addresses=None, email_account_admins: bool=None, storage_endpoint: str=None, storage_account_access_key: str=None, retention_days: int=None, **kwargs) -> None: super(ServerSecurityAlertPolicy, self).__init__(**kwargs) + self.system_data = None self.state = state self.disabled_alerts = disabled_alerts self.email_addresses = email_addresses @@ -9120,6 +10247,9 @@ class ServerUpdate(Model): Variables are only populated by the server, and will be ignored when sending a request. + :param identity: Server identity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities :param administrator_login: Administrator username for the server. Once created it cannot be changed. :type administrator_login: str @@ -9144,7 +10274,28 @@ class ServerUpdate(Model): allowed for this server. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or - ~azure.mgmt.sql.models.ServerPublicNetworkAccess + ~azure.mgmt.sql.models.ServerNetworkAccessFlag + :ivar workspace_feature: Whether or not existing server has a workspace + created and if it allows connection from workspace. Possible values + include: 'Connected', 'Disconnected' + :vartype workspace_feature: str or + ~azure.mgmt.sql.models.ServerWorkspaceFeature + :param primary_user_assigned_identity_id: The resource id of a user + assigned identity to be used by default. + :type primary_user_assigned_identity_id: str + :param federated_client_id: The Client id used for cross tenant CMK + scenario + :type federated_client_id: str + :param key_id: A CMK URI of the key to use for encryption. + :type key_id: str + :param administrators: The Azure Active Directory identity of the server. + :type administrators: ~azure.mgmt.sql.models.ServerExternalAdministrator + :param restrict_outbound_network_access: Whether or not to restrict + outbound network access for this server. Value is optional but if passed + in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', + 'Disabled' + :type restrict_outbound_network_access: str or + ~azure.mgmt.sql.models.ServerNetworkAccessFlag :param tags: Resource tags. :type tags: dict[str, str] """ @@ -9153,9 +10304,11 @@ class ServerUpdate(Model): 'state': {'readonly': True}, 'fully_qualified_domain_name': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, + 'workspace_feature': {'readonly': True}, } _attribute_map = { + 'identity': {'key': 'identity', 'type': 'ResourceIdentityWithUserAssignedIdentities'}, 'administrator_login': {'key': 'properties.administratorLogin', 'type': 'str'}, 'administrator_login_password': {'key': 'properties.administratorLoginPassword', 'type': 'str'}, 'version': {'key': 'properties.version', 'type': 'str'}, @@ -9164,11 +10317,18 @@ class ServerUpdate(Model): 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[ServerPrivateEndpointConnection]'}, 'minimal_tls_version': {'key': 'properties.minimalTlsVersion', 'type': 'str'}, 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'workspace_feature': {'key': 'properties.workspaceFeature', 'type': 'str'}, + 'primary_user_assigned_identity_id': {'key': 'properties.primaryUserAssignedIdentityId', 'type': 'str'}, + 'federated_client_id': {'key': 'properties.federatedClientId', 'type': 'str'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, + 'restrict_outbound_network_access': {'key': 'properties.restrictOutboundNetworkAccess', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, tags=None, **kwargs) -> None: + def __init__(self, *, identity=None, administrator_login: str=None, administrator_login_password: str=None, version: str=None, minimal_tls_version: str=None, public_network_access=None, primary_user_assigned_identity_id: str=None, federated_client_id: str=None, key_id: str=None, administrators=None, restrict_outbound_network_access=None, tags=None, **kwargs) -> None: super(ServerUpdate, self).__init__(**kwargs) + self.identity = identity self.administrator_login = administrator_login self.administrator_login_password = administrator_login_password self.version = version @@ -9177,63 +10337,15 @@ def __init__(self, *, administrator_login: str=None, administrator_login_passwor self.private_endpoint_connections = None self.minimal_tls_version = minimal_tls_version self.public_network_access = public_network_access + self.workspace_feature = None + self.primary_user_assigned_identity_id = primary_user_assigned_identity_id + self.federated_client_id = federated_client_id + self.key_id = key_id + self.administrators = administrators + self.restrict_outbound_network_access = restrict_outbound_network_access self.tags = tags -class ServerUsage(Model): - """Represents server metrics. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar name: Name of the server usage metric. - :vartype name: str - :ivar resource_name: The name of the resource. - :vartype resource_name: str - :ivar display_name: The metric display name. - :vartype display_name: str - :ivar current_value: The current value of the metric. - :vartype current_value: float - :ivar limit: The current limit of the metric. - :vartype limit: float - :ivar unit: The units of the metric. - :vartype unit: str - :ivar next_reset_time: The next reset time for the metric (ISO8601 - format). - :vartype next_reset_time: datetime - """ - - _validation = { - 'name': {'readonly': True}, - 'resource_name': {'readonly': True}, - 'display_name': {'readonly': True}, - 'current_value': {'readonly': True}, - 'limit': {'readonly': True}, - 'unit': {'readonly': True}, - 'next_reset_time': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'resource_name': {'key': 'resourceName', 'type': 'str'}, - 'display_name': {'key': 'displayName', 'type': 'str'}, - 'current_value': {'key': 'currentValue', 'type': 'float'}, - 'limit': {'key': 'limit', 'type': 'float'}, - 'unit': {'key': 'unit', 'type': 'str'}, - 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs) -> None: - super(ServerUsage, self).__init__(**kwargs) - self.name = None - self.resource_name = None - self.display_name = None - self.current_value = None - self.limit = None - self.unit = None - self.next_reset_time = None - - class ServerVersionCapability(Model): """The server capability. @@ -9299,9 +10411,9 @@ class ServerVulnerabilityAssessment(ProxyResource): https://myStorage.blob.core.windows.net/VaScans/). :type storage_container_path: str :param storage_container_sas_key: A shared access signature (SAS Key) that - has read and write access to the blob container specified in - 'storageContainerPath' parameter. If 'storageAccountAccessKey' isn't - specified, StorageContainerSasKey is required. + has write access to the blob container specified in 'storageContainerPath' + parameter. If 'storageAccountAccessKey' isn't specified, + StorageContainerSasKey is required. :type storage_container_sas_key: str :param storage_account_access_key: Specifies the identifier key of the storage account for vulnerability assessment scan results. If @@ -9338,63 +10450,6 @@ def __init__(self, *, storage_container_path: str, storage_container_sas_key: st self.recurring_scans = recurring_scans -class ServiceObjective(ProxyResource): - """Represents a database service objective. - - 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 service_objective_name: The name for the service objective. - :vartype service_objective_name: str - :ivar is_default: Gets whether the service level objective is the default - service objective. - :vartype is_default: bool - :ivar is_system: Gets whether the service level objective is a system - service objective. - :vartype is_system: bool - :ivar description: The description for the service level objective. - :vartype description: str - :ivar enabled: Gets whether the service level objective is enabled. - :vartype enabled: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'service_objective_name': {'readonly': True}, - 'is_default': {'readonly': True}, - 'is_system': {'readonly': True}, - 'description': {'readonly': True}, - 'enabled': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'service_objective_name': {'key': 'properties.serviceObjectiveName', 'type': 'str'}, - 'is_default': {'key': 'properties.isDefault', 'type': 'bool'}, - 'is_system': {'key': 'properties.isSystem', 'type': 'bool'}, - 'description': {'key': 'properties.description', 'type': 'str'}, - 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, - } - - def __init__(self, **kwargs) -> None: - super(ServiceObjective, self).__init__(**kwargs) - self.service_objective_name = None - self.is_default = None - self.is_system = None - self.description = None - self.enabled = None - - class ServiceObjectiveCapability(Model): """The service objectives capability. @@ -9492,151 +10547,6 @@ def __init__(self, *, reason: str=None, **kwargs) -> None: self.reason = reason -class ServiceTierAdvisor(ProxyResource): - """Represents a Service Tier Advisor. - - 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 observation_period_start: The observation period start (ISO8601 - format). - :vartype observation_period_start: datetime - :ivar observation_period_end: The observation period start (ISO8601 - format). - :vartype observation_period_end: datetime - :ivar active_time_ratio: The activeTimeRatio for service tier advisor. - :vartype active_time_ratio: float - :ivar min_dtu: Gets or sets minDtu for service tier advisor. - :vartype min_dtu: float - :ivar avg_dtu: Gets or sets avgDtu for service tier advisor. - :vartype avg_dtu: float - :ivar max_dtu: Gets or sets maxDtu for service tier advisor. - :vartype max_dtu: float - :ivar max_size_in_gb: Gets or sets maxSizeInGB for service tier advisor. - :vartype max_size_in_gb: float - :ivar service_level_objective_usage_metrics: Gets or sets - serviceLevelObjectiveUsageMetrics for the service tier advisor. - :vartype service_level_objective_usage_metrics: - list[~azure.mgmt.sql.models.SloUsageMetric] - :ivar current_service_level_objective: Gets or sets - currentServiceLevelObjective for service tier advisor. - :vartype current_service_level_objective: str - :ivar current_service_level_objective_id: Gets or sets - currentServiceLevelObjectiveId for service tier advisor. - :vartype current_service_level_objective_id: str - :ivar usage_based_recommendation_service_level_objective: Gets or sets - usageBasedRecommendationServiceLevelObjective for service tier advisor. - :vartype usage_based_recommendation_service_level_objective: str - :ivar usage_based_recommendation_service_level_objective_id: Gets or sets - usageBasedRecommendationServiceLevelObjectiveId for service tier advisor. - :vartype usage_based_recommendation_service_level_objective_id: str - :ivar database_size_based_recommendation_service_level_objective: Gets or - sets databaseSizeBasedRecommendationServiceLevelObjective for service tier - advisor. - :vartype database_size_based_recommendation_service_level_objective: str - :ivar database_size_based_recommendation_service_level_objective_id: Gets - or sets databaseSizeBasedRecommendationServiceLevelObjectiveId for service - tier advisor. - :vartype database_size_based_recommendation_service_level_objective_id: - str - :ivar disaster_plan_based_recommendation_service_level_objective: Gets or - sets disasterPlanBasedRecommendationServiceLevelObjective for service tier - advisor. - :vartype disaster_plan_based_recommendation_service_level_objective: str - :ivar disaster_plan_based_recommendation_service_level_objective_id: Gets - or sets disasterPlanBasedRecommendationServiceLevelObjectiveId for service - tier advisor. - :vartype disaster_plan_based_recommendation_service_level_objective_id: - str - :ivar overall_recommendation_service_level_objective: Gets or sets - overallRecommendationServiceLevelObjective for service tier advisor. - :vartype overall_recommendation_service_level_objective: str - :ivar overall_recommendation_service_level_objective_id: Gets or sets - overallRecommendationServiceLevelObjectiveId for service tier advisor. - :vartype overall_recommendation_service_level_objective_id: str - :ivar confidence: Gets or sets confidence for service tier advisor. - :vartype confidence: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'observation_period_start': {'readonly': True}, - 'observation_period_end': {'readonly': True}, - 'active_time_ratio': {'readonly': True}, - 'min_dtu': {'readonly': True}, - 'avg_dtu': {'readonly': True}, - 'max_dtu': {'readonly': True}, - 'max_size_in_gb': {'readonly': True}, - 'service_level_objective_usage_metrics': {'readonly': True}, - 'current_service_level_objective': {'readonly': True}, - 'current_service_level_objective_id': {'readonly': True}, - 'usage_based_recommendation_service_level_objective': {'readonly': True}, - 'usage_based_recommendation_service_level_objective_id': {'readonly': True}, - 'database_size_based_recommendation_service_level_objective': {'readonly': True}, - 'database_size_based_recommendation_service_level_objective_id': {'readonly': True}, - 'disaster_plan_based_recommendation_service_level_objective': {'readonly': True}, - 'disaster_plan_based_recommendation_service_level_objective_id': {'readonly': True}, - 'overall_recommendation_service_level_objective': {'readonly': True}, - 'overall_recommendation_service_level_objective_id': {'readonly': True}, - 'confidence': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'observation_period_start': {'key': 'properties.observationPeriodStart', 'type': 'iso-8601'}, - 'observation_period_end': {'key': 'properties.observationPeriodEnd', 'type': 'iso-8601'}, - 'active_time_ratio': {'key': 'properties.activeTimeRatio', 'type': 'float'}, - 'min_dtu': {'key': 'properties.minDtu', 'type': 'float'}, - 'avg_dtu': {'key': 'properties.avgDtu', 'type': 'float'}, - 'max_dtu': {'key': 'properties.maxDtu', 'type': 'float'}, - 'max_size_in_gb': {'key': 'properties.maxSizeInGB', 'type': 'float'}, - 'service_level_objective_usage_metrics': {'key': 'properties.serviceLevelObjectiveUsageMetrics', 'type': '[SloUsageMetric]'}, - 'current_service_level_objective': {'key': 'properties.currentServiceLevelObjective', 'type': 'str'}, - 'current_service_level_objective_id': {'key': 'properties.currentServiceLevelObjectiveId', 'type': 'str'}, - 'usage_based_recommendation_service_level_objective': {'key': 'properties.usageBasedRecommendationServiceLevelObjective', 'type': 'str'}, - 'usage_based_recommendation_service_level_objective_id': {'key': 'properties.usageBasedRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'database_size_based_recommendation_service_level_objective': {'key': 'properties.databaseSizeBasedRecommendationServiceLevelObjective', 'type': 'str'}, - 'database_size_based_recommendation_service_level_objective_id': {'key': 'properties.databaseSizeBasedRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'disaster_plan_based_recommendation_service_level_objective': {'key': 'properties.disasterPlanBasedRecommendationServiceLevelObjective', 'type': 'str'}, - 'disaster_plan_based_recommendation_service_level_objective_id': {'key': 'properties.disasterPlanBasedRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'overall_recommendation_service_level_objective': {'key': 'properties.overallRecommendationServiceLevelObjective', 'type': 'str'}, - 'overall_recommendation_service_level_objective_id': {'key': 'properties.overallRecommendationServiceLevelObjectiveId', 'type': 'str'}, - 'confidence': {'key': 'properties.confidence', 'type': 'float'}, - } - - def __init__(self, **kwargs) -> None: - super(ServiceTierAdvisor, self).__init__(**kwargs) - self.observation_period_start = None - self.observation_period_end = None - self.active_time_ratio = None - self.min_dtu = None - self.avg_dtu = None - self.max_dtu = None - self.max_size_in_gb = None - self.service_level_objective_usage_metrics = None - self.current_service_level_objective = None - self.current_service_level_objective_id = None - self.usage_based_recommendation_service_level_objective = None - self.usage_based_recommendation_service_level_objective_id = None - self.database_size_based_recommendation_service_level_objective = None - self.database_size_based_recommendation_service_level_objective_id = None - self.disaster_plan_based_recommendation_service_level_objective = None - self.disaster_plan_based_recommendation_service_level_objective_id = None - self.overall_recommendation_service_level_objective = None - self.overall_recommendation_service_level_objective_id = None - self.confidence = None - - class Sku(Model): """An ARM Resource SKU. @@ -9678,49 +10588,39 @@ def __init__(self, *, name: str, tier: str=None, size: str=None, family: str=Non self.capacity = capacity -class SloUsageMetric(Model): - """A Slo Usage Metric. +class SqlAgentConfiguration(ProxyResource): + """A recoverable managed database resource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar service_level_objective: The serviceLevelObjective for SLO usage - metric. Possible values include: 'System', 'System0', 'System1', - 'System2', 'System3', 'System4', 'System2L', 'System3L', 'System4L', - 'Free', 'Basic', 'S0', 'S1', 'S2', 'S3', 'S4', 'S6', 'S7', 'S9', 'S12', - 'P1', 'P2', 'P3', 'P4', 'P6', 'P11', 'P15', 'PRS1', 'PRS2', 'PRS4', - 'PRS6', 'DW100', 'DW200', 'DW300', 'DW400', 'DW500', 'DW600', 'DW1000', - 'DW1200', 'DW1000c', 'DW1500', 'DW1500c', 'DW2000', 'DW2000c', 'DW3000', - 'DW2500c', 'DW3000c', 'DW6000', 'DW5000c', 'DW6000c', 'DW7500c', - 'DW10000c', 'DW15000c', 'DW30000c', 'DS100', 'DS200', 'DS300', 'DS400', - 'DS500', 'DS600', 'DS1000', 'DS1200', 'DS1500', 'DS2000', 'ElasticPool' - :vartype service_level_objective: str or - ~azure.mgmt.sql.models.ServiceObjectiveName - :ivar service_level_objective_id: The serviceLevelObjectiveId for SLO - usage metric. - :vartype service_level_objective_id: str - :ivar in_range_time_ratio: Gets or sets inRangeTimeRatio for SLO usage - metric. - :vartype in_range_time_ratio: float + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: The state of Sql Agent. Possible values include: 'Enabled', + 'Disabled' + :type state: str or ~azure.mgmt.sql.models.enum """ _validation = { - 'service_level_objective': {'readonly': True}, - 'service_level_objective_id': {'readonly': True}, - 'in_range_time_ratio': {'readonly': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'service_level_objective': {'key': 'serviceLevelObjective', 'type': 'str'}, - 'service_level_objective_id': {'key': 'serviceLevelObjectiveId', 'type': 'str'}, - 'in_range_time_ratio': {'key': 'inRangeTimeRatio', 'type': 'float'}, + '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) -> None: - super(SloUsageMetric, self).__init__(**kwargs) - self.service_level_objective = None - self.service_level_objective_id = None - self.in_range_time_ratio = None + def __init__(self, *, state=None, **kwargs) -> None: + super(SqlAgentConfiguration, self).__init__(**kwargs) + self.state = state class StorageCapability(Model): @@ -10116,6 +11016,8 @@ class SyncGroup(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str + :param sku: The name and capacity of the SKU. + :type sku: ~azure.mgmt.sql.models.Sku :param interval: Sync interval of the sync group. :type interval: int :ivar last_sync_time: Last sync time of the sync group. @@ -10138,6 +11040,11 @@ class SyncGroup(ProxyResource): :vartype sync_state: str or ~azure.mgmt.sql.models.SyncGroupState :param schema: Sync schema of the sync group. :type schema: ~azure.mgmt.sql.models.SyncGroupSchema + :param enable_conflict_logging: If conflict logging is enabled. + :type enable_conflict_logging: bool + :param conflict_logging_retention_in_days: Conflict logging retention + period. + :type conflict_logging_retention_in_days: int :param use_private_link_connection: If use private link connection is enabled. :type use_private_link_connection: bool @@ -10159,6 +11066,7 @@ class SyncGroup(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, 'interval': {'key': 'properties.interval', 'type': 'int'}, 'last_sync_time': {'key': 'properties.lastSyncTime', 'type': 'iso-8601'}, 'conflict_resolution_policy': {'key': 'properties.conflictResolutionPolicy', 'type': 'str'}, @@ -10167,12 +11075,15 @@ class SyncGroup(ProxyResource): 'hub_database_password': {'key': 'properties.hubDatabasePassword', 'type': 'str'}, 'sync_state': {'key': 'properties.syncState', 'type': 'str'}, 'schema': {'key': 'properties.schema', 'type': 'SyncGroupSchema'}, + 'enable_conflict_logging': {'key': 'properties.enableConflictLogging', 'type': 'bool'}, + 'conflict_logging_retention_in_days': {'key': 'properties.conflictLoggingRetentionInDays', 'type': 'int'}, 'use_private_link_connection': {'key': 'properties.usePrivateLinkConnection', 'type': 'bool'}, 'private_endpoint_name': {'key': 'properties.privateEndpointName', 'type': 'str'}, } - def __init__(self, *, interval: int=None, conflict_resolution_policy=None, sync_database_id: str=None, hub_database_user_name: str=None, hub_database_password: str=None, schema=None, use_private_link_connection: bool=None, **kwargs) -> None: + def __init__(self, *, sku=None, interval: int=None, conflict_resolution_policy=None, sync_database_id: str=None, hub_database_user_name: str=None, hub_database_password: str=None, schema=None, enable_conflict_logging: bool=None, conflict_logging_retention_in_days: int=None, use_private_link_connection: bool=None, **kwargs) -> None: super(SyncGroup, self).__init__(**kwargs) + self.sku = sku self.interval = interval self.last_sync_time = None self.conflict_resolution_policy = conflict_resolution_policy @@ -10181,6 +11092,8 @@ def __init__(self, *, interval: int=None, conflict_resolution_policy=None, sync_ self.hub_database_password = hub_database_password self.sync_state = None self.schema = schema + self.enable_conflict_logging = enable_conflict_logging + self.conflict_logging_retention_in_days = conflict_logging_retention_in_days self.use_private_link_connection = use_private_link_connection self.private_endpoint_name = None @@ -10395,38 +11308,22 @@ def __init__(self, *, database_type=None, sync_agent_id: str=None, sql_server_da class SystemData(Model): """Metadata pertaining to creation and last modification of the resource. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar created_by: A string identifier for the identity that created the - resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource: - . Possible values include: 'User', - 'Application', 'ManagedIdentity', 'Key' - :vartype created_by_type: str or ~azure.mgmt.sql.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: datetime - :ivar last_modified_by: A string identifier for the identity that last - modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the - resource: . Possible values include: - 'User', 'Application', 'ManagedIdentity', 'Key' - :vartype last_modified_by_type: str or - ~azure.mgmt.sql.models.CreatedByType - :ivar last_modified_at: The timestamp of last modification (UTC). - :vartype last_modified_at: datetime - """ - - _validation = { - 'created_by': {'readonly': True}, - 'created_by_type': {'readonly': True}, - 'created_at': {'readonly': True}, - 'last_modified_by': {'readonly': True}, - 'last_modified_by_type': {'readonly': True}, - 'last_modified_at': {'readonly': True}, - } + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. + Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + :type created_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the + resource. Possible values include: 'User', 'Application', + 'ManagedIdentity', 'Key' + :type last_modified_by_type: str or ~azure.mgmt.sql.models.CreatedByType + :param last_modified_at: The timestamp of resource last modification (UTC) + :type last_modified_at: datetime + """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, @@ -10437,14 +11334,14 @@ class SystemData(Model): 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, } - def __init__(self, **kwargs) -> None: + def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: super(SystemData, self).__init__(**kwargs) - self.created_by = None - self.created_by_type = None - self.created_at = None - self.last_modified_by = None - self.last_modified_by_type = None - self.last_modified_at = None + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at class TdeCertificate(ProxyResource): @@ -10489,6 +11386,46 @@ def __init__(self, *, private_blob: str, cert_password: str=None, **kwargs) -> N self.cert_password = cert_password +class TimeZone(ProxyResource): + """Time Zone. + + 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 time_zone_id: The time zone id + :vartype time_zone_id: str + :ivar display_name: The time zone display name + :vartype display_name: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'time_zone_id': {'readonly': True}, + 'display_name': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'time_zone_id': {'key': 'properties.timeZoneId', 'type': 'str'}, + 'display_name': {'key': 'properties.displayName', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(TimeZone, self).__init__(**kwargs) + self.time_zone_id = None + self.display_name = None + + class TopQueries(Model): """TopQueries. @@ -10544,49 +11481,27 @@ def __init__(self, *, queries=None, **kwargs) -> None: self.queries = queries -class TransparentDataEncryption(ProxyResource): - """Represents a database transparent data encryption configuration. +class UpdateLongTermRetentionBackupParameters(Model): + """Contains the information necessary to perform long term retention backup + update operation. - 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 + :param requested_backup_storage_redundancy: The storage redundancy type of + the copied backup. Possible values include: 'Geo', 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy """ - _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': 'TransparentDataEncryptionStatus'}, + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, } - def __init__(self, *, status=None, **kwargs) -> None: - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = status + def __init__(self, *, requested_backup_storage_redundancy=None, **kwargs) -> None: + super(UpdateLongTermRetentionBackupParameters, self).__init__(**kwargs) + self.requested_backup_storage_redundancy = requested_backup_storage_redundancy -class TransparentDataEncryptionActivity(ProxyResource): - """Represents a database transparent data encryption Scan. +class UpdateManagedInstanceDnsServersOperation(ProxyResource): + """A recoverable managed database resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -10597,57 +11512,28 @@ class TransparentDataEncryptionActivity(ProxyResource): :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 + :ivar status: The status of the DNS refresh operation. Possible values + include: 'Succeeded', 'Failed' + :vartype status: str or ~azure.mgmt.sql.models.enum """ _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) -> None: - super(TransparentDataEncryptionActivity, self).__init__(**kwargs) - self.location = None + super(UpdateManagedInstanceDnsServersOperation, self).__init__(**kwargs) self.status = None - self.percent_complete = None - - -class UnlinkParameters(Model): - """Represents the parameters for Unlink Replication Link request. - - :param forced_termination: Determines whether link will be terminated in a - forced or a friendly way. - :type forced_termination: bool - """ - - _attribute_map = { - 'forced_termination': {'key': 'forcedTermination', 'type': 'bool'}, - } - - def __init__(self, *, forced_termination: bool=None, **kwargs) -> None: - super(UnlinkParameters, self).__init__(**kwargs) - self.forced_termination = forced_termination class UpsertManagedServerOperationParameters(Model): @@ -10756,6 +11642,34 @@ def __init__(self, **kwargs) -> None: self.requested_limit = None +class UserIdentity(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) -> None: + super(UserIdentity, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None + + class VirtualCluster(TrackedResource): """An Azure SQL virtual cluster. @@ -10781,6 +11695,9 @@ class VirtualCluster(TrackedResource): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_configuration_id: Specifies maintenance configuration + id to apply to this virtual cluster. + :type maintenance_configuration_id: str """ _validation = { @@ -10801,13 +11718,15 @@ class VirtualCluster(TrackedResource): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, family: str=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, family: str=None, maintenance_configuration_id: str=None, **kwargs) -> None: super(VirtualCluster, self).__init__(location=location, tags=tags, **kwargs) self.subnet_id = None self.family = family self.child_resources = None + self.maintenance_configuration_id = maintenance_configuration_id class VirtualClusterUpdate(Model): @@ -10823,6 +11742,9 @@ class VirtualClusterUpdate(Model): :type family: str :ivar child_resources: List of resources in this virtual cluster. :vartype child_resources: list[str] + :param maintenance_configuration_id: Specifies maintenance configuration + id to apply to this virtual cluster. + :type maintenance_configuration_id: str :param tags: Resource tags. :type tags: dict[str, str] """ @@ -10836,14 +11758,16 @@ class VirtualClusterUpdate(Model): 'subnet_id': {'key': 'properties.subnetId', 'type': 'str'}, 'family': {'key': 'properties.family', 'type': 'str'}, 'child_resources': {'key': 'properties.childResources', 'type': '[str]'}, + 'maintenance_configuration_id': {'key': 'properties.maintenanceConfigurationId', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, } - def __init__(self, *, family: str=None, tags=None, **kwargs) -> None: + def __init__(self, *, family: str=None, maintenance_configuration_id: str=None, tags=None, **kwargs) -> None: super(VirtualClusterUpdate, self).__init__(**kwargs) self.subnet_id = None self.family = family self.child_resources = None + self.maintenance_configuration_id = maintenance_configuration_id self.tags = tags @@ -10868,7 +11792,7 @@ class VirtualNetworkRule(ProxyResource): the virtual network has vnet service endpoint enabled. :type ignore_missing_vnet_service_endpoint: bool :ivar state: Virtual Network Rule State. Possible values include: - 'Initializing', 'InProgress', 'Ready', 'Deleting', 'Unknown' + 'Initializing', 'InProgress', 'Ready', 'Failed', 'Deleting', 'Unknown' :vartype state: str or ~azure.mgmt.sql.models.VirtualNetworkRuleState """ diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py index a6ba1f7d34b2..8be9499b26b9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_paged_models.py @@ -12,97 +12,110 @@ from msrest.paging import Paged -class RecoverableDatabasePaged(Paged): +class BackupShortTermRetentionPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`RecoverableDatabase ` object + A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RecoverableDatabase]'} + 'current_page': {'key': 'value', 'type': '[BackupShortTermRetentionPolicy]'} } def __init__(self, *args, **kwargs): - super(RecoverableDatabasePaged, self).__init__(*args, **kwargs) -class RestorableDroppedDatabasePaged(Paged): + super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class ExtendedDatabaseBlobAuditingPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`RestorableDroppedDatabase ` object + A paging container for iterating over a list of :class:`ExtendedDatabaseBlobAuditingPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RestorableDroppedDatabase]'} + 'current_page': {'key': 'value', 'type': '[ExtendedDatabaseBlobAuditingPolicy]'} } def __init__(self, *args, **kwargs): - super(RestorableDroppedDatabasePaged, self).__init__(*args, **kwargs) -class DataMaskingRulePaged(Paged): + super(ExtendedDatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class ExtendedServerBlobAuditingPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`DataMaskingRule ` object + A paging container for iterating over a list of :class:`ExtendedServerBlobAuditingPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[DataMaskingRule]'} + 'current_page': {'key': 'value', 'type': '[ExtendedServerBlobAuditingPolicy]'} } def __init__(self, *args, **kwargs): - super(DataMaskingRulePaged, self).__init__(*args, **kwargs) -class FirewallRulePaged(Paged): + super(ExtendedServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class ServerBlobAuditingPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`FirewallRule ` object + A paging container for iterating over a list of :class:`ServerBlobAuditingPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[FirewallRule]'} + 'current_page': {'key': 'value', 'type': '[ServerBlobAuditingPolicy]'} } def __init__(self, *args, **kwargs): - super(FirewallRulePaged, self).__init__(*args, **kwargs) -class GeoBackupPolicyPaged(Paged): + super(ServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class DatabaseBlobAuditingPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`DatabaseBlobAuditingPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DatabaseBlobAuditingPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(DatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class DatabaseColumnPaged(Paged): """ - A paging container for iterating over a list of :class:`GeoBackupPolicy ` object + A paging container for iterating over a list of :class:`DatabaseColumn ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[GeoBackupPolicy]'} + 'current_page': {'key': 'value', 'type': '[DatabaseColumn]'} } def __init__(self, *args, **kwargs): - super(GeoBackupPolicyPaged, self).__init__(*args, **kwargs) -class MetricPaged(Paged): + super(DatabaseColumnPaged, self).__init__(*args, **kwargs) +class ImportExportExtensionsOperationResultPaged(Paged): """ - A paging container for iterating over a list of :class:`Metric ` object + A paging container for iterating over a list of :class:`ImportExportExtensionsOperationResult ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Metric]'} + 'current_page': {'key': 'value', 'type': '[ImportExportExtensionsOperationResult]'} } def __init__(self, *args, **kwargs): - super(MetricPaged, self).__init__(*args, **kwargs) -class MetricDefinitionPaged(Paged): + super(ImportExportExtensionsOperationResultPaged, self).__init__(*args, **kwargs) +class DatabaseOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`MetricDefinition ` object + A paging container for iterating over a list of :class:`DatabaseOperation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[MetricDefinition]'} + 'current_page': {'key': 'value', 'type': '[DatabaseOperation]'} } def __init__(self, *args, **kwargs): - super(MetricDefinitionPaged, self).__init__(*args, **kwargs) + super(DatabaseOperationPaged, self).__init__(*args, **kwargs) class DatabasePaged(Paged): """ A paging container for iterating over a list of :class:`Database ` object @@ -116,526 +129,578 @@ class DatabasePaged(Paged): def __init__(self, *args, **kwargs): super(DatabasePaged, self).__init__(*args, **kwargs) -class ElasticPoolPaged(Paged): +class DatabaseSchemaPaged(Paged): """ - A paging container for iterating over a list of :class:`ElasticPool ` object + A paging container for iterating over a list of :class:`DatabaseSchema ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ElasticPool]'} + 'current_page': {'key': 'value', 'type': '[DatabaseSchema]'} } def __init__(self, *args, **kwargs): - super(ElasticPoolPaged, self).__init__(*args, **kwargs) -class RecommendedElasticPoolPaged(Paged): + super(DatabaseSchemaPaged, self).__init__(*args, **kwargs) +class DatabaseSecurityAlertPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`RecommendedElasticPool ` object + A paging container for iterating over a list of :class:`DatabaseSecurityAlertPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RecommendedElasticPool]'} + 'current_page': {'key': 'value', 'type': '[DatabaseSecurityAlertPolicy]'} } def __init__(self, *args, **kwargs): - super(RecommendedElasticPoolPaged, self).__init__(*args, **kwargs) -class RecommendedElasticPoolMetricPaged(Paged): + super(DatabaseSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class DatabaseTablePaged(Paged): """ - A paging container for iterating over a list of :class:`RecommendedElasticPoolMetric ` object + A paging container for iterating over a list of :class:`DatabaseTable ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RecommendedElasticPoolMetric]'} + 'current_page': {'key': 'value', 'type': '[DatabaseTable]'} } def __init__(self, *args, **kwargs): - super(RecommendedElasticPoolMetricPaged, self).__init__(*args, **kwargs) -class ReplicationLinkPaged(Paged): + super(DatabaseTablePaged, self).__init__(*args, **kwargs) +class DatabaseUsagePaged(Paged): """ - A paging container for iterating over a list of :class:`ReplicationLink ` object + A paging container for iterating over a list of :class:`DatabaseUsage ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ReplicationLink]'} + 'current_page': {'key': 'value', 'type': '[DatabaseUsage]'} } def __init__(self, *args, **kwargs): - super(ReplicationLinkPaged, self).__init__(*args, **kwargs) -class ServerCommunicationLinkPaged(Paged): + super(DatabaseUsagePaged, self).__init__(*args, **kwargs) +class DatabaseVulnerabilityAssessmentPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerCommunicationLink ` object + A paging container for iterating over a list of :class:`DatabaseVulnerabilityAssessment ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerCommunicationLink]'} + 'current_page': {'key': 'value', 'type': '[DatabaseVulnerabilityAssessment]'} } def __init__(self, *args, **kwargs): - super(ServerCommunicationLinkPaged, self).__init__(*args, **kwargs) -class ServiceObjectivePaged(Paged): + super(DatabaseVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) +class VulnerabilityAssessmentScanRecordPaged(Paged): """ - A paging container for iterating over a list of :class:`ServiceObjective ` object + A paging container for iterating over a list of :class:`VulnerabilityAssessmentScanRecord ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServiceObjective]'} + 'current_page': {'key': 'value', 'type': '[VulnerabilityAssessmentScanRecord]'} } def __init__(self, *args, **kwargs): - super(ServiceObjectivePaged, self).__init__(*args, **kwargs) -class ElasticPoolActivityPaged(Paged): + super(VulnerabilityAssessmentScanRecordPaged, self).__init__(*args, **kwargs) +class DataWarehouseUserActivitiesPaged(Paged): """ - A paging container for iterating over a list of :class:`ElasticPoolActivity ` object + A paging container for iterating over a list of :class:`DataWarehouseUserActivities ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ElasticPoolActivity]'} + 'current_page': {'key': 'value', 'type': '[DataWarehouseUserActivities]'} } def __init__(self, *args, **kwargs): - super(ElasticPoolActivityPaged, self).__init__(*args, **kwargs) -class ElasticPoolDatabaseActivityPaged(Paged): + super(DataWarehouseUserActivitiesPaged, self).__init__(*args, **kwargs) +class DeletedServerPaged(Paged): """ - A paging container for iterating over a list of :class:`ElasticPoolDatabaseActivity ` object + A paging container for iterating over a list of :class:`DeletedServer ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ElasticPoolDatabaseActivity]'} + 'current_page': {'key': 'value', 'type': '[DeletedServer]'} } def __init__(self, *args, **kwargs): - super(ElasticPoolDatabaseActivityPaged, self).__init__(*args, **kwargs) -class ServiceTierAdvisorPaged(Paged): + super(DeletedServerPaged, self).__init__(*args, **kwargs) +class ElasticPoolOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`ServiceTierAdvisor ` object + A paging container for iterating over a list of :class:`ElasticPoolOperation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServiceTierAdvisor]'} + 'current_page': {'key': 'value', 'type': '[ElasticPoolOperation]'} } def __init__(self, *args, **kwargs): - super(ServiceTierAdvisorPaged, self).__init__(*args, **kwargs) -class TransparentDataEncryptionActivityPaged(Paged): + super(ElasticPoolOperationPaged, self).__init__(*args, **kwargs) +class ElasticPoolPaged(Paged): """ - A paging container for iterating over a list of :class:`TransparentDataEncryptionActivity ` object + A paging container for iterating over a list of :class:`ElasticPool ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[TransparentDataEncryptionActivity]'} + 'current_page': {'key': 'value', 'type': '[ElasticPool]'} } def __init__(self, *args, **kwargs): - super(TransparentDataEncryptionActivityPaged, self).__init__(*args, **kwargs) -class ServerUsagePaged(Paged): + super(ElasticPoolPaged, self).__init__(*args, **kwargs) +class EncryptionProtectorPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerUsage ` object + A paging container for iterating over a list of :class:`EncryptionProtector ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerUsage]'} + 'current_page': {'key': 'value', 'type': '[EncryptionProtector]'} } def __init__(self, *args, **kwargs): - super(ServerUsagePaged, self).__init__(*args, **kwargs) -class DatabaseUsagePaged(Paged): + super(EncryptionProtectorPaged, self).__init__(*args, **kwargs) +class FailoverGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseUsage ` object + A paging container for iterating over a list of :class:`FailoverGroup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[DatabaseUsage]'} + 'current_page': {'key': 'value', 'type': '[FailoverGroup]'} } def __init__(self, *args, **kwargs): - super(DatabaseUsagePaged, self).__init__(*args, **kwargs) -class EncryptionProtectorPaged(Paged): + super(FailoverGroupPaged, self).__init__(*args, **kwargs) +class FirewallRulePaged(Paged): """ - A paging container for iterating over a list of :class:`EncryptionProtector ` object + A paging container for iterating over a list of :class:`FirewallRule ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[EncryptionProtector]'} + 'current_page': {'key': 'value', 'type': '[FirewallRule]'} } def __init__(self, *args, **kwargs): - super(EncryptionProtectorPaged, self).__init__(*args, **kwargs) -class FailoverGroupPaged(Paged): + super(FirewallRulePaged, self).__init__(*args, **kwargs) +class InstanceFailoverGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`FailoverGroup ` object + A paging container for iterating over a list of :class:`InstanceFailoverGroup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[FailoverGroup]'} + 'current_page': {'key': 'value', 'type': '[InstanceFailoverGroup]'} } def __init__(self, *args, **kwargs): - super(FailoverGroupPaged, self).__init__(*args, **kwargs) -class OperationPaged(Paged): + super(InstanceFailoverGroupPaged, self).__init__(*args, **kwargs) +class InstancePoolPaged(Paged): """ - A paging container for iterating over a list of :class:`Operation ` object + A paging container for iterating over a list of :class:`InstancePool ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Operation]'} + 'current_page': {'key': 'value', 'type': '[InstancePool]'} } def __init__(self, *args, **kwargs): - super(OperationPaged, self).__init__(*args, **kwargs) -class ServerKeyPaged(Paged): + super(InstancePoolPaged, self).__init__(*args, **kwargs) +class JobAgentPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerKey ` object + A paging container for iterating over a list of :class:`JobAgent ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerKey]'} + 'current_page': {'key': 'value', 'type': '[JobAgent]'} } def __init__(self, *args, **kwargs): - super(ServerKeyPaged, self).__init__(*args, **kwargs) -class SyncAgentPaged(Paged): + super(JobAgentPaged, self).__init__(*args, **kwargs) +class JobCredentialPaged(Paged): """ - A paging container for iterating over a list of :class:`SyncAgent ` object + A paging container for iterating over a list of :class:`JobCredential ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SyncAgent]'} + 'current_page': {'key': 'value', 'type': '[JobCredential]'} } def __init__(self, *args, **kwargs): - super(SyncAgentPaged, self).__init__(*args, **kwargs) -class SyncAgentLinkedDatabasePaged(Paged): + super(JobCredentialPaged, self).__init__(*args, **kwargs) +class JobExecutionPaged(Paged): """ - A paging container for iterating over a list of :class:`SyncAgentLinkedDatabase ` object + A paging container for iterating over a list of :class:`JobExecution ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SyncAgentLinkedDatabase]'} + 'current_page': {'key': 'value', 'type': '[JobExecution]'} } def __init__(self, *args, **kwargs): - super(SyncAgentLinkedDatabasePaged, self).__init__(*args, **kwargs) -class SubscriptionUsagePaged(Paged): + super(JobExecutionPaged, self).__init__(*args, **kwargs) +class JobPaged(Paged): """ - A paging container for iterating over a list of :class:`SubscriptionUsage ` object + A paging container for iterating over a list of :class:`Job ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SubscriptionUsage]'} + 'current_page': {'key': 'value', 'type': '[Job]'} } def __init__(self, *args, **kwargs): - super(SubscriptionUsagePaged, self).__init__(*args, **kwargs) -class VirtualClusterPaged(Paged): + super(JobPaged, self).__init__(*args, **kwargs) +class JobStepPaged(Paged): """ - A paging container for iterating over a list of :class:`VirtualCluster ` object + A paging container for iterating over a list of :class:`JobStep ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[VirtualCluster]'} + 'current_page': {'key': 'value', 'type': '[JobStep]'} } def __init__(self, *args, **kwargs): - super(VirtualClusterPaged, self).__init__(*args, **kwargs) -class VirtualNetworkRulePaged(Paged): + super(JobStepPaged, self).__init__(*args, **kwargs) +class JobTargetGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`VirtualNetworkRule ` object + A paging container for iterating over a list of :class:`JobTargetGroup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} + 'current_page': {'key': 'value', 'type': '[JobTargetGroup]'} } def __init__(self, *args, **kwargs): - super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) -class ExtendedDatabaseBlobAuditingPolicyPaged(Paged): + super(JobTargetGroupPaged, self).__init__(*args, **kwargs) +class JobVersionPaged(Paged): """ - A paging container for iterating over a list of :class:`ExtendedDatabaseBlobAuditingPolicy ` object + A paging container for iterating over a list of :class:`JobVersion ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ExtendedDatabaseBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[JobVersion]'} } def __init__(self, *args, **kwargs): - super(ExtendedDatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class ExtendedServerBlobAuditingPolicyPaged(Paged): + super(JobVersionPaged, self).__init__(*args, **kwargs) +class LedgerDigestUploadsPaged(Paged): """ - A paging container for iterating over a list of :class:`ExtendedServerBlobAuditingPolicy ` object + A paging container for iterating over a list of :class:`LedgerDigestUploads ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ExtendedServerBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[LedgerDigestUploads]'} } def __init__(self, *args, **kwargs): - super(ExtendedServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class ServerBlobAuditingPolicyPaged(Paged): + super(LedgerDigestUploadsPaged, self).__init__(*args, **kwargs) +class LongTermRetentionBackupPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerBlobAuditingPolicy ` object + A paging container for iterating over a list of :class:`LongTermRetentionBackup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[LongTermRetentionBackup]'} } def __init__(self, *args, **kwargs): - super(ServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class DatabaseBlobAuditingPolicyPaged(Paged): + super(LongTermRetentionBackupPaged, self).__init__(*args, **kwargs) +class ManagedInstanceLongTermRetentionBackupPaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseBlobAuditingPolicy ` object + A paging container for iterating over a list of :class:`ManagedInstanceLongTermRetentionBackup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[DatabaseBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceLongTermRetentionBackup]'} } def __init__(self, *args, **kwargs): - super(DatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class DatabaseVulnerabilityAssessmentPaged(Paged): + super(ManagedInstanceLongTermRetentionBackupPaged, self).__init__(*args, **kwargs) +class LongTermRetentionPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseVulnerabilityAssessment ` object + A paging container for iterating over a list of :class:`LongTermRetentionPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[DatabaseVulnerabilityAssessment]'} + 'current_page': {'key': 'value', 'type': '[LongTermRetentionPolicy]'} } def __init__(self, *args, **kwargs): - super(DatabaseVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) -class JobAgentPaged(Paged): + super(LongTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class ManagedBackupShortTermRetentionPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`JobAgent ` object + A paging container for iterating over a list of :class:`ManagedBackupShortTermRetentionPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobAgent]'} + 'current_page': {'key': 'value', 'type': '[ManagedBackupShortTermRetentionPolicy]'} } def __init__(self, *args, **kwargs): - super(JobAgentPaged, self).__init__(*args, **kwargs) -class JobCredentialPaged(Paged): + super(ManagedBackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class QueryStatisticsPaged(Paged): """ - A paging container for iterating over a list of :class:`JobCredential ` object + A paging container for iterating over a list of :class:`QueryStatistics ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobCredential]'} + 'current_page': {'key': 'value', 'type': '[QueryStatistics]'} } def __init__(self, *args, **kwargs): - super(JobCredentialPaged, self).__init__(*args, **kwargs) -class JobExecutionPaged(Paged): + super(QueryStatisticsPaged, self).__init__(*args, **kwargs) +class ManagedDatabasePaged(Paged): """ - A paging container for iterating over a list of :class:`JobExecution ` object + A paging container for iterating over a list of :class:`ManagedDatabase ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobExecution]'} + 'current_page': {'key': 'value', 'type': '[ManagedDatabase]'} } def __init__(self, *args, **kwargs): - super(JobExecutionPaged, self).__init__(*args, **kwargs) -class JobPaged(Paged): + super(ManagedDatabasePaged, self).__init__(*args, **kwargs) +class ManagedDatabaseSecurityAlertPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`Job ` object + A paging container for iterating over a list of :class:`ManagedDatabaseSecurityAlertPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Job]'} + 'current_page': {'key': 'value', 'type': '[ManagedDatabaseSecurityAlertPolicy]'} } def __init__(self, *args, **kwargs): - super(JobPaged, self).__init__(*args, **kwargs) -class JobStepPaged(Paged): + super(ManagedDatabaseSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class SecurityEventPaged(Paged): """ - A paging container for iterating over a list of :class:`JobStep ` object + A paging container for iterating over a list of :class:`SecurityEvent ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobStep]'} + 'current_page': {'key': 'value', 'type': '[SecurityEvent]'} } def __init__(self, *args, **kwargs): - super(JobStepPaged, self).__init__(*args, **kwargs) -class JobTargetGroupPaged(Paged): + super(SecurityEventPaged, self).__init__(*args, **kwargs) +class SensitivityLabelPaged(Paged): """ - A paging container for iterating over a list of :class:`JobTargetGroup ` object + A paging container for iterating over a list of :class:`SensitivityLabel ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobTargetGroup]'} + 'current_page': {'key': 'value', 'type': '[SensitivityLabel]'} } def __init__(self, *args, **kwargs): - super(JobTargetGroupPaged, self).__init__(*args, **kwargs) -class JobVersionPaged(Paged): + super(SensitivityLabelPaged, self).__init__(*args, **kwargs) +class ManagedTransparentDataEncryptionPaged(Paged): """ - A paging container for iterating over a list of :class:`JobVersion ` object + A paging container for iterating over a list of :class:`ManagedTransparentDataEncryption ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[JobVersion]'} + 'current_page': {'key': 'value', 'type': '[ManagedTransparentDataEncryption]'} } def __init__(self, *args, **kwargs): - super(JobVersionPaged, self).__init__(*args, **kwargs) -class LongTermRetentionBackupPaged(Paged): + super(ManagedTransparentDataEncryptionPaged, self).__init__(*args, **kwargs) +class ManagedInstanceAdministratorPaged(Paged): """ - A paging container for iterating over a list of :class:`LongTermRetentionBackup ` object + A paging container for iterating over a list of :class:`ManagedInstanceAdministrator ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedInstanceAdministrator]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstanceAdministratorPaged, self).__init__(*args, **kwargs) +class ManagedInstanceAzureADOnlyAuthenticationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedInstanceAzureADOnlyAuthentication ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedInstanceAzureADOnlyAuthentication]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstanceAzureADOnlyAuthenticationPaged, self).__init__(*args, **kwargs) +class ManagedInstanceEncryptionProtectorPaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedInstanceEncryptionProtector ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedInstanceEncryptionProtector]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstanceEncryptionProtectorPaged, self).__init__(*args, **kwargs) +class ManagedInstanceKeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedInstanceKey ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedInstanceKey]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstanceKeyPaged, self).__init__(*args, **kwargs) +class ManagedInstanceLongTermRetentionPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedInstanceLongTermRetentionPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[LongTermRetentionBackup]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceLongTermRetentionPolicy]'} } def __init__(self, *args, **kwargs): - super(LongTermRetentionBackupPaged, self).__init__(*args, **kwargs) -class ManagedBackupShortTermRetentionPolicyPaged(Paged): + super(ManagedInstanceLongTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class ManagedInstanceOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedBackupShortTermRetentionPolicy ` object + A paging container for iterating over a list of :class:`ManagedInstanceOperation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedBackupShortTermRetentionPolicy]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceOperation]'} } def __init__(self, *args, **kwargs): - super(ManagedBackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) -class ServerDnsAliasPaged(Paged): + super(ManagedInstanceOperationPaged, self).__init__(*args, **kwargs) +class ManagedInstancePrivateEndpointConnectionPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerDnsAlias ` object + A paging container for iterating over a list of :class:`ManagedInstancePrivateEndpointConnection ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerDnsAlias]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstancePrivateEndpointConnection]'} } def __init__(self, *args, **kwargs): - super(ServerDnsAliasPaged, self).__init__(*args, **kwargs) -class ServerSecurityAlertPolicyPaged(Paged): + super(ManagedInstancePrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class ManagedInstancePrivateLinkPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerSecurityAlertPolicy ` object + A paging container for iterating over a list of :class:`ManagedInstancePrivateLink ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerSecurityAlertPolicy]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstancePrivateLink]'} } def __init__(self, *args, **kwargs): - super(ServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) -class RestorableDroppedManagedDatabasePaged(Paged): + super(ManagedInstancePrivateLinkPaged, self).__init__(*args, **kwargs) +class ManagedInstancePaged(Paged): """ - A paging container for iterating over a list of :class:`RestorableDroppedManagedDatabase ` object + A paging container for iterating over a list of :class:`ManagedInstance ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RestorableDroppedManagedDatabase]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstance]'} } def __init__(self, *args, **kwargs): - super(RestorableDroppedManagedDatabasePaged, self).__init__(*args, **kwargs) -class RestorePointPaged(Paged): + super(ManagedInstancePaged, self).__init__(*args, **kwargs) +class TopQueriesPaged(Paged): """ - A paging container for iterating over a list of :class:`RestorePoint ` object + A paging container for iterating over a list of :class:`TopQueries ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RestorePoint]'} + 'current_page': {'key': 'value', 'type': '[TopQueries]'} } def __init__(self, *args, **kwargs): - super(RestorePointPaged, self).__init__(*args, **kwargs) -class ManagedDatabaseSecurityAlertPolicyPaged(Paged): + super(TopQueriesPaged, self).__init__(*args, **kwargs) +class ManagedInstanceVulnerabilityAssessmentPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedDatabaseSecurityAlertPolicy ` object + A paging container for iterating over a list of :class:`ManagedInstanceVulnerabilityAssessment ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedDatabaseSecurityAlertPolicy]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceVulnerabilityAssessment]'} } def __init__(self, *args, **kwargs): - super(ManagedDatabaseSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) + super(ManagedInstanceVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) class ManagedServerSecurityAlertPolicyPaged(Paged): """ A paging container for iterating over a list of :class:`ManagedServerSecurityAlertPolicy ` object @@ -649,214 +714,214 @@ class ManagedServerSecurityAlertPolicyPaged(Paged): def __init__(self, *args, **kwargs): super(ManagedServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) -class SensitivityLabelPaged(Paged): +class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`SensitivityLabel ` object + A paging container for iterating over a list of :class:`Operation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SensitivityLabel]'} + 'current_page': {'key': 'value', 'type': '[Operation]'} } def __init__(self, *args, **kwargs): - super(SensitivityLabelPaged, self).__init__(*args, **kwargs) -class ManagedInstanceAdministratorPaged(Paged): + super(OperationPaged, self).__init__(*args, **kwargs) +class OperationsHealthPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceAdministrator ` object + A paging container for iterating over a list of :class:`OperationsHealth ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceAdministrator]'} + 'current_page': {'key': 'value', 'type': '[OperationsHealth]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceAdministratorPaged, self).__init__(*args, **kwargs) -class DatabaseOperationPaged(Paged): + super(OperationsHealthPaged, self).__init__(*args, **kwargs) +class OutboundFirewallRulePaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseOperation ` object + A paging container for iterating over a list of :class:`OutboundFirewallRule ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[DatabaseOperation]'} + 'current_page': {'key': 'value', 'type': '[OutboundFirewallRule]'} } def __init__(self, *args, **kwargs): - super(DatabaseOperationPaged, self).__init__(*args, **kwargs) -class ElasticPoolOperationPaged(Paged): + super(OutboundFirewallRulePaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionPaged(Paged): """ - A paging container for iterating over a list of :class:`ElasticPoolOperation ` object + A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ElasticPoolOperation]'} + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} } def __init__(self, *args, **kwargs): - super(ElasticPoolOperationPaged, self).__init__(*args, **kwargs) -class VulnerabilityAssessmentScanRecordPaged(Paged): + super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class PrivateLinkResourcePaged(Paged): """ - A paging container for iterating over a list of :class:`VulnerabilityAssessmentScanRecord ` object + A paging container for iterating over a list of :class:`PrivateLinkResource ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[VulnerabilityAssessmentScanRecord]'} + 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} } def __init__(self, *args, **kwargs): - super(VulnerabilityAssessmentScanRecordPaged, self).__init__(*args, **kwargs) -class InstanceFailoverGroupPaged(Paged): + super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class RecoverableManagedDatabasePaged(Paged): """ - A paging container for iterating over a list of :class:`InstanceFailoverGroup ` object + A paging container for iterating over a list of :class:`RecoverableManagedDatabase ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[InstanceFailoverGroup]'} + 'current_page': {'key': 'value', 'type': '[RecoverableManagedDatabase]'} } def __init__(self, *args, **kwargs): - super(InstanceFailoverGroupPaged, self).__init__(*args, **kwargs) -class ManagedInstanceKeyPaged(Paged): + super(RecoverableManagedDatabasePaged, self).__init__(*args, **kwargs) +class ReplicationLinkPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceKey ` object + A paging container for iterating over a list of :class:`ReplicationLink ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceKey]'} + 'current_page': {'key': 'value', 'type': '[ReplicationLink]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceKeyPaged, self).__init__(*args, **kwargs) -class ManagedInstanceEncryptionProtectorPaged(Paged): + super(ReplicationLinkPaged, self).__init__(*args, **kwargs) +class RestorableDroppedDatabasePaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceEncryptionProtector ` object + A paging container for iterating over a list of :class:`RestorableDroppedDatabase ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceEncryptionProtector]'} + 'current_page': {'key': 'value', 'type': '[RestorableDroppedDatabase]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceEncryptionProtectorPaged, self).__init__(*args, **kwargs) -class RecoverableManagedDatabasePaged(Paged): + super(RestorableDroppedDatabasePaged, self).__init__(*args, **kwargs) +class RestorableDroppedManagedDatabasePaged(Paged): """ - A paging container for iterating over a list of :class:`RecoverableManagedDatabase ` object + A paging container for iterating over a list of :class:`RestorableDroppedManagedDatabase ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RecoverableManagedDatabase]'} + 'current_page': {'key': 'value', 'type': '[RestorableDroppedManagedDatabase]'} } def __init__(self, *args, **kwargs): - super(RecoverableManagedDatabasePaged, self).__init__(*args, **kwargs) -class BackupShortTermRetentionPolicyPaged(Paged): + super(RestorableDroppedManagedDatabasePaged, self).__init__(*args, **kwargs) +class RestorePointPaged(Paged): """ - A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy ` object + A paging container for iterating over a list of :class:`RestorePoint ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[BackupShortTermRetentionPolicy]'} + 'current_page': {'key': 'value', 'type': '[RestorePoint]'} } def __init__(self, *args, **kwargs): - super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) -class ManagedInstanceVulnerabilityAssessmentPaged(Paged): + super(RestorePointPaged, self).__init__(*args, **kwargs) +class ServerAzureADAdministratorPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceVulnerabilityAssessment ` object + A paging container for iterating over a list of :class:`ServerAzureADAdministrator ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceVulnerabilityAssessment]'} + 'current_page': {'key': 'value', 'type': '[ServerAzureADAdministrator]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) -class ServerVulnerabilityAssessmentPaged(Paged): + super(ServerAzureADAdministratorPaged, self).__init__(*args, **kwargs) +class ServerAzureADOnlyAuthenticationPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerVulnerabilityAssessment ` object + A paging container for iterating over a list of :class:`ServerAzureADOnlyAuthentication ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerVulnerabilityAssessment]'} + 'current_page': {'key': 'value', 'type': '[ServerAzureADOnlyAuthentication]'} } def __init__(self, *args, **kwargs): - super(ServerVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) -class InstancePoolPaged(Paged): + super(ServerAzureADOnlyAuthenticationPaged, self).__init__(*args, **kwargs) +class ServerDevOpsAuditingSettingsPaged(Paged): """ - A paging container for iterating over a list of :class:`InstancePool ` object + A paging container for iterating over a list of :class:`ServerDevOpsAuditingSettings ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[InstancePool]'} + 'current_page': {'key': 'value', 'type': '[ServerDevOpsAuditingSettings]'} } def __init__(self, *args, **kwargs): - super(InstancePoolPaged, self).__init__(*args, **kwargs) -class UsagePaged(Paged): + super(ServerDevOpsAuditingSettingsPaged, self).__init__(*args, **kwargs) +class ServerDnsAliasPaged(Paged): """ - A paging container for iterating over a list of :class:`Usage ` object + A paging container for iterating over a list of :class:`ServerDnsAlias ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[Usage]'} + 'current_page': {'key': 'value', 'type': '[ServerDnsAlias]'} } def __init__(self, *args, **kwargs): - super(UsagePaged, self).__init__(*args, **kwargs) -class PrivateEndpointConnectionPaged(Paged): + super(ServerDnsAliasPaged, self).__init__(*args, **kwargs) +class ServerKeyPaged(Paged): """ - A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object + A paging container for iterating over a list of :class:`ServerKey ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnection]'} + 'current_page': {'key': 'value', 'type': '[ServerKey]'} } def __init__(self, *args, **kwargs): - super(PrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) -class PrivateLinkResourcePaged(Paged): + super(ServerKeyPaged, self).__init__(*args, **kwargs) +class ServerOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`PrivateLinkResource ` object + A paging container for iterating over a list of :class:`ServerOperation ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[PrivateLinkResource]'} + 'current_page': {'key': 'value', 'type': '[ServerOperation]'} } def __init__(self, *args, **kwargs): - super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) + super(ServerOperationPaged, self).__init__(*args, **kwargs) class ServerPaged(Paged): """ A paging container for iterating over a list of :class:`Server ` object @@ -870,84 +935,84 @@ class ServerPaged(Paged): def __init__(self, *args, **kwargs): super(ServerPaged, self).__init__(*args, **kwargs) -class ManagedInstanceLongTermRetentionBackupPaged(Paged): +class ServerSecurityAlertPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceLongTermRetentionBackup ` object + A paging container for iterating over a list of :class:`ServerSecurityAlertPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceLongTermRetentionBackup]'} + 'current_page': {'key': 'value', 'type': '[ServerSecurityAlertPolicy]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceLongTermRetentionBackupPaged, self).__init__(*args, **kwargs) -class ManagedInstanceLongTermRetentionPolicyPaged(Paged): + super(ServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class ServerTrustGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceLongTermRetentionPolicy ` object + A paging container for iterating over a list of :class:`ServerTrustGroup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceLongTermRetentionPolicy]'} + 'current_page': {'key': 'value', 'type': '[ServerTrustGroup]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceLongTermRetentionPolicyPaged, self).__init__(*args, **kwargs) -class WorkloadGroupPaged(Paged): + super(ServerTrustGroupPaged, self).__init__(*args, **kwargs) +class ServerVulnerabilityAssessmentPaged(Paged): """ - A paging container for iterating over a list of :class:`WorkloadGroup ` object + A paging container for iterating over a list of :class:`ServerVulnerabilityAssessment ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[WorkloadGroup]'} + 'current_page': {'key': 'value', 'type': '[ServerVulnerabilityAssessment]'} } def __init__(self, *args, **kwargs): - super(WorkloadGroupPaged, self).__init__(*args, **kwargs) -class WorkloadClassifierPaged(Paged): + super(ServerVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) +class SubscriptionUsagePaged(Paged): """ - A paging container for iterating over a list of :class:`WorkloadClassifier ` object + A paging container for iterating over a list of :class:`SubscriptionUsage ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[WorkloadClassifier]'} + 'current_page': {'key': 'value', 'type': '[SubscriptionUsage]'} } def __init__(self, *args, **kwargs): - super(WorkloadClassifierPaged, self).__init__(*args, **kwargs) -class ManagedInstanceOperationPaged(Paged): + super(SubscriptionUsagePaged, self).__init__(*args, **kwargs) +class SyncAgentPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceOperation ` object + A paging container for iterating over a list of :class:`SyncAgent ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceOperation]'} + 'current_page': {'key': 'value', 'type': '[SyncAgent]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceOperationPaged, self).__init__(*args, **kwargs) -class ServerAzureADAdministratorPaged(Paged): + super(SyncAgentPaged, self).__init__(*args, **kwargs) +class SyncAgentLinkedDatabasePaged(Paged): """ - A paging container for iterating over a list of :class:`ServerAzureADAdministrator ` object + A paging container for iterating over a list of :class:`SyncAgentLinkedDatabase ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerAzureADAdministrator]'} + 'current_page': {'key': 'value', 'type': '[SyncAgentLinkedDatabase]'} } def __init__(self, *args, **kwargs): - super(ServerAzureADAdministratorPaged, self).__init__(*args, **kwargs) + super(SyncAgentLinkedDatabasePaged, self).__init__(*args, **kwargs) class SyncDatabaseIdPropertiesPaged(Paged): """ A paging container for iterating over a list of :class:`SyncDatabaseIdProperties ` object @@ -1013,94 +1078,94 @@ class SyncMemberPaged(Paged): def __init__(self, *args, **kwargs): super(SyncMemberPaged, self).__init__(*args, **kwargs) -class ManagedDatabasePaged(Paged): +class TimeZonePaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedDatabase ` object + A paging container for iterating over a list of :class:`TimeZone ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedDatabase]'} + 'current_page': {'key': 'value', 'type': '[TimeZone]'} } def __init__(self, *args, **kwargs): - super(ManagedDatabasePaged, self).__init__(*args, **kwargs) -class ServerAzureADOnlyAuthenticationPaged(Paged): + super(TimeZonePaged, self).__init__(*args, **kwargs) +class LogicalDatabaseTransparentDataEncryptionPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerAzureADOnlyAuthentication ` object + A paging container for iterating over a list of :class:`LogicalDatabaseTransparentDataEncryption ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerAzureADOnlyAuthentication]'} + 'current_page': {'key': 'value', 'type': '[LogicalDatabaseTransparentDataEncryption]'} } def __init__(self, *args, **kwargs): - super(ServerAzureADOnlyAuthenticationPaged, self).__init__(*args, **kwargs) -class ManagedInstancePaged(Paged): + super(LogicalDatabaseTransparentDataEncryptionPaged, self).__init__(*args, **kwargs) +class UsagePaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstance ` object + A paging container for iterating over a list of :class:`Usage ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstance]'} + 'current_page': {'key': 'value', 'type': '[Usage]'} } def __init__(self, *args, **kwargs): - super(ManagedInstancePaged, self).__init__(*args, **kwargs) -class TopQueriesPaged(Paged): + super(UsagePaged, self).__init__(*args, **kwargs) +class VirtualClusterPaged(Paged): """ - A paging container for iterating over a list of :class:`TopQueries ` object + A paging container for iterating over a list of :class:`VirtualCluster ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[TopQueries]'} + 'current_page': {'key': 'value', 'type': '[VirtualCluster]'} } def __init__(self, *args, **kwargs): - super(TopQueriesPaged, self).__init__(*args, **kwargs) -class ManagedInstanceAzureADOnlyAuthenticationPaged(Paged): + super(VirtualClusterPaged, self).__init__(*args, **kwargs) +class VirtualNetworkRulePaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceAzureADOnlyAuthentication ` object + A paging container for iterating over a list of :class:`VirtualNetworkRule ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstanceAzureADOnlyAuthentication]'} + 'current_page': {'key': 'value', 'type': '[VirtualNetworkRule]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceAzureADOnlyAuthenticationPaged, self).__init__(*args, **kwargs) -class ServerTrustGroupPaged(Paged): + super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) +class WorkloadClassifierPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerTrustGroup ` object + A paging container for iterating over a list of :class:`WorkloadClassifier ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerTrustGroup]'} + 'current_page': {'key': 'value', 'type': '[WorkloadClassifier]'} } def __init__(self, *args, **kwargs): - super(ServerTrustGroupPaged, self).__init__(*args, **kwargs) -class ServerDevOpsAuditingSettingsPaged(Paged): + super(WorkloadClassifierPaged, self).__init__(*args, **kwargs) +class WorkloadGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerDevOpsAuditingSettings ` object + A paging container for iterating over a list of :class:`WorkloadGroup ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerDevOpsAuditingSettings]'} + 'current_page': {'key': 'value', 'type': '[WorkloadGroup]'} } def __init__(self, *args, **kwargs): - super(ServerDevOpsAuditingSettingsPaged, self).__init__(*args, **kwargs) + super(WorkloadGroupPaged, self).__init__(*args, **kwargs) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py index 8a2099ecd7d5..274245b8ded7 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 @@ -12,257 +12,288 @@ from enum import Enum -class ServerConnectionType(str, Enum): +class BlobAuditingPolicyState(str, Enum): - default = "Default" - proxy = "Proxy" - redirect = "Redirect" + enabled = "Enabled" + disabled = "Disabled" -class SecurityAlertPolicyState(str, Enum): +class AdvisorStatus(str, Enum): - new = "New" - enabled = "Enabled" - disabled = "Disabled" + ga = "GA" + public_preview = "PublicPreview" + limited_public_preview = "LimitedPublicPreview" + private_preview = "PrivatePreview" -class SecurityAlertPolicyEmailAccountAdmins(str, Enum): +class AutoExecuteStatus(str, Enum): enabled = "Enabled" disabled = "Disabled" + default = "Default" -class SecurityAlertPolicyUseServerDefault(str, Enum): +class AutoExecuteStatusInheritedFrom(str, Enum): - enabled = "Enabled" - disabled = "Disabled" + default = "Default" + subscription = "Subscription" + server = "Server" + elastic_pool = "ElasticPool" + database = "Database" -class DataMaskingState(str, Enum): +class RecommendedActionCurrentState(str, Enum): - disabled = "Disabled" - enabled = "Enabled" + active = "Active" + pending = "Pending" + executing = "Executing" + verifying = "Verifying" + pending_revert = "PendingRevert" + revert_cancelled = "RevertCancelled" + reverting = "Reverting" + reverted = "Reverted" + ignored = "Ignored" + expired = "Expired" + monitoring = "Monitoring" + resolved = "Resolved" + success = "Success" + error = "Error" -class DataMaskingRuleState(str, Enum): +class RecommendedActionInitiatedBy(str, Enum): - disabled = "Disabled" - enabled = "Enabled" + user = "User" + system = "System" -class DataMaskingFunction(str, Enum): +class ImplementationMethod(str, Enum): - default = "Default" - ccn = "CCN" - email = "Email" - number = "Number" - ssn = "SSN" - text = "Text" + tsql = "TSql" + azure_power_shell = "AzurePowerShell" -class GeoBackupPolicyState(str, Enum): +class IsRetryable(str, Enum): - disabled = "Disabled" - enabled = "Enabled" + yes = "Yes" + no = "No" -class UnitType(str, Enum): +class AutomaticTuningMode(str, Enum): - count = "count" - bytes = "bytes" - seconds = "seconds" - percent = "percent" - count_per_second = "countPerSecond" - bytes_per_second = "bytesPerSecond" + inherit = "Inherit" + custom = "Custom" + auto = "Auto" + unspecified = "Unspecified" -class PrimaryAggregationType(str, Enum): +class AutomaticTuningOptionModeDesired(str, Enum): - none = "None" - average = "Average" - count = "Count" - minimum = "Minimum" - maximum = "Maximum" - total = "Total" + off = "Off" + on = "On" + default = "Default" -class UnitDefinitionType(str, Enum): +class AutomaticTuningOptionModeActual(str, Enum): - count = "Count" - bytes = "Bytes" - seconds = "Seconds" - percent = "Percent" - count_per_second = "CountPerSecond" - bytes_per_second = "BytesPerSecond" + off = "Off" + on = "On" + + +class AutomaticTuningDisabledReason(str, Enum): + default = "Default" + disabled = "Disabled" + auto_configured = "AutoConfigured" + inherited_from_server = "InheritedFromServer" + query_store_off = "QueryStoreOff" + query_store_read_only = "QueryStoreReadOnly" + not_supported = "NotSupported" -class ElasticPoolEdition(str, Enum): - basic = "Basic" - standard = "Standard" - premium = "Premium" - general_purpose = "GeneralPurpose" - business_critical = "BusinessCritical" +class ColumnDataType(str, Enum): + + image = "image" + text = "text" + uniqueidentifier = "uniqueidentifier" + date_enum = "date" + time = "time" + datetime2 = "datetime2" + datetimeoffset = "datetimeoffset" + tinyint = "tinyint" + smallint = "smallint" + int_enum = "int" + smalldatetime = "smalldatetime" + real = "real" + money = "money" + datetime_enum = "datetime" + float_enum = "float" + sql_variant = "sql_variant" + ntext = "ntext" + bit = "bit" + decimal_enum = "decimal" + numeric = "numeric" + smallmoney = "smallmoney" + bigint = "bigint" + hierarchyid = "hierarchyid" + geometry = "geometry" + geography = "geography" + varbinary = "varbinary" + varchar = "varchar" + binary = "binary" + char = "char" + timestamp = "timestamp" + nvarchar = "nvarchar" + nchar = "nchar" + xml = "xml" + sysname = "sysname" + + +class TableTemporalType(str, Enum): + + non_temporal_table = "NonTemporalTable" + history_table = "HistoryTable" + system_versioned_temporal_table = "SystemVersionedTemporalTable" -class ReplicationRole(str, Enum): +class StorageKeyType(str, Enum): - primary = "Primary" - secondary = "Secondary" - non_readable_secondary = "NonReadableSecondary" - source = "Source" + shared_access_key = "SharedAccessKey" + storage_access_key = "StorageAccessKey" + + +class ManagementOperationState(str, Enum): + + pending = "Pending" + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + cancel_in_progress = "CancelInProgress" + cancelled = "Cancelled" + + +class CreateMode(str, Enum): + + default = "Default" copy = "Copy" + secondary = "Secondary" + point_in_time_restore = "PointInTimeRestore" + restore = "Restore" + recovery = "Recovery" + restore_external_backup = "RestoreExternalBackup" + restore_external_backup_secondary = "RestoreExternalBackupSecondary" + restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" + online_secondary = "OnlineSecondary" -class ReplicationState(str, Enum): +class SampleName(str, Enum): - pending = "PENDING" - seeding = "SEEDING" - catch_up = "CATCH_UP" - suspended = "SUSPENDED" + adventure_works_lt = "AdventureWorksLT" + wide_world_importers_std = "WideWorldImportersStd" + wide_world_importers_full = "WideWorldImportersFull" -class RecommendedIndexAction(str, Enum): +class DatabaseStatus(str, Enum): - create = "Create" - drop = "Drop" - rebuild = "Rebuild" + online = "Online" + restoring = "Restoring" + recovery_pending = "RecoveryPending" + recovering = "Recovering" + suspect = "Suspect" + offline = "Offline" + standby = "Standby" + shutdown = "Shutdown" + emergency_mode = "EmergencyMode" + auto_closed = "AutoClosed" + copying = "Copying" + creating = "Creating" + inaccessible = "Inaccessible" + offline_secondary = "OfflineSecondary" + pausing = "Pausing" + paused = "Paused" + resuming = "Resuming" + scaling = "Scaling" + offline_changing_dw_performance_tiers = "OfflineChangingDwPerformanceTiers" + online_changing_dw_performance_tiers = "OnlineChangingDwPerformanceTiers" + disabled = "Disabled" -class RecommendedIndexState(str, Enum): +class CatalogCollationType(str, Enum): - active = "Active" - pending = "Pending" - executing = "Executing" - verifying = "Verifying" - pending_revert = "Pending Revert" - reverting = "Reverting" - reverted = "Reverted" - ignored = "Ignored" - expired = "Expired" - blocked = "Blocked" - success = "Success" + database_default = "DATABASE_DEFAULT" + sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" -class RecommendedIndexType(str, Enum): +class DatabaseLicenseType(str, Enum): - clustered = "CLUSTERED" - nonclustered = "NONCLUSTERED" - columnstore = "COLUMNSTORE" - clusteredcolumnstore = "CLUSTERED COLUMNSTORE" + license_included = "LicenseIncluded" + base_price = "BasePrice" -class TransparentDataEncryptionStatus(str, Enum): +class DatabaseReadScale(str, Enum): enabled = "Enabled" disabled = "Disabled" -class ServiceObjectiveName(str, Enum): +class SecondaryType(str, Enum): - system = "System" - system0 = "System0" - system1 = "System1" - system2 = "System2" - system3 = "System3" - system4 = "System4" - system2_l = "System2L" - system3_l = "System3L" - system4_l = "System4L" - free = "Free" - basic = "Basic" - s0 = "S0" - s1 = "S1" - s2 = "S2" - s3 = "S3" - s4 = "S4" - s6 = "S6" - s7 = "S7" - s9 = "S9" - s12 = "S12" - p1 = "P1" - p2 = "P2" - p3 = "P3" - p4 = "P4" - p6 = "P6" - p11 = "P11" - p15 = "P15" - prs1 = "PRS1" - prs2 = "PRS2" - prs4 = "PRS4" - prs6 = "PRS6" - dw100 = "DW100" - dw200 = "DW200" - dw300 = "DW300" - dw400 = "DW400" - dw500 = "DW500" - dw600 = "DW600" - dw1000 = "DW1000" - dw1200 = "DW1200" - dw1000c = "DW1000c" - dw1500 = "DW1500" - dw1500c = "DW1500c" - dw2000 = "DW2000" - dw2000c = "DW2000c" - dw3000 = "DW3000" - dw2500c = "DW2500c" - dw3000c = "DW3000c" - dw6000 = "DW6000" - dw5000c = "DW5000c" - dw6000c = "DW6000c" - dw7500c = "DW7500c" - dw10000c = "DW10000c" - dw15000c = "DW15000c" - dw30000c = "DW30000c" - ds100 = "DS100" - ds200 = "DS200" - ds300 = "DS300" - ds400 = "DS400" - ds500 = "DS500" - ds600 = "DS600" - ds1000 = "DS1000" - ds1200 = "DS1200" - ds1500 = "DS1500" - ds2000 = "DS2000" - elastic_pool = "ElasticPool" + geo = "Geo" + named = "Named" -class TransparentDataEncryptionActivityStatus(str, Enum): +class CurrentBackupStorageRedundancy(str, Enum): - encrypting = "Encrypting" - decrypting = "Decrypting" + geo = "Geo" + local = "Local" + zone = "Zone" -class AutomaticTuningMode(str, Enum): +class RequestedBackupStorageRedundancy(str, Enum): - inherit = "Inherit" - custom = "Custom" - auto = "Auto" - unspecified = "Unspecified" + geo = "Geo" + local = "Local" + zone = "Zone" -class AutomaticTuningOptionModeDesired(str, Enum): +class SecurityAlertsPolicyState(str, Enum): - off = "Off" - on = "On" - default = "Default" + enabled = "Enabled" + disabled = "Disabled" -class AutomaticTuningOptionModeActual(str, Enum): +class CreatedByType(str, Enum): - off = "Off" - on = "On" + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" -class AutomaticTuningDisabledReason(str, Enum): +class VulnerabilityAssessmentScanTriggerType(str, Enum): - default = "Default" + on_demand = "OnDemand" + recurring = "Recurring" + + +class VulnerabilityAssessmentScanState(str, Enum): + + passed = "Passed" + failed = "Failed" + failed_to_run = "FailedToRun" + in_progress = "InProgress" + + +class ElasticPoolState(str, Enum): + + creating = "Creating" + ready = "Ready" disabled = "Disabled" - auto_configured = "AutoConfigured" - inherited_from_server = "InheritedFromServer" - query_store_off = "QueryStoreOff" - query_store_read_only = "QueryStoreReadOnly" - not_supported = "NotSupported" + + +class ElasticPoolLicenseType(str, Enum): + + license_included = "LicenseIncluded" + base_price = "BasePrice" class ServerKeyType(str, Enum): @@ -289,38 +320,16 @@ class FailoverGroupReplicationRole(str, Enum): secondary = "Secondary" -class OperationOrigin(str, Enum): - - user = "user" - system = "system" - - -class SyncAgentState(str, Enum): - - online = "Online" - offline = "Offline" - never_connected = "NeverConnected" - - -class SyncMemberDbType(str, Enum): - - azure_sql_database = "AzureSqlDatabase" - sql_server_database = "SqlServerDatabase" - - -class VirtualNetworkRuleState(str, Enum): +class InstanceFailoverGroupReplicationRole(str, Enum): - initializing = "Initializing" - in_progress = "InProgress" - ready = "Ready" - deleting = "Deleting" - unknown = "Unknown" + primary = "Primary" + secondary = "Secondary" -class BlobAuditingPolicyState(str, Enum): +class InstancePoolLicenseType(str, Enum): - enabled = "Enabled" - disabled = "Disabled" + license_included = "LicenseIncluded" + base_price = "BasePrice" class JobAgentState(str, Enum): @@ -391,362 +400,338 @@ class JobTargetGroupMembershipType(str, Enum): exclude = "Exclude" -class AutomaticTuningServerMode(str, Enum): +class LedgerDigestUploadsState(str, Enum): - custom = "Custom" - auto = "Auto" - unspecified = "Unspecified" + enabled = "Enabled" + disabled = "Disabled" -class AutomaticTuningServerReason(str, Enum): +class MaxSizeUnit(str, Enum): - default = "Default" - disabled = "Disabled" - auto_configured = "AutoConfigured" + megabytes = "Megabytes" + gigabytes = "Gigabytes" + terabytes = "Terabytes" + petabytes = "Petabytes" -class RestorePointType(str, Enum): +class LogSizeUnit(str, Enum): - continuous = "CONTINUOUS" - discrete = "DISCRETE" + megabytes = "Megabytes" + gigabytes = "Gigabytes" + terabytes = "Terabytes" + petabytes = "Petabytes" + percent = "Percent" -class SensitivityLabelRank(str, Enum): +class CapabilityStatus(str, Enum): - none = "None" - low = "Low" - medium = "Medium" - high = "High" - critical = "Critical" + visible = "Visible" + available = "Available" + default = "Default" + disabled = "Disabled" -class ManagementOperationState(str, Enum): +class PerformanceLevelUnit(str, Enum): - pending = "Pending" - in_progress = "InProgress" - succeeded = "Succeeded" - failed = "Failed" - cancel_in_progress = "CancelInProgress" - cancelled = "Cancelled" + dtu = "DTU" + vcores = "VCores" -class VulnerabilityAssessmentScanTriggerType(str, Enum): +class PauseDelayTimeUnit(str, Enum): - on_demand = "OnDemand" - recurring = "Recurring" + minutes = "Minutes" -class VulnerabilityAssessmentScanState(str, Enum): +class TargetBackupStorageRedundancy(str, Enum): - passed = "Passed" - failed = "Failed" - failed_to_run = "FailedToRun" - in_progress = "InProgress" + geo = "Geo" + local = "Local" + zone = "Zone" -class InstanceFailoverGroupReplicationRole(str, Enum): +class BackupStorageRedundancy(str, Enum): - primary = "Primary" - secondary = "Secondary" + geo = "Geo" + local = "Local" + zone = "Zone" -class InstancePoolLicenseType(str, Enum): +class DayOfWeek(str, Enum): - license_included = "LicenseIncluded" - base_price = "BasePrice" + sunday = "Sunday" + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" -class PrivateLinkServiceConnectionStateStatus(str, Enum): +class QueryTimeGrainType(str, Enum): - approved = "Approved" - pending = "Pending" - rejected = "Rejected" - disconnected = "Disconnected" + pt1_h = "PT1H" + p1_d = "P1D" -class PrivateLinkServiceConnectionStateActionsRequire(str, Enum): +class QueryMetricUnitType(str, Enum): - none = "None" + percentage = "percentage" + kb = "KB" + microseconds = "microseconds" + count = "count" -class PrivateEndpointProvisioningState(str, Enum): +class ManagedDatabaseStatus(str, Enum): - approving = "Approving" - ready = "Ready" - dropping = "Dropping" - failed = "Failed" - rejecting = "Rejecting" + online = "Online" + offline = "Offline" + shutdown = "Shutdown" + creating = "Creating" + inaccessible = "Inaccessible" + restoring = "Restoring" + updating = "Updating" -class IdentityType(str, Enum): +class ManagedDatabaseCreateMode(str, Enum): - none = "None" - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" + default = "Default" + restore_external_backup = "RestoreExternalBackup" + point_in_time_restore = "PointInTimeRestore" + recovery = "Recovery" + restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" -class ServerPublicNetworkAccess(str, Enum): +class SecurityAlertPolicyState(str, Enum): + new = "New" enabled = "Enabled" disabled = "Disabled" -class CheckNameAvailabilityReason(str, Enum): +class SecurityEventType(str, Enum): - invalid = "Invalid" - already_exists = "AlreadyExists" + undefined = "Undefined" + sql_injection_vulnerability = "SqlInjectionVulnerability" + sql_injection_exploit = "SqlInjectionExploit" -class MaxSizeUnit(str, Enum): +class SensitivityLabelRank(str, Enum): - megabytes = "Megabytes" - gigabytes = "Gigabytes" - terabytes = "Terabytes" - petabytes = "Petabytes" + none = "None" + low = "Low" + medium = "Medium" + high = "High" + critical = "Critical" -class LogSizeUnit(str, Enum): +class SensitivityLabelUpdateKind(str, Enum): - megabytes = "Megabytes" - gigabytes = "Gigabytes" - terabytes = "Terabytes" - petabytes = "Petabytes" - percent = "Percent" + set = "set" + remove = "remove" -class CapabilityStatus(str, Enum): +class RecommendedSensitivityLabelUpdateKind(str, Enum): - visible = "Visible" - available = "Available" - default = "Default" - disabled = "Disabled" + enable = "enable" + disable = "disable" -class PerformanceLevelUnit(str, Enum): +class TransparentDataEncryptionState(str, Enum): - dtu = "DTU" - vcores = "VCores" + enabled = "Enabled" + disabled = "Disabled" -class PauseDelayTimeUnit(str, Enum): +class IdentityType(str, Enum): - minutes = "Minutes" + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" -class SyncGroupLogType(str, Enum): +class ManagedServerCreateMode(str, Enum): - all = "All" - error = "Error" - warning = "Warning" - success = "Success" + default = "Default" + point_in_time_restore = "PointInTimeRestore" -class SyncConflictResolutionPolicy(str, Enum): +class ManagedInstanceLicenseType(str, Enum): - hub_win = "HubWin" - member_win = "MemberWin" + license_included = "LicenseIncluded" + base_price = "BasePrice" -class SyncGroupState(str, Enum): +class ManagedInstanceProxyOverride(str, Enum): - not_ready = "NotReady" - error = "Error" - warning = "Warning" - progressing = "Progressing" - good = "Good" + proxy = "Proxy" + redirect = "Redirect" + default = "Default" -class SyncDirection(str, Enum): +class StorageAccountType(str, Enum): - bidirectional = "Bidirectional" - one_way_member_to_hub = "OneWayMemberToHub" - one_way_hub_to_member = "OneWayHubToMember" + grs = "GRS" + lrs = "LRS" + zrs = "ZRS" -class SyncMemberState(str, Enum): +class AdministratorType(str, Enum): - sync_in_progress = "SyncInProgress" - sync_succeeded = "SyncSucceeded" - sync_failed = "SyncFailed" - disabled_tombstone_cleanup = "DisabledTombstoneCleanup" - disabled_backup_restore = "DisabledBackupRestore" - sync_succeeded_with_warnings = "SyncSucceededWithWarnings" - sync_cancelling = "SyncCancelling" - sync_cancelled = "SyncCancelled" - un_provisioned = "UnProvisioned" - provisioning = "Provisioning" - provisioned = "Provisioned" - provision_failed = "ProvisionFailed" - de_provisioning = "DeProvisioning" - de_provisioned = "DeProvisioned" - de_provision_failed = "DeProvisionFailed" - reprovisioning = "Reprovisioning" - reprovision_failed = "ReprovisionFailed" - un_reprovisioned = "UnReprovisioned" + active_directory = "ActiveDirectory" -class ManagedDatabaseStatus(str, Enum): +class PrincipalType(str, Enum): - online = "Online" - offline = "Offline" - shutdown = "Shutdown" - creating = "Creating" - inaccessible = "Inaccessible" - restoring = "Restoring" - updating = "Updating" + user = "User" + group = "Group" + application = "Application" -class CatalogCollationType(str, Enum): +class OperationOrigin(str, Enum): - database_default = "DATABASE_DEFAULT" - sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" + user = "user" + system = "system" -class ManagedDatabaseCreateMode(str, Enum): +class PrivateLinkServiceConnectionStateStatus(str, Enum): - default = "Default" - restore_external_backup = "RestoreExternalBackup" - point_in_time_restore = "PointInTimeRestore" - recovery = "Recovery" - restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" + approved = "Approved" + pending = "Pending" + rejected = "Rejected" + disconnected = "Disconnected" -class ManagedServerCreateMode(str, Enum): +class PrivateLinkServiceConnectionStateActionsRequire(str, Enum): - default = "Default" - point_in_time_restore = "PointInTimeRestore" + none = "None" -class ManagedInstanceLicenseType(str, Enum): +class PrivateEndpointProvisioningState(str, Enum): - license_included = "LicenseIncluded" - base_price = "BasePrice" + approving = "Approving" + ready = "Ready" + dropping = "Dropping" + failed = "Failed" + rejecting = "Rejecting" -class ManagedInstanceProxyOverride(str, Enum): +class RestorePointType(str, Enum): - proxy = "Proxy" - redirect = "Redirect" - default = "Default" + continuous = "CONTINUOUS" + discrete = "DISCRETE" -class StorageAccountType(str, Enum): +class AutomaticTuningServerMode(str, Enum): - grs = "GRS" - lrs = "LRS" - zrs = "ZRS" + custom = "Custom" + auto = "Auto" + unspecified = "Unspecified" -class QueryTimeGrainType(str, Enum): +class AutomaticTuningServerReason(str, Enum): - pt1_h = "PT1H" - p1_d = "P1D" + default = "Default" + disabled = "Disabled" + auto_configured = "AutoConfigured" -class QueryMetricUnitType(str, Enum): +class ServerNetworkAccessFlag(str, Enum): - percentage = "percentage" - kb = "KB" - microseconds = "microseconds" - count = "count" + enabled = "Enabled" + disabled = "Disabled" -class CreateMode(str, Enum): +class ServerWorkspaceFeature(str, Enum): - default = "Default" - copy = "Copy" - secondary = "Secondary" - point_in_time_restore = "PointInTimeRestore" - restore = "Restore" - recovery = "Recovery" - restore_external_backup = "RestoreExternalBackup" - restore_external_backup_secondary = "RestoreExternalBackupSecondary" - restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" - online_secondary = "OnlineSecondary" + connected = "Connected" + disconnected = "Disconnected" -class SampleName(str, Enum): +class CheckNameAvailabilityReason(str, Enum): - adventure_works_lt = "AdventureWorksLT" - wide_world_importers_std = "WideWorldImportersStd" - wide_world_importers_full = "WideWorldImportersFull" + invalid = "Invalid" + already_exists = "AlreadyExists" -class DatabaseStatus(str, Enum): +class SyncAgentState(str, Enum): online = "Online" - restoring = "Restoring" - recovery_pending = "RecoveryPending" - recovering = "Recovering" - suspect = "Suspect" offline = "Offline" - standby = "Standby" - shutdown = "Shutdown" - emergency_mode = "EmergencyMode" - auto_closed = "AutoClosed" - copying = "Copying" - creating = "Creating" - inaccessible = "Inaccessible" - offline_secondary = "OfflineSecondary" - pausing = "Pausing" - paused = "Paused" - resuming = "Resuming" - scaling = "Scaling" - offline_changing_dw_performance_tiers = "OfflineChangingDwPerformanceTiers" - online_changing_dw_performance_tiers = "OnlineChangingDwPerformanceTiers" - disabled = "Disabled" + never_connected = "NeverConnected" -class DatabaseLicenseType(str, Enum): +class SyncMemberDbType(str, Enum): - license_included = "LicenseIncluded" - base_price = "BasePrice" + azure_sql_database = "AzureSqlDatabase" + sql_server_database = "SqlServerDatabase" -class DatabaseReadScale(str, Enum): +class SyncGroupLogType(str, Enum): - enabled = "Enabled" - disabled = "Disabled" + all = "All" + error = "Error" + warning = "Warning" + success = "Success" -class SecondaryType(str, Enum): +class SyncConflictResolutionPolicy(str, Enum): - geo = "Geo" - named = "Named" + hub_win = "HubWin" + member_win = "MemberWin" -class StorageKeyType(str, Enum): +class SyncGroupState(str, Enum): - shared_access_key = "SharedAccessKey" - storage_access_key = "StorageAccessKey" + not_ready = "NotReady" + error = "Error" + warning = "Warning" + progressing = "Progressing" + good = "Good" -class ElasticPoolState(str, Enum): +class SyncDirection(str, Enum): - creating = "Creating" - ready = "Ready" - disabled = "Disabled" + bidirectional = "Bidirectional" + one_way_member_to_hub = "OneWayMemberToHub" + one_way_hub_to_member = "OneWayHubToMember" -class ElasticPoolLicenseType(str, Enum): +class SyncMemberState(str, Enum): - license_included = "LicenseIncluded" - base_price = "BasePrice" + sync_in_progress = "SyncInProgress" + sync_succeeded = "SyncSucceeded" + sync_failed = "SyncFailed" + disabled_tombstone_cleanup = "DisabledTombstoneCleanup" + disabled_backup_restore = "DisabledBackupRestore" + sync_succeeded_with_warnings = "SyncSucceededWithWarnings" + sync_cancelling = "SyncCancelling" + sync_cancelled = "SyncCancelled" + un_provisioned = "UnProvisioned" + provisioning = "Provisioning" + provisioned = "Provisioned" + provision_failed = "ProvisionFailed" + de_provisioning = "DeProvisioning" + de_provisioned = "DeProvisioned" + de_provision_failed = "DeProvisionFailed" + reprovisioning = "Reprovisioning" + reprovision_failed = "ReprovisionFailed" + un_reprovisioned = "UnReprovisioned" -class CreatedByType(str, Enum): +class VirtualNetworkRuleState(str, Enum): - user = "User" - application = "Application" - managed_identity = "ManagedIdentity" - key = "Key" + initializing = "Initializing" + in_progress = "InProgress" + ready = "Ready" + failed = "Failed" + deleting = "Deleting" + unknown = "Unknown" -class LongTermRetentionDatabaseState(str, Enum): +class ReplicaType(str, Enum): - all = "All" - live = "Live" - deleted = "Deleted" + primary = "Primary" + readable_secondary = "ReadableSecondary" class VulnerabilityAssessmentPolicyBaselineName(str, Enum): @@ -755,12 +740,6 @@ class VulnerabilityAssessmentPolicyBaselineName(str, Enum): default = "default" -class SensitivityLabelSource(str, Enum): - - current = "current" - recommended = "recommended" - - class CapabilityGroup(str, Enum): supported_editions = "supportedEditions" @@ -770,46 +749,17 @@ class CapabilityGroup(str, Enum): supported_managed_instance_editions = "supportedManagedInstanceEditions" -class DatabaseState1(str, Enum): - - all = "All" - live = "Live" - deleted = "Deleted" - - -class DatabaseState2(str, Enum): - - all = "All" - live = "Live" - deleted = "Deleted" - - -class DatabaseState3(str, Enum): +class DatabaseState(str, Enum): all = "All" live = "Live" deleted = "Deleted" -class DatabaseState4(str, Enum): - - all = "All" - live = "Live" - deleted = "Deleted" - - -class DatabaseState5(str, Enum): - - all = "All" - live = "Live" - deleted = "Deleted" - - -class DatabaseState6(str, Enum): +class SensitivityLabelSource(str, Enum): - all = "All" - live = "Live" - deleted = "Deleted" + current = "current" + recommended = "recommended" class AggregationFunctionType(str, Enum): @@ -828,9 +778,3 @@ class MetricType(str, Enum): log_io = "logIo" duration = "duration" dtu = "dtu" - - -class ReplicaType(str, Enum): - - primary = "Primary" - readable_secondary = "ReadableSecondary" 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 1380f65a6008..0648d62d5bbf 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 @@ -9,42 +9,34 @@ # regenerated. # -------------------------------------------------------------------------- -from ._recoverable_databases_operations import RecoverableDatabasesOperations -from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations -from ._server_connection_policies_operations import ServerConnectionPoliciesOperations -from ._database_threat_detection_policies_operations import DatabaseThreatDetectionPoliciesOperations -from ._data_masking_policies_operations import DataMaskingPoliciesOperations -from ._data_masking_rules_operations import DataMaskingRulesOperations -from ._firewall_rules_operations import FirewallRulesOperations -from ._geo_backup_policies_operations import GeoBackupPoliciesOperations -from ._databases_operations import DatabasesOperations -from ._elastic_pools_operations import ElasticPoolsOperations -from ._recommended_elastic_pools_operations import RecommendedElasticPoolsOperations -from ._replication_links_operations import ReplicationLinksOperations -from ._server_communication_links_operations import ServerCommunicationLinksOperations -from ._service_objectives_operations import ServiceObjectivesOperations -from ._elastic_pool_activities_operations import ElasticPoolActivitiesOperations -from ._elastic_pool_database_activities_operations import ElasticPoolDatabaseActivitiesOperations -from ._service_tier_advisors_operations import ServiceTierAdvisorsOperations -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations -from ._transparent_data_encryption_activities_operations import TransparentDataEncryptionActivitiesOperations -from ._server_usages_operations import ServerUsagesOperations -from ._database_usages_operations import DatabaseUsagesOperations -from ._database_automatic_tuning_operations import DatabaseAutomaticTuningOperations -from ._encryption_protectors_operations import EncryptionProtectorsOperations -from ._failover_groups_operations import FailoverGroupsOperations -from ._operations import Operations -from ._server_keys_operations import ServerKeysOperations -from ._sync_agents_operations import SyncAgentsOperations -from ._subscription_usages_operations import SubscriptionUsagesOperations -from ._virtual_clusters_operations import VirtualClustersOperations -from ._virtual_network_rules_operations import VirtualNetworkRulesOperations +from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations from ._server_blob_auditing_policies_operations import ServerBlobAuditingPoliciesOperations from ._database_blob_auditing_policies_operations import DatabaseBlobAuditingPoliciesOperations +from ._database_advisors_operations import DatabaseAdvisorsOperations +from ._database_automatic_tuning_operations import DatabaseAutomaticTuningOperations +from ._database_columns_operations import DatabaseColumnsOperations +from ._database_extensions_operations import DatabaseExtensionsOperations +from ._database_operations import DatabaseOperations +from ._database_recommended_actions_operations import DatabaseRecommendedActionsOperations +from ._databases_operations import DatabasesOperations +from ._database_schemas_operations import DatabaseSchemasOperations +from ._database_security_alert_policies_operations import DatabaseSecurityAlertPoliciesOperations +from ._database_tables_operations import DatabaseTablesOperations +from ._database_usages_operations import DatabaseUsagesOperations from ._database_vulnerability_assessment_rule_baselines_operations import DatabaseVulnerabilityAssessmentRuleBaselinesOperations from ._database_vulnerability_assessments_operations import DatabaseVulnerabilityAssessmentsOperations +from ._database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations +from ._data_warehouse_user_activities_operations import DataWarehouseUserActivitiesOperations +from ._deleted_servers_operations import DeletedServersOperations +from ._elastic_pool_operations import ElasticPoolOperations +from ._elastic_pools_operations import ElasticPoolsOperations +from ._encryption_protectors_operations import EncryptionProtectorsOperations +from ._failover_groups_operations import FailoverGroupsOperations +from ._firewall_rules_operations import FirewallRulesOperations +from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations +from ._instance_pools_operations import InstancePoolsOperations from ._job_agents_operations import JobAgentsOperations from ._job_credentials_operations import JobCredentialsOperations from ._job_executions_operations import JobExecutionsOperations @@ -54,94 +46,108 @@ from ._job_target_executions_operations import JobTargetExecutionsOperations from ._job_target_groups_operations import JobTargetGroupsOperations from ._job_versions_operations import JobVersionsOperations +from ._ledger_digest_uploads_operations import LedgerDigestUploadsOperations +from ._capabilities_operations import CapabilitiesOperations from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations -from ._backup_long_term_retention_policies_operations import BackupLongTermRetentionPoliciesOperations +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 from ._managed_backup_short_term_retention_policies_operations import ManagedBackupShortTermRetentionPoliciesOperations -from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations -from ._server_automatic_tuning_operations import ServerAutomaticTuningOperations -from ._server_dns_aliases_operations import ServerDnsAliasesOperations -from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations -from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations -from ._restore_points_operations import RestorePointsOperations +from ._managed_database_columns_operations import ManagedDatabaseColumnsOperations +from ._managed_database_queries_operations import ManagedDatabaseQueriesOperations +from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations +from ._managed_databases_operations import ManagedDatabasesOperations +from ._managed_database_schemas_operations import ManagedDatabaseSchemasOperations from ._managed_database_security_alert_policies_operations import ManagedDatabaseSecurityAlertPoliciesOperations -from ._managed_server_security_alert_policies_operations import ManagedServerSecurityAlertPoliciesOperations -from ._sensitivity_labels_operations import SensitivityLabelsOperations -from ._managed_instance_administrators_operations import ManagedInstanceAdministratorsOperations -from ._database_operations import DatabaseOperations -from ._elastic_pool_operations import ElasticPoolOperations -from ._database_vulnerability_assessment_scans_operations import DatabaseVulnerabilityAssessmentScansOperations +from ._managed_database_security_events_operations import ManagedDatabaseSecurityEventsOperations +from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations +from ._managed_database_recommended_sensitivity_labels_operations import ManagedDatabaseRecommendedSensitivityLabelsOperations +from ._managed_database_tables_operations import ManagedDatabaseTablesOperations +from ._managed_database_transparent_data_encryption_operations import ManagedDatabaseTransparentDataEncryptionOperations from ._managed_database_vulnerability_assessment_rule_baselines_operations import ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations -from ._managed_database_vulnerability_assessment_scans_operations import ManagedDatabaseVulnerabilityAssessmentScansOperations from ._managed_database_vulnerability_assessments_operations import ManagedDatabaseVulnerabilityAssessmentsOperations -from ._instance_failover_groups_operations import InstanceFailoverGroupsOperations -from ._tde_certificates_operations import TdeCertificatesOperations -from ._managed_instance_tde_certificates_operations import ManagedInstanceTdeCertificatesOperations -from ._managed_instance_keys_operations import ManagedInstanceKeysOperations +from ._managed_database_vulnerability_assessment_scans_operations import ManagedDatabaseVulnerabilityAssessmentScansOperations +from ._managed_instance_administrators_operations import ManagedInstanceAdministratorsOperations +from ._managed_instance_azure_ad_only_authentications_operations import ManagedInstanceAzureADOnlyAuthenticationsOperations from ._managed_instance_encryption_protectors_operations import ManagedInstanceEncryptionProtectorsOperations -from ._recoverable_managed_databases_operations import RecoverableManagedDatabasesOperations -from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations +from ._managed_instance_keys_operations import ManagedInstanceKeysOperations +from ._managed_instance_long_term_retention_policies_operations import ManagedInstanceLongTermRetentionPoliciesOperations +from ._managed_instance_operations import ManagedInstanceOperations +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 ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations -from ._managed_database_sensitivity_labels_operations import ManagedDatabaseSensitivityLabelsOperations -from ._instance_pools_operations import InstancePoolsOperations -from ._usages_operations import UsagesOperations +from ._managed_restorable_dropped_database_backup_short_term_retention_policies_operations import ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations +from ._managed_server_security_alert_policies_operations import ManagedServerSecurityAlertPoliciesOperations +from ._operations import Operations +from ._operations_health_operations import OperationsHealthOperations +from ._outbound_firewall_rules_operations import OutboundFirewallRulesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations -from ._servers_operations import ServersOperations -from ._capabilities_operations import CapabilitiesOperations -from ._long_term_retention_managed_instance_backups_operations import LongTermRetentionManagedInstanceBackupsOperations -from ._managed_instance_long_term_retention_policies_operations import ManagedInstanceLongTermRetentionPoliciesOperations -from ._workload_groups_operations import WorkloadGroupsOperations -from ._workload_classifiers_operations import WorkloadClassifiersOperations -from ._managed_instance_operations import ManagedInstanceOperations +from ._recoverable_managed_databases_operations import RecoverableManagedDatabasesOperations +from ._replication_links_operations import ReplicationLinksOperations +from ._restorable_dropped_databases_operations import RestorableDroppedDatabasesOperations +from ._restorable_dropped_managed_databases_operations import RestorableDroppedManagedDatabasesOperations +from ._restore_points_operations import RestorePointsOperations +from ._sensitivity_labels_operations import SensitivityLabelsOperations +from ._recommended_sensitivity_labels_operations import RecommendedSensitivityLabelsOperations +from ._server_advisors_operations import ServerAdvisorsOperations +from ._server_automatic_tuning_operations import ServerAutomaticTuningOperations from ._server_azure_ad_administrators_operations import ServerAzureADAdministratorsOperations -from ._sync_groups_operations import SyncGroupsOperations -from ._sync_members_operations import SyncMembersOperations -from ._managed_databases_operations import ManagedDatabasesOperations -from ._managed_database_restore_details_operations import ManagedDatabaseRestoreDetailsOperations from ._server_azure_ad_only_authentications_operations import ServerAzureADOnlyAuthenticationsOperations -from ._managed_instances_operations import ManagedInstancesOperations -from ._managed_instance_azure_ad_only_authentications_operations import ManagedInstanceAzureADOnlyAuthenticationsOperations -from ._server_trust_groups_operations import ServerTrustGroupsOperations from ._server_dev_ops_audit_settings_operations import ServerDevOpsAuditSettingsOperations +from ._server_dns_aliases_operations import ServerDnsAliasesOperations +from ._server_keys_operations import ServerKeysOperations +from ._server_operations import ServerOperations +from ._servers_operations import ServersOperations +from ._server_security_alert_policies_operations import ServerSecurityAlertPoliciesOperations +from ._server_trust_groups_operations import ServerTrustGroupsOperations +from ._server_vulnerability_assessments_operations import ServerVulnerabilityAssessmentsOperations +from ._sql_agent_operations import SqlAgentOperations +from ._subscription_usages_operations import SubscriptionUsagesOperations +from ._sync_agents_operations import SyncAgentsOperations +from ._sync_groups_operations import SyncGroupsOperations +from ._sync_members_operations import SyncMembersOperations +from ._tde_certificates_operations import TdeCertificatesOperations +from ._time_zones_operations import TimeZonesOperations +from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations +from ._usages_operations import UsagesOperations +from ._virtual_clusters_operations import VirtualClustersOperations +from ._virtual_network_rules_operations import VirtualNetworkRulesOperations +from ._workload_classifiers_operations import WorkloadClassifiersOperations +from ._workload_groups_operations import WorkloadGroupsOperations __all__ = [ - 'RecoverableDatabasesOperations', - 'RestorableDroppedDatabasesOperations', - 'ServerConnectionPoliciesOperations', - 'DatabaseThreatDetectionPoliciesOperations', - 'DataMaskingPoliciesOperations', - 'DataMaskingRulesOperations', - 'FirewallRulesOperations', - 'GeoBackupPoliciesOperations', - 'DatabasesOperations', - 'ElasticPoolsOperations', - 'RecommendedElasticPoolsOperations', - 'ReplicationLinksOperations', - 'ServerCommunicationLinksOperations', - 'ServiceObjectivesOperations', - 'ElasticPoolActivitiesOperations', - 'ElasticPoolDatabaseActivitiesOperations', - 'ServiceTierAdvisorsOperations', - 'TransparentDataEncryptionsOperations', - 'TransparentDataEncryptionActivitiesOperations', - 'ServerUsagesOperations', - 'DatabaseUsagesOperations', - 'DatabaseAutomaticTuningOperations', - 'EncryptionProtectorsOperations', - 'FailoverGroupsOperations', - 'Operations', - 'ServerKeysOperations', - 'SyncAgentsOperations', - 'SubscriptionUsagesOperations', - 'VirtualClustersOperations', - 'VirtualNetworkRulesOperations', + 'BackupShortTermRetentionPoliciesOperations', 'ExtendedDatabaseBlobAuditingPoliciesOperations', 'ExtendedServerBlobAuditingPoliciesOperations', 'ServerBlobAuditingPoliciesOperations', 'DatabaseBlobAuditingPoliciesOperations', + 'DatabaseAdvisorsOperations', + 'DatabaseAutomaticTuningOperations', + 'DatabaseColumnsOperations', + 'DatabaseExtensionsOperations', + 'DatabaseOperations', + 'DatabaseRecommendedActionsOperations', + 'DatabasesOperations', + 'DatabaseSchemasOperations', + 'DatabaseSecurityAlertPoliciesOperations', + 'DatabaseTablesOperations', + 'DatabaseUsagesOperations', 'DatabaseVulnerabilityAssessmentRuleBaselinesOperations', 'DatabaseVulnerabilityAssessmentsOperations', + 'DatabaseVulnerabilityAssessmentScansOperations', + 'DataWarehouseUserActivitiesOperations', + 'DeletedServersOperations', + 'ElasticPoolOperations', + 'ElasticPoolsOperations', + 'EncryptionProtectorsOperations', + 'FailoverGroupsOperations', + 'FirewallRulesOperations', + 'InstanceFailoverGroupsOperations', + 'InstancePoolsOperations', 'JobAgentsOperations', 'JobCredentialsOperations', 'JobExecutionsOperations', @@ -151,54 +157,76 @@ 'JobTargetExecutionsOperations', 'JobTargetGroupsOperations', 'JobVersionsOperations', + 'LedgerDigestUploadsOperations', + 'CapabilitiesOperations', 'LongTermRetentionBackupsOperations', - 'BackupLongTermRetentionPoliciesOperations', + 'LongTermRetentionManagedInstanceBackupsOperations', + 'LongTermRetentionPoliciesOperations', + 'MaintenanceWindowOptionsOperations', + 'MaintenanceWindowsOperations', 'ManagedBackupShortTermRetentionPoliciesOperations', - 'ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations', - 'ServerAutomaticTuningOperations', - 'ServerDnsAliasesOperations', - 'ServerSecurityAlertPoliciesOperations', - 'RestorableDroppedManagedDatabasesOperations', - 'RestorePointsOperations', + 'ManagedDatabaseColumnsOperations', + 'ManagedDatabaseQueriesOperations', + 'ManagedDatabaseRestoreDetailsOperations', + 'ManagedDatabasesOperations', + 'ManagedDatabaseSchemasOperations', 'ManagedDatabaseSecurityAlertPoliciesOperations', - 'ManagedServerSecurityAlertPoliciesOperations', - 'SensitivityLabelsOperations', - 'ManagedInstanceAdministratorsOperations', - 'DatabaseOperations', - 'ElasticPoolOperations', - 'DatabaseVulnerabilityAssessmentScansOperations', + 'ManagedDatabaseSecurityEventsOperations', + 'ManagedDatabaseSensitivityLabelsOperations', + 'ManagedDatabaseRecommendedSensitivityLabelsOperations', + 'ManagedDatabaseTablesOperations', + 'ManagedDatabaseTransparentDataEncryptionOperations', 'ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations', - 'ManagedDatabaseVulnerabilityAssessmentScansOperations', 'ManagedDatabaseVulnerabilityAssessmentsOperations', - 'InstanceFailoverGroupsOperations', - 'TdeCertificatesOperations', - 'ManagedInstanceTdeCertificatesOperations', - 'ManagedInstanceKeysOperations', + 'ManagedDatabaseVulnerabilityAssessmentScansOperations', + 'ManagedInstanceAdministratorsOperations', + 'ManagedInstanceAzureADOnlyAuthenticationsOperations', 'ManagedInstanceEncryptionProtectorsOperations', - 'RecoverableManagedDatabasesOperations', - 'BackupShortTermRetentionPoliciesOperations', + 'ManagedInstanceKeysOperations', + 'ManagedInstanceLongTermRetentionPoliciesOperations', + 'ManagedInstanceOperations', + 'ManagedInstancePrivateEndpointConnectionsOperations', + 'ManagedInstancePrivateLinkResourcesOperations', + 'ManagedInstancesOperations', + 'ManagedInstanceTdeCertificatesOperations', 'ManagedInstanceVulnerabilityAssessmentsOperations', - 'ServerVulnerabilityAssessmentsOperations', - 'ManagedDatabaseSensitivityLabelsOperations', - 'InstancePoolsOperations', - 'UsagesOperations', + 'ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations', + 'ManagedServerSecurityAlertPoliciesOperations', + 'Operations', + 'OperationsHealthOperations', + 'OutboundFirewallRulesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', - 'ServersOperations', - 'CapabilitiesOperations', - 'LongTermRetentionManagedInstanceBackupsOperations', - 'ManagedInstanceLongTermRetentionPoliciesOperations', - 'WorkloadGroupsOperations', - 'WorkloadClassifiersOperations', - 'ManagedInstanceOperations', + 'RecoverableManagedDatabasesOperations', + 'ReplicationLinksOperations', + 'RestorableDroppedDatabasesOperations', + 'RestorableDroppedManagedDatabasesOperations', + 'RestorePointsOperations', + 'SensitivityLabelsOperations', + 'RecommendedSensitivityLabelsOperations', + 'ServerAdvisorsOperations', + 'ServerAutomaticTuningOperations', 'ServerAzureADAdministratorsOperations', - 'SyncGroupsOperations', - 'SyncMembersOperations', - 'ManagedDatabasesOperations', - 'ManagedDatabaseRestoreDetailsOperations', 'ServerAzureADOnlyAuthenticationsOperations', - 'ManagedInstancesOperations', - 'ManagedInstanceAzureADOnlyAuthenticationsOperations', - 'ServerTrustGroupsOperations', 'ServerDevOpsAuditSettingsOperations', + 'ServerDnsAliasesOperations', + 'ServerKeysOperations', + 'ServerOperations', + 'ServersOperations', + 'ServerSecurityAlertPoliciesOperations', + 'ServerTrustGroupsOperations', + 'ServerVulnerabilityAssessmentsOperations', + 'SqlAgentOperations', + 'SubscriptionUsagesOperations', + 'SyncAgentsOperations', + 'SyncGroupsOperations', + 'SyncMembersOperations', + 'TdeCertificatesOperations', + 'TimeZonesOperations', + 'TransparentDataEncryptionsOperations', + 'UsagesOperations', + 'VirtualClustersOperations', + 'VirtualNetworkRulesOperations', + 'WorkloadClassifiersOperations', + 'WorkloadGroupsOperations', ] diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py index 1fab2366624f..88e312091449 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py @@ -28,7 +28,7 @@ class BackupShortTermRetentionPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar policy_name: The policy name. Should always be "default". Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.policy_name = "default" - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py index 782e021859fa..0de89774ab6d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_capabilities_operations.py @@ -25,7 +25,7 @@ class CapabilitiesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2020-08-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-08-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py index 178abf85f1b5..cd17ac52f012 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py @@ -16,8 +16,8 @@ from .. import models -class RecoverableDatabasesOperations(object): - """RecoverableDatabasesOperations operations. +class DataWarehouseUserActivitiesOperations(object): + """DataWarehouseUserActivitiesOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,7 +25,8 @@ class RecoverableDatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar data_warehouse_user_activity_name: The activity name of the data warehouse. . Constant value: "current". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,14 +36,15 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.data_warehouse_user_activity_name = "current" + self.api_version = "2021-02-01-preview" self.config = config def get( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a recoverable database, which is a resource representing a - database's geo backup. + """Gets the user activities of a data warehouse which includes running and + suspended queries. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -50,25 +52,26 @@ def get( :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 + :param database_name: The name of the database. :type database_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: RecoverableDatabase or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.RecoverableDatabase or + :return: DataWarehouseUserActivities or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DataWarehouseUserActivities or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'dataWarehouseUserActivityName': self._serialize.url("self.data_warehouse_user_activity_name", self.data_warehouse_user_activity_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -97,18 +100,19 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('RecoverableDatabase', response) + deserialized = self._deserialize('DataWarehouseUserActivities', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}'} - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of recoverable databases. + def list_by_database( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """List the user activities of a data warehouse which includes running and + suspended queries. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -116,24 +120,27 @@ def list_by_server( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str + :param database_name: The name of the database. + :type database_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of RecoverableDatabase + :return: An iterator like instance of DataWarehouseUserActivities :rtype: - ~azure.mgmt.sql.models.RecoverableDatabasePaged[~azure.mgmt.sql.models.RecoverableDatabase] + ~azure.mgmt.sql.models.DataWarehouseUserActivitiesPaged[~azure.mgmt.sql.models.DataWarehouseUserActivities] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_server.metadata['url'] + url = self.list_by_database.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + '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) @@ -175,7 +182,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.RecoverableDatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.DataWarehouseUserActivitiesPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataWarehouseUserActivities'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py similarity index 55% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py index 3d51678f036d..c563a6a21ea6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py @@ -16,8 +16,8 @@ from .. import models -class DataMaskingPoliciesOperations(object): - """DataMaskingPoliciesOperations operations. +class DatabaseAdvisorsOperations(object): + """DatabaseAdvisorsOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,8 +25,7 @@ class DataMaskingPoliciesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - :ivar data_masking_policy_name: The name of the database for which the data masking rule applies. Constant value: "Default". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,14 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" - self.data_masking_policy_name = "Default" + self.api_version = "2021-02-01-preview" self.config = config - def create_or_update( - self, resource_group_name, server_name, database_name, data_masking_state, exempt_principals=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates a database data masking policy. + def list_by_database( + self, resource_group_name, server_name, database_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of database advisors. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -53,46 +51,37 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. :type database_name: str - :param data_masking_state: The state of the data masking policy. - Possible values include: 'Disabled', 'Enabled' - :type data_masking_state: str or - ~azure.mgmt.sql.models.DataMaskingState - :param exempt_principals: The list of the exempt principals. Specifies - the semicolon-separated list of database users for which the data - masking policy does not apply. The specified users receive data - results without masking for all of the database queries. - :type exempt_principals: str + :param expand: The child resources to include in the response. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: DataMaskingPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy or + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.sql.models.Advisor] or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.DataMaskingPolicy(data_masking_state=data_masking_state, exempt_principals=exempt_principals) - # Construct URL - url = self.create_or_update.metadata['url'] + url = self.list_by_database.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_name, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -100,11 +89,8 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'DataMaskingPolicy') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -114,18 +100,18 @@ def create_or_update( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('DataMaskingPolicy', response) + deserialized = self._deserialize('[Advisor]', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors'} def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a database data masking policy. + self, resource_group_name, server_name, database_name, advisor_name, custom_headers=None, raw=False, **operation_config): + """Gets a database advisor. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -135,24 +121,26 @@ def get( :type server_name: str :param database_name: The name of the database. :type database_name: str + :param advisor_name: The name of the Database Advisor. + :type advisor_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: DataMaskingPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.DataMaskingPolicy or + :return: Advisor or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.Advisor or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_name, 'str') + 'advisorName': self._serialize.url("advisor_name", advisor_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -181,11 +169,92 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('DataMaskingPolicy', response) + deserialized = self._deserialize('Advisor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}'} + + def update( + self, resource_group_name, server_name, database_name, advisor_name, auto_execute_status, custom_headers=None, raw=False, **operation_config): + """Updates a database advisor. + + :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 advisor_name: The name of the Database Advisor. + :type advisor_name: str + :param auto_execute_status: Gets the auto-execute status (whether to + let the system execute the recommendations) of this advisor. Possible + values are 'Enabled' and 'Disabled'. Possible values include: + 'Enabled', 'Disabled', 'Default' + :type auto_execute_status: str or + ~azure.mgmt.sql.models.AutoExecuteStatus + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Advisor or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.Advisor or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.Advisor(auto_execute_status=auto_execute_status) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'advisorName': self._serialize.url("advisor_name", advisor_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Advisor') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Advisor', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}'} + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py index 30b493d10191..4aa04b3c4cd5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_automatic_tuning_operations.py @@ -25,7 +25,7 @@ class DatabaseAutomaticTuningOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py index 6ae7ba69abd6..52296578d087 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_blob_auditing_policies_operations.py @@ -26,7 +26,7 @@ class DatabaseBlobAuditingPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar blob_auditing_policy_name: The name of the blob auditing policy. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.blob_auditing_policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py similarity index 64% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_elastic_pools_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py index 95c89bf1df1b..5ae07bda499c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_columns_operations.py @@ -16,8 +16,8 @@ from .. import models -class RecommendedElasticPoolsOperations(object): - """RecommendedElasticPoolsOperations operations. +class DatabaseColumnsOperations(object): + """DatabaseColumnsOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,7 +25,7 @@ class RecommendedElasticPoolsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,13 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def get( - self, resource_group_name, server_name, recommended_elastic_pool_name, custom_headers=None, raw=False, **operation_config): - """Gets a recommended elastic pool. + def list_by_database( + self, resource_group_name, server_name, database_name, schema=None, table=None, column=None, order_by=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """List database columns. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -49,96 +49,53 @@ def get( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param recommended_elastic_pool_name: The name of the recommended - elastic pool to be retrieved. - :type recommended_elastic_pool_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema: + :type schema: list[str] + :param table: + :type table: list[str] + :param column: + :type column: list[str] + :param order_by: + :type order_by: list[str] + :param skiptoken: An opaque token that identifies a starting point in + the collection. + :type skiptoken: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: RecommendedElasticPool or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.RecommendedElasticPool or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'recommendedElasticPoolName': self._serialize.url("recommended_elastic_pool_name", recommended_elastic_pool_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('RecommendedElasticPool', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}'} - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Returns recommended elastic pools. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of RecommendedElasticPool + :return: An iterator like instance of DatabaseColumn :rtype: - ~azure.mgmt.sql.models.RecommendedElasticPoolPaged[~azure.mgmt.sql.models.RecommendedElasticPool] + ~azure.mgmt.sql.models.DatabaseColumnPaged[~azure.mgmt.sql.models.DatabaseColumn] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_server.metadata['url'] + url = self.list_by_database.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + '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 = {} + if schema is not None: + query_parameters['schema'] = self._serialize.query("schema", schema, '[str]', div=',') + if table is not None: + query_parameters['table'] = self._serialize.query("table", table, '[str]', div=',') + if column is not None: + query_parameters['column'] = self._serialize.query("column", column, '[str]', div=',') + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query("order_by", order_by, '[str]', div=',') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -175,14 +132,14 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.RecommendedElasticPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.DatabaseColumnPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/columns'} - def list_metrics( - self, resource_group_name, server_name, recommended_elastic_pool_name, custom_headers=None, raw=False, **operation_config): - """Returns recommended elastic pool metrics. + def list_by_table( + self, resource_group_name, server_name, database_name, schema_name, table_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List database columns. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -190,33 +147,43 @@ def list_metrics( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param recommended_elastic_pool_name: The name of the recommended - elastic pool to be retrieved. - :type recommended_elastic_pool_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema_name: The name of the schema. + :type schema_name: str + :param table_name: The name of the table. + :type table_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of RecommendedElasticPoolMetric + :return: An iterator like instance of DatabaseColumn :rtype: - ~azure.mgmt.sql.models.RecommendedElasticPoolMetricPaged[~azure.mgmt.sql.models.RecommendedElasticPoolMetric] + ~azure.mgmt.sql.models.DatabaseColumnPaged[~azure.mgmt.sql.models.DatabaseColumn] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_metrics.metadata['url'] + url = self.list_by_table.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'recommendedElasticPoolName': self._serialize.url("recommended_elastic_pool_name", recommended_elastic_pool_name, 'str') + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'tableName': self._serialize.url("table_name", table_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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -253,7 +220,82 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.RecommendedElasticPoolMetricPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.DatabaseColumnPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns'} + + def get( + self, resource_group_name, server_name, database_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): + """Get database column. + + :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 schema_name: The name of the schema. + :type schema_name: str + :param table_name: The name of the table. + :type table_name: str + :param column_name: The name of the column. + :type column_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseColumn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseColumn or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'tableName': self._serialize.url("table_name", table_name, 'str'), + 'columnName': self._serialize.url("column_name", column_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabaseColumn', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recommendedElasticPools/{recommendedElasticPoolName}/metrics'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py new file mode 100644 index 000000000000..481106fdb065 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_extensions_operations.py @@ -0,0 +1,294 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DatabaseExtensionsOperations(object): + """DatabaseExtensionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, extension_name, custom_headers=None, raw=False, **operation_config): + """Gets a database extension. This will return resource not found as it is + not supported. + + :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 extension_name: + :type extension_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'} + + + def _create_or_update_initial( + self, resource_group_name, server_name, database_name, extension_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'extensionName': self._serialize.url("extension_name", extension_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DatabaseExtensions') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ImportExportExtensionsOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, server_name, database_name, extension_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Perform a database extension operation, like polybase import. + + :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 extension_name: + :type extension_name: str + :param parameters: The database import request parameters. + :type parameters: ~azure.mgmt.sql.models.DatabaseExtensions + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ImportExportExtensionsOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + extension_name=extension_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ImportExportExtensionsOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions/{extensionName}'} + + def list_by_database( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """List database extension. This will return an empty list as it is not + supported. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + ImportExportExtensionsOperationResult + :rtype: + ~azure.mgmt.sql.models.ImportExportExtensionsOperationResultPaged[~azure.mgmt.sql.models.ImportExportExtensionsOperationResult] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ImportExportExtensionsOperationResultPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/extensions'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations.py index 9fdb5969fcff..64f81806a5bb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_operations.py @@ -25,7 +25,7 @@ class DatabaseOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py new file mode 100644 index 000000000000..b69c5a47910f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_recommended_actions_operations.py @@ -0,0 +1,264 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class DatabaseRecommendedActionsOperations(object): + """DatabaseRecommendedActionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def list_by_database_advisor( + self, resource_group_name, server_name, database_name, advisor_name, custom_headers=None, raw=False, **operation_config): + """Gets list of Database Recommended Actions. + + :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 advisor_name: The name of the Database Advisor. + :type advisor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.sql.models.RecommendedAction] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_database_advisor.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'advisorName': self._serialize.url("advisor_name", advisor_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[RecommendedAction]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_database_advisor.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions'} + + def get( + self, resource_group_name, server_name, database_name, advisor_name, recommended_action_name, custom_headers=None, raw=False, **operation_config): + """Gets a database recommended action. + + :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 advisor_name: The name of the Database Advisor. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended + Action. + :type recommended_action_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecommendedAction or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.RecommendedAction or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'advisorName': self._serialize.url("advisor_name", advisor_name, 'str'), + 'recommendedActionName': self._serialize.url("recommended_action_name", recommended_action_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RecommendedAction', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}'} + + def update( + self, resource_group_name, server_name, database_name, advisor_name, recommended_action_name, state, custom_headers=None, raw=False, **operation_config): + """Updates a database recommended action. + + :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 advisor_name: The name of the Database Advisor. + :type advisor_name: str + :param recommended_action_name: The name of Database Recommended + Action. + :type recommended_action_name: str + :param state: Gets the info of the current state the recommended + action is in. + :type state: ~azure.mgmt.sql.models.RecommendedActionStateInfo + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RecommendedAction or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.RecommendedAction or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.RecommendedAction(state=state) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'advisorName': self._serialize.url("advisor_name", advisor_name, 'str'), + 'recommendedActionName': self._serialize.url("recommended_action_name", recommended_action_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RecommendedAction') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RecommendedAction', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/advisors/{advisorName}/recommendedActions/{recommendedActionName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_tier_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py similarity index 81% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_tier_advisors_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py index ff0328f21bd7..f5bde642deed 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_tier_advisors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_schemas_operations.py @@ -16,8 +16,8 @@ from .. import models -class ServiceTierAdvisorsOperations(object): - """ServiceTierAdvisorsOperations operations. +class DatabaseSchemasOperations(object): + """DatabaseSchemasOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,7 +25,7 @@ class ServiceTierAdvisorsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,82 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def get( - self, resource_group_name, server_name, database_name, service_tier_advisor_name, custom_headers=None, raw=False, **operation_config): - """Gets a service tier advisor. - - :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 database. - :type database_name: str - :param service_tier_advisor_name: The name of service tier advisor. - :type service_tier_advisor_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ServiceTierAdvisor or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ServiceTierAdvisor or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'serviceTierAdvisorName': self._serialize.url("service_tier_advisor_name", service_tier_advisor_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ServiceTierAdvisor', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors/{serviceTierAdvisorName}'} - def list_by_database( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Returns service tier advisors for specified database. + self, resource_group_name, server_name, database_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List database schemas. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -118,16 +49,19 @@ def list_by_database( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of database. + :param database_name: The name of the database. :type database_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ServiceTierAdvisor + :return: An iterator like instance of DatabaseSchema :rtype: - ~azure.mgmt.sql.models.ServiceTierAdvisorPaged[~azure.mgmt.sql.models.ServiceTierAdvisor] + ~azure.mgmt.sql.models.DatabaseSchemaPaged[~azure.mgmt.sql.models.DatabaseSchema] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -135,15 +69,17 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_database.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') + '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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -180,7 +116,76 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.ServiceTierAdvisorPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.DatabaseSchemaPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas'} + + def get( + self, resource_group_name, server_name, database_name, schema_name, custom_headers=None, raw=False, **operation_config): + """Get database schema. + + :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 schema_name: The name of the schema. + :type schema_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseSchema or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseSchema or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabaseSchema', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/serviceTierAdvisors'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py similarity index 77% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py index e3b1cc9cd7ec..3274aa38bd3d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_geo_backup_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py @@ -16,8 +16,8 @@ from .. import models -class GeoBackupPoliciesOperations(object): - """GeoBackupPoliciesOperations operations. +class DatabaseSecurityAlertPoliciesOperations(object): + """DatabaseSecurityAlertPoliciesOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,8 +25,8 @@ class GeoBackupPoliciesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - :ivar geo_backup_policy_name: The name of the geo backup policy. Constant value: "Default". + :ivar security_alert_policy_name: The name of the security alert policy. Constant value: "default". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,46 +36,42 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" - self.geo_backup_policy_name = "Default" + self.security_alert_policy_name = "default" + self.api_version = "2021-02-01-preview" self.config = config - def create_or_update( - self, resource_group_name, server_name, database_name, state, custom_headers=None, raw=False, **operation_config): - """Updates a database geo backup policy. + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a database's security alert 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. + :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database. + :param database_name: The name of the database for which the security + alert policy is defined. :type database_name: str - :param state: The state of the geo backup policy. Possible values - include: 'Disabled', 'Enabled' - :type state: str or ~azure.mgmt.sql.models.GeoBackupPolicyState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: GeoBackupPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy or + :return: DatabaseSecurityAlertPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.GeoBackupPolicy(state=state) - # Construct URL - url = self.create_or_update.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'geoBackupPolicyName': self._serialize.url("self.geo_backup_policy_name", self.geo_backup_policy_name, 'str') + 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_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) @@ -86,7 +82,6 @@ def create_or_update( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -94,61 +89,59 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'GeoBackupPolicy') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: - deserialized = self._deserialize('GeoBackupPolicy', response) - if response.status_code == 201: - deserialized = self._deserialize('GeoBackupPolicy', response) + deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}'} - def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a geo backup policy. + def create_or_update( + self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a database's security alert 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. + :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database. + :param database_name: The name of the database for which the security + alert policy is defined. :type database_name: str + :param parameters: The database security alert policy. + :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: GeoBackupPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.GeoBackupPolicy or + :return: DatabaseSecurityAlertPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'geoBackupPolicyName': self._serialize.url("self.geo_backup_policy_name", self.geo_backup_policy_name, 'str') + 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_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) @@ -159,6 +152,7 @@ def get( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -166,46 +160,52 @@ def get( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(parameters, 'DatabaseSecurityAlertPolicy') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 201]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: - deserialized = self._deserialize('GeoBackupPolicy', response) + deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}'} def list_by_database( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Returns a list of geo backup policies. + """Gets a list of database's security alert policies. :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. + :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database. + :param database_name: The name of the database for which the security + alert policy is defined. :type database_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of GeoBackupPolicy + :return: An iterator like instance of DatabaseSecurityAlertPolicy :rtype: - ~azure.mgmt.sql.models.GeoBackupPolicyPaged[~azure.mgmt.sql.models.GeoBackupPolicy] + ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicyPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -213,10 +213,10 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_database.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') + '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) @@ -258,7 +258,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.GeoBackupPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.DatabaseSecurityAlertPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py similarity index 69% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py index 4430f4d7bc9c..f9317e42fe51 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_masking_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py @@ -16,8 +16,8 @@ from .. import models -class DataMaskingRulesOperations(object): - """DataMaskingRulesOperations operations. +class DatabaseTablesOperations(object): + """DatabaseTablesOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,8 +25,7 @@ class DataMaskingRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - :ivar data_masking_policy_name: The name of the database for which the data masking rule applies. Constant value: "Default". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,14 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" - self.data_masking_policy_name = "Default" + self.api_version = "2021-02-01-preview" self.config = config - def create_or_update( - self, resource_group_name, server_name, database_name, data_masking_rule_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a database data masking rule. + def list_by_schema( + self, resource_group_name, server_name, database_name, schema_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List database tables. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -53,110 +51,38 @@ def create_or_update( :type server_name: str :param database_name: The name of the database. :type database_name: str - :param data_masking_rule_name: The name of the data masking rule. - :type data_masking_rule_name: str - :param parameters: The required parameters for creating or updating a - data masking rule. - :type parameters: ~azure.mgmt.sql.models.DataMaskingRule + :param schema_name: The name of the schema. + :type schema_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: DataMaskingRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.DataMaskingRule or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.create_or_update.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_name, 'str'), - 'dataMaskingRuleName': self._serialize.url("data_masking_rule_name", data_masking_rule_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'DataMaskingRule') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 201]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('DataMaskingRule', response) - if response.status_code == 201: - deserialized = self._deserialize('DataMaskingRule', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}'} - - def list_by_database( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of database data masking rules. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of DataMaskingRule + :return: An iterator like instance of DatabaseTable :rtype: - ~azure.mgmt.sql.models.DataMaskingRulePaged[~azure.mgmt.sql.models.DataMaskingRule] + ~azure.mgmt.sql.models.DatabaseTablePaged[~azure.mgmt.sql.models.DatabaseTable] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_database.metadata['url'] + url = self.list_by_schema.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_name, 'str') + 'schemaName': self._serialize.url("schema_name", schema_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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -193,7 +119,79 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.DataMaskingRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.DatabaseTablePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_schema.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables'} + + def get( + self, resource_group_name, server_name, database_name, schema_name, table_name, custom_headers=None, raw=False, **operation_config): + """Get database table. + + :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 schema_name: The name of the schema. + :type schema_name: str + :param table_name: The name of the table. + :type table_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseTable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseTable or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'tableName': self._serialize.url("table_name", table_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabaseTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py index 8cf8df83a5a8..0c197c5d373c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_usages_operations.py @@ -25,7 +25,7 @@ class DatabaseUsagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,13 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config def list_by_database( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Returns database usages. + """Gets database usages. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -66,10 +66,10 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_database.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') + '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) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py index 8e04b1fbc4a1..9a542771a2aa 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_rule_baselines_operations.py @@ -26,7 +26,7 @@ class DatabaseVulnerabilityAssessmentRuleBaselinesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py index 06efd2638038..5df39afc5dce 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessment_scans_operations.py @@ -28,7 +28,7 @@ class DatabaseVulnerabilityAssessmentScansOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,10 +39,101 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config + + def _initiate_scan_initial( + self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.initiate_scan.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def initiate_scan( + self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, polling=True, **operation_config): + """Executes a Vulnerability Assessment database scan. + + :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 scan_id: The vulnerability assessment scan Id of the scan to + retrieve. + :type scan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._initiate_scan_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + scan_id=scan_id, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + initiate_scan.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan'} + def list_by_database( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): """Lists the vulnerability assessment scans of a database. @@ -194,97 +285,6 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}'} - - def _initiate_scan_initial( - self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.initiate_scan.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), - 'scanId': self._serialize.url("scan_id", scan_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def initiate_scan( - self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Executes a Vulnerability Assessment database scan. - - :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 scan_id: The vulnerability assessment scan Id of the scan to - retrieve. - :type scan_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._initiate_scan_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - scan_id=scan_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - initiate_scan.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/initiateScan'} - def export( self, resource_group_name, server_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): """Convert an existing scan result to a human readable format. If already diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py index 4fbf4f24a995..20b9e155477d 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_vulnerability_assessments_operations.py @@ -26,7 +26,7 @@ class DatabaseVulnerabilityAssessmentsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py index a2cbd88c163d..9b25db62d34e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_databases_operations.py @@ -27,6 +27,7 @@ class DatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,173 +37,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2021-02-01-preview" self.config = config - def list_metrics( - self, resource_group_name, server_name, database_name, filter, custom_headers=None, raw=False, **operation_config): - """Returns database metrics. - - :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 filter: An OData filter expression that describes a subset of - metrics to return. - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Metric - :rtype: - ~azure.mgmt.sql.models.MetricPaged[~azure.mgmt.sql.models.Metric] - :raises: :class:`CloudError` - """ - api_version = "2014-04-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_metrics.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MetricPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics'} - - def list_metric_definitions( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Returns database metric definitions. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of MetricDefinition - :rtype: - ~azure.mgmt.sql.models.MetricDefinitionPaged[~azure.mgmt.sql.models.MetricDefinition] - :raises: :class:`CloudError` - """ - api_version = "2014-04-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_metric_definitions.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions'} - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, skip_token=None, custom_headers=None, raw=False, **operation_config): """Gets a list of databases. :param resource_group_name: The name of the resource group that @@ -211,6 +51,8 @@ def list_by_server( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str + :param skip_token: + :type skip_token: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -221,8 +63,6 @@ def list_by_server( ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL @@ -236,7 +76,9 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -299,8 +141,6 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" - # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -313,7 +153,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -348,8 +188,6 @@ def get( def _create_or_update_initial( self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -362,7 +200,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -458,8 +296,6 @@ def get_long_running_output(response): def _delete_initial( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -472,7 +308,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -545,8 +381,6 @@ def get_long_running_output(response): def _update_initial( self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -559,7 +393,7 @@ def _update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -672,8 +506,6 @@ def list_by_elastic_pool( ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL @@ -688,7 +520,7 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -730,12 +562,10 @@ def internal_paging(next_link=None): list_by_elastic_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/databases'} - def _pause_initial( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - + def _failover_initial( + self, resource_group_name, server_name, database_name, replica_type=None, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.pause.metadata['url'] + url = self.failover.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -746,11 +576,12 @@ def _pause_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + if replica_type is not None: + query_parameters['replicaType'] = self._serialize.query("replica_type", replica_type, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -767,20 +598,13 @@ def _pause_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Database', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - - def pause( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Pauses a database. + def failover( + self, resource_group_name, server_name, database_name, replica_type=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Failovers a database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -788,39 +612,37 @@ def pause( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database to be paused. + :param database_name: The name of the database to failover. :type database_name: str + :param replica_type: The type of replica to be failed over. Possible + values include: 'Primary', 'ReadableSecondary' + :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns Database or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.Database] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.Database]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ - raw_result = self._pause_initial( + raw_result = self._failover_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, + replica_type=replica_type, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('Database', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -828,15 +650,87 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - pause.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'} + failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover'} + def list_inaccessible_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of inaccessible databases in a logical server. - def _resume_initial( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Database + :rtype: + ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_inaccessible_by_server.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_inaccessible_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases'} + + def _pause_initial( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.resume.metadata['url'] + url = self.pause.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -847,7 +741,7 @@ def _resume_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -879,9 +773,9 @@ def _resume_initial( return deserialized - def resume( + def pause( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Resumes a database. + """Pauses a database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -889,7 +783,7 @@ def resume( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database to be resumed. + :param database_name: The name of the database to be paused. :type database_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -904,7 +798,7 @@ def resume( ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.Database]] :raises: :class:`CloudError` """ - raw_result = self._resume_initial( + raw_result = self._pause_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, @@ -929,15 +823,13 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'} - + pause.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/pause'} - def _failover_initial( - self, resource_group_name, server_name, database_name, replica_type=None, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" + def _resume_initial( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.failover.metadata['url'] + url = self.resume.metadata['url'] path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -948,12 +840,11 @@ def _failover_initial( # Construct parameters query_parameters = {} - if replica_type is not None: - query_parameters['replicaType'] = self._serialize.query("replica_type", replica_type, 'str') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -970,13 +861,20 @@ def _failover_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Database', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - def failover( - self, resource_group_name, server_name, database_name, replica_type=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Failovers a database. + return deserialized + + def resume( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Resumes a database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -984,37 +882,39 @@ def failover( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database to failover. + :param database_name: The name of the database to be resumed. :type database_name: str - :param replica_type: The type of replica to be failed over. Possible - values include: 'Primary', 'ReadableSecondary' - :type replica_type: str or ~azure.mgmt.sql.models.ReplicaType :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :return: An instance of LROPoller that returns Database or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.Database] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.Database]] :raises: :class:`CloudError` """ - raw_result = self._failover_initial( + raw_result = self._resume_initial( resource_group_name=resource_group_name, server_name=server_name, database_name=database_name, - replica_type=replica_type, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): + deserialized = self._deserialize('Database', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + return deserialized + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -1022,89 +922,11 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/failover'} - - def list_inaccessible_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of inaccessible databases in a logical server. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Database - :rtype: - ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] - :raises: :class:`CloudError` - """ - api_version = "2020-08-01-preview" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_inaccessible_by_server.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.DatabasePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_inaccessible_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/inaccessibleDatabases'} + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/resume'} def _upgrade_data_warehouse_initial( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.upgrade_data_warehouse.metadata['url'] path_format_arguments = { @@ -1117,7 +939,7 @@ def _upgrade_data_warehouse_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -1212,8 +1034,6 @@ def rename( """ parameters = models.ResourceMoveDefinition(id=id) - api_version = "2020-08-01-preview" - # Construct URL url = self.rename.metadata['url'] path_format_arguments = { @@ -1226,7 +1046,7 @@ def rename( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -1258,8 +1078,6 @@ def rename( def _import_method_initial( self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.import_method.metadata['url'] path_format_arguments = { @@ -1272,7 +1090,7 @@ def _import_method_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -1366,115 +1184,8 @@ def get_long_running_output(response): import_method.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/import'} - def _import_database_initial( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - - # Construct URL - url = self.import_database.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'ImportNewDatabaseDefinition') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('ImportExportOperationResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def import_database( - self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Imports a bacpac into a new database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param parameters: The database import request parameters. - :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns - ImportExportOperationResult or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportOperationResult] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportOperationResult]] - :raises: :class:`CloudError` - """ - raw_result = self._import_database_initial( - resource_group_name=resource_group_name, - server_name=server_name, - parameters=parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('ImportExportOperationResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - import_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'} - - def _export_initial( self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.export.metadata['url'] path_format_arguments = { @@ -1487,7 +1198,7 @@ def _export_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py new file mode 100644 index 000000000000..979ceec11448 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_operations.py @@ -0,0 +1,334 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class DeletedServersOperations(object): + """DeletedServersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Gets a list of all deleted servers in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedServer + :rtype: + ~azure.mgmt.sql.models.DeletedServerPaged[~azure.mgmt.sql.models.DeletedServer] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeletedServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/deletedServers'} + + def get( + self, location_name, deleted_server_name, custom_headers=None, raw=False, **operation_config): + """Gets a deleted server. + + :param location_name: The name of the region where the resource is + located. + :type location_name: str + :param deleted_server_name: The name of the deleted server. + :type deleted_server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DeletedServer or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DeletedServer or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'deletedServerName': self._serialize.url("deleted_server_name", deleted_server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DeletedServer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}'} + + def list_by_location( + self, location_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of deleted servers for a location. + + :param location_name: The name of the region where the resource is + located. + :type location_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DeletedServer + :rtype: + ~azure.mgmt.sql.models.DeletedServerPaged[~azure.mgmt.sql.models.DeletedServer] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DeletedServerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers'} + + + def _recover_initial( + self, location_name, deleted_server_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.recover.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'deletedServerName': self._serialize.url("deleted_server_name", deleted_server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('DeletedServer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def recover( + self, location_name, deleted_server_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Recovers a deleted server. + + :param location_name: The name of the region where the resource is + located. + :type location_name: str + :param deleted_server_name: The name of the deleted server. + :type deleted_server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns DeletedServer or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.DeletedServer] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.DeletedServer]] + :raises: :class:`CloudError` + """ + raw_result = self._recover_initial( + location_name=location_name, + deleted_server_name=deleted_server_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DeletedServer', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + recover.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/deletedServers/{deletedServerName}/recover'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py deleted file mode 100644 index 6280285c5e59..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_database_activities_operations.py +++ /dev/null @@ -1,117 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError - -from .. import models - - -class ElasticPoolDatabaseActivitiesOperations(object): - """ElasticPoolDatabaseActivitiesOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2014-04-01" - - self.config = config - - def list_by_elastic_pool( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - """Returns activity on databases inside of an elastic pool. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param elastic_pool_name: The name of the elastic pool. - :type elastic_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ElasticPoolDatabaseActivity - :rtype: - ~azure.mgmt.sql.models.ElasticPoolDatabaseActivityPaged[~azure.mgmt.sql.models.ElasticPoolDatabaseActivity] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_elastic_pool.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_pool_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ElasticPoolDatabaseActivityPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_elastic_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations.py index 26dd59fe4abf..51d2daaa5820 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations.py @@ -25,7 +25,7 @@ class ElasticPoolOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py index a932f04fb386..78bc06e7e84c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pools_operations.py @@ -27,6 +27,7 @@ class ElasticPoolsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,171 +37,10 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2021-02-01-preview" self.config = config - def list_metrics( - self, resource_group_name, server_name, elastic_pool_name, filter, custom_headers=None, raw=False, **operation_config): - """Returns elastic pool metrics. - - :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 elastic_pool_name: The name of the elastic pool. - :type elastic_pool_name: str - :param filter: An OData filter expression that describes a subset of - metrics to return. - :type filter: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of Metric - :rtype: - ~azure.mgmt.sql.models.MetricPaged[~azure.mgmt.sql.models.Metric] - :raises: :class:`CloudError` - """ - api_version = "2014-04-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_metrics.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_pool_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MetricPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_metrics.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics'} - - def list_metric_definitions( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - """Returns elastic pool metric definitions. - - :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 elastic_pool_name: The name of the elastic pool. - :type elastic_pool_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of MetricDefinition - :rtype: - ~azure.mgmt.sql.models.MetricDefinitionPaged[~azure.mgmt.sql.models.MetricDefinition] - :raises: :class:`CloudError` - """ - api_version = "2014-04-01" - - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_metric_definitions.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_pool_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.MetricDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_metric_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions'} - def list_by_server( self, resource_group_name, server_name, skip=None, custom_headers=None, raw=False, **operation_config): """Gets all elastic pools in a server. @@ -212,7 +52,7 @@ def list_by_server( :param server_name: The name of the server. :type server_name: str :param skip: The number of elements in the collection to skip. - :type skip: int + :type skip: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -223,8 +63,6 @@ def list_by_server( ~azure.mgmt.sql.models.ElasticPoolPaged[~azure.mgmt.sql.models.ElasticPool] :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" - def prepare_request(next_link=None): if not next_link: # Construct URL @@ -239,8 +77,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['$skip'] = self._serialize.query("skip", skip, 'long') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: url = next_link @@ -303,8 +141,6 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" - # Construct URL url = self.get.metadata['url'] path_format_arguments = { @@ -317,7 +153,7 @@ def get( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -352,8 +188,6 @@ def get( def _create_or_update_initial( self, resource_group_name, server_name, elastic_pool_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -366,7 +200,7 @@ def _create_or_update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -462,8 +296,6 @@ def get_long_running_output(response): def _delete_initial( self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -476,7 +308,7 @@ def _delete_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -549,8 +381,6 @@ def get_long_running_output(response): def _update_initial( self, resource_group_name, server_name, elastic_pool_name, parameters, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -563,7 +393,7 @@ def _update_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} @@ -657,8 +487,6 @@ def get_long_running_output(response): def _failover_initial( self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" - # Construct URL url = self.failover.metadata['url'] path_format_arguments = { @@ -671,7 +499,7 @@ def _failover_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py index 05aeb918af93..af9001bd4ba0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_encryption_protectors_operations.py @@ -27,8 +27,8 @@ class EncryptionProtectorsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar encryption_protector_name: The name of the encryption protector to be updated. Constant value: "current". - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + :ivar encryption_protector_name: The name of the encryption protector to be retrieved. Constant value: "current". """ models = models @@ -38,93 +38,11 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer + self.api_version = "2021-02-01-preview" self.encryption_protector_name = "current" - self.api_version = "2015-05-01-preview" self.config = config - - def _revalidate_initial( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.revalidate.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'encryptionProtectorName': self._serialize.url("self.encryption_protector_name", self.encryption_protector_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def revalidate( - self, resource_group_name, server_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Revalidates an existing encryption protector. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._revalidate_initial( - resource_group_name=resource_group_name, - server_name=server_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - revalidate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate'} - def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): """Gets a list of server encryption protectors. @@ -265,9 +183,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, server_name, server_key_type, server_key_name=None, custom_headers=None, raw=False, **operation_config): - parameters = models.EncryptionProtector(server_key_name=server_key_name, server_key_type=server_key_type) - + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -317,7 +233,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, server_name, server_key_type, server_key_name=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an existing encryption protector. :param resource_group_name: The name of the resource group that @@ -326,12 +242,8 @@ def create_or_update( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param server_key_type: The encryption protector type like - 'ServiceManaged', 'AzureKeyVault'. Possible values include: - 'ServiceManaged', 'AzureKeyVault' - :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :param server_key_name: The name of the server key. - :type server_key_name: str + :param parameters: The requested encryption protector resource state. + :type parameters: ~azure.mgmt.sql.models.EncryptionProtector :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -348,8 +260,7 @@ def create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, server_name=server_name, - server_key_type=server_key_type, - server_key_name=server_key_name, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config @@ -372,3 +283,85 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}'} + + + def _revalidate_initial( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.revalidate.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'encryptionProtectorName': self._serialize.url("self.encryption_protector_name", self.encryption_protector_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def revalidate( + self, resource_group_name, server_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Revalidates an existing encryption protector. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._revalidate_initial( + resource_group_name=resource_group_name, + server_name=server_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + revalidate.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/encryptionProtector/{encryptionProtectorName}/revalidate'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py index 8603d99a6acd..ae3ce2fd15e8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_database_blob_auditing_policies_operations.py @@ -26,7 +26,7 @@ class ExtendedDatabaseBlobAuditingPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar blob_auditing_policy_name: The name of the blob auditing policy. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.blob_auditing_policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py index 728bf1c26c9d..f3085c3a34bd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_extended_server_blob_auditing_policies_operations.py @@ -28,7 +28,7 @@ class ExtendedServerBlobAuditingPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar blob_auditing_policy_name: The name of the blob auditing policy. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.blob_auditing_policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py index 797c0d27ab17..89e6794d1453 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_failover_groups_operations.py @@ -27,7 +27,7 @@ class FailoverGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py index e211cff58cbb..6f102ea9c1f2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_firewall_rules_operations.py @@ -25,7 +25,7 @@ class FirewallRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,13 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def create_or_update( - self, resource_group_name, server_name, firewall_rule_name, start_ip_address, end_ip_address, custom_headers=None, raw=False, **operation_config): - """Creates or updates a firewall rule. + def get( + self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): + """Gets a firewall rule. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -51,14 +51,6 @@ def create_or_update( :type server_name: str :param firewall_rule_name: The name of the firewall rule. :type firewall_rule_name: str - :param start_ip_address: The start IP address of the firewall rule. - Must be IPv4 format. Use value '0.0.0.0' to represent all - Azure-internal IP addresses. - :type start_ip_address: str - :param end_ip_address: The end IP address of the firewall rule. Must - be IPv4 format. Must be greater than or equal to startIpAddress. Use - value '0.0.0.0' to represent all Azure-internal IP addresses. - :type end_ip_address: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -69,15 +61,13 @@ def create_or_update( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.FirewallRule(start_ip_address=start_ip_address, end_ip_address=end_ip_address) - # Construct URL - url = self.create_or_update.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -88,7 +78,6 @@ def create_or_update( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -96,14 +85,11 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'FirewallRule') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -111,19 +97,17 @@ def create_or_update( deserialized = None if response.status_code == 200: deserialized = self._deserialize('FirewallRule', response) - if response.status_code == 201: - deserialized = self._deserialize('FirewallRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}'} - def delete( - self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Deletes a firewall rule. + def create_or_update( + self, resource_group_name, server_name, firewall_rule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a firewall rule. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -133,22 +117,26 @@ def delete( :type server_name: str :param firewall_rule_name: The name of the firewall rule. :type firewall_rule_name: str + :param parameters: The required parameters for creating or updating a + firewall rule. + :type parameters: ~azure.mgmt.sql.models.FirewallRule :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: FirewallRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.FirewallRule or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.delete.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -158,6 +146,8 @@ def delete( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -165,23 +155,34 @@ def delete( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(parameters, 'FirewallRule') + # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 204]: + if response.status_code not in [200, 201]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('FirewallRule', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}'} - def get( + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}'} + + def delete( self, resource_group_name, server_name, firewall_rule_name, custom_headers=None, raw=False, **operation_config): - """Gets a firewall rule. + """Deletes a firewall rule. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -196,18 +197,17 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: FirewallRule or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.FirewallRule or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str') + 'firewallRuleName': self._serialize.url("firewall_rule_name", firewall_rule_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -217,7 +217,6 @@ def get( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -226,28 +225,22 @@ def get( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('FirewallRule', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules/{firewallRuleName}'} def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Returns a list of firewall rules. + """Gets a list of firewall rules. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -270,9 +263,9 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_server.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + '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) @@ -318,3 +311,74 @@ def internal_paging(next_link=None): return deserialized list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules'} + + def replace( + self, resource_group_name, server_name, values=None, custom_headers=None, raw=False, **operation_config): + """Replaces all firewall rules on the server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param values: + :type values: list[~azure.mgmt.sql.models.FirewallRule] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: FirewallRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.FirewallRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.FirewallRuleList(values=values) + + # Construct URL + url = self.replace.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'FirewallRuleList') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('FirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + replace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/firewallRules'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py index 33960af71031..141ff79c34cf 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_failover_groups_operations.py @@ -27,7 +27,7 @@ class InstanceFailoverGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py index 43721ed26b1b..40ac206412f1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_instance_pools_operations.py @@ -27,7 +27,7 @@ class InstancePoolsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py index a6641946abaf..3e69cf7016be 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_agents_operations.py @@ -27,7 +27,7 @@ class JobAgentsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py index 9c469c605600..0e61e3fe27ba 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_credentials_operations.py @@ -25,7 +25,7 @@ class JobCredentialsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py index 71885bdb661e..574e073ac2fb 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_executions_operations.py @@ -27,7 +27,7 @@ class JobExecutionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -69,9 +69,9 @@ def list_by_agent( executions are included. :type is_active: bool :param skip: The number of elements in the collection to skip. - :type skip: int + :type skip: long :param top: The number of elements to return from the collection. - :type top: int + :type top: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -107,9 +107,9 @@ def prepare_request(next_link=None): if is_active is not None: query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + query_parameters['$skip'] = self._serialize.query("skip", skip, 'long') if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['$top'] = self._serialize.query("top", top, 'long') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -348,9 +348,9 @@ def list_by_job( executions are included. :type is_active: bool :param skip: The number of elements in the collection to skip. - :type skip: int + :type skip: long :param top: The number of elements to return from the collection. - :type top: int + :type top: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -387,9 +387,9 @@ def prepare_request(next_link=None): if is_active is not None: query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + query_parameters['$skip'] = self._serialize.query("skip", skip, 'long') if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['$top'] = self._serialize.query("top", top, 'long') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py index 8410a94138e8..35ca9902e5f1 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_step_executions_operations.py @@ -25,7 +25,7 @@ class JobStepExecutionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -71,9 +71,9 @@ def list_by_job_execution( executions are included. :type is_active: bool :param skip: The number of elements in the collection to skip. - :type skip: int + :type skip: long :param top: The number of elements to return from the collection. - :type top: int + :type top: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -111,9 +111,9 @@ def prepare_request(next_link=None): if is_active is not None: query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + query_parameters['$skip'] = self._serialize.query("skip", skip, 'long') if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['$top'] = self._serialize.query("top", top, 'long') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py index e7383e961171..92b240ae3e86 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_steps_operations.py @@ -25,7 +25,7 @@ class JobStepsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py index a6722c0278bc..a17c1a00b27e 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_executions_operations.py @@ -25,7 +25,7 @@ class JobTargetExecutionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -71,9 +71,9 @@ def list_by_job_execution( executions are included. :type is_active: bool :param skip: The number of elements in the collection to skip. - :type skip: int + :type skip: long :param top: The number of elements to return from the collection. - :type top: int + :type top: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -111,9 +111,9 @@ def prepare_request(next_link=None): if is_active is not None: query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + query_parameters['$skip'] = self._serialize.query("skip", skip, 'long') if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['$top'] = self._serialize.query("top", top, 'long') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -189,9 +189,9 @@ def list_by_step( executions are included. :type is_active: bool :param skip: The number of elements in the collection to skip. - :type skip: int + :type skip: long :param top: The number of elements to return from the collection. - :type top: int + :type top: long :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -230,9 +230,9 @@ def prepare_request(next_link=None): if is_active is not None: query_parameters['isActive'] = self._serialize.query("is_active", is_active, 'bool') if skip is not None: - query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + query_parameters['$skip'] = self._serialize.query("skip", skip, 'long') if top is not None: - query_parameters['$top'] = self._serialize.query("top", top, 'int') + query_parameters['$top'] = self._serialize.query("top", top, 'long') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py index a3769c0e2bcb..819264244f28 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_target_groups_operations.py @@ -25,7 +25,7 @@ class JobTargetGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py index da92973e0695..20f44e5e561a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_job_versions_operations.py @@ -25,7 +25,7 @@ class JobVersionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py index f0830d089829..770e20391bfc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_jobs_operations.py @@ -25,7 +25,7 @@ class JobsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config 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 new file mode 100644 index 000000000000..e980a387feee --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py @@ -0,0 +1,332 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class LedgerDigestUploadsOperations(object): + """LedgerDigestUploadsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar ledger_digest_uploads: . Constant value: "current". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.ledger_digest_uploads = "current" + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets the current ledger digest upload configuration for a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LedgerDigestUploads or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'ledgerDigestUploads': self._serialize.url("self.ledger_digest_uploads", self.ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LedgerDigestUploads', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} + + def create_or_update( + self, resource_group_name, server_name, database_name, digest_storage_endpoint=None, custom_headers=None, raw=False, **operation_config): + """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 digest_storage_endpoint: The digest storage endpoint, which + must be either an Azure blob storage endpoint or an URI for Azure + Confidential Ledger. + :type digest_storage_endpoint: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LedgerDigestUploads or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.LedgerDigestUploads(digest_storage_endpoint=digest_storage_endpoint) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'ledgerDigestUploads': self._serialize.url("self.ledger_digest_uploads", self.ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'LedgerDigestUploads') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LedgerDigestUploads', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} + + def list_by_database( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets all ledger digest upload settings on a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of LedgerDigestUploads + :rtype: + ~azure.mgmt.sql.models.LedgerDigestUploadsPaged[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LedgerDigestUploadsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads'} + + def disable( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """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 dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: LedgerDigestUploads or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.disable.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'ledgerDigestUploads': self._serialize.url("self.ledger_digest_uploads", self.ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LedgerDigestUploads', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} 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 55a0bbdd777a..50e631c1243f 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 @@ -27,7 +27,7 @@ class LongTermRetentionBackupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,18 +37,239 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config - def get_by_resource_group( - self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): + + def _copy_initial( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.copy.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), + 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), + 'backupName': self._serialize.url("backup_name", backup_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CopyLongTermRetentionBackupParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def copy( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copy an existing long term retention backup. + + :param location_name: The location of the database. + :type location_name: str + :param long_term_retention_server_name: The name of the server + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database + :type long_term_retention_database_name: str + :param backup_name: The backup name. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy + request + :type parameters: + ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + LongTermRetentionBackupOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._copy_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + copy.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy'} + + + def _update_initial( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, requested_backup_storage_redundancy=None, custom_headers=None, raw=False, **operation_config): + parameters = models.UpdateLongTermRetentionBackupParameters(requested_backup_storage_redundancy=requested_backup_storage_redundancy) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), + 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), + 'backupName': self._serialize.url("backup_name", backup_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'UpdateLongTermRetentionBackupParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, requested_backup_storage_redundancy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an existing long term retention backup. + + :param location_name: The location of the database. + :type location_name: str + :param long_term_retention_server_name: The name of the server + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database + :type long_term_retention_database_name: str + :param backup_name: The backup name. + :type backup_name: str + :param requested_backup_storage_redundancy: The storage redundancy + type of the copied backup. Possible values include: 'Geo', 'Local', + 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + LongTermRetentionBackupOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + requested_backup_storage_redundancy=requested_backup_storage_redundancy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update'} + + def get( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): """Gets a long term retention backup. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str :param location_name: The location of the database. :type location_name: str :param long_term_retention_server_name: The name of the server @@ -68,9 +289,8 @@ def get_by_resource_group( :raises: :class:`CloudError` """ # Construct URL - url = self.get_by_resource_group.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), @@ -111,15 +331,14 @@ def get_by_resource_group( return client_raw_response return deserialized - get_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} - def _delete_by_resource_group_initial( - self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): + def _delete_initial( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.delete_by_resource_group.metadata['url'] + url = self.delete.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), @@ -154,14 +373,10 @@ def _delete_by_resource_group_initial( client_raw_response = ClientRawResponse(None, response) return client_raw_response - def delete_by_resource_group( - self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, polling=True, **operation_config): + def delete( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a long term retention backup. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param long_term_retention_server_name: The name of the server @@ -181,8 +396,7 @@ def delete_by_resource_group( ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ - raw_result = self._delete_by_resource_group_initial( - resource_group_name=resource_group_name, + raw_result = self._delete_initial( location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, long_term_retention_database_name=long_term_retention_database_name, @@ -204,16 +418,12 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} - def list_by_resource_group_database( - self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): + def list_by_database( + self, location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): """Lists all long term retention backups for a database. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param long_term_retention_server_name: The name of the server @@ -226,8 +436,7 @@ def list_by_resource_group_database( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or - ~azure.mgmt.sql.models.LongTermRetentionDatabaseState + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -241,9 +450,8 @@ def list_by_resource_group_database( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group_database.metadata['url'] + url = self.list_by_database.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), @@ -296,16 +504,12 @@ def internal_paging(next_link=None): deserialized = models.LongTermRetentionBackupPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups'} - def list_by_resource_group_location( - self, resource_group_name, location_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): + def list_by_location( + self, location_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): """Lists the long term retention backups for a given location. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param only_latest_per_database: Whether or not to only get the latest @@ -314,8 +518,7 @@ def list_by_resource_group_location( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or - ~azure.mgmt.sql.models.LongTermRetentionDatabaseState + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -329,9 +532,8 @@ def list_by_resource_group_location( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group_location.metadata['url'] + url = self.list_by_location.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -382,16 +584,12 @@ def internal_paging(next_link=None): deserialized = models.LongTermRetentionBackupPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups'} + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups'} - def list_by_resource_group_server( - self, resource_group_name, location_name, long_term_retention_server_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): + def list_by_server( + self, location_name, long_term_retention_server_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): """Lists the long term retention backups for a given server. - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param long_term_retention_server_name: The name of the server @@ -402,8 +600,7 @@ def list_by_resource_group_server( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or - ~azure.mgmt.sql.models.LongTermRetentionDatabaseState + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -417,9 +614,8 @@ def list_by_resource_group_server( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_resource_group_server.metadata['url'] + url = self.list_by_server.metadata['url'] path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -471,12 +667,253 @@ def internal_paging(next_link=None): deserialized = models.LongTermRetentionBackupPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups'} + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups'} - def get( - self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): + + def _copy_by_resource_group_initial( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.copy_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), + 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), + 'backupName': self._serialize.url("backup_name", backup_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'CopyLongTermRetentionBackupParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def copy_by_resource_group( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Copy an existing long term retention backup to a different server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param location_name: The location of the database. + :type location_name: str + :param long_term_retention_server_name: The name of the server + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database + :type long_term_retention_database_name: str + :param backup_name: The backup name. + :type backup_name: str + :param parameters: The parameters needed for long term retention copy + request + :type parameters: + ~azure.mgmt.sql.models.CopyLongTermRetentionBackupParameters + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + LongTermRetentionBackupOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._copy_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + copy_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/copy'} + + + def _update_by_resource_group_initial( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, requested_backup_storage_redundancy=None, custom_headers=None, raw=False, **operation_config): + parameters = models.UpdateLongTermRetentionBackupParameters(requested_backup_storage_redundancy=requested_backup_storage_redundancy) + + # Construct URL + url = self.update_by_resource_group.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), + 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), + 'backupName': self._serialize.url("backup_name", backup_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'UpdateLongTermRetentionBackupParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update_by_resource_group( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, requested_backup_storage_redundancy=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates an existing long term retention backup. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param location_name: The location of the database. + :type location_name: str + :param long_term_retention_server_name: The name of the server + :type long_term_retention_server_name: str + :param long_term_retention_database_name: The name of the database + :type long_term_retention_database_name: str + :param backup_name: The backup name. + :type backup_name: str + :param requested_backup_storage_redundancy: The storage redundancy + type of the copied backup. Possible values include: 'Geo', 'Local', + 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + LongTermRetentionBackupOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.LongTermRetentionBackupOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._update_by_resource_group_initial( + resource_group_name=resource_group_name, + location_name=location_name, + long_term_retention_server_name=long_term_retention_server_name, + long_term_retention_database_name=long_term_retention_database_name, + backup_name=backup_name, + requested_backup_storage_redundancy=requested_backup_storage_redundancy, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('LongTermRetentionBackupOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + update_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}/update'} + + def get_by_resource_group( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): """Gets a long term retention backup. + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str :param location_name: The location of the database. :type location_name: str :param long_term_retention_server_name: The name of the server @@ -496,8 +933,9 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.get_by_resource_group.metadata['url'] path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), @@ -538,14 +976,15 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} + get_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} - def _delete_initial( - self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): + def _delete_by_resource_group_initial( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.delete.metadata['url'] + url = self.delete_by_resource_group.metadata['url'] path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), @@ -580,10 +1019,14 @@ def _delete_initial( client_raw_response = ClientRawResponse(None, response) return client_raw_response - def delete( - self, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, polling=True, **operation_config): + def delete_by_resource_group( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, backup_name, custom_headers=None, raw=False, polling=True, **operation_config): """Deletes a long term retention backup. + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param long_term_retention_server_name: The name of the server @@ -603,7 +1046,8 @@ def delete( ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ - raw_result = self._delete_initial( + raw_result = self._delete_by_resource_group_initial( + resource_group_name=resource_group_name, location_name=location_name, long_term_retention_server_name=long_term_retention_server_name, long_term_retention_database_name=long_term_retention_database_name, @@ -625,12 +1069,16 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} + delete_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups/{backupName}'} - def list_by_database( - self, location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): + def list_by_resource_group_database( + self, resource_group_name, location_name, long_term_retention_server_name, long_term_retention_database_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): """Lists all long term retention backups for a database. + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param long_term_retention_server_name: The name of the server @@ -643,8 +1091,7 @@ def list_by_database( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or - ~azure.mgmt.sql.models.LongTermRetentionDatabaseState + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -658,8 +1105,9 @@ def list_by_database( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_database.metadata['url'] + url = self.list_by_resource_group_database.metadata['url'] path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'longTermRetentionDatabaseName': self._serialize.url("long_term_retention_database_name", long_term_retention_database_name, 'str'), @@ -712,12 +1160,16 @@ def internal_paging(next_link=None): deserialized = models.LongTermRetentionBackupPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups'} + list_by_resource_group_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionDatabases/{longTermRetentionDatabaseName}/longTermRetentionBackups'} - def list_by_location( - self, location_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): + def list_by_resource_group_location( + self, resource_group_name, location_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): """Lists the long term retention backups for a given location. + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param only_latest_per_database: Whether or not to only get the latest @@ -726,8 +1178,7 @@ def list_by_location( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or - ~azure.mgmt.sql.models.LongTermRetentionDatabaseState + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -741,8 +1192,9 @@ def list_by_location( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_location.metadata['url'] + url = self.list_by_resource_group_location.metadata['url'] path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -793,12 +1245,16 @@ def internal_paging(next_link=None): deserialized = models.LongTermRetentionBackupPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups'} + list_by_resource_group_location.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionBackups'} - def list_by_server( - self, location_name, long_term_retention_server_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): + def list_by_resource_group_server( + self, resource_group_name, location_name, long_term_retention_server_name, only_latest_per_database=None, database_state=None, custom_headers=None, raw=False, **operation_config): """Lists the long term retention backups for a given server. + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str :param location_name: The location of the database :type location_name: str :param long_term_retention_server_name: The name of the server @@ -809,8 +1265,7 @@ def list_by_server( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or - ~azure.mgmt.sql.models.LongTermRetentionDatabaseState + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -824,8 +1279,9 @@ def list_by_server( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_server.metadata['url'] + url = self.list_by_resource_group_server.metadata['url'] path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'locationName': self._serialize.url("location_name", location_name, 'str'), 'longTermRetentionServerName': self._serialize.url("long_term_retention_server_name", long_term_retention_server_name, 'str'), 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') @@ -877,4 +1333,4 @@ def internal_paging(next_link=None): deserialized = models.LongTermRetentionBackupPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups'} + list_by_resource_group_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/longTermRetentionServers/{longTermRetentionServerName}/longTermRetentionBackups'} 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 6de0045d6600..7fe1661c2fde 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 @@ -27,7 +27,7 @@ class LongTermRetentionManagedInstanceBackupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -212,7 +212,7 @@ def list_by_database( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState1 + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -297,7 +297,7 @@ def list_by_instance( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState2 + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -380,7 +380,7 @@ def list_by_location( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState3 + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -635,7 +635,7 @@ def list_by_resource_group_database( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState4 + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -725,7 +725,7 @@ def list_by_resource_group_instance( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState5 + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -813,7 +813,7 @@ def list_by_resource_group_location( :param database_state: Whether to query against just live databases, just deleted databases, or all databases. Possible values include: 'All', 'Live', 'Deleted' - :type database_state: str or ~azure.mgmt.sql.models.DatabaseState6 + :type database_state: str or ~azure.mgmt.sql.models.DatabaseState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py similarity index 75% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_long_term_retention_policies_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py index 532ce23b9aef..70d71e466f0a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_long_term_retention_policies_operations.py @@ -18,8 +18,8 @@ from .. import models -class BackupLongTermRetentionPoliciesOperations(object): - """BackupLongTermRetentionPoliciesOperations operations. +class LongTermRetentionPoliciesOperations(object): + """LongTermRetentionPoliciesOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -28,7 +28,7 @@ class BackupLongTermRetentionPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar policy_name: The policy name. Should always be Default. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -60,9 +60,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: BackupLongTermRetentionPolicy or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.sql.models.BackupLongTermRetentionPolicy or + :return: LongTermRetentionPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.LongTermRetentionPolicy or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ @@ -102,7 +101,7 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BackupLongTermRetentionPolicy', response) + deserialized = self._deserialize('LongTermRetentionPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -141,7 +140,7 @@ def _create_or_update_initial( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'BackupLongTermRetentionPolicy') + body_content = self._serialize.body(parameters, 'LongTermRetentionPolicy') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) @@ -155,7 +154,7 @@ def _create_or_update_initial( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('BackupLongTermRetentionPolicy', response) + deserialized = self._deserialize('LongTermRetentionPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -176,19 +175,18 @@ def create_or_update( :param database_name: The name of the database. :type database_name: str :param parameters: The long term retention policy info. - :type parameters: ~azure.mgmt.sql.models.BackupLongTermRetentionPolicy + :type parameters: ~azure.mgmt.sql.models.LongTermRetentionPolicy :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns - BackupLongTermRetentionPolicy or - ClientRawResponse if raw==True + :return: An instance of LROPoller that returns LongTermRetentionPolicy + or ClientRawResponse if raw==True :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.BackupLongTermRetentionPolicy] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.LongTermRetentionPolicy] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.BackupLongTermRetentionPolicy]] + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.LongTermRetentionPolicy]] :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( @@ -202,7 +200,7 @@ def create_or_update( ) def get_long_running_output(response): - deserialized = self._deserialize('BackupLongTermRetentionPolicy', response) + deserialized = self._deserialize('LongTermRetentionPolicy', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -236,52 +234,62 @@ def list_by_database( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: BackupLongTermRetentionPolicy or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.sql.models.BackupLongTermRetentionPolicy or - ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of LongTermRetentionPolicy + :rtype: + ~azure.mgmt.sql.models.LongTermRetentionPolicyPaged[~azure.mgmt.sql.models.LongTermRetentionPolicy] :raises: :class:`CloudError` """ - # Construct URL - url = self.list_by_database.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('BackupLongTermRetentionPolicy', response) - + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response + header_dict = {} + deserialized = models.LongTermRetentionPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/backupLongTermRetentionPolicies'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py new file mode 100644 index 000000000000..40c5c6c01a56 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_window_options_operations.py @@ -0,0 +1,111 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class MaintenanceWindowOptionsOperations(object): + """MaintenanceWindowOptionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, maintenance_window_options_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of available maintenance windows. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database to get maintenance + windows options for. + :type database_name: str + :param maintenance_window_options_name: Maintenance window options + name. + :type maintenance_window_options_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: MaintenanceWindowOptions or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.MaintenanceWindowOptions or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['maintenanceWindowOptionsName'] = self._serialize.query("maintenance_window_options_name", maintenance_window_options_name, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MaintenanceWindowOptions', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindowOptions/current'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_threat_detection_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_threat_detection_policies_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py index 888228ba55d3..b3638ec340e5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_threat_detection_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_maintenance_windows_operations.py @@ -16,8 +16,8 @@ from .. import models -class DatabaseThreatDetectionPoliciesOperations(object): - """DatabaseThreatDetectionPoliciesOperations operations. +class MaintenanceWindowsOperations(object): + """MaintenanceWindowsOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,8 +25,7 @@ class DatabaseThreatDetectionPoliciesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar security_alert_policy_name: The name of the security alert policy. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,14 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.security_alert_policy_name = "default" - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a database's threat detection policy. + self, resource_group_name, server_name, database_name, maintenance_window_name, custom_headers=None, raw=False, **operation_config): + """Gets maintenance windows settings for a database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -51,32 +49,34 @@ def get( :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 database - Threat Detection policy is defined. + :param database_name: The name of the database to get maintenance + windows for. :type database_name: str + :param maintenance_window_name: Maintenance window name. + :type maintenance_window_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: DatabaseSecurityAlertPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or + :return: MaintenanceWindows or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.MaintenanceWindows or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_policy_name, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + query_parameters['maintenanceWindowName'] = self._serialize.query("maintenance_window_name", maintenance_window_name, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -100,18 +100,18 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) + deserialized = self._deserialize('MaintenanceWindows', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current'} def create_or_update( - self, resource_group_name, server_name, database_name, parameters, custom_headers=None, raw=False, **operation_config): - """Creates or updates a database's threat detection policy. + self, resource_group_name, server_name, database_name, maintenance_window_name, time_ranges=None, custom_headers=None, raw=False, **operation_config): + """Sets maintenance windows settings for a database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -119,39 +119,42 @@ def create_or_update( :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 database - Threat Detection policy is defined. + :param database_name: The name of the database to set maintenance + windows for. :type database_name: str - :param parameters: The database Threat Detection policy. - :type parameters: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy + :param maintenance_window_name: Maintenance window name. + :type maintenance_window_name: str + :param time_ranges: + :type time_ranges: + list[~azure.mgmt.sql.models.MaintenanceWindowTimeRange] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: DatabaseSecurityAlertPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or - ~msrest.pipeline.ClientRawResponse + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + parameters = models.MaintenanceWindows(time_ranges=time_ranges) + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_policy_name, 'str') + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} + query_parameters['maintenanceWindowName'] = self._serialize.query("maintenance_window_name", maintenance_window_name, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -161,26 +164,18 @@ def create_or_update( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct body - body_content = self._serialize.body(parameters, 'DatabaseSecurityAlertPolicy') + body_content = self._serialize.body(parameters, 'MaintenanceWindows') # Construct and send request request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) - if response.status_code == 201: - deserialized = self._deserialize('DatabaseSecurityAlertPolicy', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - - return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/securityAlertPolicies/{securityAlertPolicyName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/maintenanceWindows/current'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py index 475f8b2228e1..55ded7558fa2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_backup_short_term_retention_policies_operations.py @@ -28,7 +28,7 @@ class ManagedBackupShortTermRetentionPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar policy_name: The policy name. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py new file mode 100644 index 000000000000..fda9d934631d --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_columns_operations.py @@ -0,0 +1,301 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ManagedDatabaseColumnsOperations(object): + """ManagedDatabaseColumnsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def list_by_database( + self, resource_group_name, managed_instance_name, database_name, schema=None, table=None, column=None, order_by=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """List managed database columns. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema: + :type schema: list[str] + :param table: + :type table: list[str] + :param column: + :type column: list[str] + :param order_by: + :type order_by: list[str] + :param skiptoken: An opaque token that identifies a starting point in + the collection. + :type skiptoken: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatabaseColumn + :rtype: + ~azure.mgmt.sql.models.DatabaseColumnPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if schema is not None: + query_parameters['schema'] = self._serialize.query("schema", schema, '[str]', div=',') + if table is not None: + query_parameters['table'] = self._serialize.query("table", table, '[str]', div=',') + if column is not None: + query_parameters['column'] = self._serialize.query("column", column, '[str]', div=',') + if order_by is not None: + query_parameters['orderBy'] = self._serialize.query("order_by", order_by, '[str]', div=',') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatabaseColumnPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/columns'} + + def list_by_table( + self, resource_group_name, managed_instance_name, database_name, schema_name, table_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List managed database columns. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema_name: The name of the schema. + :type schema_name: str + :param table_name: The name of the table. + :type table_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatabaseColumn + :rtype: + ~azure.mgmt.sql.models.DatabaseColumnPaged[~azure.mgmt.sql.models.DatabaseColumn] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_table.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'tableName': self._serialize.url("table_name", table_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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatabaseColumnPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_table.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns'} + + def get( + self, resource_group_name, managed_instance_name, database_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): + """Get managed database column. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema_name: The name of the schema. + :type schema_name: str + :param table_name: The name of the table. + :type table_name: str + :param column_name: The name of the column. + :type column_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseColumn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseColumn or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'tableName': self._serialize.url("table_name", table_name, 'str'), + 'columnName': self._serialize.url("column_name", column_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabaseColumn', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py new file mode 100644 index 000000000000..7cbf6af19744 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_queries_operations.py @@ -0,0 +1,202 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ManagedDatabaseQueriesOperations(object): + """ManagedDatabaseQueriesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, managed_instance_name, database_name, query_id, custom_headers=None, raw=False, **operation_config): + """Get query by query id. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param query_id: + :type query_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagedInstanceQuery or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ManagedInstanceQuery or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'queryId': self._serialize.url("query_id", query_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagedInstanceQuery', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}'} + + def list_by_query( + self, resource_group_name, managed_instance_name, database_name, query_id, start_time=None, end_time=None, interval=None, custom_headers=None, raw=False, **operation_config): + """Get query execution statistics by query id. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param query_id: + :type query_id: str + :param start_time: Start time for observed period. + :type start_time: str + :param end_time: End time for observed period. + :type end_time: str + :param interval: The time step to be used to summarize the metric + values. Possible values include: 'PT1H', 'P1D' + :type interval: str or ~azure.mgmt.sql.models.QueryTimeGrainType + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of QueryStatistics + :rtype: + ~azure.mgmt.sql.models.QueryStatisticsPaged[~azure.mgmt.sql.models.QueryStatistics] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_query.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'queryId': self._serialize.url("query_id", query_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if start_time is not None: + query_parameters['startTime'] = self._serialize.query("start_time", start_time, 'str') + if end_time is not None: + query_parameters['endTime'] = self._serialize.query("end_time", end_time, 'str') + if interval is not None: + query_parameters['interval'] = self._serialize.query("interval", interval, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.QueryStatisticsPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/queries/{queryId}/statistics'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py new file mode 100644 index 000000000000..848d2a7ce68f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_recommended_sensitivity_labels_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ManagedDatabaseRecommendedSensitivityLabelsOperations(object): + """ManagedDatabaseRecommendedSensitivityLabelsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def update( + self, resource_group_name, managed_instance_name, database_name, operations=None, custom_headers=None, raw=False, **operation_config): + """Update recommended sensitivity labels states of a given database using + an operations batch. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param operations: + :type operations: + list[~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.RecommendedSensitivityLabelUpdateList(operations=operations) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RecommendedSensitivityLabelUpdateList') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/recommendedSensitivityLabels'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py index a9c6e0988623..32d453391109 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_restore_details_operations.py @@ -26,7 +26,7 @@ class ManagedDatabaseRestoreDetailsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar restore_details_name: The name of the restore details to retrieve. Constant value: "Default". - :ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.restore_details_name = "Default" - self.api_version = "2020-02-02-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py new file mode 100644 index 000000000000..59922c6b1b0a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_schemas_operations.py @@ -0,0 +1,191 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ManagedDatabaseSchemasOperations(object): + """ManagedDatabaseSchemasOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def list_by_database( + self, resource_group_name, managed_instance_name, database_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List managed database schemas. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatabaseSchema + :rtype: + ~azure.mgmt.sql.models.DatabaseSchemaPaged[~azure.mgmt.sql.models.DatabaseSchema] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatabaseSchemaPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas'} + + def get( + self, resource_group_name, managed_instance_name, database_name, schema_name, custom_headers=None, raw=False, **operation_config): + """Get managed database schema. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema_name: The name of the schema. + :type schema_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseSchema or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseSchema or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabaseSchema', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py index c1f7467d795c..491f36f0b9ac 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_alert_policies_operations.py @@ -26,7 +26,7 @@ class ManagedDatabaseSecurityAlertPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar security_alert_policy_name: The name of the security alert policy. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.security_alert_policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config 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/_managed_database_security_events_operations.py similarity index 62% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py index 6807645bd6c0..5192ee5c3613 100644 --- 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/_managed_database_security_events_operations.py @@ -16,8 +16,8 @@ from .. import models -class TransparentDataEncryptionActivitiesOperations(object): - """TransparentDataEncryptionActivitiesOperations operations. +class ManagedDatabaseSecurityEventsOperations(object): + """ManagedDatabaseSecurityEventsOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,8 +25,7 @@ class TransparentDataEncryptionActivitiesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - :ivar transparent_data_encryption_name: The name of the transparent data encryption configuration. Constant value: "current". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,50 +35,65 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" - self.transparent_data_encryption_name = "current" + self.api_version = "2021-02-01-preview" self.config = config - def list_by_configuration( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Returns a database's transparent data encryption operation result. + def list_by_database( + self, resource_group_name, managed_instance_name, database_name, filter=None, skip=None, top=None, skiptoken=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of security events. :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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the managed database for which the + security events are retrieved. :type database_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: str + :param skip: The number of elements in the collection to skip. + :type skip: long + :param top: The number of elements to return from the collection. + :type top: long + :param skiptoken: An opaque token that identifies a starting point in + the collection. + :type skiptoken: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of - TransparentDataEncryptionActivity + :return: An iterator like instance of SecurityEvent :rtype: - ~azure.mgmt.sql.models.TransparentDataEncryptionActivityPaged[~azure.mgmt.sql.models.TransparentDataEncryptionActivity] + ~azure.mgmt.sql.models.SecurityEventPaged[~azure.mgmt.sql.models.SecurityEvent] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_configuration.metadata['url'] + url = self.list_by_database.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("self.transparent_data_encryption_name", self.transparent_data_encryption_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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'long') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'long') + if skiptoken is not None: + query_parameters['$skiptoken'] = self._serialize.query("skiptoken", skiptoken, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -116,7 +130,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.TransparentDataEncryptionActivityPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.SecurityEventPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults'} + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/securityEvents'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py index 5ff97dd77a49..46f4b406ff92 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_sensitivity_labels_operations.py @@ -25,7 +25,7 @@ class ManagedDatabaseSensitivityLabelsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -417,7 +417,7 @@ def enable_recommendation( enable_recommendation.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}/enable'} def list_current_by_database( - self, resource_group_name, managed_instance_name, database_name, filter=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, managed_instance_name, database_name, skip_token=None, count=None, filter=None, custom_headers=None, raw=False, **operation_config): """Gets the sensitivity labels of a given database. :param resource_group_name: The name of the resource group that @@ -428,6 +428,10 @@ def list_current_by_database( :type managed_instance_name: str :param database_name: The name of the database. :type database_name: str + :param skip_token: + :type skip_token: str + :param count: + :type count: bool :param filter: An OData filter expression that filters elements in the collection. :type filter: str @@ -455,6 +459,10 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if count is not None: + query_parameters['$count'] = self._serialize.query("count", count, 'bool') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') @@ -498,8 +506,75 @@ def internal_paging(next_link=None): return deserialized list_current_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels'} + def update( + self, resource_group_name, managed_instance_name, database_name, operations=None, custom_headers=None, raw=False, **operation_config): + """Update sensitivity labels of a given database using an operations + batch. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param operations: + :type operations: list[~azure.mgmt.sql.models.SensitivityLabelUpdate] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.SensitivityLabelUpdateList(operations=operations) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SensitivityLabelUpdateList') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/currentSensitivityLabels'} + def list_recommended_by_database( - self, resource_group_name, managed_instance_name, database_name, include_disabled_recommendations=None, skip_token=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, managed_instance_name, database_name, skip_token=None, include_disabled_recommendations=None, filter=None, custom_headers=None, raw=False, **operation_config): """Gets the sensitivity labels of a given database. :param resource_group_name: The name of the resource group that @@ -510,11 +585,11 @@ def list_recommended_by_database( :type managed_instance_name: str :param database_name: The name of the database. :type database_name: str + :param skip_token: + :type skip_token: str :param include_disabled_recommendations: Specifies whether to include disabled recommendations or not. :type include_disabled_recommendations: bool - :param skip_token: - :type skip_token: str :param filter: An OData filter expression that filters elements in the collection. :type filter: str @@ -542,10 +617,10 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - if include_disabled_recommendations is not None: - query_parameters['includeDisabledRecommendations'] = self._serialize.query("include_disabled_recommendations", include_disabled_recommendations, 'bool') if skip_token is not None: query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if include_disabled_recommendations is not None: + query_parameters['includeDisabledRecommendations'] = self._serialize.query("include_disabled_recommendations", include_disabled_recommendations, 'bool') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py new file mode 100644 index 000000000000..1a3cc4cfb717 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_tables_operations.py @@ -0,0 +1,197 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ManagedDatabaseTablesOperations(object): + """ManagedDatabaseTablesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def list_by_schema( + self, resource_group_name, managed_instance_name, database_name, schema_name, filter=None, custom_headers=None, raw=False, **operation_config): + """List managed database tables. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema_name: The name of the schema. + :type schema_name: str + :param filter: An OData filter expression that filters elements in the + collection. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DatabaseTable + :rtype: + ~azure.mgmt.sql.models.DatabaseTablePaged[~azure.mgmt.sql.models.DatabaseTable] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_schema.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_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 = {} + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.DatabaseTablePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_schema.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables'} + + def get( + self, resource_group_name, managed_instance_name, database_name, schema_name, table_name, custom_headers=None, raw=False, **operation_config): + """Get managed database table. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param schema_name: The name of the schema. + :type schema_name: str + :param table_name: The name of the table. + :type table_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DatabaseTable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseTable or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'tableName': self._serialize.url("table_name", table_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DatabaseTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/schemas/{schemaName}/tables/{tableName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py new file mode 100644 index 000000000000..b80acf5dd2e4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_transparent_data_encryption_operations.py @@ -0,0 +1,270 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ManagedDatabaseTransparentDataEncryptionOperations(object): + """ManagedDatabaseTransparentDataEncryptionOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar tde_name: The name of the transparent data encryption configuration. Constant value: "current". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.tde_name = "current" + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a managed 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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the managed database for which the + transparent data encryption is defined. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagedTransparentDataEncryption or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'tdeName': self._serialize.url("self.tde_name", self.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) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagedTransparentDataEncryption', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} + + def create_or_update( + self, resource_group_name, managed_instance_name, database_name, state, custom_headers=None, raw=False, **operation_config): + """Updates a 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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the managed database for which the + security alert policy is defined. + :type database_name: 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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagedTransparentDataEncryption or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.ManagedTransparentDataEncryption or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.ManagedTransparentDataEncryption(state=state) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'tdeName': self._serialize.url("self.tde_name", self.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) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ManagedTransparentDataEncryption') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagedTransparentDataEncryption', response) + if response.status_code == 201: + deserialized = self._deserialize('ManagedTransparentDataEncryption', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} + + def list_by_database( + self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of managed database's transparent data encryptions. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the managed database for which the + transparent data encryption is defined. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedTransparentDataEncryption + :rtype: + ~azure.mgmt.sql.models.ManagedTransparentDataEncryptionPaged[~azure.mgmt.sql.models.ManagedTransparentDataEncryption] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ManagedTransparentDataEncryptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/transparentDataEncryption'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py index 2c4017b6193b..24c166743c4c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_rule_baselines_operations.py @@ -26,7 +26,7 @@ class ManagedDatabaseVulnerabilityAssessmentRuleBaselinesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py index e3a2b20ffdc4..bf214c95abf8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessment_scans_operations.py @@ -28,7 +28,7 @@ class ManagedDatabaseVulnerabilityAssessmentScansOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,161 +39,10 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config - def list_by_database( - self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): - """Lists the vulnerability assessment scans of a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param database_name: The name of the database. - :type database_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of - VulnerabilityAssessmentScanRecord - :rtype: - ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_database.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans'} - - def get( - self, resource_group_name, managed_instance_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): - """Gets a vulnerability assessment scan record of a database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param database_name: The name of the database. - :type database_name: str - :param scan_id: The vulnerability assessment scan Id of the scan to - retrieve. - :type scan_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: VulnerabilityAssessmentScanRecord or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), - 'scanId': self._serialize.url("scan_id", scan_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('VulnerabilityAssessmentScanRecord', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}'} - def _initiate_scan_initial( self, resource_group_name, managed_instance_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): @@ -359,3 +208,154 @@ def export( return deserialized export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export'} + + def list_by_database( + self, resource_group_name, managed_instance_name, database_name, custom_headers=None, raw=False, **operation_config): + """Lists the vulnerability assessment scans of a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + VulnerabilityAssessmentScanRecord + :rtype: + ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecordPaged[~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.VulnerabilityAssessmentScanRecordPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans'} + + def get( + self, resource_group_name, managed_instance_name, database_name, scan_id, custom_headers=None, raw=False, **operation_config): + """Gets a vulnerability assessment scan record of a database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param database_name: The name of the database. + :type database_name: str + :param scan_id: The vulnerability assessment scan Id of the scan to + retrieve. + :type scan_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: VulnerabilityAssessmentScanRecord or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.sql.models.VulnerabilityAssessmentScanRecord or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'scanId': self._serialize.url("scan_id", scan_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('VulnerabilityAssessmentScanRecord', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py index c5d8e57cb81f..abec08887759 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_vulnerability_assessments_operations.py @@ -26,7 +26,7 @@ class ManagedDatabaseVulnerabilityAssessmentsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py index 117395813f75..45fba4850c2a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_databases_operations.py @@ -27,7 +27,7 @@ class ManagedDatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-02-02-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py index 5851bb683248..fd6f33e75c40 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_administrators_operations.py @@ -27,8 +27,8 @@ class ManagedInstanceAdministratorsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". - :ivar administrator_name: The administrator name. Constant value: "ActiveDirectory". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + :ivar administrator_name: . Constant value: "ActiveDirectory". """ models = models @@ -38,7 +38,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.administrator_name = "ActiveDirectory" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py index 3a5cfedf4bb5..c61fd9686a86 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_azure_ad_only_authentications_operations.py @@ -28,7 +28,7 @@ class ManagedInstanceAzureADOnlyAuthenticationsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar authentication_name: The name of server azure active directory only authentication. Constant value: "Default". - :ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.authentication_name = "Default" - self.api_version = "2020-02-02-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py index 2224d3d8728f..b1a7f149fc51 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_encryption_protectors_operations.py @@ -28,7 +28,7 @@ class ManagedInstanceEncryptionProtectorsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar encryption_protector_name: The name of the encryption protector to be updated. Constant value: "current". - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.encryption_protector_name = "current" - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -267,9 +267,7 @@ def get( def _create_or_update_initial( - self, resource_group_name, managed_instance_name, server_key_type, server_key_name=None, custom_headers=None, raw=False, **operation_config): - parameters = models.ManagedInstanceEncryptionProtector(server_key_name=server_key_name, server_key_type=server_key_type) - + self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -319,7 +317,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, managed_instance_name, server_key_type, server_key_name=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, managed_instance_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates an existing encryption protector. :param resource_group_name: The name of the resource group that @@ -328,12 +326,9 @@ def create_or_update( :type resource_group_name: str :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str - :param server_key_type: The encryption protector type like - 'ServiceManaged', 'AzureKeyVault'. Possible values include: - 'ServiceManaged', 'AzureKeyVault' - :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType - :param server_key_name: The name of the managed instance key. - :type server_key_name: str + :param parameters: The requested encryption protector resource state. + :type parameters: + ~azure.mgmt.sql.models.ManagedInstanceEncryptionProtector :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -351,8 +346,7 @@ def create_or_update( raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, managed_instance_name=managed_instance_name, - server_key_type=server_key_type, - server_key_name=server_key_name, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py index 7d7876efc7bd..7a573aeb2e8c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_keys_operations.py @@ -27,7 +27,7 @@ class ManagedInstanceKeysOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py index e26952358e26..a9eb85265cd7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_long_term_retention_policies_operations.py @@ -28,7 +28,7 @@ class ManagedInstanceLongTermRetentionPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar policy_name: The policy name. Should always be Default. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.policy_name = "default" - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations.py index 364884fafd7b..9de21a8c434c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_operations.py @@ -25,7 +25,7 @@ class ManagedInstanceOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,68 +35,10 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config - def cancel( - self, resource_group_name, managed_instance_name, operation_id, custom_headers=None, raw=False, **operation_config): - """Cancels the asynchronous operation on the managed instance. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param managed_instance_name: The name of the managed instance. - :type managed_instance_name: str - :param operation_id: - :type operation_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.cancel.metadata['url'] - path_format_arguments = { - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), - 'operationId': self._serialize.url("operation_id", operation_id, 'str'), - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel'} - def list_by_managed_instance( self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): """Gets a list of operations performed on the managed instance. @@ -236,3 +178,61 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}'} + + def cancel( + self, resource_group_name, managed_instance_name, operation_id, custom_headers=None, raw=False, **operation_config): + """Cancels the asynchronous operation on the managed instance. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param operation_id: + :type operation_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'operationId': self._serialize.url("operation_id", operation_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/operations/{operationId}/cancel'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py new file mode 100644 index 000000000000..9329d79efd27 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_endpoint_connections_operations.py @@ -0,0 +1,388 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ManagedInstancePrivateEndpointConnectionsOperations(object): + """ManagedInstancePrivateEndpointConnectionsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def get( + self, resource_group_name, managed_instance_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + """Gets a private endpoint connection. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param private_endpoint_connection_name: The name of the private + endpoint connection. + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagedInstancePrivateEndpointConnection or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagedInstancePrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _create_or_update_initial( + self, resource_group_name, managed_instance_name, private_endpoint_connection_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ManagedInstancePrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ManagedInstancePrivateEndpointConnection') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ManagedInstancePrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, managed_instance_name, private_endpoint_connection_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Approve or reject a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param private_endpoint: Private endpoint which the connection belongs + to. + :type private_endpoint: + ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointProperty + :param private_link_service_connection_state: Connection State of the + Private Endpoint Connection. + :type private_link_service_connection_state: + ~azure.mgmt.sql.models.ManagedInstancePrivateLinkServiceConnectionStateProperty + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ManagedInstancePrivateEndpointConnection or + ClientRawResponse if + raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + private_endpoint=private_endpoint, + private_link_service_connection_state=private_link_service_connection_state, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ManagedInstancePrivateEndpointConnection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + + def _delete_initial( + self, resource_group_name, managed_instance_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'privateEndpointConnectionName': self._serialize.url("private_endpoint_connection_name", private_endpoint_connection_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, managed_instance_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a private endpoint connection with a given name. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param private_endpoint_connection_name: + :type private_endpoint_connection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + managed_instance_name=managed_instance_name, + private_endpoint_connection_name=private_endpoint_connection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections/{privateEndpointConnectionName}'} + + def list_by_managed_instance( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets all private endpoint connections on a server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + ManagedInstancePrivateEndpointConnection + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnectionPaged[~azure.mgmt.sql.models.ManagedInstancePrivateEndpointConnection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_managed_instance.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ManagedInstancePrivateEndpointConnectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_managed_instance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateEndpointConnections'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py similarity index 73% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py index f1ae98c7828e..5ce9fe75ac13 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_service_objectives_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py @@ -16,8 +16,8 @@ from .. import models -class ServiceObjectivesOperations(object): - """ServiceObjectivesOperations operations. +class ManagedInstancePrivateLinkResourcesOperations(object): + """ManagedInstancePrivateLinkResourcesOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,7 +25,7 @@ class ServiceObjectivesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,105 +35,38 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def get( - self, resource_group_name, server_name, service_objective_name, custom_headers=None, raw=False, **operation_config): - """Gets a database service objective. - - :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 service_objective_name: The name of the service objective to - retrieve. - :type service_objective_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ServiceObjective or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ServiceObjective or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'serviceObjectiveName': self._serialize.url("service_objective_name", service_objective_name, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('ServiceObjective', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}'} - - def list_by_server( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Returns database service objectives. + def list_by_managed_instance( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets the private link resources for SQL server. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ServiceObjective + :return: An iterator like instance of ManagedInstancePrivateLink :rtype: - ~azure.mgmt.sql.models.ServiceObjectivePaged[~azure.mgmt.sql.models.ServiceObjective] + ~azure.mgmt.sql.models.ManagedInstancePrivateLinkPaged[~azure.mgmt.sql.models.ManagedInstancePrivateLink] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_server.metadata['url'] + url = self.list_by_managed_instance.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -175,7 +108,73 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.ServiceObjectivePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.ManagedInstancePrivateLinkPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_managed_instance.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources'} + + def get( + self, resource_group_name, managed_instance_name, group_name, custom_headers=None, raw=False, **operation_config): + """Gets a private link resource for SQL server. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param group_name: The name of the private link resource. + :type group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ManagedInstancePrivateLink or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ManagedInstancePrivateLink or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'groupName': self._serialize.url("group_name", group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ManagedInstancePrivateLink', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/privateLinkResources/{groupName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py index c3f3e3fdc8e5..8eaf1dd7dbc8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_tde_certificates_operations.py @@ -27,7 +27,7 @@ class ManagedInstanceTdeCertificatesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py index 04c452d37993..674bb6267f62 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_vulnerability_assessments_operations.py @@ -26,7 +26,7 @@ class ManagedInstanceVulnerabilityAssessmentsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config 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 d55732b4a705..b7763a9fef74 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 @@ -27,7 +27,7 @@ class ManagedInstancesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,12 +37,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-02-02-preview" + self.api_version = "2021-02-01-preview" self.config = config def list_by_instance_pool( - self, resource_group_name, instance_pool_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, instance_pool_name, expand=None, custom_headers=None, raw=False, **operation_config): """Gets a list of all managed instances in an instance pool. :param resource_group_name: The name of the resource group that @@ -51,6 +51,8 @@ def list_by_instance_pool( :type resource_group_name: str :param instance_pool_name: The instance pool name. :type instance_pool_name: str + :param expand: The child resources to include in the response. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -74,6 +76,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -115,14 +119,86 @@ def internal_paging(next_link=None): return deserialized list_by_instance_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/instancePools/{instancePoolName}/managedInstances'} + def list( + self, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of all managed instances in the subscription. + + :param expand: The child resources to include in the response. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ManagedInstance + :rtype: + ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} + def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, expand=None, custom_headers=None, raw=False, **operation_config): """Gets a list of managed instances in a resource group. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str + :param expand: The child resources to include in the response. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -145,6 +221,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -187,7 +265,7 @@ def internal_paging(next_link=None): list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances'} def get( - self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, managed_instance_name, expand=None, custom_headers=None, raw=False, **operation_config): """Gets a managed instance. :param resource_group_name: The name of the resource group that @@ -196,6 +274,8 @@ def get( :type resource_group_name: str :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str + :param expand: The child resources to include in the response. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -217,6 +297,8 @@ def get( # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -733,69 +815,3 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/failover'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Gets a list of all managed instances in the subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of ManagedInstance - :rtype: - ~azure.mgmt.sql.models.ManagedInstancePaged[~azure.mgmt.sql.models.ManagedInstance] - :raises: :class:`CloudError` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.ManagedInstancePaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/managedInstances'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py index 882500ff53e5..d89479dfd828 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_restorable_dropped_database_backup_short_term_retention_policies_operations.py @@ -28,7 +28,7 @@ class ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar policy_name: The policy name. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -167,7 +167,7 @@ def _create_or_update_initial( def create_or_update( self, resource_group_name, managed_instance_name, restorable_dropped_database_id, retention_days=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Sets a database's long term retention policy. + """Sets a database's short term retention policy. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -278,7 +278,7 @@ def _update_initial( def update( self, resource_group_name, managed_instance_name, restorable_dropped_database_id, retention_days=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Sets a database's long term retention policy. + """Sets a database's short term retention policy. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure 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 1f75bd170197..354383d961fa 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 @@ -28,7 +28,7 @@ class ManagedServerSecurityAlertPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar security_alert_policy_name: The name of the security alert policy. Constant value: "Default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.security_alert_policy_name = "Default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py index 7ccdf683aa8a..9659b6aa15e2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations_health_operations.py similarity index 66% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations_health_operations.py index 3fb2cfc9bb14..a410c977f1b6 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_activities_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations_health_operations.py @@ -16,8 +16,8 @@ from .. import models -class ElasticPoolActivitiesOperations(object): - """ElasticPoolActivitiesOperations operations. +class OperationsHealthOperations(object): + """OperationsHealthOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,7 +25,7 @@ class ElasticPoolActivitiesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,42 +35,34 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def list_by_elastic_pool( - self, resource_group_name, server_name, elastic_pool_name, custom_headers=None, raw=False, **operation_config): - """Returns elastic pool activities. - - :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 elastic_pool_name: The name of the elastic pool for which to - get the current activity. - :type elastic_pool_name: str + def list_by_location( + self, location_name, custom_headers=None, raw=False, **operation_config): + """Gets a service operation health status. + + :param location_name: The name of the region where the resource is + located. + :type location_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ElasticPoolActivity + :return: An iterator like instance of OperationsHealth :rtype: - ~azure.mgmt.sql.models.ElasticPoolActivityPaged[~azure.mgmt.sql.models.ElasticPoolActivity] + ~azure.mgmt.sql.models.OperationsHealthPaged[~azure.mgmt.sql.models.OperationsHealth] :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_elastic_pool.metadata['url'] + url = self.list_by_location.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'elasticPoolName': self._serialize.url("elastic_pool_name", elastic_pool_name, 'str') + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -112,7 +104,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.ElasticPoolActivityPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.OperationsHealthPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_elastic_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity'} + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/operationsHealth'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py similarity index 72% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py index 3a8782c7510f..9a8ebbf1e659 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_communication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_outbound_firewall_rules_operations.py @@ -18,8 +18,8 @@ from .. import models -class ServerCommunicationLinksOperations(object): - """ServerCommunicationLinksOperations operations. +class OutboundFirewallRulesOperations(object): + """OutboundFirewallRulesOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -27,7 +27,7 @@ class ServerCommunicationLinksOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,13 +37,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def delete( - self, resource_group_name, server_name, communication_link_name, custom_headers=None, raw=False, **operation_config): - """Deletes a server communication link. + def get( + self, resource_group_name, server_name, outbound_rule_fqdn, custom_headers=None, raw=False, **operation_config): + """Gets an outbound firewall rule. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -51,25 +51,25 @@ def delete( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param communication_link_name: The name of the server communication - link. - :type communication_link_name: str + :param outbound_rule_fqdn: + :type outbound_rule_fqdn: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: OutboundFirewallRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.OutboundFirewallRule or + ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL - url = self.delete.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'communicationLinkName': self._serialize.url("communication_link_name", communication_link_name, 'str') + 'outboundRuleFqdn': self._serialize.url("outbound_rule_fqdn", outbound_rule_fqdn, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -79,6 +79,7 @@ def delete( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -87,7 +88,7 @@ def delete( header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -95,41 +96,29 @@ def delete( exp.request_id = response.headers.get('x-ms-request-id') raise exp + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('OutboundFirewallRule', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}'} - def get( - self, resource_group_name, server_name, communication_link_name, custom_headers=None, raw=False, **operation_config): - """Returns a server communication link. + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}'} + + + def _create_or_update_initial( + self, resource_group_name, server_name, outbound_rule_fqdn, custom_headers=None, raw=False, **operation_config): + parameters = None - :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 communication_link_name: The name of the server communication - link. - :type communication_link_name: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: ServerCommunicationLink or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ServerCommunicationLink or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ # Construct URL - url = self.get.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'communicationLinkName': self._serialize.url("communication_link_name", communication_link_name, 'str') + 'outboundRuleFqdn': self._serialize.url("outbound_rule_fqdn", outbound_rule_fqdn, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -140,6 +129,7 @@ def get( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -147,38 +137,93 @@ def get( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(parameters, 'OutboundFirewallRule') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None + if response.status_code == 200: - deserialized = self._deserialize('ServerCommunicationLink', response) + deserialized = self._deserialize('OutboundFirewallRule', response) + if response.status_code == 201: + deserialized = self._deserialize('OutboundFirewallRule', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}'} + def create_or_update( + self, resource_group_name, server_name, outbound_rule_fqdn, custom_headers=None, raw=False, polling=True, **operation_config): + """Create a outbound firewall rule with a given name. + + :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 outbound_rule_fqdn: + :type outbound_rule_fqdn: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns OutboundFirewallRule or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.OutboundFirewallRule] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.OutboundFirewallRule]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + outbound_rule_fqdn=outbound_rule_fqdn, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OutboundFirewallRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}'} - def _create_or_update_initial( - self, resource_group_name, server_name, communication_link_name, partner_server, custom_headers=None, raw=False, **operation_config): - parameters = models.ServerCommunicationLink(partner_server=partner_server) + def _delete_initial( + self, resource_group_name, server_name, outbound_rule_fqdn, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.create_or_update.metadata['url'] + url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'communicationLinkName': self._serialize.url("communication_link_name", communication_link_name, 'str') + 'outboundRuleFqdn': self._serialize.url("outbound_rule_fqdn", outbound_rule_fqdn, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -188,8 +233,6 @@ def _create_or_update_initial( # Construct headers header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -197,32 +240,22 @@ def _create_or_update_initial( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'ServerCommunicationLink') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [201, 202]: + if response.status_code not in [200, 202, 204]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - - if response.status_code == 201: - deserialized = self._deserialize('ServerCommunicationLink', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - - def create_or_update( - self, resource_group_name, server_name, communication_link_name, partner_server, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a server communication link. + def delete( + self, resource_group_name, server_name, outbound_rule_fqdn, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a outbound firewall rule with a given name. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -230,43 +263,33 @@ def create_or_update( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param communication_link_name: The name of the server communication - link. - :type communication_link_name: str - :param partner_server: The name of the partner server. - :type partner_server: str + :param outbound_rule_fqdn: + :type outbound_rule_fqdn: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns ServerCommunicationLink - or ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ServerCommunicationLink] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ServerCommunicationLink]] + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ - raw_result = self._create_or_update_initial( + raw_result = self._delete_initial( resource_group_name=resource_group_name, server_name=server_name, - communication_link_name=communication_link_name, - partner_server=partner_server, + outbound_rule_fqdn=outbound_rule_fqdn, custom_headers=custom_headers, raw=True, **operation_config ) def get_long_running_output(response): - deserialized = self._deserialize('ServerCommunicationLink', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) @@ -274,11 +297,11 @@ def get_long_running_output(response): elif polling is False: polling_method = NoPolling() else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}'} + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}'} def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of server communication links. + """Gets all outbound firewall rules on a server. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -291,9 +314,9 @@ def list_by_server( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ServerCommunicationLink + :return: An iterator like instance of OutboundFirewallRule :rtype: - ~azure.mgmt.sql.models.ServerCommunicationLinkPaged[~azure.mgmt.sql.models.ServerCommunicationLink] + ~azure.mgmt.sql.models.OutboundFirewallRulePaged[~azure.mgmt.sql.models.OutboundFirewallRule] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -301,9 +324,9 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_server.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + '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) @@ -345,7 +368,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.ServerCommunicationLinkPaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.OutboundFirewallRulePaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks'} + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py index ee40d48d7f2a..51c9b93014f2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py @@ -27,7 +27,7 @@ class PrivateEndpointConnectionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py index 5c81d2520dc0..22f30d6b0dcc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_link_resources_operations.py @@ -25,7 +25,7 @@ class PrivateLinkResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py new file mode 100644 index 000000000000..d51211b1ae2a --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recommended_sensitivity_labels_operations.py @@ -0,0 +1,108 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class RecommendedSensitivityLabelsOperations(object): + """RecommendedSensitivityLabelsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def update( + self, resource_group_name, server_name, database_name, operations=None, custom_headers=None, raw=False, **operation_config): + """Update recommended sensitivity labels states of a given database using + an operations batch. + + :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 operations: + :type operations: + list[~azure.mgmt.sql.models.RecommendedSensitivityLabelUpdate] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.RecommendedSensitivityLabelUpdateList(operations=operations) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'RecommendedSensitivityLabelUpdateList') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/recommendedSensitivityLabels'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py index 2595a4069152..72a6f1b36be9 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_recoverable_managed_databases_operations.py @@ -25,7 +25,7 @@ class RecoverableManagedDatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py index 7cb1cad8ec04..304b8aba4db5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_replication_links_operations.py @@ -12,8 +12,6 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.polling import LROPoller, NoPolling -from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -27,7 +25,7 @@ class ReplicationLinksOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,86 +35,105 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def delete( - self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): - """Deletes a database replication link. Cannot be done during failover. + def list_by_database( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of replication links on database. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str - :param server_name: The name of the server. + :param server_name: The name of the server containing the replication + link. :type server_name: str - :param database_name: The name of the database that has the - replication link to be dropped. + :param database_name: The name of the database containing the + replication link. :type database_name: str - :param link_id: The ID of the replication link to be deleted. - :type link_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: An iterator like instance of ReplicationLink + :rtype: + ~azure.mgmt.sql.models.ReplicationLinkPaged[~azure.mgmt.sql.models.ReplicationLink] :raises: :class:`CloudError` """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'linkId': self._serialize.url("link_id", link_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + else: + url = next_link + query_parameters = {} - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - if response.status_code not in [200, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + return response + + # Deserialize response + header_dict = None if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}'} + header_dict = {} + deserialized = models.ReplicationLinkPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks'} def get( - self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): - """Gets a database replication link. + self, resource_group_name, server_name, database_name, replication_link_name, custom_headers=None, raw=False, **operation_config): + """Gets a replication link. :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. + :param server_name: The name of the server containing the replication + link. :type server_name: str - :param database_name: The name of the database to get the link for. + :param database_name: The name of the database containing the + replication link. :type database_name: str - :param link_id: The replication link ID to be retrieved. - :type link_id: str + :param replication_link_name: The name of the replication link. + :type replication_link_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -130,11 +147,11 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'linkId': self._serialize.url("link_id", link_id, 'str') + 'replicationLinkName': self._serialize.url("replication_link_name", replication_link_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -170,302 +187,19 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}'} - - - def _failover_initial( - self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.failover.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'linkId': self._serialize.url("link_id", link_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{replicationLinkName}'} - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def failover( - self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Sets which replica database is primary by failing over from the current - primary replica database. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database that has the - replication link to be failed over. - :type database_name: str - :param link_id: The ID of the replication link to be failed over. - :type link_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._failover_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - failover.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/failover'} - - - def _failover_allow_data_loss_initial( - self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.failover_allow_data_loss.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'linkId': self._serialize.url("link_id", link_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def failover_allow_data_loss( - self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Sets which replica database is primary by failing over from the current - primary replica database. This operation might result in data loss. + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of replication links. :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. + :param server_name: The name of the server containing the replication + link. :type server_name: str - :param database_name: The name of the database that has the - replication link to be failed over. - :type database_name: str - :param link_id: The ID of the replication link to be failed over. - :type link_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._failover_allow_data_loss_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - failover_allow_data_loss.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/forceFailoverAllowDataLoss'} - - - def _unlink_initial( - self, resource_group_name, server_name, database_name, link_id, forced_termination=None, custom_headers=None, raw=False, **operation_config): - parameters = models.UnlinkParameters(forced_termination=forced_termination) - - # Construct URL - url = self.unlink.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'linkId': self._serialize.url("link_id", link_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(parameters, 'UnlinkParameters') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def unlink( - self, resource_group_name, server_name, database_name, link_id, forced_termination=None, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes a database replication link in forced or friendly way. - - :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 that has the - replication link to be failed over. - :type database_name: str - :param link_id: The ID of the replication link to be failed over. - :type link_id: str - :param forced_termination: Determines whether link will be terminated - in a forced or a friendly way. - :type forced_termination: bool - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._unlink_initial( - resource_group_name=resource_group_name, - server_name=server_name, - database_name=database_name, - link_id=link_id, - forced_termination=forced_termination, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - unlink.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}/unlink'} - - def list_by_database( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Lists a database's replication links. - - :param resource_group_name: The name of the resource group that - contains the resource. You can obtain this value from the Azure - Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database to retrieve links for. - :type database_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -479,12 +213,11 @@ def list_by_database( def prepare_request(next_link=None): if not next_link: # Construct URL - url = self.list_by_database.metadata['url'] + url = self.list_by_server.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - '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) @@ -529,4 +262,4 @@ def internal_paging(next_link=None): deserialized = models.ReplicationLinkPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks'} + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/replicationLinks'} 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 aa2480c63f73..90084b74b5d8 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 @@ -25,7 +25,7 @@ class RestorableDroppedDatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,80 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config - def get( - self, resource_group_name, server_name, restorable_droppeded_database_id, custom_headers=None, raw=False, **operation_config): - """Gets a deleted database that can be restored. - - :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 restorable_droppeded_database_id: The id of the deleted - database in the form of databaseName,deletionTimeInFileTimeFormat - :type restorable_droppeded_database_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RestorableDroppedDatabase or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'restorableDroppededDatabaseId': self._serialize.url("restorable_droppeded_database_id", restorable_droppeded_database_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('RestorableDroppedDatabase', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppededDatabaseId}'} - def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets a list of deleted databases that can be restored. + """Gets a list of restorable dropped databases. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -131,9 +64,9 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_server.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + '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) @@ -179,3 +112,69 @@ def internal_paging(next_link=None): return deserialized list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases'} + + def get( + self, resource_group_name, server_name, restorable_dropped_database_id, custom_headers=None, raw=False, **operation_config): + """Gets a restorable dropped database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param restorable_dropped_database_id: + :type restorable_dropped_database_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: RestorableDroppedDatabase or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.RestorableDroppedDatabase or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'restorableDroppedDatabaseId': self._serialize.url("restorable_dropped_database_id", restorable_dropped_database_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RestorableDroppedDatabase', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/restorableDroppedDatabases/{restorableDroppedDatabaseId}'} 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 0ef3d7b7c3c8..a9ba7ef46302 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 @@ -25,7 +25,7 @@ class RestorableDroppedManagedDatabasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py index 0a7f74a92b42..59dab8b5912b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_restore_points_operations.py @@ -27,7 +27,7 @@ class RestorePointsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py index 2cfb2974a8b8..2e55b7ed9a8f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sensitivity_labels_operations.py @@ -25,7 +25,7 @@ class SensitivityLabelsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,12 +35,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config def list_current_by_database( - self, resource_group_name, server_name, database_name, filter=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, database_name, skip_token=None, count=None, filter=None, custom_headers=None, raw=False, **operation_config): """Gets the sensitivity labels of a given database. :param resource_group_name: The name of the resource group that @@ -51,6 +51,10 @@ def list_current_by_database( :type server_name: str :param database_name: The name of the database. :type database_name: str + :param skip_token: + :type skip_token: str + :param count: + :type count: bool :param filter: An OData filter expression that filters elements in the collection. :type filter: str @@ -78,6 +82,10 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if skip_token is not None: + query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if count is not None: + query_parameters['$count'] = self._serialize.query("count", count, 'bool') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') @@ -121,8 +129,75 @@ def internal_paging(next_link=None): return deserialized list_current_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels'} + def update( + self, resource_group_name, server_name, database_name, operations=None, custom_headers=None, raw=False, **operation_config): + """Update sensitivity labels of a given database using an operations + batch. + + :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 operations: + :type operations: list[~azure.mgmt.sql.models.SensitivityLabelUpdate] + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.SensitivityLabelUpdateList(operations=operations) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'SensitivityLabelUpdateList') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/currentSensitivityLabels'} + def list_recommended_by_database( - self, resource_group_name, server_name, database_name, include_disabled_recommendations=None, skip_token=None, filter=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, database_name, skip_token=None, include_disabled_recommendations=None, filter=None, custom_headers=None, raw=False, **operation_config): """Gets the sensitivity labels of a given database. :param resource_group_name: The name of the resource group that @@ -133,11 +208,11 @@ def list_recommended_by_database( :type server_name: str :param database_name: The name of the database. :type database_name: str + :param skip_token: + :type skip_token: str :param include_disabled_recommendations: Specifies whether to include disabled recommendations or not. :type include_disabled_recommendations: bool - :param skip_token: - :type skip_token: str :param filter: An OData filter expression that filters elements in the collection. :type filter: str @@ -165,10 +240,10 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} - if include_disabled_recommendations is not None: - query_parameters['includeDisabledRecommendations'] = self._serialize.query("include_disabled_recommendations", include_disabled_recommendations, 'bool') if skip_token is not None: query_parameters['$skipToken'] = self._serialize.query("skip_token", skip_token, 'str') + if include_disabled_recommendations is not None: + query_parameters['includeDisabledRecommendations'] = self._serialize.query("include_disabled_recommendations", include_disabled_recommendations, 'bool') if filter is not None: query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py new file mode 100644 index 000000000000..b800bc121555 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_advisors_operations.py @@ -0,0 +1,251 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ServerAdvisorsOperations(object): + """ServerAdvisorsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def list_by_server( + self, resource_group_name, server_name, expand=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of server advisors. + + :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 expand: The child resources to include in the response. + :type expand: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: list or ClientRawResponse if raw=true + :rtype: list[~azure.mgmt.sql.models.Advisor] or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('[Advisor]', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors'} + + def get( + self, resource_group_name, server_name, advisor_name, custom_headers=None, raw=False, **operation_config): + """Gets a server advisor. + + :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 advisor_name: The name of the Server Advisor. + :type advisor_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Advisor or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.Advisor or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'advisorName': self._serialize.url("advisor_name", advisor_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Advisor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}'} + + def update( + self, resource_group_name, server_name, advisor_name, auto_execute_status, custom_headers=None, raw=False, **operation_config): + """Updates a server advisor. + + :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 advisor_name: The name of the Server Advisor. + :type advisor_name: str + :param auto_execute_status: Gets the auto-execute status (whether to + let the system execute the recommendations) of this advisor. Possible + values are 'Enabled' and 'Disabled'. Possible values include: + 'Enabled', 'Disabled', 'Default' + :type auto_execute_status: str or + ~azure.mgmt.sql.models.AutoExecuteStatus + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Advisor or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.Advisor or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.Advisor(auto_execute_status=auto_execute_status) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'advisorName': self._serialize.url("advisor_name", advisor_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'Advisor') + + # Construct and send request + request = self._client.patch(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Advisor', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/advisors/{advisorName}'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py index 243174bc107d..e9c5cfe84a48 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_automatic_tuning_operations.py @@ -25,7 +25,7 @@ class ServerAutomaticTuningOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py index a14bcecb0748..360ab78538d5 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_administrators_operations.py @@ -27,8 +27,8 @@ class ServerAzureADAdministratorsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". :ivar administrator_name: The name of server active directory administrator. Constant value: "ActiveDirectory". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -38,8 +38,8 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" self.administrator_name = "ActiveDirectory" + self.api_version = "2021-02-01-preview" self.config = config @@ -66,10 +66,10 @@ def get( # Construct URL url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'administratorName': self._serialize.url("self.administrator_name", self.administrator_name, 'str') + 'administratorName': self._serialize.url("self.administrator_name", self.administrator_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -113,10 +113,10 @@ def _create_or_update_initial( # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'administratorName': self._serialize.url("self.administrator_name", self.administrator_name, 'str') + 'administratorName': self._serialize.url("self.administrator_name", self.administrator_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -220,10 +220,10 @@ def _delete_initial( # Construct URL url = self.delete.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'administratorName': self._serialize.url("self.administrator_name", self.administrator_name, 'str') + 'administratorName': self._serialize.url("self.administrator_name", self.administrator_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -321,9 +321,9 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_server.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + '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) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py index d28949ed8c1c..f5227b6ec7a3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_azure_ad_only_authentications_operations.py @@ -28,7 +28,7 @@ class ServerAzureADOnlyAuthenticationsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar authentication_name: The name of server azure active directory only authentication. Constant value: "Default". - :ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.authentication_name = "Default" - self.api_version = "2020-02-02-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py index c9c7feb47d4d..c7d53324cd1a 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_blob_auditing_policies_operations.py @@ -28,7 +28,7 @@ class ServerBlobAuditingPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar blob_auditing_policy_name: The name of the blob auditing policy. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.blob_auditing_policy_name = "default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py index 1ea248913a61..3476f7c31e2b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dev_ops_audit_settings_operations.py @@ -27,7 +27,7 @@ class ServerDevOpsAuditSettingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2020-08-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-08-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py index d8ec5ec33941..f2ac9be5a687 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_dns_aliases_operations.py @@ -27,7 +27,7 @@ class ServerDnsAliasesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -52,7 +52,7 @@ def get( :param server_name: The name of the server that the alias is pointing to. :type server_name: str - :param dns_alias_name: The name of the server DNS alias. + :param dns_alias_name: The name of the server dns alias. :type dns_alias_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -159,7 +159,7 @@ def _create_or_update_initial( def create_or_update( self, resource_group_name, server_name, dns_alias_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates a server dns alias. + """Creates a server DNS alias. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -168,7 +168,7 @@ def create_or_update( :param server_name: The name of the server that the alias is pointing to. :type server_name: str - :param dns_alias_name: The name of the server DNS alias. + :param dns_alias_name: The name of the server dns alias. :type dns_alias_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -260,7 +260,7 @@ def delete( :param server_name: The name of the server that the alias is pointing to. :type server_name: str - :param dns_alias_name: The name of the server DNS alias. + :param dns_alias_name: The name of the server dns alias. :type dns_alias_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the @@ -373,7 +373,7 @@ def internal_paging(next_link=None): def _acquire_initial( - self, resource_group_name, server_name, dns_alias_name, old_server_dns_alias_id=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, dns_alias_name, old_server_dns_alias_id, custom_headers=None, raw=False, **operation_config): parameters = models.ServerDnsAliasAcquisition(old_server_dns_alias_id=old_server_dns_alias_id) # Construct URL @@ -392,6 +392,7 @@ def _acquire_initial( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) @@ -412,12 +413,19 @@ def _acquire_initial( exp.request_id = response.headers.get('x-ms-request-id') raise exp + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ServerDnsAlias', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + return deserialized + def acquire( - self, resource_group_name, server_name, dns_alias_name, old_server_dns_alias_id=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, server_name, dns_alias_name, old_server_dns_alias_id, custom_headers=None, raw=False, polling=True, **operation_config): """Acquires server DNS alias from another server. :param resource_group_name: The name of the resource group that @@ -437,10 +445,12 @@ def acquire( direct response alongside the deserialized response :param polling: True for ARMPolling, False for no polling, or a polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :return: An instance of LROPoller that returns ServerDnsAlias or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ServerDnsAlias] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ServerDnsAlias]] :raises: :class:`CloudError` """ raw_result = self._acquire_initial( @@ -454,10 +464,14 @@ def acquire( ) def get_long_running_output(response): + deserialized = self._deserialize('ServerDnsAlias', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + return deserialized + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py index ffbd75711807..6cbafbd90cb3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_keys_operations.py @@ -27,7 +27,7 @@ class ServerKeysOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config @@ -183,7 +183,9 @@ def get( def _create_or_update_initial( - self, resource_group_name, server_name, key_name, parameters, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, key_name, server_key_type, uri=None, custom_headers=None, raw=False, **operation_config): + parameters = models.ServerKey(server_key_type=server_key_type, uri=uri) + # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -235,7 +237,7 @@ def _create_or_update_initial( return deserialized def create_or_update( - self, resource_group_name, server_name, key_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, server_name, key_name, server_key_type, uri=None, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates a server key. :param resource_group_name: The name of the resource group that @@ -247,12 +249,17 @@ def create_or_update( :param key_name: The name of the server key to be operated on (updated or created). The key name is required to be in the format of 'vault_key_version'. For example, if the keyId is - https://YourVaultName.vault.azure.net/keys/YourKeyName/01234567890123456789012345678901, + https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: - YourVaultName_YourKeyName_01234567890123456789012345678901 + YourVaultName_YourKeyName_YourKeyVersion :type key_name: str - :param parameters: The requested server key resource state. - :type parameters: ~azure.mgmt.sql.models.ServerKey + :param server_key_type: The server key type like 'ServiceManaged', + 'AzureKeyVault'. Possible values include: 'ServiceManaged', + 'AzureKeyVault' + :type server_key_type: str or ~azure.mgmt.sql.models.ServerKeyType + :param uri: The URI of the server key. If the ServerKeyType is + AzureKeyVault, then the URI is required. + :type uri: str :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -270,7 +277,8 @@ def create_or_update( resource_group_name=resource_group_name, server_name=server_name, key_name=key_name, - parameters=parameters, + server_key_type=server_key_type, + uri=uri, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations.py similarity index 87% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations.py index 5ac207d27f69..b5ba52408a92 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations.py @@ -16,8 +16,8 @@ from .. import models -class ServerUsagesOperations(object): - """ServerUsagesOperations operations. +class ServerOperations(object): + """ServerOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,7 +25,7 @@ class ServerUsagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,13 +35,13 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" + self.api_version = "2021-02-01-preview" self.config = config def list_by_server( self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Returns server usages. + """Gets a list of operations performed on the server. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure @@ -54,9 +54,9 @@ def list_by_server( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: An iterator like instance of ServerUsage + :return: An iterator like instance of ServerOperation :rtype: - ~azure.mgmt.sql.models.ServerUsagePaged[~azure.mgmt.sql.models.ServerUsage] + ~azure.mgmt.sql.models.ServerOperationPaged[~azure.mgmt.sql.models.ServerOperation] :raises: :class:`CloudError` """ def prepare_request(next_link=None): @@ -64,9 +64,9 @@ def prepare_request(next_link=None): # Construct URL url = self.list_by_server.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str') + '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) @@ -108,7 +108,7 @@ def internal_paging(next_link=None): header_dict = None if raw: header_dict = {} - deserialized = models.ServerUsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + deserialized = models.ServerOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages'} + list_by_server.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/operations'} 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 b5b8e4d82427..a4b6a5865bea 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 @@ -28,7 +28,7 @@ class ServerSecurityAlertPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar security_alert_policy_name: The name of the security alert policy. Constant value: "Default". - :ivar api_version: The API version to use for the request. Constant value: "2017-03-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.security_alert_policy_name = "Default" - self.api_version = "2017-03-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py index 807eae1649a1..b850cfc0bfe8 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_trust_groups_operations.py @@ -27,7 +27,7 @@ class ServerTrustGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2020-02-02-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-02-02-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py index 4caee1f1fb49..1e47898c65f2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_vulnerability_assessments_operations.py @@ -26,7 +26,7 @@ class ServerVulnerabilityAssessmentsOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._serialize = serializer self._deserialize = deserializer self.vulnerability_assessment_name = "default" - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py index 7abf430deda2..13ff4548c1ec 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_servers_operations.py @@ -27,7 +27,7 @@ class ServersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,18 +37,20 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config def list_by_resource_group( - self, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, expand=None, custom_headers=None, raw=False, **operation_config): """Gets a list of servers in a resource groups. :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 expand: The child resources to include in the response. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -71,6 +73,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -113,7 +117,7 @@ def internal_paging(next_link=None): list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers'} def get( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, server_name, expand=None, custom_headers=None, raw=False, **operation_config): """Gets a server. :param resource_group_name: The name of the resource group that @@ -122,6 +126,8 @@ def get( :type resource_group_name: str :param server_name: The name of the server. :type server_name: str + :param expand: The child resources to include in the response. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -143,6 +149,8 @@ def get( # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') # Construct headers @@ -463,9 +471,11 @@ def get_long_running_output(response): update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}'} def list( - self, custom_headers=None, raw=False, **operation_config): + self, expand=None, custom_headers=None, raw=False, **operation_config): """Gets a list of all servers in the subscription. + :param expand: The child resources to include in the response. + :type expand: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -487,6 +497,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} + if expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') else: @@ -528,6 +540,109 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/servers'} + + def _import_database_initial( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.import_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'ImportNewDatabaseDefinition') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ImportExportOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def import_database( + self, resource_group_name, server_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Imports a bacpac into a new database. + + :param resource_group_name: The name of the resource group that + contains the resource. You can obtain this value from the Azure + Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param parameters: The database import request parameters. + :type parameters: ~azure.mgmt.sql.models.ImportNewDatabaseDefinition + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ImportExportOperationResult or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.sql.models.ImportExportOperationResult] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.sql.models.ImportExportOperationResult]] + :raises: :class:`CloudError` + """ + raw_result = self._import_database_initial( + resource_group_name=resource_group_name, + server_name=server_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ImportExportOperationResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + import_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/import'} + def check_name_availability( self, name, custom_headers=None, raw=False, **operation_config): """Determines whether a resource can be created with the specified name. 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/_sql_agent_operations.py similarity index 70% rename from sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_connection_policies_operations.py rename to sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sql_agent_operations.py index 4813f39f62ac..5382b93e61b3 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/_sql_agent_operations.py @@ -16,8 +16,8 @@ from .. import models -class ServerConnectionPoliciesOperations(object): - """ServerConnectionPoliciesOperations operations. +class SqlAgentOperations(object): + """SqlAgentOperations operations. You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. @@ -25,8 +25,7 @@ class ServerConnectionPoliciesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - :ivar connection_policy_name: The name of the connection policy. Constant value: "default". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,44 +35,36 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" - self.connection_policy_name = "default" + self.api_version = "2021-02-01-preview" self.config = config - def create_or_update( - self, resource_group_name, server_name, connection_type, custom_headers=None, raw=False, **operation_config): - """Creates or updates the server's connection policy. + def get( + self, resource_group_name, managed_instance_name, custom_headers=None, raw=False, **operation_config): + """Gets current instance sql agent 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 connection_type: The server connection type. Possible values - include: 'Default', 'Proxy', 'Redirect' - :type connection_type: str or - ~azure.mgmt.sql.models.ServerConnectionType + :param managed_instance_name: The name of the managed instance. + :type managed_instance_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ServerConnectionPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy or + :return: SqlAgentConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.ServerConnectionPolicy(connection_type=connection_type) - # Construct URL - url = self.create_or_update.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'connectionPolicyName': self._serialize.url("self.connection_policy_name", self.connection_policy_name, 'str') + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -84,7 +75,6 @@ def create_or_update( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -92,58 +82,57 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'ServerConnectionPolicy') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ServerConnectionPolicy', response) - if response.status_code == 201: - deserialized = self._deserialize('ServerConnectionPolicy', response) + deserialized = self._deserialize('SqlAgentConfiguration', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current'} - def get( - self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): - """Gets the server's secure connection policy. + def create_or_update( + self, resource_group_name, managed_instance_name, state=None, custom_headers=None, raw=False, **operation_config): + """Puts new sql agent configuration to 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 managed_instance_name: The name of the managed instance. + :type managed_instance_name: str + :param state: The state of Sql Agent. Possible values include: + 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.sql.models.enum :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ServerConnectionPolicy or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ServerConnectionPolicy or + :return: SqlAgentConfiguration or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.SqlAgentConfiguration or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + parameters = models.SqlAgentConfiguration(state=state) + # Construct URL - url = self.get.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'connectionPolicyName': self._serialize.url("self.connection_policy_name", self.connection_policy_name, 'str') + 'managedInstanceName': self._serialize.url("managed_instance_name", managed_instance_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } url = self._client.format_url(url, **path_format_arguments) @@ -154,6 +143,7 @@ def get( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -161,8 +151,11 @@ def get( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(parameters, 'SqlAgentConfiguration') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: @@ -172,11 +165,11 @@ def get( deserialized = None if response.status_code == 200: - deserialized = self._deserialize('ServerConnectionPolicy', response) + deserialized = self._deserialize('SqlAgentConfiguration', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/connectionPolicies/{connectionPolicyName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/sqlAgent/current'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py index 355be5f6fd68..2743d4223dbe 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_subscription_usages_operations.py @@ -25,7 +25,7 @@ class SubscriptionUsagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py index ec00730c027a..a4bbf1a17164 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_agents_operations.py @@ -27,7 +27,7 @@ class SyncAgentsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config 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 398562cffe7e..fc64d03cc468 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 @@ -27,7 +27,7 @@ class SyncGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py index 3bff27863a9c..f36082a443a7 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_members_operations.py @@ -27,7 +27,7 @@ class SyncMembersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py index 86037d49ca05..a2b3a4f8cc82 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_tde_certificates_operations.py @@ -27,7 +27,7 @@ class TdeCertificatesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2017-10-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py new file mode 100644 index 000000000000..8f4adbec72e6 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_time_zones_operations.py @@ -0,0 +1,170 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class TimeZonesOperations(object): + """TimeZonesOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2021-02-01-preview" + + self.config = config + + def list_by_location( + self, location_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of managed instance time zones by location. + + :param location_name: + :type location_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TimeZone + :rtype: + ~azure.mgmt.sql.models.TimeZonePaged[~azure.mgmt.sql.models.TimeZone] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_location.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.TimeZonePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones'} + + def get( + self, location_name, time_zone_id, custom_headers=None, raw=False, **operation_config): + """Gets a managed instance time zone. + + :param location_name: + :type location_name: str + :param time_zone_id: + :type time_zone_id: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: TimeZone or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.TimeZone or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'locationName': self._serialize.url("location_name", location_name, 'str'), + 'timeZoneId': self._serialize.url("time_zone_id", time_zone_id, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('TimeZone', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Sql/locations/{locationName}/timeZones/{timeZoneId}'} 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 b497a7ee5656..d1b63c79a3ec 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 @@ -25,8 +25,8 @@ class TransparentDataEncryptionsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2014-04-01". - :ivar transparent_data_encryption_name: The name of the transparent data encryption configuration. Constant value: "current". + :ivar tde_name: The name of the transparent data encryption configuration. Constant value: "current". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -36,15 +36,14 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2014-04-01" - self.transparent_data_encryption_name = "current" + self.tde_name = "current" + self.api_version = "2021-02-01-preview" self.config = config - def create_or_update( - self, resource_group_name, server_name, database_name, status=None, custom_headers=None, raw=False, **operation_config): - """Creates or updates a database's transparent data encryption - configuration. + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """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 @@ -52,33 +51,29 @@ def create_or_update( :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 status: The status of the database transparent data encryption. - Possible values include: 'Enabled', 'Disabled' - :type status: str or - ~azure.mgmt.sql.models.TransparentDataEncryptionStatus :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TransparentDataEncryption or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption or + :return: LogicalDatabaseTransparentDataEncryption or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - parameters = models.TransparentDataEncryption(status=status) - # Construct URL - url = self.create_or_update.metadata['url'] + url = self.get.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("self.transparent_data_encryption_name", self.transparent_data_encryption_name, 'str') + 'tdeName': self._serialize.url("self.tde_name", self.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) @@ -89,7 +84,6 @@ def create_or_update( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -97,34 +91,29 @@ def create_or_update( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - # Construct body - body_content = self._serialize.body(parameters, 'TransparentDataEncryption') - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200, 201]: + if response.status_code not in [200]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: - deserialized = self._deserialize('TransparentDataEncryption', response) - if response.status_code == 201: - deserialized = self._deserialize('TransparentDataEncryption', response) + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} - def get( - self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - """Gets a database's transparent data encryption configuration. + def create_or_update( + self, resource_group_name, server_name, database_name, state, custom_headers=None, raw=False, **operation_config): + """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 @@ -132,27 +121,35 @@ def get( :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 state: Specifies the state of the transparent data encryption. + Possible values include: 'Enabled', 'Disabled' + :type state: str or + ~azure.mgmt.sql.models.TransparentDataEncryptionState :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TransparentDataEncryption or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption or + :return: LogicalDatabaseTransparentDataEncryption or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + parameters = models.LogicalDatabaseTransparentDataEncryption(state=state) + # Construct URL - url = self.get.metadata['url'] + url = self.create_or_update.metadata['url'] path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("self.transparent_data_encryption_name", self.transparent_data_encryption_name, 'str') + 'tdeName': self._serialize.url("self.tde_name", self.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) @@ -163,6 +160,7 @@ def get( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -170,22 +168,106 @@ def get( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(parameters, 'LogicalDatabaseTransparentDataEncryption') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 201, 202]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp deserialized = None if response.status_code == 200: - deserialized = self._deserialize('TransparentDataEncryption', response) + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', response) + if response.status_code == 201: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} + + def list_by_database( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """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 + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + LogicalDatabaseTransparentDataEncryption + :rtype: + ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryptionPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.LogicalDatabaseTransparentDataEncryptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py index 59164a38e347..e5cb4c0b8cc0 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_usages_operations.py @@ -25,7 +25,7 @@ class UsagesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2018-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2018-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py index b91ece534ef3..f5991a8e6e1b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py @@ -27,7 +27,7 @@ class VirtualClustersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,10 +37,76 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config + def update_dns_servers( + self, resource_group_name, virtual_cluster_name, custom_headers=None, raw=False, **operation_config): + """Synchronizes the DNS server settings used by the managed instances + inside the given virtual cluster. + + :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 virtual_cluster_name: The name of the virtual cluster. + :type virtual_cluster_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: UpdateManagedInstanceDnsServersOperation or ClientRawResponse + if raw=true + :rtype: + ~azure.mgmt.sql.models.UpdateManagedInstanceDnsServersOperation or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.update_dns_servers.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'virtualClusterName': self._serialize.url("virtual_cluster_name", virtual_cluster_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('UpdateManagedInstanceDnsServersOperation', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update_dns_servers.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers'} + def list( self, custom_headers=None, raw=False, **operation_config): """Gets a list of all virtualClusters in the subscription. @@ -324,9 +390,7 @@ def get_long_running_output(response): def _update_initial( - self, resource_group_name, virtual_cluster_name, family=None, tags=None, custom_headers=None, raw=False, **operation_config): - parameters = models.VirtualClusterUpdate(family=family, tags=tags) - + self, resource_group_name, virtual_cluster_name, parameters, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.update.metadata['url'] path_format_arguments = { @@ -375,7 +439,7 @@ def _update_initial( return deserialized def update( - self, resource_group_name, virtual_cluster_name, family=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, virtual_cluster_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): """Updates a virtual cluster. :param resource_group_name: The name of the resource group that @@ -384,11 +448,8 @@ def update( :type resource_group_name: str :param virtual_cluster_name: The name of the virtual cluster. :type virtual_cluster_name: str - :param family: If the service has different generations of hardware, - for the same SKU, then that can be captured here. - :type family: str - :param tags: Resource tags. - :type tags: dict[str, str] + :param parameters: The requested virtual cluster resource state. + :type parameters: ~azure.mgmt.sql.models.VirtualClusterUpdate :param dict custom_headers: headers that will be added to the request :param bool raw: The poller return type is ClientRawResponse, the direct response alongside the deserialized response @@ -405,8 +466,7 @@ def update( raw_result = self._update_initial( resource_group_name=resource_group_name, virtual_cluster_name=virtual_cluster_name, - family=family, - tags=tags, + parameters=parameters, custom_headers=custom_headers, raw=True, **operation_config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py index 3485f42e9f85..0378e57da3dd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_network_rules_operations.py @@ -27,7 +27,7 @@ class VirtualNetworkRulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2015-05-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2015-05-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py index c1e2c5ea728b..81ba50dd8c90 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_classifiers_operations.py @@ -27,7 +27,7 @@ class WorkloadClassifiersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py index 5f1e5e208d17..9dd8af382279 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_workload_groups_operations.py @@ -27,7 +27,7 @@ class WorkloadGroupsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for the request. Constant value: "2019-06-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2021-02-01-preview". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-06-01-preview" + self.api_version = "2021-02-01-preview" self.config = config