From eec18e79569f8509c6e11b8df26a68e184ab78cf Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 16 Apr 2021 00:41:20 +0000 Subject: [PATCH] CodeGen from PR 13960 in Azure/azure-rest-api-specs add missing usage.json to v5 sdk tag (#13960) --- sdk/sql/azure-mgmt-sql/MANIFEST.in | 1 + sdk/sql/azure-mgmt-sql/_meta.json | 8 + .../azure/mgmt/sql/_sql_management_client.py | 578 ++- .../azure/mgmt/sql/models/__init__.py | 529 ++- .../azure/mgmt/sql/models/_models.py | 3845 +++++++++++----- .../azure/mgmt/sql/models/_models_py3.py | 3913 ++++++++++++----- .../azure/mgmt/sql/models/_paged_models.py | 762 ++-- .../models/_sql_management_client_enums.py | 811 ++-- .../azure/mgmt/sql/operations/__init__.py | 264 +- ...hort_term_retention_policies_operations.py | 4 +- .../operations/_capabilities_operations.py | 4 +- ...ta_warehouse_user_activities_operations.py | 188 + .../_database_advisors_operations.py | 260 ++ .../_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 +- ...base_security_alert_policies_operations.py | 264 ++ .../operations/_database_tables_operations.py | 197 + .../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 | 133 +- .../operations/_deleted_servers_operations.py | 334 ++ .../operations/_elastic_pool_operations.py | 4 +- .../operations/_elastic_pools_operations.py | 12 +- .../_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 | 4 +- .../_job_step_executions_operations.py | 4 +- .../sql/operations/_job_steps_operations.py | 4 +- .../_job_target_executions_operations.py | 4 +- .../_job_target_groups_operations.py | 4 +- .../operations/_job_versions_operations.py | 4 +- .../mgmt/sql/operations/_jobs_operations.py | 4 +- ..._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 +- ...ged_database_security_events_operations.py | 136 + ..._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 ++ ...tance_private_link_resources_operations.py | 180 + ...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 +- .../_operations_health_operations.py | 110 + ...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 | 311 +- ...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 +- .../mgmt/sql/operations/_server_operations.py | 114 + ...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 +- .../_virtual_clusters_operations.py | 86 +- .../_virtual_network_rules_operations.py | 4 +- .../_workload_classifiers_operations.py | 4 +- .../operations/_workload_groups_operations.py | 4 +- 115 files changed, 14576 insertions(+), 4767 deletions(-) create mode 100644 sdk/sql/azure-mgmt-sql/_meta.json create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py 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%) create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_deleted_servers_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 create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py 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 create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations_health_operations.py 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 create mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations.py 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..498b915f25b9 --- /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": "d293c71ce3a03403f06f40302d38bd67727af73a", + "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..823ce68f49df 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 @@ -14,41 +14,45 @@ 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 UsagesOperations +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 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 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 +62,74 @@ from .operations import JobTargetExecutionsOperations from .operations import JobTargetGroupsOperations from .operations import JobVersionsOperations +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 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 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 VirtualClustersOperations +from .operations import VirtualNetworkRulesOperations +from .operations import WorkloadClassifiersOperations +from .operations import WorkloadGroupsOperations from . import models @@ -119,26 +141,16 @@ class SqlManagementClient(SDKClient): :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 @@ -149,34 +161,14 @@ class SqlManagementClient(SDKClient): :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 usages: Usages operations + :vartype usages: azure.mgmt.sql.operations.UsagesOperations + :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 +177,48 @@ 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 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 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 +237,142 @@ 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 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 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 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 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 @@ -329,26 +395,16 @@ def __init__( 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._client, self.config, self._serialize, self._deserialize) - self.firewall_rules = FirewallRulesOperations( - self._client, self.config, self._serialize, self._deserialize) self.geo_backup_policies = GeoBackupPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) self.databases = DatabasesOperations( self._client, self.config, self._serialize, self._deserialize) self.elastic_pools = ElasticPoolsOperations( self._client, self.config, self._serialize, self._deserialize) - self.recommended_elastic_pools = RecommendedElasticPoolsOperations( - self._client, self.config, self._serialize, self._deserialize) self.replication_links = ReplicationLinksOperations( self._client, self.config, self._serialize, self._deserialize) self.server_communication_links = ServerCommunicationLinksOperations( @@ -359,46 +415,64 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( self._client, self.config, self._serialize, self._deserialize) - self.service_tier_advisors = ServiceTierAdvisorsOperations( - self._client, self.config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( - self._client, self.config, self._serialize, self._deserialize) self.transparent_data_encryption_activities = TransparentDataEncryptionActivitiesOperations( self._client, self.config, self._serialize, self._deserialize) self.server_usages = ServerUsagesOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_usages = DatabaseUsagesOperations( + self.usages = UsagesOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_automatic_tuning = DatabaseAutomaticTuningOperations( + self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.encryption_protectors = EncryptionProtectorsOperations( + self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.failover_groups = FailoverGroupsOperations( + self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.operations = Operations( + self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_keys = ServerKeysOperations( + self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( self._client, self.config, self._serialize, self._deserialize) - self.sync_agents = SyncAgentsOperations( + self.database_advisors = DatabaseAdvisorsOperations( self._client, self.config, self._serialize, self._deserialize) - self.subscription_usages = SubscriptionUsagesOperations( + self.database_automatic_tuning = DatabaseAutomaticTuningOperations( self._client, self.config, self._serialize, self._deserialize) - self.virtual_clusters = VirtualClustersOperations( + self.database_columns = DatabaseColumnsOperations( self._client, self.config, self._serialize, self._deserialize) - self.virtual_network_rules = VirtualNetworkRulesOperations( + self.database_extensions = DatabaseExtensionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( + self.database_operations = DatabaseOperations( self._client, self.config, self._serialize, self._deserialize) - self.extended_server_blob_auditing_policies = ExtendedServerBlobAuditingPoliciesOperations( + self.database_recommended_actions = DatabaseRecommendedActionsOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_blob_auditing_policies = ServerBlobAuditingPoliciesOperations( + self.database_schemas = DatabaseSchemasOperations( self._client, self.config, self._serialize, self._deserialize) - self.database_blob_auditing_policies = DatabaseBlobAuditingPoliciesOperations( + self.database_security_alert_policies = DatabaseSecurityAlertPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + 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_vulnerability_assessment_rule_baselines = DatabaseVulnerabilityAssessmentRuleBaselinesOperations( self._client, self.config, self._serialize, self._deserialize) self.database_vulnerability_assessments = DatabaseVulnerabilityAssessmentsOperations( self._client, self.config, self._serialize, self._deserialize) + self.database_vulnerability_assessment_scans = DatabaseVulnerabilityAssessmentScansOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_warehouse_user_activities = DataWarehouseUserActivitiesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.deleted_servers = DeletedServersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.elastic_pool_operations = ElasticPoolOperations( + 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.firewall_rules = FirewallRulesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.instance_failover_groups = InstanceFailoverGroupsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.instance_pools = InstancePoolsOperations( + self._client, self.config, self._serialize, self._deserialize) self.job_agents = JobAgentsOperations( self._client, self.config, self._serialize, self._deserialize) self.job_credentials = JobCredentialsOperations( @@ -417,103 +491,139 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.job_versions = JobVersionsOperations( 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.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.restorable_dropped_databases = RestorableDroppedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.long_term_retention_managed_instance_backups = LongTermRetentionManagedInstanceBackupsOperations( + self.restorable_dropped_managed_databases = RestorableDroppedManagedDatabasesOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_long_term_retention_policies = ManagedInstanceLongTermRetentionPoliciesOperations( + self.restore_points = RestorePointsOperations( self._client, self.config, self._serialize, self._deserialize) - self.workload_groups = WorkloadGroupsOperations( + self.sensitivity_labels = SensitivityLabelsOperations( self._client, self.config, self._serialize, self._deserialize) - self.workload_classifiers = WorkloadClassifiersOperations( + self.recommended_sensitivity_labels = RecommendedSensitivityLabelsOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_operations = ManagedInstanceOperations( + 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.virtual_clusters = VirtualClustersOperations( self._client, self.config, self._serialize, self._deserialize) - self.managed_instance_azure_ad_only_authentications = ManagedInstanceAzureADOnlyAuthenticationsOperations( + self.virtual_network_rules = VirtualNetworkRulesOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_trust_groups = ServerTrustGroupsOperations( + self.workload_classifiers = WorkloadClassifiersOperations( self._client, self.config, self._serialize, self._deserialize) - self.server_dev_ops_audit_settings = ServerDevOpsAuditSettingsOperations( + 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..f2bfbbc07514 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,20 +10,25 @@ # -------------------------------------------------------------------------- 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 @@ -32,6 +37,8 @@ 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 @@ -52,8 +59,10 @@ from ._models_py3 import FailoverGroupReadWriteEndpoint from ._models_py3 import FailoverGroupUpdate from ._models_py3 import FirewallRule + from ._models_py3 import FirewallRuleList from ._models_py3 import GeoBackupPolicy 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 @@ -80,9 +89,15 @@ from ._models_py3 import JobVersion 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 +108,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,14 +119,19 @@ 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 @@ -124,6 +145,7 @@ from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationImpact + from ._models_py3 import OperationsHealth from ._models_py3 import PartnerInfo from ._models_py3 import PartnerRegionInfo from ._models_py3 import PerformanceLevelCapability @@ -135,35 +157,49 @@ 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 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 RecoverableDatabase 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 @@ -173,9 +209,9 @@ 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 +229,17 @@ 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,20 +249,25 @@ 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 @@ -232,6 +276,8 @@ 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 @@ -252,8 +298,10 @@ from ._models import FailoverGroupReadWriteEndpoint from ._models import FailoverGroupUpdate from ._models import FirewallRule + from ._models import FirewallRuleList from ._models import GeoBackupPolicy from ._models import ImportExistingDatabaseDefinition + from ._models import ImportExportExtensionsOperationResult from ._models import ImportExportOperationResult from ._models import ImportNewDatabaseDefinition from ._models import InstanceFailoverGroup @@ -280,9 +328,15 @@ from ._models import JobVersion 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 +347,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,14 +358,19 @@ 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 @@ -324,6 +384,7 @@ from ._models import Operation from ._models import OperationDisplay from ._models import OperationImpact + from ._models import OperationsHealth from ._models import PartnerInfo from ._models import PartnerRegionInfo from ._models import PerformanceLevelCapability @@ -335,35 +396,49 @@ 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 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 RecoverableDatabase 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 @@ -373,9 +448,9 @@ 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 +468,17 @@ 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,11 +489,17 @@ 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 DataWarehouseUserActivitiesPaged +from ._paged_models import DeletedServerPaged from ._paged_models import ElasticPoolActivityPaged from ._paged_models import ElasticPoolDatabaseActivityPaged from ._paged_models import ElasticPoolOperationPaged @@ -426,6 +510,7 @@ 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 +520,9 @@ from ._paged_models import JobStepPaged from ._paged_models import JobTargetGroupPaged from ._paged_models import JobVersionPaged +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,21 +534,25 @@ 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 ManagedTransparentDataEncryptionPaged from ._paged_models import MetricDefinitionPaged from ._paged_models import MetricPaged from ._paged_models import OperationPaged +from ._paged_models import OperationsHealthPaged from ._paged_models import PrivateEndpointConnectionPaged from ._paged_models import PrivateLinkResourcePaged -from ._paged_models import RecommendedElasticPoolMetricPaged -from ._paged_models import RecommendedElasticPoolPaged +from ._paged_models import QueryStatisticsPaged from ._paged_models import RecoverableDatabasePaged 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 @@ -470,13 +561,13 @@ 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,6 +576,7 @@ 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 @@ -494,10 +586,6 @@ from ._paged_models import WorkloadClassifierPaged from ._paged_models import WorkloadGroupPaged from ._sql_management_client_enums import ( - ServerConnectionType, - SecurityAlertPolicyState, - SecurityAlertPolicyEmailAccountAdmins, - SecurityAlertPolicyUseServerDefault, DataMaskingState, DataMaskingRuleState, DataMaskingFunction, @@ -505,28 +593,45 @@ 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,80 +641,78 @@ JobStepActionSource, JobStepOutputType, JobTargetGroupMembershipType, - AutomaticTuningServerMode, - AutomaticTuningServerReason, - RestorePointType, - SensitivityLabelRank, - ManagementOperationState, - VulnerabilityAssessmentScanTriggerType, - VulnerabilityAssessmentScanState, - InstanceFailoverGroupReplicationRole, - InstancePoolLicenseType, - PrivateLinkServiceConnectionStateStatus, - PrivateLinkServiceConnectionStateActionsRequire, - PrivateEndpointProvisioningState, - IdentityType, - ServerPublicNetworkAccess, - CheckNameAvailabilityReason, 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, + ServerPublicNetworkAccess, + 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', @@ -618,6 +721,8 @@ 'DatabaseVulnerabilityAssessmentScansExport', 'DataMaskingPolicy', 'DataMaskingRule', + 'DataWarehouseUserActivities', + 'DeletedServer', 'EditionCapability', 'ElasticPool', 'ElasticPoolActivity', @@ -638,8 +743,10 @@ 'FailoverGroupReadWriteEndpoint', 'FailoverGroupUpdate', 'FirewallRule', + 'FirewallRuleList', 'GeoBackupPolicy', 'ImportExistingDatabaseDefinition', + 'ImportExportExtensionsOperationResult', 'ImportExportOperationResult', 'ImportNewDatabaseDefinition', 'InstanceFailoverGroup', @@ -666,9 +773,15 @@ 'JobVersion', 'LicenseTypeCapability', 'LocationCapabilities', + 'LogicalDatabaseTransparentDataEncryption', 'LogSizeCapability', 'LongTermRetentionBackup', + 'LongTermRetentionBackupOperationResult', + 'LongTermRetentionPolicy', 'MaintenanceConfigurationCapability', + 'MaintenanceWindowOptions', + 'MaintenanceWindows', + 'MaintenanceWindowTimeRange', 'ManagedBackupShortTermRetentionPolicy', 'ManagedDatabase', 'ManagedDatabaseRestoreDetailsResult', @@ -679,6 +792,7 @@ 'ManagedInstanceAzureADOnlyAuthentication', 'ManagedInstanceEditionCapability', 'ManagedInstanceEncryptionProtector', + 'ManagedInstanceExternalAdministrator', 'ManagedInstanceFamilyCapability', 'ManagedInstanceKey', 'ManagedInstanceLongTermRetentionBackup', @@ -689,14 +803,19 @@ 'ManagedInstanceOperationSteps', 'ManagedInstancePairInfo', 'ManagedInstancePecProperty', + 'ManagedInstancePrivateEndpointConnection', 'ManagedInstancePrivateEndpointConnectionProperties', 'ManagedInstancePrivateEndpointProperty', + 'ManagedInstancePrivateLink', + 'ManagedInstancePrivateLinkProperties', 'ManagedInstancePrivateLinkServiceConnectionStateProperty', + 'ManagedInstanceQuery', 'ManagedInstanceUpdate', 'ManagedInstanceVcoresCapability', 'ManagedInstanceVersionCapability', 'ManagedInstanceVulnerabilityAssessment', 'ManagedServerSecurityAlertPolicy', + 'ManagedTransparentDataEncryption', 'MaxSizeCapability', 'MaxSizeRangeCapability', 'Metric', @@ -710,6 +829,7 @@ 'Operation', 'OperationDisplay', 'OperationImpact', + 'OperationsHealth', 'PartnerInfo', 'PartnerRegionInfo', 'PerformanceLevelCapability', @@ -721,35 +841,49 @@ 'PrivateLinkResourceProperties', 'PrivateLinkServiceConnectionStateProperty', 'ProxyResource', + 'ProxyResourceWithWritableName', 'QueryMetricInterval', 'QueryMetricProperties', + 'QueryStatistics', 'QueryStatisticsProperties', 'ReadScaleCapability', - 'RecommendedElasticPool', - 'RecommendedElasticPoolMetric', - 'RecommendedIndex', + 'RecommendedAction', + 'RecommendedActionErrorInfo', + 'RecommendedActionImpactRecord', + 'RecommendedActionImplementationInfo', + 'RecommendedActionMetricInfo', + 'RecommendedActionStateInfo', + 'RecommendedSensitivityLabelUpdate', + 'RecommendedSensitivityLabelUpdateList', 'RecoverableDatabase', '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', @@ -759,9 +893,9 @@ 'ServerVulnerabilityAssessment', 'ServiceObjective', 'ServiceObjectiveCapability', - 'ServiceTierAdvisor', 'Sku', 'SloUsageMetric', + 'SqlAgentConfiguration', 'StorageCapability', 'SubscriptionUsage', 'SyncAgent', @@ -779,14 +913,17 @@ 'SyncMember', 'SystemData', 'TdeCertificate', + 'TimeZone', 'TopQueries', 'TrackedResource', - 'TransparentDataEncryption', 'TransparentDataEncryptionActivity', 'UnlinkParameters', + 'UpdateLongTermRetentionBackupParameters', + 'UpdateManagedInstanceDnsServersOperation', 'UpsertManagedServerOperationParameters', 'UpsertManagedServerOperationStep', 'Usage', + 'UserIdentity', 'VirtualCluster', 'VirtualClusterUpdate', 'VirtualNetworkRule', @@ -796,39 +933,42 @@ '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', + 'UsagePaged', + 'BackupShortTermRetentionPolicyPaged', 'ExtendedDatabaseBlobAuditingPolicyPaged', 'ExtendedServerBlobAuditingPolicyPaged', 'ServerBlobAuditingPolicyPaged', 'DatabaseBlobAuditingPolicyPaged', + 'DatabaseColumnPaged', + 'ImportExportExtensionsOperationResultPaged', + 'DatabaseOperationPaged', + 'DatabaseSchemaPaged', + 'DatabaseSecurityAlertPolicyPaged', + 'DatabaseTablePaged', + 'DatabaseUsagePaged', 'DatabaseVulnerabilityAssessmentPaged', + 'VulnerabilityAssessmentScanRecordPaged', + 'DataWarehouseUserActivitiesPaged', + 'DeletedServerPaged', + 'ElasticPoolOperationPaged', + 'EncryptionProtectorPaged', + 'FailoverGroupPaged', + 'FirewallRulePaged', + 'InstanceFailoverGroupPaged', + 'InstancePoolPaged', 'JobAgentPaged', 'JobCredentialPaged', 'JobExecutionPaged', @@ -837,52 +977,59 @@ 'JobTargetGroupPaged', 'JobVersionPaged', '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', 'PrivateEndpointConnectionPaged', 'PrivateLinkResourcePaged', - 'ServerPaged', - 'ManagedInstanceLongTermRetentionBackupPaged', - 'ManagedInstanceLongTermRetentionPolicyPaged', - 'WorkloadGroupPaged', - 'WorkloadClassifierPaged', - 'ManagedInstanceOperationPaged', + 'RecoverableManagedDatabasePaged', + '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', + 'TimeZonePaged', + 'LogicalDatabaseTransparentDataEncryptionPaged', + 'VirtualClusterPaged', + 'VirtualNetworkRulePaged', + 'WorkloadClassifierPaged', + 'WorkloadGroupPaged', 'DataMaskingState', 'DataMaskingRuleState', 'DataMaskingFunction', @@ -890,28 +1037,45 @@ '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', @@ -921,61 +1085,54 @@ 'JobStepActionSource', 'JobStepOutputType', 'JobTargetGroupMembershipType', - 'AutomaticTuningServerMode', - 'AutomaticTuningServerReason', - 'RestorePointType', - 'SensitivityLabelRank', - 'ManagementOperationState', - 'VulnerabilityAssessmentScanTriggerType', - 'VulnerabilityAssessmentScanState', - 'InstanceFailoverGroupReplicationRole', - 'InstancePoolLicenseType', - 'PrivateLinkServiceConnectionStateStatus', - 'PrivateLinkServiceConnectionStateActionsRequire', - 'PrivateEndpointProvisioningState', - 'IdentityType', - 'ServerPublicNetworkAccess', - 'CheckNameAvailabilityReason', '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', + 'ServerPublicNetworkAccess', + '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..ba1db5f26a3f 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 @@ -660,6 +751,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,7 +794,8 @@ 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'}, @@ -743,7 +836,8 @@ 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 @@ -811,27 +905,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 @@ -896,16 +969,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 +994,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 +1033,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 +1270,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 +1314,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 +1378,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 +1550,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 @@ -1319,6 +1588,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,7 +1624,8 @@ 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'}, @@ -1394,7 +1665,8 @@ 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 @@ -1402,58 +1674,54 @@ def __init__(self, **kwargs): 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 +1741,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 @@ -1793,23 +2061,109 @@ def __init__(self, **kwargs): self.kind = None -class EditionCapability(Model): - """The edition capability. +class DataWarehouseUserActivities(ProxyResource): + """User activities of a data warehouse. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The database edition name. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar supported_service_level_objectives: The list of supported service - objectives for the edition. - :vartype supported_service_level_objectives: - list[~azure.mgmt.sql.models.ServiceObjectiveCapability] - :ivar zone_redundant: Whether or not zone redundancy is supported for the - edition. - :vartype zone_redundant: bool - :ivar read_scale: The read scale capability for the edition. - :vartype read_scale: ~azure.mgmt.sql.models.ReadScaleCapability + :ivar type: Resource type. + :vartype type: 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}, + 'active_queries_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'active_queries_count': {'key': 'properties.activeQueriesCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(DataWarehouseUserActivities, self).__init__(**kwargs) + self.active_queries_count = None + + +class DeletedServer(ProxyResource): + """A deleted server. + + 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 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}, + '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'}, + '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(DeletedServer, self).__init__(**kwargs) + self.version = None + self.deletion_time = None + self.original_id = None + self.fully_qualified_domain_name = None + + +class EditionCapability(Model): + """The edition capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The database edition name. + :vartype name: str + :ivar supported_service_level_objectives: The list of supported service + objectives for the edition. + :vartype supported_service_level_objectives: + list[~azure.mgmt.sql.models.ServiceObjectiveCapability] + :ivar zone_redundant: Whether or not zone redundancy is supported for the + edition. + :vartype zone_redundant: bool + :ivar read_scale: The read scale capability for the edition. + :vartype read_scale: ~azure.mgmt.sql.models.ReadScaleCapability :ivar supported_storage_capabilities: The list of supported storage capabilities for this edition :vartype supported_storage_capabilities: @@ -2620,6 +2974,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 +3002,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 +3014,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 +3087,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 @@ -2813,16 +3151,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 +3176,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 +3214,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 +3253,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 @@ -2982,16 +3336,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 +3361,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 +3398,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,91 +3585,152 @@ 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 - :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 """ _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(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 + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: 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}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', '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.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 GeoBackupPolicy(ProxyResource): + """A database geo backup 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 + :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 + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, 'type': {'readonly': True}, 'state': {'required': True}, 'storage_type': {'readonly': True}, @@ -3372,6 +3810,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 +4651,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 +4662,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 +4676,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) @@ -4567,6 +5070,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 +5162,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 +5182,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 +5195,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,49 +5207,79 @@ 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 zone_redundant: Whether or not zone redundancy is supported for the - maintenance configuration. - :vartype zone_redundant: bool - :ivar status: The status of the capability. Possible values include: - 'Visible', 'Available', 'Default', 'Disabled' - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :param reason: The reason for the capability not being available. - :type reason: 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}, - 'zone_redundant': {'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'}, - 'zone_redundant': {'key': 'zoneRedundant', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'CapabilityStatus'}, - 'reason': {'key': 'reason', '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(MaintenanceConfigurationCapability, self).__init__(**kwargs) - self.name = None - self.zone_redundant = 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.reason = kwargs.get('reason', None) + self.message = None -class ManagedBackupShortTermRetentionPolicy(ProxyResource): - """A short term retention policy. +class LongTermRetentionPolicy(ProxyResource): + """A long term retention policy. Variables are only populated by the server, and will be ignored when sending a request. @@ -4708,9 +5290,18 @@ class ManagedBackupShortTermRetentionPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param retention_days: The backup retention period in days. This is how - many days Point-in-Time Restore will be supported. - :type retention_days: int + :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 = { @@ -4723,29 +5314,234 @@ class ManagedBackupShortTermRetentionPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + '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(ManagedBackupShortTermRetentionPolicy, self).__init__(**kwargs) - self.retention_days = kwargs.get('retention_days', None) + 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 ManagedDatabase(TrackedResource): - """A managed database resource. +class MaintenanceConfigurationCapability(Model): + """The maintenance configuration capability. 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. + :ivar name: Maintenance configuration name :vartype name: str - :ivar type: Resource type. - :vartype type: str - :param location: Required. Resource location. + :ivar zone_redundant: Whether or not zone redundancy is supported for the + maintenance configuration. + :vartype zone_redundant: bool + :ivar status: The status of the capability. Possible values include: + 'Visible', 'Available', 'Default', 'Disabled' + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :param reason: The reason for the capability not being available. + :type reason: str + """ + + _validation = { + 'name': {'readonly': True}, + 'zone_redundant': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'CapabilityStatus'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MaintenanceConfigurationCapability, self).__init__(**kwargs) + self.name = None + self.zone_redundant = None + self.status = None + 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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param retention_days: The backup retention period in days. This is how + many days Point-in-Time Restore will be supported. + :type retention_days: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(ManagedBackupShortTermRetentionPolicy, self).__init__(**kwargs) + self.retention_days = kwargs.get('retention_days', None) + + +class ManagedDatabase(TrackedResource): + """A managed database resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Required. Resource location. :type location: str :param tags: Resource tags. :type tags: dict[str, str] @@ -4972,7 +5768,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,7 +5968,8 @@ 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 @@ -5267,6 +6064,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 +6093,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 +6119,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 +6152,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 +6328,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 +6352,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 +6362,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 +6482,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 +6495,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 +6507,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 +6517,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 +6546,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 +6562,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 +6575,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 +6586,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 +6897,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,52 +6993,151 @@ 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 ManagedInstanceUpdate(Model): - """An update request for an Azure SQL Database managed instance. +class ManagedInstancePrivateLinkProperties(Model): + """Properties of a private link resource. Variables are only populated by the server, and will be ignored when sending a request. - :param sku: Managed instance sku - :type sku: ~azure.mgmt.sql.models.Sku + :ivar 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): + """An update request for an Azure SQL Database managed instance. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku: Managed instance sku + :type sku: ~azure.mgmt.sql.models.Sku :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' :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum @@ -6215,6 +7229,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 +7252,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 +7277,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 +7311,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 +7450,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 +7503,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 +7537,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 +7546,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 +7559,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 +7570,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. @@ -7015,6 +8087,51 @@ def __init__(self, **kwargs): self.change_value_relative = None +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 id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :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}, + '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'}, + '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(OperationsHealth, self).__init__(**kwargs) + self.operations_health_name = None + self.health = None + self.description = None + + class PartnerInfo(Model): """Partner server information for the failover group. @@ -7290,22 +8407,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 +8578,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,218 +8709,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 - 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 +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, **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(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). - :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] + :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 = { - 'id': {'readonly': True}, + '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): + 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): + 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 + """ + + _validation = { + 'current_value': {'required': True}, + 'action_initiated_by': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + '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(RecommendedActionStateInfo, self).__init__(**kwargs) + self.current_value = kwargs.get('current_value', None) + self.action_initiated_by = None + self.last_modified = None + + +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 + :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}, - 'action': {'readonly': True}, - 'state': {'readonly': True}, - 'created': {'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}, + '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'}, - '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'}, + 'op': {'key': 'properties.op', 'type': 'RecommendedSensitivityLabelUpdateKind'}, '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]'}, + 'column': {'key': 'properties.column', 'type': 'str'}, } def __init__(self, **kwargs): - super(RecommendedIndex, self).__init__(**kwargs) - self.action = None - self.state = None - self.created = 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 + 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 RecoverableDatabase(ProxyResource): @@ -7834,7 +9277,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 +9288,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 +9390,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 +9427,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,25 +9438,25 @@ 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: The resource name of the elastic pool containing + this database. + :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 """ @@ -8020,12 +9464,9 @@ class RestorableDroppedDatabase(ProxyResource): '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}, @@ -8035,12 +9476,12 @@ class RestorableDroppedDatabase(ProxyResource): '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'}, @@ -8048,12 +9489,12 @@ class RestorableDroppedDatabase(ProxyResource): 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 @@ -8178,6 +9619,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 +9784,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 +9813,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 +9824,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 +9838,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 +9850,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 +9942,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 @@ -8284,6 +9972,18 @@ class Server(TrackedResource): 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccess + :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 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 """ _validation = { @@ -8295,6 +9995,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 +10004,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 +10014,10 @@ 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'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, } def __init__(self, **kwargs): @@ -8327,6 +10032,10 @@ 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.key_id = kwargs.get('key_id', None) + self.administrators = kwargs.get('administrators', None) class ServerAutomaticTuning(ProxyResource): @@ -8488,27 +10197,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 @@ -8573,16 +10277,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 +10302,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,28 +10339,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) + 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 ServerCommunicationLink(ProxyResource): @@ -8691,54 +10418,6 @@ def __init__(self, **kwargs): 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) - - class ServerDevOpsAuditingSettings(ProxyResource): """A server DevOps auditing settings. @@ -8862,13 +10541,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 +10563,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 +10638,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,45 +10649,152 @@ 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 = { + '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'}, + 'subregion': {'key': 'properties.subregion', 'type': 'str'}, + 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, + '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'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'subregion': {'key': 'properties.subregion', 'type': 'str'}, - 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, - 'uri': {'key': 'properties.uri', 'type': 'str'}, - 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + '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 +10840,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 +10874,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 +10883,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 +10896,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 +10956,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 @@ -9145,6 +10984,18 @@ class ServerUpdate(Model): 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccess + :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 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 tags: Resource tags. :type tags: dict[str, str] """ @@ -9153,9 +11004,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 +11017,16 @@ 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'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, '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,6 +11035,10 @@ 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.key_id = kwargs.get('key_id', None) + self.administrators = kwargs.get('administrators', None) self.tags = kwargs.get('tags', None) @@ -9299,9 +11161,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 @@ -9492,151 +11354,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. @@ -9723,6 +11440,41 @@ def __init__(self, **kwargs): self.in_range_time_ratio = None +class SqlAgentConfiguration(ProxyResource): + """A recoverable managed database 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 state: The state of Sql Agent. Possible values include: 'Enabled', + 'Disabled' + :type state: str or ~azure.mgmt.sql.models.enum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlAgentConfiguration, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + + class StorageCapability(Model): """The storage account type capability. @@ -10116,6 +11868,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 +11892,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 +11918,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 +11927,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 +11944,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 +12160,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 +12188,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 +12238,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,47 +12333,6 @@ 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. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :param status: The status of the database transparent data encryption. - Possible values include: 'Enabled', 'Disabled' - :type status: str or - ~azure.mgmt.sql.models.TransparentDataEncryptionStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'TransparentDataEncryptionStatus'}, - } - - def __init__(self, **kwargs): - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = kwargs.get('status', None) - - class TransparentDataEncryptionActivity(ProxyResource): """Represents a database transparent data encryption Scan. @@ -10650,6 +12398,61 @@ def __init__(self, **kwargs): self.forced_termination = kwargs.get('forced_termination', None) +class UpdateLongTermRetentionBackupParameters(Model): + """Contains the information necessary to perform long term retention backup + update operation. + + :param requested_backup_storage_redundancy: The storage redundancy type of + the copied backup. Possible values include: 'Geo', 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + """ + + _attribute_map = { + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateLongTermRetentionBackupParameters, self).__init__(**kwargs) + self.requested_backup_storage_redundancy = kwargs.get('requested_backup_storage_redundancy', None) + + +class UpdateManagedInstanceDnsServersOperation(ProxyResource): + """A recoverable managed database 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 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}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UpdateManagedInstanceDnsServersOperation, self).__init__(**kwargs) + self.status = None + + class UpsertManagedServerOperationParameters(Model): """UpsertManagedServerOperationParameters. @@ -10756,6 +12559,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 +12612,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 +12635,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 +12643,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 +12659,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 +12675,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 +12684,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 +12709,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..f775bb5acde0 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 @@ -660,6 +751,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 +794,15 @@ 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'}, } - 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, **kwargs) -> None: super(Database, self).__init__(location=location, tags=tags, **kwargs) self.sku = sku self.kind = None @@ -743,7 +836,8 @@ 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 @@ -811,27 +905,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 @@ -896,16 +969,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 +994,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 +1270,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 +1314,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 +1378,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 +1550,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 @@ -1319,6 +1588,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,7 +1624,8 @@ 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'}, @@ -1362,7 +1633,7 @@ class DatabaseUpdate(Model): '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, tags=None, **kwargs) -> None: super(DatabaseUpdate, self).__init__(**kwargs) self.sku = sku self.create_mode = create_mode @@ -1394,7 +1665,8 @@ 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 @@ -1402,58 +1674,54 @@ def __init__(self, *, sku=None, create_mode=None, collation: str=None, max_size_ 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 +1741,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 @@ -1793,17 +2061,103 @@ def __init__(self, *, schema_name: str, table_name: str, column_name: str, maski self.kind = None -class EditionCapability(Model): - """The edition capability. +class DataWarehouseUserActivities(ProxyResource): + """User activities of a data warehouse. Variables are only populated by the server, and will be ignored when sending a request. - :ivar name: The database edition name. + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar supported_service_level_objectives: The list of supported service - objectives for the edition. - :vartype supported_service_level_objectives: + :ivar type: Resource type. + :vartype type: 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}, + 'active_queries_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'active_queries_count': {'key': 'properties.activeQueriesCount', 'type': 'int'}, + } + + def __init__(self, **kwargs) -> None: + super(DataWarehouseUserActivities, self).__init__(**kwargs) + self.active_queries_count = None + + +class DeletedServer(ProxyResource): + """A deleted server. + + 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 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}, + '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'}, + '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) -> 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): + """The edition capability. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: The database edition name. + :vartype name: str + :ivar supported_service_level_objectives: The list of supported service + objectives for the edition. + :vartype supported_service_level_objectives: list[~azure.mgmt.sql.models.ServiceObjectiveCapability] :ivar zone_redundant: Whether or not zone redundancy is supported for the edition. @@ -2620,6 +2974,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 +3002,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 +3014,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 +3087,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 @@ -2813,16 +3151,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 +3176,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 +3214,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 +3253,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 @@ -2982,16 +3336,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 +3361,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 +3398,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,105 +3585,166 @@ 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 - :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 """ _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'}, + } + + 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 + :param name: Resource name. + :type name: str + :ivar type: Resource type. + :vartype type: 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}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'start_ip_address': {'key': 'properties.startIpAddress', 'type': 'str'}, + 'end_ip_address': {'key': 'properties.endIpAddress', 'type': 'str'}, + } + + 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 GeoBackupPolicy(ProxyResource): + """A database geo backup 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 + :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 + """ + + _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'}, } @@ -3372,6 +3810,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 +4651,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 +4662,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 +4674,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 @@ -4567,6 +5070,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 +5162,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 +5182,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 +5195,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,49 +5207,79 @@ 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 + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. :vartype name: str - :ivar zone_redundant: Whether or not zone redundancy is supported for the - maintenance configuration. - :vartype zone_redundant: bool - :ivar status: The status of the capability. Possible values include: - 'Visible', 'Available', 'Default', 'Disabled' - :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus - :param reason: The reason for the capability not being available. - :type reason: 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}, - 'zone_redundant': {'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'}, - 'zone_redundant': {'key': 'zoneRedundant', 'type': 'bool'}, - 'status': {'key': 'status', 'type': 'CapabilityStatus'}, - 'reason': {'key': 'reason', '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, *, reason: str=None, **kwargs) -> None: - super(MaintenanceConfigurationCapability, self).__init__(**kwargs) - self.name = None - self.zone_redundant = None + 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.reason = reason + self.message = None -class ManagedBackupShortTermRetentionPolicy(ProxyResource): - """A short term retention policy. +class LongTermRetentionPolicy(ProxyResource): + """A long term retention policy. Variables are only populated by the server, and will be ignored when sending a request. @@ -4708,9 +5290,18 @@ class ManagedBackupShortTermRetentionPolicy(ProxyResource): :vartype name: str :ivar type: Resource type. :vartype type: str - :param retention_days: The backup retention period in days. This is how - many days Point-in-Time Restore will be supported. - :type retention_days: int + :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 = { @@ -4723,21 +5314,226 @@ class ManagedBackupShortTermRetentionPolicy(ProxyResource): 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + '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, *, retention_days: int=None, **kwargs) -> None: - super(ManagedBackupShortTermRetentionPolicy, self).__init__(**kwargs) - self.retention_days = retention_days + 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 ManagedDatabase(TrackedResource): - """A managed database resource. +class MaintenanceConfigurationCapability(Model): + """The maintenance configuration capability. 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 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 + :ivar status: The status of the capability. Possible values include: + 'Visible', 'Available', 'Default', 'Disabled' + :vartype status: str or ~azure.mgmt.sql.models.CapabilityStatus + :param reason: The reason for the capability not being available. + :type reason: str + """ + + _validation = { + 'name': {'readonly': True}, + 'zone_redundant': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'bool'}, + 'status': {'key': 'status', 'type': 'CapabilityStatus'}, + 'reason': {'key': 'reason', 'type': 'str'}, + } + + def __init__(self, *, reason: str=None, **kwargs) -> None: + super(MaintenanceConfigurationCapability, self).__init__(**kwargs) + self.name = None + self.zone_redundant = None + self.status = 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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param retention_days: The backup retention period in days. This is how + many days Point-in-Time Restore will be supported. + :type retention_days: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + } + + def __init__(self, *, retention_days: int=None, **kwargs) -> None: + super(ManagedBackupShortTermRetentionPolicy, self).__init__(**kwargs) + self.retention_days = retention_days + + +class ManagedDatabase(TrackedResource): + """A managed database resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. :ivar id: Resource ID. :vartype id: str @@ -4972,7 +5768,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,7 +5968,8 @@ 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 @@ -5267,6 +6064,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 +6093,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 +6119,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 +6152,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 +6328,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 +6352,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 +6482,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 +6495,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 +6507,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 +6517,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 +6546,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 +6562,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 +6575,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 +6586,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 +6897,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,59 +6993,158 @@ 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 - self.actions_required = None + def __init__(self, **kwargs) -> None: + super(ManagedInstancePrivateLink, self).__init__(**kwargs) + self.properties = None -class ManagedInstanceUpdate(Model): - """An update request for an Azure SQL Database managed instance. +class ManagedInstancePrivateLinkProperties(Model): + """Properties of a private link resource. Variables are only populated by the server, and will be ignored when sending a request. - :param sku: Managed instance sku - :type sku: ~azure.mgmt.sql.models.Sku - :param identity: Managed instance identity - :type identity: ~azure.mgmt.sql.models.ResourceIdentity - :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', - 'Updating', 'Unknown', 'Succeeded', 'Failed' - :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum - :param managed_instance_create_mode: Specifies the mode of database - creation. - Default: Regular instance creation. - Restore: Creates an instance by restoring a set of backups to specific + :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. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param sku: Managed instance sku + :type sku: ~azure.mgmt.sql.models.Sku + :param identity: Managed instance identity + :type identity: + ~azure.mgmt.sql.models.ResourceIdentityWithUserAssignedIdentities + :ivar provisioning_state: Possible values include: 'Creating', 'Deleting', + 'Updating', 'Unknown', 'Succeeded', 'Failed' + :vartype provisioning_state: str or ~azure.mgmt.sql.models.enum + :param managed_instance_create_mode: Specifies the mode of database + creation. + Default: Regular instance creation. + Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId must be specified. Possible values include: 'Default', 'PointInTimeRestore' :type managed_instance_create_mode: str or @@ -6215,6 +7229,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 +7252,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 +7277,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 +7311,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 +7450,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 +7503,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 +7537,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 +7546,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 +7559,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 +7570,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. @@ -7015,6 +8087,51 @@ def __init__(self, **kwargs) -> None: self.change_value_relative = None +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 id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :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}, + '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'}, + '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(OperationsHealth, self).__init__(**kwargs) + self.operations_health_name = None + self.health = None + self.description = None + + class PartnerInfo(Model): """Partner server information for the failover group. @@ -7290,22 +8407,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 +8578,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,218 +8709,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 = { + 'current_value': {'required': True}, + 'action_initiated_by': {'readonly': True}, + 'last_modified': {'readonly': True}, + } + + _attribute_map = { + 'current_value': {'key': 'currentValue', 'type': 'str'}, + 'action_initiated_by': {'key': 'actionInitiatedBy', 'type': 'RecommendedActionInitiatedBy'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + } + + 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 + + +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 + :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}, - 'action': {'readonly': True}, - 'state': {'readonly': True}, - 'created': {'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}, + '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'}, - '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'}, + 'op': {'key': 'properties.op', 'type': 'RecommendedSensitivityLabelUpdateKind'}, '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]'}, + 'column': {'key': 'properties.column', 'type': 'str'}, } - def __init__(self, **kwargs) -> None: - super(RecommendedIndex, self).__init__(**kwargs) - self.action = None - self.state = None - self.created = 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 + 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 RecoverableDatabase(ProxyResource): @@ -7834,7 +9277,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 +9288,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 +9390,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 +9427,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,25 +9438,25 @@ 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: The resource name of the elastic pool containing + this database. + :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 """ @@ -8020,12 +9464,9 @@ class RestorableDroppedDatabase(ProxyResource): '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}, @@ -8035,25 +9476,25 @@ class RestorableDroppedDatabase(ProxyResource): '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'}, } - 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 @@ -8178,6 +9619,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 +9784,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 +9813,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 +9824,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 +9838,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 +9850,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 +9942,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 @@ -8284,6 +9972,18 @@ class Server(TrackedResource): 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccess + :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 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 """ _validation = { @@ -8295,6 +9995,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 +10004,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 +10014,13 @@ 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'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, } - 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, key_id: str=None, administrators=None, **kwargs) -> None: super(Server, self).__init__(location=location, tags=tags, **kwargs) self.identity = identity self.kind = None @@ -8327,6 +10032,10 @@ 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.key_id = key_id + self.administrators = administrators class ServerAutomaticTuning(ProxyResource): @@ -8488,27 +10197,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 @@ -8573,16 +10277,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 +10302,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,28 +10339,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 + 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 ServerCommunicationLink(ProxyResource): @@ -8691,54 +10418,6 @@ def __init__(self, *, partner_server: str, **kwargs) -> 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 - - class ServerDevOpsAuditingSettings(ProxyResource): """A server DevOps auditing settings. @@ -8862,22 +10541,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 +10638,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,45 +10649,152 @@ 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 = { + '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'}, + 'subregion': {'key': 'properties.subregion', 'type': 'str'}, + 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, + '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'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'subregion': {'key': 'properties.subregion', 'type': 'str'}, - 'server_key_type': {'key': 'properties.serverKeyType', 'type': 'str'}, - 'uri': {'key': 'properties.uri', 'type': 'str'}, - 'thumbprint': {'key': 'properties.thumbprint', 'type': 'str'}, - 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, + '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 +10840,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 +10874,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 +10883,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 +10896,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 +10956,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 @@ -9145,6 +10984,18 @@ class ServerUpdate(Model): 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' :type public_network_access: str or ~azure.mgmt.sql.models.ServerPublicNetworkAccess + :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 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 tags: Resource tags. :type tags: dict[str, str] """ @@ -9153,9 +11004,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 +11017,16 @@ 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'}, + 'key_id': {'key': 'properties.keyId', 'type': 'str'}, + 'administrators': {'key': 'properties.administrators', 'type': 'ServerExternalAdministrator'}, '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, key_id: str=None, administrators=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,6 +11035,10 @@ 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.key_id = key_id + self.administrators = administrators self.tags = tags @@ -9299,9 +11161,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 @@ -9492,151 +11354,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. @@ -9723,6 +11440,41 @@ def __init__(self, **kwargs) -> None: self.in_range_time_ratio = None +class SqlAgentConfiguration(ProxyResource): + """A recoverable managed database 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 state: The state of Sql Agent. Possible values include: 'Enabled', + 'Disabled' + :type state: str or ~azure.mgmt.sql.models.enum + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__(self, *, state=None, **kwargs) -> None: + super(SqlAgentConfiguration, self).__init__(**kwargs) + self.state = state + + class StorageCapability(Model): """The storage account type capability. @@ -10116,6 +11868,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 +11892,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 +11918,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 +11927,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 +11944,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 +12160,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 +12186,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 +12238,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,47 +12333,6 @@ def __init__(self, *, queries=None, **kwargs) -> None: self.queries = queries -class TransparentDataEncryption(ProxyResource): - """Represents a database transparent data encryption configuration. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :param status: The status of the database transparent data encryption. - Possible values include: 'Enabled', 'Disabled' - :type status: str or - ~azure.mgmt.sql.models.TransparentDataEncryptionStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'TransparentDataEncryptionStatus'}, - } - - def __init__(self, *, status=None, **kwargs) -> None: - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = status - - class TransparentDataEncryptionActivity(ProxyResource): """Represents a database transparent data encryption Scan. @@ -10650,6 +12398,61 @@ def __init__(self, *, forced_termination: bool=None, **kwargs) -> None: self.forced_termination = forced_termination +class UpdateLongTermRetentionBackupParameters(Model): + """Contains the information necessary to perform long term retention backup + update operation. + + :param requested_backup_storage_redundancy: The storage redundancy type of + the copied backup. Possible values include: 'Geo', 'Local', 'Zone' + :type requested_backup_storage_redundancy: str or + ~azure.mgmt.sql.models.RequestedBackupStorageRedundancy + """ + + _attribute_map = { + 'requested_backup_storage_redundancy': {'key': 'properties.requestedBackupStorageRedundancy', 'type': 'str'}, + } + + 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 UpdateManagedInstanceDnsServersOperation(ProxyResource): + """A recoverable managed database 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 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}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'properties.status', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(UpdateManagedInstanceDnsServersOperation, self).__init__(**kwargs) + self.status = None + + class UpsertManagedServerOperationParameters(Model): """UpsertManagedServerOperationParameters. @@ -10756,6 +12559,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 +12612,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 +12635,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 +12659,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 +12675,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 +12709,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..06de97ef2fe0 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 @@ -25,19 +25,6 @@ class RecoverableDatabasePaged(Paged): def __init__(self, *args, **kwargs): super(RecoverableDatabasePaged, self).__init__(*args, **kwargs) -class RestorableDroppedDatabasePaged(Paged): - """ - 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': '[RestorableDroppedDatabase]'} - } - - def __init__(self, *args, **kwargs): - - super(RestorableDroppedDatabasePaged, self).__init__(*args, **kwargs) class DataMaskingRulePaged(Paged): """ A paging container for iterating over a list of :class:`DataMaskingRule ` object @@ -51,19 +38,6 @@ class DataMaskingRulePaged(Paged): def __init__(self, *args, **kwargs): super(DataMaskingRulePaged, self).__init__(*args, **kwargs) -class FirewallRulePaged(Paged): - """ - 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': '[FirewallRule]'} - } - - def __init__(self, *args, **kwargs): - - super(FirewallRulePaged, self).__init__(*args, **kwargs) class GeoBackupPolicyPaged(Paged): """ A paging container for iterating over a list of :class:`GeoBackupPolicy ` object @@ -129,32 +103,6 @@ class ElasticPoolPaged(Paged): def __init__(self, *args, **kwargs): super(ElasticPoolPaged, self).__init__(*args, **kwargs) -class RecommendedElasticPoolPaged(Paged): - """ - A paging container for iterating over a list of :class:`RecommendedElasticPool ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RecommendedElasticPool]'} - } - - def __init__(self, *args, **kwargs): - - super(RecommendedElasticPoolPaged, self).__init__(*args, **kwargs) -class RecommendedElasticPoolMetricPaged(Paged): - """ - A paging container for iterating over a list of :class:`RecommendedElasticPoolMetric ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RecommendedElasticPoolMetric]'} - } - - def __init__(self, *args, **kwargs): - - super(RecommendedElasticPoolMetricPaged, self).__init__(*args, **kwargs) class ReplicationLinkPaged(Paged): """ A paging container for iterating over a list of :class:`ReplicationLink ` object @@ -220,19 +168,6 @@ class ElasticPoolDatabaseActivityPaged(Paged): def __init__(self, *args, **kwargs): super(ElasticPoolDatabaseActivityPaged, self).__init__(*args, **kwargs) -class ServiceTierAdvisorPaged(Paged): - """ - A paging container for iterating over a list of :class:`ServiceTierAdvisor ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServiceTierAdvisor]'} - } - - def __init__(self, *args, **kwargs): - - super(ServiceTierAdvisorPaged, self).__init__(*args, **kwargs) class TransparentDataEncryptionActivityPaged(Paged): """ A paging container for iterating over a list of :class:`TransparentDataEncryptionActivity ` object @@ -259,396 +194,500 @@ class ServerUsagePaged(Paged): def __init__(self, *args, **kwargs): super(ServerUsagePaged, self).__init__(*args, **kwargs) -class DatabaseUsagePaged(Paged): +class UsagePaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseUsage ` 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': '[DatabaseUsage]'} + 'current_page': {'key': 'value', 'type': '[Usage]'} } def __init__(self, *args, **kwargs): - super(DatabaseUsagePaged, self).__init__(*args, **kwargs) -class EncryptionProtectorPaged(Paged): + super(UsagePaged, self).__init__(*args, **kwargs) +class BackupShortTermRetentionPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`EncryptionProtector ` 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': '[EncryptionProtector]'} + 'current_page': {'key': 'value', 'type': '[BackupShortTermRetentionPolicy]'} } def __init__(self, *args, **kwargs): - super(EncryptionProtectorPaged, self).__init__(*args, **kwargs) -class FailoverGroupPaged(Paged): + super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class ExtendedDatabaseBlobAuditingPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`FailoverGroup ` 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': '[FailoverGroup]'} + 'current_page': {'key': 'value', 'type': '[ExtendedDatabaseBlobAuditingPolicy]'} } def __init__(self, *args, **kwargs): - super(FailoverGroupPaged, self).__init__(*args, **kwargs) -class OperationPaged(Paged): + super(ExtendedDatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class ExtendedServerBlobAuditingPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`Operation ` 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': '[Operation]'} + 'current_page': {'key': 'value', 'type': '[ExtendedServerBlobAuditingPolicy]'} } def __init__(self, *args, **kwargs): - super(OperationPaged, self).__init__(*args, **kwargs) -class ServerKeyPaged(Paged): + super(ExtendedServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class ServerBlobAuditingPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerKey ` 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': '[ServerKey]'} + 'current_page': {'key': 'value', 'type': '[ServerBlobAuditingPolicy]'} } def __init__(self, *args, **kwargs): - super(ServerKeyPaged, self).__init__(*args, **kwargs) -class SyncAgentPaged(Paged): + super(ServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class DatabaseBlobAuditingPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`SyncAgent ` object + 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': '[SyncAgent]'} + 'current_page': {'key': 'value', 'type': '[DatabaseBlobAuditingPolicy]'} } def __init__(self, *args, **kwargs): - super(SyncAgentPaged, self).__init__(*args, **kwargs) -class SyncAgentLinkedDatabasePaged(Paged): + super(DatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class DatabaseColumnPaged(Paged): """ - A paging container for iterating over a list of :class:`SyncAgentLinkedDatabase ` 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': '[SyncAgentLinkedDatabase]'} + 'current_page': {'key': 'value', 'type': '[DatabaseColumn]'} } def __init__(self, *args, **kwargs): - super(SyncAgentLinkedDatabasePaged, self).__init__(*args, **kwargs) -class SubscriptionUsagePaged(Paged): + super(DatabaseColumnPaged, self).__init__(*args, **kwargs) +class ImportExportExtensionsOperationResultPaged(Paged): """ - A paging container for iterating over a list of :class:`SubscriptionUsage ` 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': '[SubscriptionUsage]'} + 'current_page': {'key': 'value', 'type': '[ImportExportExtensionsOperationResult]'} } def __init__(self, *args, **kwargs): - super(SubscriptionUsagePaged, self).__init__(*args, **kwargs) -class VirtualClusterPaged(Paged): + super(ImportExportExtensionsOperationResultPaged, self).__init__(*args, **kwargs) +class DatabaseOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`VirtualCluster ` 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': '[VirtualCluster]'} + 'current_page': {'key': 'value', 'type': '[DatabaseOperation]'} } def __init__(self, *args, **kwargs): - super(VirtualClusterPaged, self).__init__(*args, **kwargs) -class VirtualNetworkRulePaged(Paged): + super(DatabaseOperationPaged, self).__init__(*args, **kwargs) +class DatabaseSchemaPaged(Paged): """ - A paging container for iterating over a list of :class:`VirtualNetworkRule ` 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': '[VirtualNetworkRule]'} + 'current_page': {'key': 'value', 'type': '[DatabaseSchema]'} } def __init__(self, *args, **kwargs): - super(VirtualNetworkRulePaged, self).__init__(*args, **kwargs) -class ExtendedDatabaseBlobAuditingPolicyPaged(Paged): + super(DatabaseSchemaPaged, self).__init__(*args, **kwargs) +class DatabaseSecurityAlertPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`ExtendedDatabaseBlobAuditingPolicy ` 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': '[ExtendedDatabaseBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[DatabaseSecurityAlertPolicy]'} } def __init__(self, *args, **kwargs): - super(ExtendedDatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class ExtendedServerBlobAuditingPolicyPaged(Paged): + super(DatabaseSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class DatabaseTablePaged(Paged): """ - A paging container for iterating over a list of :class:`ExtendedServerBlobAuditingPolicy ` 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': '[ExtendedServerBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[DatabaseTable]'} } def __init__(self, *args, **kwargs): - super(ExtendedServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class ServerBlobAuditingPolicyPaged(Paged): + super(DatabaseTablePaged, self).__init__(*args, **kwargs) +class DatabaseUsagePaged(Paged): """ - A paging container for iterating over a list of :class:`ServerBlobAuditingPolicy ` 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': '[ServerBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[DatabaseUsage]'} } def __init__(self, *args, **kwargs): - super(ServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class DatabaseBlobAuditingPolicyPaged(Paged): + super(DatabaseUsagePaged, self).__init__(*args, **kwargs) +class DatabaseVulnerabilityAssessmentPaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseBlobAuditingPolicy ` 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': '[DatabaseBlobAuditingPolicy]'} + 'current_page': {'key': 'value', 'type': '[DatabaseVulnerabilityAssessment]'} } def __init__(self, *args, **kwargs): - super(DatabaseBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) -class DatabaseVulnerabilityAssessmentPaged(Paged): + super(DatabaseVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) +class VulnerabilityAssessmentScanRecordPaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseVulnerabilityAssessment ` 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': '[DatabaseVulnerabilityAssessment]'} + 'current_page': {'key': 'value', 'type': '[VulnerabilityAssessmentScanRecord]'} } def __init__(self, *args, **kwargs): - super(DatabaseVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) -class JobAgentPaged(Paged): + super(VulnerabilityAssessmentScanRecordPaged, self).__init__(*args, **kwargs) +class DataWarehouseUserActivitiesPaged(Paged): """ - A paging container for iterating over a list of :class:`JobAgent ` 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': '[JobAgent]'} + 'current_page': {'key': 'value', 'type': '[DataWarehouseUserActivities]'} } def __init__(self, *args, **kwargs): - super(JobAgentPaged, self).__init__(*args, **kwargs) -class JobCredentialPaged(Paged): + super(DataWarehouseUserActivitiesPaged, self).__init__(*args, **kwargs) +class DeletedServerPaged(Paged): """ - A paging container for iterating over a list of :class:`JobCredential ` 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': '[JobCredential]'} + 'current_page': {'key': 'value', 'type': '[DeletedServer]'} } def __init__(self, *args, **kwargs): - super(JobCredentialPaged, self).__init__(*args, **kwargs) -class JobExecutionPaged(Paged): + super(DeletedServerPaged, self).__init__(*args, **kwargs) +class ElasticPoolOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`JobExecution ` 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': '[JobExecution]'} + 'current_page': {'key': 'value', 'type': '[ElasticPoolOperation]'} } def __init__(self, *args, **kwargs): - super(JobExecutionPaged, self).__init__(*args, **kwargs) -class JobPaged(Paged): + super(ElasticPoolOperationPaged, self).__init__(*args, **kwargs) +class EncryptionProtectorPaged(Paged): """ - A paging container for iterating over a list of :class:`Job ` 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': '[Job]'} + 'current_page': {'key': 'value', 'type': '[EncryptionProtector]'} } def __init__(self, *args, **kwargs): - super(JobPaged, self).__init__(*args, **kwargs) -class JobStepPaged(Paged): + super(EncryptionProtectorPaged, self).__init__(*args, **kwargs) +class FailoverGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`JobStep ` 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': '[JobStep]'} + 'current_page': {'key': 'value', 'type': '[FailoverGroup]'} } def __init__(self, *args, **kwargs): - super(JobStepPaged, self).__init__(*args, **kwargs) -class JobTargetGroupPaged(Paged): + super(FailoverGroupPaged, self).__init__(*args, **kwargs) +class FirewallRulePaged(Paged): """ - A paging container for iterating over a list of :class:`JobTargetGroup ` 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': '[JobTargetGroup]'} + 'current_page': {'key': 'value', 'type': '[FirewallRule]'} } def __init__(self, *args, **kwargs): - super(JobTargetGroupPaged, self).__init__(*args, **kwargs) -class JobVersionPaged(Paged): + super(FirewallRulePaged, self).__init__(*args, **kwargs) +class InstanceFailoverGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`JobVersion ` 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': '[JobVersion]'} + 'current_page': {'key': 'value', 'type': '[InstanceFailoverGroup]'} } def __init__(self, *args, **kwargs): - super(JobVersionPaged, self).__init__(*args, **kwargs) -class LongTermRetentionBackupPaged(Paged): + super(InstanceFailoverGroupPaged, self).__init__(*args, **kwargs) +class InstancePoolPaged(Paged): """ - A paging container for iterating over a list of :class:`LongTermRetentionBackup ` 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': '[LongTermRetentionBackup]'} + 'current_page': {'key': 'value', 'type': '[InstancePool]'} } def __init__(self, *args, **kwargs): - super(LongTermRetentionBackupPaged, self).__init__(*args, **kwargs) -class ManagedBackupShortTermRetentionPolicyPaged(Paged): + super(InstancePoolPaged, self).__init__(*args, **kwargs) +class JobAgentPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedBackupShortTermRetentionPolicy ` 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': '[ManagedBackupShortTermRetentionPolicy]'} + 'current_page': {'key': 'value', 'type': '[JobAgent]'} } def __init__(self, *args, **kwargs): - super(ManagedBackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) -class ServerDnsAliasPaged(Paged): + super(JobAgentPaged, self).__init__(*args, **kwargs) +class JobCredentialPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerDnsAlias ` 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': '[ServerDnsAlias]'} + 'current_page': {'key': 'value', 'type': '[JobCredential]'} } def __init__(self, *args, **kwargs): - super(ServerDnsAliasPaged, self).__init__(*args, **kwargs) -class ServerSecurityAlertPolicyPaged(Paged): + super(JobCredentialPaged, self).__init__(*args, **kwargs) +class JobExecutionPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerSecurityAlertPolicy ` 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': '[ServerSecurityAlertPolicy]'} + 'current_page': {'key': 'value', 'type': '[JobExecution]'} } def __init__(self, *args, **kwargs): - super(ServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) -class RestorableDroppedManagedDatabasePaged(Paged): + super(JobExecutionPaged, self).__init__(*args, **kwargs) +class JobPaged(Paged): """ - A paging container for iterating over a list of :class:`RestorableDroppedManagedDatabase ` 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': '[RestorableDroppedManagedDatabase]'} + 'current_page': {'key': 'value', 'type': '[Job]'} } def __init__(self, *args, **kwargs): - super(RestorableDroppedManagedDatabasePaged, self).__init__(*args, **kwargs) -class RestorePointPaged(Paged): + super(JobPaged, self).__init__(*args, **kwargs) +class JobStepPaged(Paged): """ - A paging container for iterating over a list of :class:`RestorePoint ` 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': '[RestorePoint]'} + 'current_page': {'key': 'value', 'type': '[JobStep]'} } def __init__(self, *args, **kwargs): - super(RestorePointPaged, self).__init__(*args, **kwargs) -class ManagedDatabaseSecurityAlertPolicyPaged(Paged): + super(JobStepPaged, self).__init__(*args, **kwargs) +class JobTargetGroupPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedDatabaseSecurityAlertPolicy ` 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': '[ManagedDatabaseSecurityAlertPolicy]'} + 'current_page': {'key': 'value', 'type': '[JobTargetGroup]'} } def __init__(self, *args, **kwargs): - super(ManagedDatabaseSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) -class ManagedServerSecurityAlertPolicyPaged(Paged): + super(JobTargetGroupPaged, self).__init__(*args, **kwargs) +class JobVersionPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedServerSecurityAlertPolicy ` 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': '[ManagedServerSecurityAlertPolicy]'} + 'current_page': {'key': 'value', 'type': '[JobVersion]'} } def __init__(self, *args, **kwargs): - super(ManagedServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) + super(JobVersionPaged, self).__init__(*args, **kwargs) +class LongTermRetentionBackupPaged(Paged): + """ + 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': '[LongTermRetentionBackup]'} + } + + def __init__(self, *args, **kwargs): + + super(LongTermRetentionBackupPaged, self).__init__(*args, **kwargs) +class ManagedInstanceLongTermRetentionBackupPaged(Paged): + """ + 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': '[ManagedInstanceLongTermRetentionBackup]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedInstanceLongTermRetentionBackupPaged, self).__init__(*args, **kwargs) +class LongTermRetentionPolicyPaged(Paged): + """ + 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': '[LongTermRetentionPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(LongTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class ManagedBackupShortTermRetentionPolicyPaged(Paged): + """ + 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': '[ManagedBackupShortTermRetentionPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedBackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class QueryStatisticsPaged(Paged): + """ + 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': '[QueryStatistics]'} + } + + def __init__(self, *args, **kwargs): + + super(QueryStatisticsPaged, self).__init__(*args, **kwargs) +class ManagedDatabasePaged(Paged): + """ + A paging container for iterating over a list of :class:`ManagedDatabase ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ManagedDatabase]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedDatabasePaged, self).__init__(*args, **kwargs) +class ManagedDatabaseSecurityAlertPolicyPaged(Paged): + """ + 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': '[ManagedDatabaseSecurityAlertPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedDatabaseSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class SecurityEventPaged(Paged): + """ + 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': '[SecurityEvent]'} + } + + def __init__(self, *args, **kwargs): + + super(SecurityEventPaged, self).__init__(*args, **kwargs) class SensitivityLabelPaged(Paged): """ A paging container for iterating over a list of :class:`SensitivityLabel ` object @@ -662,6 +701,19 @@ class SensitivityLabelPaged(Paged): def __init__(self, *args, **kwargs): super(SensitivityLabelPaged, self).__init__(*args, **kwargs) +class ManagedTransparentDataEncryptionPaged(Paged): + """ + 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': '[ManagedTransparentDataEncryption]'} + } + + def __init__(self, *args, **kwargs): + + super(ManagedTransparentDataEncryptionPaged, self).__init__(*args, **kwargs) class ManagedInstanceAdministratorPaged(Paged): """ A paging container for iterating over a list of :class:`ManagedInstanceAdministrator ` object @@ -675,110 +727,123 @@ class ManagedInstanceAdministratorPaged(Paged): def __init__(self, *args, **kwargs): super(ManagedInstanceAdministratorPaged, self).__init__(*args, **kwargs) -class DatabaseOperationPaged(Paged): +class ManagedInstanceAzureADOnlyAuthenticationPaged(Paged): """ - A paging container for iterating over a list of :class:`DatabaseOperation ` object + 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': '[DatabaseOperation]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceAzureADOnlyAuthentication]'} } def __init__(self, *args, **kwargs): - super(DatabaseOperationPaged, self).__init__(*args, **kwargs) -class ElasticPoolOperationPaged(Paged): + super(ManagedInstanceAzureADOnlyAuthenticationPaged, self).__init__(*args, **kwargs) +class ManagedInstanceEncryptionProtectorPaged(Paged): """ - A paging container for iterating over a list of :class:`ElasticPoolOperation ` object + 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': '[ElasticPoolOperation]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceEncryptionProtector]'} } def __init__(self, *args, **kwargs): - super(ElasticPoolOperationPaged, self).__init__(*args, **kwargs) -class VulnerabilityAssessmentScanRecordPaged(Paged): + super(ManagedInstanceEncryptionProtectorPaged, self).__init__(*args, **kwargs) +class ManagedInstanceKeyPaged(Paged): """ - A paging container for iterating over a list of :class:`VulnerabilityAssessmentScanRecord ` object + 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': '[VulnerabilityAssessmentScanRecord]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceKey]'} } def __init__(self, *args, **kwargs): - super(VulnerabilityAssessmentScanRecordPaged, self).__init__(*args, **kwargs) -class InstanceFailoverGroupPaged(Paged): + super(ManagedInstanceKeyPaged, self).__init__(*args, **kwargs) +class ManagedInstanceLongTermRetentionPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`InstanceFailoverGroup ` object + 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': '[InstanceFailoverGroup]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceLongTermRetentionPolicy]'} } def __init__(self, *args, **kwargs): - super(InstanceFailoverGroupPaged, self).__init__(*args, **kwargs) -class ManagedInstanceKeyPaged(Paged): + super(ManagedInstanceLongTermRetentionPolicyPaged, self).__init__(*args, **kwargs) +class ManagedInstanceOperationPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceKey ` 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': '[ManagedInstanceKey]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstanceOperation]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceKeyPaged, self).__init__(*args, **kwargs) -class ManagedInstanceEncryptionProtectorPaged(Paged): + super(ManagedInstanceOperationPaged, self).__init__(*args, **kwargs) +class ManagedInstancePrivateEndpointConnectionPaged(Paged): """ - A paging container for iterating over a list of :class:`ManagedInstanceEncryptionProtector ` 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': '[ManagedInstanceEncryptionProtector]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstancePrivateEndpointConnection]'} } def __init__(self, *args, **kwargs): - super(ManagedInstanceEncryptionProtectorPaged, self).__init__(*args, **kwargs) -class RecoverableManagedDatabasePaged(Paged): + super(ManagedInstancePrivateEndpointConnectionPaged, self).__init__(*args, **kwargs) +class ManagedInstancePrivateLinkPaged(Paged): """ - A paging container for iterating over a list of :class:`RecoverableManagedDatabase ` 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': '[RecoverableManagedDatabase]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstancePrivateLink]'} } def __init__(self, *args, **kwargs): - super(RecoverableManagedDatabasePaged, self).__init__(*args, **kwargs) -class BackupShortTermRetentionPolicyPaged(Paged): + super(ManagedInstancePrivateLinkPaged, self).__init__(*args, **kwargs) +class ManagedInstancePaged(Paged): """ - A paging container for iterating over a list of :class:`BackupShortTermRetentionPolicy ` 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': '[BackupShortTermRetentionPolicy]'} + 'current_page': {'key': 'value', 'type': '[ManagedInstance]'} } def __init__(self, *args, **kwargs): - super(BackupShortTermRetentionPolicyPaged, self).__init__(*args, **kwargs) + super(ManagedInstancePaged, self).__init__(*args, **kwargs) +class TopQueriesPaged(Paged): + """ + 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': '[TopQueries]'} + } + + def __init__(self, *args, **kwargs): + + super(TopQueriesPaged, self).__init__(*args, **kwargs) class ManagedInstanceVulnerabilityAssessmentPaged(Paged): """ A paging container for iterating over a list of :class:`ManagedInstanceVulnerabilityAssessment ` object @@ -792,45 +857,45 @@ class ManagedInstanceVulnerabilityAssessmentPaged(Paged): def __init__(self, *args, **kwargs): super(ManagedInstanceVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) -class ServerVulnerabilityAssessmentPaged(Paged): +class ManagedServerSecurityAlertPolicyPaged(Paged): """ - A paging container for iterating over a list of :class:`ServerVulnerabilityAssessment ` object + A paging container for iterating over a list of :class:`ManagedServerSecurityAlertPolicy ` object """ _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ServerVulnerabilityAssessment]'} + 'current_page': {'key': 'value', 'type': '[ManagedServerSecurityAlertPolicy]'} } def __init__(self, *args, **kwargs): - super(ServerVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) -class InstancePoolPaged(Paged): + super(ManagedServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class OperationPaged(Paged): """ - A paging container for iterating over a list of :class:`InstancePool ` 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': '[InstancePool]'} + 'current_page': {'key': 'value', 'type': '[Operation]'} } def __init__(self, *args, **kwargs): - super(InstancePoolPaged, self).__init__(*args, **kwargs) -class UsagePaged(Paged): + super(OperationPaged, self).__init__(*args, **kwargs) +class OperationsHealthPaged(Paged): """ - A paging container for iterating over a list of :class:`Usage ` 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': '[Usage]'} + 'current_page': {'key': 'value', 'type': '[OperationsHealth]'} } def __init__(self, *args, **kwargs): - super(UsagePaged, self).__init__(*args, **kwargs) + super(OperationsHealthPaged, self).__init__(*args, **kwargs) class PrivateEndpointConnectionPaged(Paged): """ A paging container for iterating over a list of :class:`PrivateEndpointConnection ` object @@ -857,6 +922,136 @@ class PrivateLinkResourcePaged(Paged): def __init__(self, *args, **kwargs): super(PrivateLinkResourcePaged, self).__init__(*args, **kwargs) +class RecoverableManagedDatabasePaged(Paged): + """ + 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': '[RecoverableManagedDatabase]'} + } + + def __init__(self, *args, **kwargs): + + super(RecoverableManagedDatabasePaged, self).__init__(*args, **kwargs) +class RestorableDroppedDatabasePaged(Paged): + """ + 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': '[RestorableDroppedDatabase]'} + } + + def __init__(self, *args, **kwargs): + + super(RestorableDroppedDatabasePaged, self).__init__(*args, **kwargs) +class RestorableDroppedManagedDatabasePaged(Paged): + """ + 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': '[RestorableDroppedManagedDatabase]'} + } + + def __init__(self, *args, **kwargs): + + super(RestorableDroppedManagedDatabasePaged, self).__init__(*args, **kwargs) +class RestorePointPaged(Paged): + """ + 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': '[RestorePoint]'} + } + + def __init__(self, *args, **kwargs): + + super(RestorePointPaged, self).__init__(*args, **kwargs) +class ServerAzureADAdministratorPaged(Paged): + """ + 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': '[ServerAzureADAdministrator]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerAzureADAdministratorPaged, self).__init__(*args, **kwargs) +class ServerAzureADOnlyAuthenticationPaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerAzureADOnlyAuthentication ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerAzureADOnlyAuthentication]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerAzureADOnlyAuthenticationPaged, self).__init__(*args, **kwargs) +class ServerDevOpsAuditingSettingsPaged(Paged): + """ + 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': '[ServerDevOpsAuditingSettings]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerDevOpsAuditingSettingsPaged, self).__init__(*args, **kwargs) +class ServerDnsAliasPaged(Paged): + """ + 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': '[ServerDnsAlias]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerDnsAliasPaged, self).__init__(*args, **kwargs) +class ServerKeyPaged(Paged): + """ + 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': '[ServerKey]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerKeyPaged, self).__init__(*args, **kwargs) +class ServerOperationPaged(Paged): + """ + 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': '[ServerOperation]'} + } + + def __init__(self, *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 +1065,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 +1208,81 @@ 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): - """ - A paging container for iterating over a list of :class:`ManagedInstance ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[ManagedInstance]'} - } - - def __init__(self, *args, **kwargs): - - super(ManagedInstancePaged, self).__init__(*args, **kwargs) -class TopQueriesPaged(Paged): + super(LogicalDatabaseTransparentDataEncryptionPaged, 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..bf0db40f4df6 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,32 +12,6 @@ from enum import Enum -class ServerConnectionType(str, Enum): - - default = "Default" - proxy = "Proxy" - redirect = "Redirect" - - -class SecurityAlertPolicyState(str, Enum): - - new = "New" - enabled = "Enabled" - disabled = "Disabled" - - -class SecurityAlertPolicyEmailAccountAdmins(str, Enum): - - enabled = "Enabled" - disabled = "Disabled" - - -class SecurityAlertPolicyUseServerDefault(str, Enum): - - enabled = "Enabled" - disabled = "Disabled" - - class DataMaskingState(str, Enum): disabled = "Disabled" @@ -96,68 +70,6 @@ class UnitDefinitionType(str, Enum): bytes_per_second = "BytesPerSecond" -class ElasticPoolEdition(str, Enum): - - basic = "Basic" - standard = "Standard" - premium = "Premium" - general_purpose = "GeneralPurpose" - business_critical = "BusinessCritical" - - -class ReplicationRole(str, Enum): - - primary = "Primary" - secondary = "Secondary" - non_readable_secondary = "NonReadableSecondary" - source = "Source" - copy = "Copy" - - -class ReplicationState(str, Enum): - - pending = "PENDING" - seeding = "SEEDING" - catch_up = "CATCH_UP" - suspended = "SUSPENDED" - - -class RecommendedIndexAction(str, Enum): - - create = "Create" - drop = "Drop" - rebuild = "Rebuild" - - -class RecommendedIndexState(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" - - -class RecommendedIndexType(str, Enum): - - clustered = "CLUSTERED" - nonclustered = "NONCLUSTERED" - columnstore = "COLUMNSTORE" - clusteredcolumnstore = "CLUSTERED COLUMNSTORE" - - -class TransparentDataEncryptionStatus(str, Enum): - - enabled = "Enabled" - disabled = "Disabled" - - class ServiceObjectiveName(str, Enum): system = "System" @@ -233,6 +145,72 @@ class TransparentDataEncryptionActivityStatus(str, Enum): decrypting = "Decrypting" +class BlobAuditingPolicyState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class AdvisorStatus(str, Enum): + + ga = "GA" + public_preview = "PublicPreview" + limited_public_preview = "LimitedPublicPreview" + private_preview = "PrivatePreview" + + +class AutoExecuteStatus(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + default = "Default" + + +class AutoExecuteStatusInheritedFrom(str, Enum): + + default = "Default" + subscription = "Subscription" + server = "Server" + elastic_pool = "ElasticPool" + database = "Database" + + +class RecommendedActionCurrentState(str, Enum): + + 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 RecommendedActionInitiatedBy(str, Enum): + + user = "User" + system = "System" + + +class ImplementationMethod(str, Enum): + + tsql = "TSql" + azure_power_shell = "AzurePowerShell" + + +class IsRetryable(str, Enum): + + yes = "Yes" + no = "No" + + class AutomaticTuningMode(str, Enum): inherit = "Inherit" @@ -265,236 +243,294 @@ class AutomaticTuningDisabledReason(str, Enum): not_supported = "NotSupported" -class ServerKeyType(str, Enum): - - service_managed = "ServiceManaged" - azure_key_vault = "AzureKeyVault" +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 ReadWriteEndpointFailoverPolicy(str, Enum): +class StorageKeyType(str, Enum): - manual = "Manual" - automatic = "Automatic" + shared_access_key = "SharedAccessKey" + storage_access_key = "StorageAccessKey" -class ReadOnlyEndpointFailoverPolicy(str, Enum): +class ManagementOperationState(str, Enum): - disabled = "Disabled" - enabled = "Enabled" + pending = "Pending" + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + cancel_in_progress = "CancelInProgress" + cancelled = "Cancelled" -class FailoverGroupReplicationRole(str, Enum): +class CreateMode(str, Enum): - primary = "Primary" + 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 OperationOrigin(str, Enum): +class SampleName(str, Enum): - user = "user" - system = "system" + adventure_works_lt = "AdventureWorksLT" + wide_world_importers_std = "WideWorldImportersStd" + wide_world_importers_full = "WideWorldImportersFull" -class SyncAgentState(str, Enum): +class DatabaseStatus(str, Enum): online = "Online" + restoring = "Restoring" + recovery_pending = "RecoveryPending" + recovering = "Recovering" + suspect = "Suspect" offline = "Offline" - never_connected = "NeverConnected" + 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 SyncMemberDbType(str, Enum): +class CatalogCollationType(str, Enum): - azure_sql_database = "AzureSqlDatabase" - sql_server_database = "SqlServerDatabase" + database_default = "DATABASE_DEFAULT" + sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" -class VirtualNetworkRuleState(str, Enum): +class DatabaseLicenseType(str, Enum): - initializing = "Initializing" - in_progress = "InProgress" - ready = "Ready" - deleting = "Deleting" - unknown = "Unknown" + license_included = "LicenseIncluded" + base_price = "BasePrice" -class BlobAuditingPolicyState(str, Enum): +class DatabaseReadScale(str, Enum): enabled = "Enabled" disabled = "Disabled" -class JobAgentState(str, Enum): +class SecondaryType(str, Enum): - creating = "Creating" - ready = "Ready" - updating = "Updating" - deleting = "Deleting" - disabled = "Disabled" + geo = "Geo" + named = "Named" -class JobExecutionLifecycle(str, Enum): +class CurrentBackupStorageRedundancy(str, Enum): - created = "Created" - in_progress = "InProgress" - waiting_for_child_job_executions = "WaitingForChildJobExecutions" - waiting_for_retry = "WaitingForRetry" - succeeded = "Succeeded" - succeeded_with_skipped = "SucceededWithSkipped" - failed = "Failed" - timed_out = "TimedOut" - canceled = "Canceled" - skipped = "Skipped" + geo = "Geo" + local = "Local" + zone = "Zone" -class ProvisioningState(str, Enum): +class RequestedBackupStorageRedundancy(str, Enum): - created = "Created" - in_progress = "InProgress" - succeeded = "Succeeded" - failed = "Failed" - canceled = "Canceled" + geo = "Geo" + local = "Local" + zone = "Zone" -class JobTargetType(str, Enum): +class SecurityAlertsPolicyState(str, Enum): - target_group = "TargetGroup" - sql_database = "SqlDatabase" - sql_elastic_pool = "SqlElasticPool" - sql_shard_map = "SqlShardMap" - sql_server = "SqlServer" + enabled = "Enabled" + disabled = "Disabled" -class JobScheduleType(str, Enum): +class CreatedByType(str, Enum): - once = "Once" + user = "User" + application = "Application" + managed_identity = "ManagedIdentity" + key = "Key" + + +class VulnerabilityAssessmentScanTriggerType(str, Enum): + + on_demand = "OnDemand" recurring = "Recurring" -class JobStepActionType(str, Enum): +class VulnerabilityAssessmentScanState(str, Enum): - tsql = "TSql" + passed = "Passed" + failed = "Failed" + failed_to_run = "FailedToRun" + in_progress = "InProgress" -class JobStepActionSource(str, Enum): +class ElasticPoolState(str, Enum): - inline = "Inline" + creating = "Creating" + ready = "Ready" + disabled = "Disabled" -class JobStepOutputType(str, Enum): +class ElasticPoolLicenseType(str, Enum): - sql_database = "SqlDatabase" + license_included = "LicenseIncluded" + base_price = "BasePrice" -class JobTargetGroupMembershipType(str, Enum): +class ServerKeyType(str, Enum): - include = "Include" - exclude = "Exclude" + service_managed = "ServiceManaged" + azure_key_vault = "AzureKeyVault" -class AutomaticTuningServerMode(str, Enum): +class ReadWriteEndpointFailoverPolicy(str, Enum): - custom = "Custom" - auto = "Auto" - unspecified = "Unspecified" + manual = "Manual" + automatic = "Automatic" -class AutomaticTuningServerReason(str, Enum): +class ReadOnlyEndpointFailoverPolicy(str, Enum): - default = "Default" disabled = "Disabled" - auto_configured = "AutoConfigured" + enabled = "Enabled" -class RestorePointType(str, Enum): +class FailoverGroupReplicationRole(str, Enum): - continuous = "CONTINUOUS" - discrete = "DISCRETE" + primary = "Primary" + secondary = "Secondary" -class SensitivityLabelRank(str, Enum): +class InstanceFailoverGroupReplicationRole(str, Enum): - none = "None" - low = "Low" - medium = "Medium" - high = "High" - critical = "Critical" + primary = "Primary" + secondary = "Secondary" -class ManagementOperationState(str, Enum): +class InstancePoolLicenseType(str, Enum): - pending = "Pending" - in_progress = "InProgress" - succeeded = "Succeeded" - failed = "Failed" - cancel_in_progress = "CancelInProgress" - cancelled = "Cancelled" + license_included = "LicenseIncluded" + base_price = "BasePrice" -class VulnerabilityAssessmentScanTriggerType(str, Enum): +class JobAgentState(str, Enum): - on_demand = "OnDemand" - recurring = "Recurring" + creating = "Creating" + ready = "Ready" + updating = "Updating" + deleting = "Deleting" + disabled = "Disabled" -class VulnerabilityAssessmentScanState(str, Enum): +class JobExecutionLifecycle(str, Enum): - passed = "Passed" - failed = "Failed" - failed_to_run = "FailedToRun" + created = "Created" in_progress = "InProgress" + waiting_for_child_job_executions = "WaitingForChildJobExecutions" + waiting_for_retry = "WaitingForRetry" + succeeded = "Succeeded" + succeeded_with_skipped = "SucceededWithSkipped" + failed = "Failed" + timed_out = "TimedOut" + canceled = "Canceled" + skipped = "Skipped" -class InstanceFailoverGroupReplicationRole(str, Enum): - - primary = "Primary" - secondary = "Secondary" - - -class InstancePoolLicenseType(str, Enum): +class ProvisioningState(str, Enum): - license_included = "LicenseIncluded" - base_price = "BasePrice" + created = "Created" + in_progress = "InProgress" + succeeded = "Succeeded" + failed = "Failed" + canceled = "Canceled" -class PrivateLinkServiceConnectionStateStatus(str, Enum): +class JobTargetType(str, Enum): - approved = "Approved" - pending = "Pending" - rejected = "Rejected" - disconnected = "Disconnected" + target_group = "TargetGroup" + sql_database = "SqlDatabase" + sql_elastic_pool = "SqlElasticPool" + sql_shard_map = "SqlShardMap" + sql_server = "SqlServer" -class PrivateLinkServiceConnectionStateActionsRequire(str, Enum): +class JobScheduleType(str, Enum): - none = "None" + once = "Once" + recurring = "Recurring" -class PrivateEndpointProvisioningState(str, Enum): +class JobStepActionType(str, Enum): - approving = "Approving" - ready = "Ready" - dropping = "Dropping" - failed = "Failed" - rejecting = "Rejecting" + tsql = "TSql" -class IdentityType(str, Enum): +class JobStepActionSource(str, Enum): - none = "None" - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" + inline = "Inline" -class ServerPublicNetworkAccess(str, Enum): +class JobStepOutputType(str, Enum): - enabled = "Enabled" - disabled = "Disabled" + sql_database = "SqlDatabase" -class CheckNameAvailabilityReason(str, Enum): +class JobTargetGroupMembershipType(str, Enum): - invalid = "Invalid" - already_exists = "AlreadyExists" + include = "Include" + exclude = "Exclude" class MaxSizeUnit(str, Enum): @@ -533,56 +569,43 @@ class PauseDelayTimeUnit(str, Enum): minutes = "Minutes" -class SyncGroupLogType(str, Enum): +class TargetBackupStorageRedundancy(str, Enum): - all = "All" - error = "Error" - warning = "Warning" - success = "Success" + geo = "Geo" + local = "Local" + zone = "Zone" -class SyncConflictResolutionPolicy(str, Enum): +class BackupStorageRedundancy(str, Enum): - hub_win = "HubWin" - member_win = "MemberWin" + geo = "Geo" + local = "Local" + zone = "Zone" -class SyncGroupState(str, Enum): +class DayOfWeek(str, Enum): - not_ready = "NotReady" - error = "Error" - warning = "Warning" - progressing = "Progressing" - good = "Good" + sunday = "Sunday" + monday = "Monday" + tuesday = "Tuesday" + wednesday = "Wednesday" + thursday = "Thursday" + friday = "Friday" + saturday = "Saturday" -class SyncDirection(str, Enum): +class QueryTimeGrainType(str, Enum): - bidirectional = "Bidirectional" - one_way_member_to_hub = "OneWayMemberToHub" - one_way_hub_to_member = "OneWayHubToMember" + pt1_h = "PT1H" + p1_d = "P1D" -class SyncMemberState(str, Enum): +class QueryMetricUnitType(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" + percentage = "percentage" + kb = "KB" + microseconds = "microseconds" + count = "count" class ManagedDatabaseStatus(str, Enum): @@ -596,12 +619,6 @@ class ManagedDatabaseStatus(str, Enum): updating = "Updating" -class CatalogCollationType(str, Enum): - - database_default = "DATABASE_DEFAULT" - sql_latin1_general_cp1_ci_as = "SQL_Latin1_General_CP1_CI_AS" - - class ManagedDatabaseCreateMode(str, Enum): default = "Default" @@ -611,6 +628,54 @@ class ManagedDatabaseCreateMode(str, Enum): restore_long_term_retention_backup = "RestoreLongTermRetentionBackup" +class SecurityAlertPolicyState(str, Enum): + + new = "New" + enabled = "Enabled" + disabled = "Disabled" + + +class SecurityEventType(str, Enum): + + undefined = "Undefined" + sql_injection_vulnerability = "SqlInjectionVulnerability" + sql_injection_exploit = "SqlInjectionExploit" + + +class SensitivityLabelRank(str, Enum): + + none = "None" + low = "Low" + medium = "Medium" + high = "High" + critical = "Critical" + + +class SensitivityLabelUpdateKind(str, Enum): + + set = "set" + remove = "remove" + + +class RecommendedSensitivityLabelUpdateKind(str, Enum): + + enable = "enable" + disable = "disable" + + +class TransparentDataEncryptionState(str, Enum): + + enabled = "Enabled" + disabled = "Disabled" + + +class IdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + + class ManagedServerCreateMode(str, Enum): default = "Default" @@ -637,179 +702,191 @@ class StorageAccountType(str, Enum): zrs = "ZRS" -class QueryTimeGrainType(str, Enum): +class AdministratorType(str, Enum): - pt1_h = "PT1H" - p1_d = "P1D" + active_directory = "ActiveDirectory" -class QueryMetricUnitType(str, Enum): +class PrincipalType(str, Enum): - percentage = "percentage" - kb = "KB" - microseconds = "microseconds" - count = "count" + user = "User" + group = "Group" + application = "Application" -class CreateMode(str, Enum): +class OperationOrigin(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" + user = "user" + system = "system" -class SampleName(str, Enum): +class PrivateLinkServiceConnectionStateStatus(str, Enum): - adventure_works_lt = "AdventureWorksLT" - wide_world_importers_std = "WideWorldImportersStd" - wide_world_importers_full = "WideWorldImportersFull" + approved = "Approved" + pending = "Pending" + rejected = "Rejected" + disconnected = "Disconnected" -class DatabaseStatus(str, Enum): +class PrivateLinkServiceConnectionStateActionsRequire(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" + none = "None" -class DatabaseLicenseType(str, Enum): +class PrivateEndpointProvisioningState(str, Enum): - license_included = "LicenseIncluded" - base_price = "BasePrice" + approving = "Approving" + ready = "Ready" + dropping = "Dropping" + failed = "Failed" + rejecting = "Rejecting" -class DatabaseReadScale(str, Enum): +class RestorePointType(str, Enum): - enabled = "Enabled" - disabled = "Disabled" + continuous = "CONTINUOUS" + discrete = "DISCRETE" -class SecondaryType(str, Enum): +class AutomaticTuningServerMode(str, Enum): - geo = "Geo" - named = "Named" + custom = "Custom" + auto = "Auto" + unspecified = "Unspecified" -class StorageKeyType(str, Enum): +class AutomaticTuningServerReason(str, Enum): - shared_access_key = "SharedAccessKey" - storage_access_key = "StorageAccessKey" + default = "Default" + disabled = "Disabled" + auto_configured = "AutoConfigured" -class ElasticPoolState(str, Enum): +class ServerPublicNetworkAccess(str, Enum): - creating = "Creating" - ready = "Ready" + enabled = "Enabled" disabled = "Disabled" -class ElasticPoolLicenseType(str, Enum): +class ServerWorkspaceFeature(str, Enum): - license_included = "LicenseIncluded" - base_price = "BasePrice" + connected = "Connected" + disconnected = "Disconnected" -class CreatedByType(str, Enum): +class CheckNameAvailabilityReason(str, Enum): - user = "User" - application = "Application" - managed_identity = "ManagedIdentity" - key = "Key" + invalid = "Invalid" + already_exists = "AlreadyExists" + + +class SyncAgentState(str, Enum): + + online = "Online" + offline = "Offline" + never_connected = "NeverConnected" -class LongTermRetentionDatabaseState(str, Enum): +class SyncMemberDbType(str, Enum): + + azure_sql_database = "AzureSqlDatabase" + sql_server_database = "SqlServerDatabase" + + +class SyncGroupLogType(str, Enum): all = "All" - live = "Live" - deleted = "Deleted" + error = "Error" + warning = "Warning" + success = "Success" -class VulnerabilityAssessmentPolicyBaselineName(str, Enum): +class SyncConflictResolutionPolicy(str, Enum): - master = "master" - default = "default" + hub_win = "HubWin" + member_win = "MemberWin" -class SensitivityLabelSource(str, Enum): +class SyncGroupState(str, Enum): - current = "current" - recommended = "recommended" + not_ready = "NotReady" + error = "Error" + warning = "Warning" + progressing = "Progressing" + good = "Good" -class CapabilityGroup(str, Enum): +class SyncDirection(str, Enum): - supported_editions = "supportedEditions" - supported_elastic_pool_editions = "supportedElasticPoolEditions" - supported_managed_instance_versions = "supportedManagedInstanceVersions" - supported_instance_pool_editions = "supportedInstancePoolEditions" - supported_managed_instance_editions = "supportedManagedInstanceEditions" + bidirectional = "Bidirectional" + one_way_member_to_hub = "OneWayMemberToHub" + one_way_hub_to_member = "OneWayHubToMember" -class DatabaseState1(str, Enum): +class SyncMemberState(str, Enum): - all = "All" - live = "Live" - deleted = "Deleted" + 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 DatabaseState2(str, Enum): +class VirtualNetworkRuleState(str, Enum): - all = "All" - live = "Live" - deleted = "Deleted" + initializing = "Initializing" + in_progress = "InProgress" + ready = "Ready" + failed = "Failed" + deleting = "Deleting" + unknown = "Unknown" -class DatabaseState3(str, Enum): +class ReplicaType(str, Enum): + + primary = "Primary" + readable_secondary = "ReadableSecondary" - all = "All" - live = "Live" - deleted = "Deleted" +class VulnerabilityAssessmentPolicyBaselineName(str, Enum): -class DatabaseState4(str, Enum): + master = "master" + default = "default" - all = "All" - live = "Live" - deleted = "Deleted" + +class CapabilityGroup(str, Enum): + + supported_editions = "supportedEditions" + supported_elastic_pool_editions = "supportedElasticPoolEditions" + supported_managed_instance_versions = "supportedManagedInstanceVersions" + supported_instance_pool_editions = "supportedInstancePoolEditions" + supported_managed_instance_editions = "supportedManagedInstanceEditions" -class DatabaseState5(str, Enum): +class DatabaseState(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 +905,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..4b2086987308 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 @@ -10,41 +10,45 @@ # -------------------------------------------------------------------------- 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 ._usages_operations import UsagesOperations +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 ._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 ._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 +58,116 @@ from ._job_target_executions_operations import JobTargetExecutionsOperations from ._job_target_groups_operations import JobTargetGroupsOperations from ._job_versions_operations import JobVersionsOperations +from ._capabilities_operations import CapabilitiesOperations from ._long_term_retention_backups_operations import LongTermRetentionBackupsOperations -from ._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 ._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 ._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 ._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', + 'UsagesOperations', + 'BackupShortTermRetentionPoliciesOperations', 'ExtendedDatabaseBlobAuditingPoliciesOperations', 'ExtendedServerBlobAuditingPoliciesOperations', 'ServerBlobAuditingPoliciesOperations', 'DatabaseBlobAuditingPoliciesOperations', + 'DatabaseAdvisorsOperations', + 'DatabaseAutomaticTuningOperations', + 'DatabaseColumnsOperations', + 'DatabaseExtensionsOperations', + 'DatabaseOperations', + 'DatabaseRecommendedActionsOperations', + 'DatabaseSchemasOperations', + 'DatabaseSecurityAlertPoliciesOperations', + 'DatabaseTablesOperations', + 'DatabaseUsagesOperations', 'DatabaseVulnerabilityAssessmentRuleBaselinesOperations', 'DatabaseVulnerabilityAssessmentsOperations', + 'DatabaseVulnerabilityAssessmentScansOperations', + 'DataWarehouseUserActivitiesOperations', + 'DeletedServersOperations', + 'ElasticPoolOperations', + 'EncryptionProtectorsOperations', + 'FailoverGroupsOperations', + 'FirewallRulesOperations', + 'InstanceFailoverGroupsOperations', + 'InstancePoolsOperations', 'JobAgentsOperations', 'JobCredentialsOperations', 'JobExecutionsOperations', @@ -151,54 +177,72 @@ 'JobTargetExecutionsOperations', 'JobTargetGroupsOperations', 'JobVersionsOperations', + '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', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', - 'ServersOperations', - 'CapabilitiesOperations', - 'LongTermRetentionManagedInstanceBackupsOperations', - 'ManagedInstanceLongTermRetentionPoliciesOperations', - 'WorkloadGroupsOperations', - 'WorkloadClassifiersOperations', - 'ManagedInstanceOperations', + 'RecoverableManagedDatabasesOperations', + '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', + '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..9d3bd8c5e245 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_backup_short_term_retention_policies_operations.py @@ -28,7 +28,7 @@ class BackupShortTermRetentionPoliciesOperations(object): :param serializer: An object model serializer. :param deserializer: An object model deserializer. :ivar policy_name: The policy name. Should always be "default". Constant value: "default". - :ivar api_version: The API version to use for the request. Constant value: "2017-10-01-preview". + :ivar api_version: The API version to use for the request. Constant value: "2020-11-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 = "2020-11-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..ff4fe19ee7cb 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: "2020-11-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 = "2020-11-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py new file mode 100644 index 000000000000..d8a9def9448e --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_data_warehouse_user_activities_operations.py @@ -0,0 +1,188 @@ +# 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 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. + + :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 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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.data_warehouse_user_activity_name = "current" + self.api_version = "2020-11-01-preview" + + self.config = config + + def get( + self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): + """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 + 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: 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 = { + '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'), + '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) + + # 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('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}/databases/{databaseName}/dataWarehouseUserActivities/{dataWarehouseUserActivityName}'} + + 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 + 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 DataWarehouseUserActivities + :rtype: + ~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_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.DataWarehouseUserActivitiesPaged(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}/dataWarehouseUserActivities'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py new file mode 100644 index 000000000000..6c5e02d78bb8 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_advisors_operations.py @@ -0,0 +1,260 @@ +# 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 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + 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 + 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 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_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 = {} + 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_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, 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 + 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: 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'), + '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('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 + 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..8b2ee4994393 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: "2020-11-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 = "2020-11-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..278971e6b952 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: "2020-11-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 = "2020-11-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..d68b9ca73e52 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: "2020-11-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 = "2020-11-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..78fc3911cc1e --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..4605a728c639 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: "2020-11-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 = "2020-11-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..2eb617c1a463 --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..b49dd2c93f34 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: "2020-11-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 = "2020-11-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/_database_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_operations.py new file mode 100644 index 000000000000..42eaea19f61c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_security_alert_policies_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 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. + + :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 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: "2020-11-01-preview". + """ + + models = models + + 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 = "2020-11-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 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. + :type server_name: str + :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: 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'] + 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'), + '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['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('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}/securityAlertPolicies/{securityAlertPolicyName}'} + + 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. + :type server_name: str + :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: DatabaseSecurityAlertPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + '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['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, 'DatabaseSecurityAlertPolicy') + + # 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('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 + 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): + """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. + :type server_name: str + :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 DatabaseSecurityAlertPolicy + :rtype: + ~azure.mgmt.sql.models.DatabaseSecurityAlertPolicyPaged[~azure.mgmt.sql.models.DatabaseSecurityAlertPolicy] + :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.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}/securityAlertPolicies'} diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_database_tables_operations.py new file mode 100644 index 000000000000..7c499172bb3c --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_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 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + 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 + 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 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'), + '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 = {} + 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/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 + 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..3a6fe4e2b03d 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: "2020-11-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 = "2020-11-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..4f1a7db663fc 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: "2020-11-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 = "2020-11-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..0a928684afbd 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: "2020-11-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 = "2020-11-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..78a584de85da 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: "2020-11-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 = "2020-11-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..48704cb3474c 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 @@ -221,7 +221,7 @@ def list_by_server( ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" def prepare_request(next_link=None): if not next_link: @@ -299,7 +299,7 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" # Construct URL url = self.get.metadata['url'] @@ -348,7 +348,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.create_or_update.metadata['url'] @@ -458,7 +458,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.delete.metadata['url'] @@ -545,7 +545,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.update.metadata['url'] @@ -672,7 +672,7 @@ def list_by_elastic_pool( ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" def prepare_request(next_link=None): if not next_link: @@ -732,7 +732,7 @@ def internal_paging(next_link=None): def _pause_initial( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" # Construct URL url = self.pause.metadata['url'] @@ -833,7 +833,7 @@ def get_long_running_output(response): def _resume_initial( self, resource_group_name, server_name, database_name, custom_headers=None, raw=False, **operation_config): - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" # Construct URL url = self.resume.metadata['url'] @@ -934,7 +934,7 @@ def get_long_running_output(response): 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" + api_version = "2020-11-01-preview" # Construct URL url = self.failover.metadata['url'] @@ -1044,7 +1044,7 @@ def list_inaccessible_by_server( ~azure.mgmt.sql.models.DatabasePaged[~azure.mgmt.sql.models.Database] :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" def prepare_request(next_link=None): if not next_link: @@ -1103,7 +1103,7 @@ def internal_paging(next_link=None): 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" + api_version = "2020-11-01-preview" # Construct URL url = self.upgrade_data_warehouse.metadata['url'] @@ -1212,7 +1212,7 @@ def rename( """ parameters = models.ResourceMoveDefinition(id=id) - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" # Construct URL url = self.rename.metadata['url'] @@ -1258,7 +1258,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.import_method.metadata['url'] @@ -1366,114 +1366,9 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.export.metadata['url'] 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..081c09992249 --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_elastic_pool_operations.py index 26dd59fe4abf..1f474dba0c10 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: "2020-11-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 = "2020-11-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..fd1e68478a60 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 @@ -223,7 +223,7 @@ def list_by_server( ~azure.mgmt.sql.models.ElasticPoolPaged[~azure.mgmt.sql.models.ElasticPool] :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" def prepare_request(next_link=None): if not next_link: @@ -303,7 +303,7 @@ def get( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - api_version = "2020-08-01-preview" + api_version = "2020-11-01-preview" # Construct URL url = self.get.metadata['url'] @@ -352,7 +352,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.create_or_update.metadata['url'] @@ -462,7 +462,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.delete.metadata['url'] @@ -549,7 +549,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.update.metadata['url'] @@ -657,7 +657,7 @@ 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" + api_version = "2020-11-01-preview" # Construct URL url = self.failover.metadata['url'] 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..7755de5805b6 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: "2020-11-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 = "2020-11-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..30354b442621 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: "2020-11-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 = "2020-11-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..ef425972ea0c 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: "2020-11-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 = "2020-11-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..bfb90362ef3c 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: "2020-11-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 = "2020-11-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..e416bba79df6 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: "2020-11-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 = "2020-11-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..d141c281270d 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: "2020-11-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 = "2020-11-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..4d7f6cf4995a 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: "2020-11-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 = "2020-11-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..24203cd2a2bf 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: "2020-11-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 = "2020-11-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..dc3e641685bc 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: "2020-11-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 = "2020-11-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..009feac16b6c 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: "2020-11-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 = "2020-11-01-preview" self.config = config 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..06353fa4bd74 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: "2020-11-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 = "2020-11-01-preview" self.config = config 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..0ce51faa8f21 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: "2020-11-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 = "2020-11-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..f9bbbf7cbb99 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: "2020-11-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 = "2020-11-01-preview" self.config = config 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..96126c1d03d7 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: "2020-11-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 = "2020-11-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..6ef28a60912b 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: "2020-11-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 = "2020-11-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..efc6a0d787de 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: "2020-11-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 = "2020-11-01-preview" self.config = config 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..9e59fbcbbebc 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: "2020-11-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 = "2020-11-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..c0a326c81f55 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: "2020-11-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 = "2020-11-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..b4f0d27a5a1c 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: "2020-11-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 = "2020-11-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..6a81121e23c0 --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..081114e01ba3 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: "2020-11-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 = "2020-11-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..114a252b2378 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: "2020-11-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 = "2020-11-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..0ddd24b58270 --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..2029526669b3 --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..13f539031bf9 --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..15c59d022cac 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: "2020-11-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 = "2020-11-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..1bbd58fcc19c --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..4027892916af 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: "2020-11-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 = "2020-11-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py new file mode 100644 index 000000000000..b86ca69cfcdb --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_database_security_events_operations.py @@ -0,0 +1,136 @@ +# 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 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + 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 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: int + :param top: The number of elements to return from the collection. + :type top: int + :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 SecurityEvent + :rtype: + ~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_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') + if skip is not None: + query_parameters['$skip'] = self._serialize.query("skip", skip, 'int') + if top is not None: + query_parameters['$top'] = self._serialize.query("top", top, 'int') + 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.SecurityEventPaged(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}/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..30605418a1da 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: "2020-11-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 = "2020-11-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..208af6c7d878 --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..902a8595d2d5 --- /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: "2020-11-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 = "2020-11-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..fb8776914684 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: "2020-11-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 = "2020-11-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..414d3c3b0176 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: "2020-11-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 = "2020-11-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..401b94695114 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: "2020-11-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 = "2020-11-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..e8a13f722ed0 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: "2020-11-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 = "2020-11-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..3a793d36ce13 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: "2020-11-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 = "2020-11-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..1c303612cfac 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: "2020-11-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 = "2020-11-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..d0485ada786a 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: "2020-11-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 = "2020-11-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..3619d9453bab 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: "2020-11-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 = "2020-11-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..815916b4c871 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: "2020-11-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 = "2020-11-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..72ccd86aee9a 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: "2020-11-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 = "2020-11-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..a0a68fc67f4e --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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/_managed_instance_private_link_resources_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py new file mode 100644 index 000000000000..c28250fd24b5 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_instance_private_link_resources_operations.py @@ -0,0 +1,180 @@ +# 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 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + 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 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 ManagedInstancePrivateLink + :rtype: + ~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_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.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 + 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..322c1b545a47 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: "2020-11-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 = "2020-11-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..8f2c985254fc 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: "2020-11-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 = "2020-11-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..58bd77d0cca7 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: "2020-11-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 = "2020-11-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..09f2badbc182 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: "2020-11-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 = "2020-11-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..2f23db6cf926 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: "2020-11-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 = "2020-11-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..03599ad4b407 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: "2020-11-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 = "2020-11-01-preview" self.config = config diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations_health_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations_health_operations.py new file mode 100644 index 000000000000..8e31f45417c4 --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_operations_health_operations.py @@ -0,0 +1,110 @@ +# 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 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + 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 OperationsHealth + :rtype: + ~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_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.OperationsHealthPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + 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/_private_endpoint_connections_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_private_endpoint_connections_operations.py index ee40d48d7f2a..9f04fac263d4 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: "2020-11-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 = "2020-11-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..1e1cf826a105 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: "2020-11-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 = "2020-11-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..40af471a308e --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..ae299e1c3aeb 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: "2020-11-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 = "2020-11-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..7fb56c5785b6 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 @@ -27,7 +27,6 @@ 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". """ models = models @@ -37,144 +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.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. - - :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 dropped. - :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 - :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) - - # 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, 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 - delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}'} - - def get( - self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): - """Gets a database 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. - :type server_name: str - :param database_name: The name of the database to get the link for. - :type database_name: str - :param link_id: The replication link ID to be retrieved. - :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: ReplicationLink or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.sql.models.ReplicationLink 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'), - '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['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('ReplicationLink', 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}/replicationLinks/{linkId}'} - def _failover_initial( self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): + api_version = "2014-04-01" + # Construct URL url = self.failover.metadata['url'] path_format_arguments = { @@ -188,7 +57,7 @@ def _failover_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -266,6 +135,8 @@ def get_long_running_output(response): def _failover_allow_data_loss_initial( self, resource_group_name, server_name, database_name, link_id, custom_headers=None, raw=False, **operation_config): + api_version = "2014-04-01" + # Construct URL url = self.failover_allow_data_loss.metadata['url'] path_format_arguments = { @@ -279,7 +150,7 @@ def _failover_allow_data_loss_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -359,6 +230,8 @@ 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) + api_version = "2014-04-01" + # Construct URL url = self.unlink.metadata['url'] path_format_arguments = { @@ -372,7 +245,7 @@ def _unlink_initial( # Construct parameters query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') # Construct headers header_parameters = {} @@ -456,15 +329,17 @@ def get_long_running_output(response): 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. + """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 to retrieve links for. + :param database_name: The name of the database containing the + replication link. :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 @@ -476,21 +351,23 @@ def list_by_database( ~azure.mgmt.sql.models.ReplicationLinkPaged[~azure.mgmt.sql.models.ReplicationLink] :raises: :class:`CloudError` """ + api_version = "2020-11-01-preview" + def prepare_request(next_link=None): if not next_link: # 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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') else: url = next_link @@ -530,3 +407,153 @@ def internal_paging(next_link=None): 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, 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 containing the replication + link. + :type server_name: str + :param database_name: The name of the database containing the + replication link. + :type database_name: 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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ReplicationLink or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.sql.models.ReplicationLink or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + api_version = "2020-11-01-preview" + + # 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'), + '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) + + # 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' + 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('ReplicationLink', 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}/replicationLinks/{replicationLinkName}'} + + 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 containing the replication + link. + :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 ReplicationLink + :rtype: + ~azure.mgmt.sql.models.ReplicationLinkPaged[~azure.mgmt.sql.models.ReplicationLink] + :raises: :class:`CloudError` + """ + api_version = "2020-11-01-preview" + + def prepare_request(next_link=None): + if not next_link: + # 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 = {} + 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.ReplicationLinkPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + 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..e05ae9597058 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: "2020-11-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 = "2020-11-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..e946801e0e55 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: "2020-11-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 = "2020-11-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..519cc5d49050 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: "2020-11-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 = "2020-11-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..7ed76d329dfa 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: "2020-11-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 = "2020-11-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..116e1c7625cc --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..50bc318a24c3 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: "2020-11-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 = "2020-11-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..90a25d6ff97e 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: "2020-11-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 = "2020-11-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..a0421278dcbd 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: "2020-11-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 = "2020-11-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..909165d39b9b 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: "2020-11-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 = "2020-11-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..ea07140e7840 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: "2020-11-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 = "2020-11-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..2b7248f47636 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: "2020-11-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 = "2020-11-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..6632495463b3 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: "2020-11-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 = "2020-11-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_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations.py new file mode 100644 index 000000000000..481d1769285f --- /dev/null +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_operations.py @@ -0,0 +1,114 @@ +# 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 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. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version to use for the request. Constant value: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-01-preview" + + self.config = config + + def list_by_server( + self, resource_group_name, server_name, custom_headers=None, raw=False, **operation_config): + """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 + 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 ServerOperation + :rtype: + ~azure.mgmt.sql.models.ServerOperationPaged[~azure.mgmt.sql.models.ServerOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_server.metadata['url'] + path_format_arguments = { + '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.ServerOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + 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..c4c603f12902 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: "2020-11-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 = "2020-11-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..7aab63797c6c 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: "2020-11-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 = "2020-11-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..3c468adc5faf 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: "2020-11-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 = "2020-11-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..ec9379b63f81 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: "2020-11-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 = "2020-11-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..e19bf832e28b 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: "2020-11-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 = "2020-11-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..257b4f3bdfe6 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: "2020-11-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 = "2020-11-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..c8a693bab4a8 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: "2020-11-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 = "2020-11-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..424d08f48ab2 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: "2020-11-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 = "2020-11-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..8dca63300cb3 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: "2020-11-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 = "2020-11-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..1f3a2cc47e18 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: "2020-11-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 = "2020-11-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..5a3356b71c4d --- /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: "2020-11-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2020-11-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..d8d8dd20cb1d 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: "2020-11-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 = "2020-11-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/_virtual_clusters_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_virtual_clusters_operations.py index b91ece534ef3..614d15e225b6 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: "2020-11-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 = "2020-11-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..05f89005141d 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: "2020-11-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 = "2020-11-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..19302ae48f6c 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: "2020-11-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 = "2020-11-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..a96876763b0c 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: "2020-11-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 = "2020-11-01-preview" self.config = config