From e1f20099f97ddb10c352d0f9aed4948689932586 Mon Sep 17 00:00:00 2001 From: msyyc <70930885+msyyc@users.noreply.github.com> Date: Tue, 24 Nov 2020 10:07:08 +0800 Subject: [PATCH] test,version,CHANGELOG (#15498) --- sdk/synapse/azure-mgmt-synapse/CHANGELOG.md | 61 + .../synapse/_synapse_management_client.py | 80 + .../azure/mgmt/synapse/models/__init__.py | 108 +- .../azure/mgmt/synapse/models/_models.py | 1992 ++++++++++++++-- .../azure/mgmt/synapse/models/_models_py3.py | 2022 ++++++++++++++--- .../mgmt/synapse/models/_paged_models.py | 221 ++ .../_synapse_management_client_enums.py | 29 + .../azure/mgmt/synapse/operations/__init__.py | 32 + .../operations/_big_data_pools_operations.py | 8 +- .../_data_masking_policies_operations.py | 189 ++ .../_data_masking_rules_operations.py | 197 ++ ..._pool_blob_auditing_policies_operations.py | 262 +++ ...ntegration_runtime_auth_keys_operations.py | 4 +- ...ion_runtime_connection_infos_operations.py | 2 +- ...egration_runtime_credentials_operations.py | 2 +- ...tion_runtime_monitoring_data_operations.py | 8 +- ...tion_runtime_node_ip_address_operations.py | 2 +- .../_integration_runtime_nodes_operations.py | 6 +- ...tion_runtime_object_metadata_operations.py | 89 +- .../_integration_runtime_status_operations.py | 2 +- .../_integration_runtimes_operations.py | 300 ++- .../_ip_firewall_rules_operations.py | 15 +- .../synapse/operations/_keys_operations.py | 314 +++ .../mgmt/synapse/operations/_operations.py | 26 +- ...private_endpoint_connections_operations.py | 31 +- ...connections_private_link_hub_operations.py | 112 + .../_private_link_hubs_operations.py | 100 +- .../_private_link_resources_operations.py | 15 +- ...restorable_dropped_sql_pools_operations.py | 176 ++ ..._pool_blob_auditing_policies_operations.py | 76 + .../_sql_pool_columns_operations.py | 114 + ...sql_pool_connection_policies_operations.py | 8 +- ...sql_pool_geo_backup_policies_operations.py | 85 +- ...l_pool_metadata_sync_configs_operations.py | 6 +- .../_sql_pool_operation_results_operations.py | 12 +- .../_sql_pool_replication_links_operations.py | 77 +- .../_sql_pool_restore_points_operations.py | 135 +- .../_sql_pool_schemas_operations.py | 68 + ...pool_security_alert_policies_operations.py | 78 + ..._sql_pool_sensitivity_labels_operations.py | 88 +- .../operations/_sql_pool_tables_operations.py | 71 + ...transparent_data_encryptions_operations.py | 92 +- .../operations/_sql_pool_usages_operations.py | 8 +- ...ty_assessment_rule_baselines_operations.py | 80 +- ...lnerability_assessment_scans_operations.py | 71 + ...ol_vulnerability_assessments_operations.py | 2 +- ...sql_pool_workload_classifier_operations.py | 407 ++++ .../_sql_pool_workload_group_operations.py | 393 ++++ .../operations/_sql_pools_operations.py | 103 +- .../_workspace_aad_admins_operations.py | 10 +- ...dentity_sql_control_settings_operations.py | 2 +- ...erver_blob_auditing_policies_operations.py | 289 +++ ...ended_blob_auditing_policies_operations.py | 292 +++ ..._server_recoverable_sqlpools_operations.py | 182 ++ ...server_security_alert_policy_operations.py | 291 +++ ...ce_managed_sql_server_usages_operations.py | 115 + ...er_vulnerability_assessments_operations.py | 317 +++ .../_workspace_sql_aad_admins_operations.py | 284 +++ .../operations/_workspaces_operations.py | 15 +- .../azure/mgmt/synapse/version.py | 2 +- 60 files changed, 9347 insertions(+), 831 deletions(-) create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_policies_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_rules_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_extended_sql_pool_blob_auditing_policies_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_keys_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_private_link_hub_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_restorable_dropped_sql_pools_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_columns_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_classifier_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_group_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_blob_auditing_policies_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_extended_blob_auditing_policies_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_recoverable_sqlpools_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_security_alert_policy_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_usages_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_vulnerability_assessments_operations.py create mode 100644 sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_sql_aad_admins_operations.py diff --git a/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md b/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md index c74e7a194e68..2d7fb77b2c6f 100644 --- a/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md +++ b/sdk/synapse/azure-mgmt-synapse/CHANGELOG.md @@ -1,5 +1,66 @@ # Release History +## 0.5.0 (2020-11-23) + +**Features** + + - Model SelfHostedIntegrationRuntimeStatus has a new parameter node_communication_channel_encryption_mode + - Model MetadataSyncConfig has a new parameter sync_interval_in_minutes + - Model BigDataPoolResourceInfo has a new parameter spark_config_properties + - Model BigDataPoolResourceInfo has a new parameter session_level_packages_enabled + - Model BigDataPoolResourceInfo has a new parameter have_library_requirements_changed + - Model Workspace has a new parameter workspace_uid + - Model Workspace has a new parameter managed_virtual_network_settings + - Model Workspace has a new parameter purview_configuration + - Model Workspace has a new parameter workspace_repository_configuration + - Model Workspace has a new parameter encryption + - Model PrivateLinkHub has a new parameter private_endpoint_connections + - Model WorkspacePatchInfo has a new parameter managed_virtual_network_settings + - Model WorkspacePatchInfo has a new parameter purview_configuration + - Model WorkspacePatchInfo has a new parameter workspace_repository_configuration + - Added operation SqlPoolSecurityAlertPoliciesOperations.list + - Added operation SqlPoolTransparentDataEncryptionsOperations.list + - Added operation IntegrationRuntimesOperations.disable_interactive_query + - Added operation IntegrationRuntimesOperations.enable_interactive_query + - Added operation SqlPoolRestorePointsOperations.get + - Added operation SqlPoolRestorePointsOperations.delete + - Added operation SqlPoolReplicationLinksOperations.get_by_name + - Added operation SqlPoolTablesOperations.get + - Added operation SqlPoolBlobAuditingPoliciesOperations.list_by_sql_pool + - Added operation SqlPoolVulnerabilityAssessmentScansOperations.get + - Added operation IntegrationRuntimeObjectMetadataOperations.list + - Added operation SqlPoolVulnerabilityAssessmentRuleBaselinesOperations.get + - Added operation SqlPoolSchemasOperations.get + - Added operation SqlPoolSensitivityLabelsOperations.get + - Added operation SqlPoolGeoBackupPoliciesOperations.list + - Added operation IntegrationRuntimeMonitoringDataOperations.list + - Added operation group DataMaskingRulesOperations + - Added operation group WorkspaceManagedSqlServerUsagesOperations + - Added operation group WorkspaceManagedSqlServerBlobAuditingPoliciesOperations + - Added operation group ExtendedSqlPoolBlobAuditingPoliciesOperations + - Added operation group SqlPoolWorkloadGroupOperations + - Added operation group DataMaskingPoliciesOperations + - Added operation group KeysOperations + - Added operation group WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations + - Added operation group SqlPoolWorkloadClassifierOperations + - Added operation group WorkspaceManagedSqlServerRecoverableSqlpoolsOperations + - Added operation group WorkspaceSqlAadAdminsOperations + - Added operation group RestorableDroppedSqlPoolsOperations + - Added operation group WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations + - Added operation group PrivateEndpointConnectionsPrivateLinkHubOperations + - Added operation group SqlPoolColumnsOperations + - Added operation group WorkspaceManagedSqlServerSecurityAlertPolicyOperations + +**Breaking changes** + + - Operation PrivateEndpointConnectionsOperations.create has a new signature + - Operation PrivateEndpointConnectionsOperations.create has a new signature + - Operation SqlPoolMetadataSyncConfigsOperations.create has a new signature + - Operation PrivateLinkHubsOperations.create_or_update has a new signature + - Removed operation SqlPoolsOperations.rename + - Removed operation IntegrationRuntimeObjectMetadataOperations.get + - Removed operation IntegrationRuntimeMonitoringDataOperations.get + ## 0.4.0 (2020-09-25) **Features** diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py index 56a31debe3c6..3c85defe4d99 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/_synapse_management_client.py @@ -36,9 +36,17 @@ from .operations import SqlPoolVulnerabilityAssessmentScansOperations from .operations import SqlPoolSecurityAlertPoliciesOperations from .operations import SqlPoolVulnerabilityAssessmentRuleBaselinesOperations +from .operations import ExtendedSqlPoolBlobAuditingPoliciesOperations +from .operations import DataMaskingPoliciesOperations +from .operations import DataMaskingRulesOperations +from .operations import SqlPoolColumnsOperations +from .operations import SqlPoolWorkloadGroupOperations +from .operations import SqlPoolWorkloadClassifierOperations from .operations import WorkspacesOperations from .operations import WorkspaceAadAdminsOperations +from .operations import WorkspaceSqlAadAdminsOperations from .operations import WorkspaceManagedIdentitySqlControlSettingsOperations +from .operations import RestorableDroppedSqlPoolsOperations from .operations import IntegrationRuntimesOperations from .operations import IntegrationRuntimeNodeIpAddressOperations from .operations import IntegrationRuntimeObjectMetadataOperations @@ -51,6 +59,14 @@ from .operations import PrivateLinkResourcesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkHubsOperations +from .operations import PrivateEndpointConnectionsPrivateLinkHubOperations +from .operations import WorkspaceManagedSqlServerBlobAuditingPoliciesOperations +from .operations import WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations +from .operations import WorkspaceManagedSqlServerSecurityAlertPolicyOperations +from .operations import WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations +from .operations import WorkspaceManagedSqlServerUsagesOperations +from .operations import WorkspaceManagedSqlServerRecoverableSqlpoolsOperations +from .operations import KeysOperations from . import models @@ -106,12 +122,28 @@ class SynapseManagementClient(SDKClient): :vartype sql_pool_security_alert_policies: azure.mgmt.synapse.operations.SqlPoolSecurityAlertPoliciesOperations :ivar sql_pool_vulnerability_assessment_rule_baselines: SqlPoolVulnerabilityAssessmentRuleBaselines operations :vartype sql_pool_vulnerability_assessment_rule_baselines: azure.mgmt.synapse.operations.SqlPoolVulnerabilityAssessmentRuleBaselinesOperations + :ivar extended_sql_pool_blob_auditing_policies: ExtendedSqlPoolBlobAuditingPolicies operations + :vartype extended_sql_pool_blob_auditing_policies: azure.mgmt.synapse.operations.ExtendedSqlPoolBlobAuditingPoliciesOperations + :ivar data_masking_policies: DataMaskingPolicies operations + :vartype data_masking_policies: azure.mgmt.synapse.operations.DataMaskingPoliciesOperations + :ivar data_masking_rules: DataMaskingRules operations + :vartype data_masking_rules: azure.mgmt.synapse.operations.DataMaskingRulesOperations + :ivar sql_pool_columns: SqlPoolColumns operations + :vartype sql_pool_columns: azure.mgmt.synapse.operations.SqlPoolColumnsOperations + :ivar sql_pool_workload_group: SqlPoolWorkloadGroup operations + :vartype sql_pool_workload_group: azure.mgmt.synapse.operations.SqlPoolWorkloadGroupOperations + :ivar sql_pool_workload_classifier: SqlPoolWorkloadClassifier operations + :vartype sql_pool_workload_classifier: azure.mgmt.synapse.operations.SqlPoolWorkloadClassifierOperations :ivar workspaces: Workspaces operations :vartype workspaces: azure.mgmt.synapse.operations.WorkspacesOperations :ivar workspace_aad_admins: WorkspaceAadAdmins operations :vartype workspace_aad_admins: azure.mgmt.synapse.operations.WorkspaceAadAdminsOperations + :ivar workspace_sql_aad_admins: WorkspaceSqlAadAdmins operations + :vartype workspace_sql_aad_admins: azure.mgmt.synapse.operations.WorkspaceSqlAadAdminsOperations :ivar workspace_managed_identity_sql_control_settings: WorkspaceManagedIdentitySqlControlSettings operations :vartype workspace_managed_identity_sql_control_settings: azure.mgmt.synapse.operations.WorkspaceManagedIdentitySqlControlSettingsOperations + :ivar restorable_dropped_sql_pools: RestorableDroppedSqlPools operations + :vartype restorable_dropped_sql_pools: azure.mgmt.synapse.operations.RestorableDroppedSqlPoolsOperations :ivar integration_runtimes: IntegrationRuntimes operations :vartype integration_runtimes: azure.mgmt.synapse.operations.IntegrationRuntimesOperations :ivar integration_runtime_node_ip_address: IntegrationRuntimeNodeIpAddress operations @@ -136,6 +168,22 @@ class SynapseManagementClient(SDKClient): :vartype private_endpoint_connections: azure.mgmt.synapse.operations.PrivateEndpointConnectionsOperations :ivar private_link_hubs: PrivateLinkHubs operations :vartype private_link_hubs: azure.mgmt.synapse.operations.PrivateLinkHubsOperations + :ivar private_endpoint_connections_private_link_hub: PrivateEndpointConnectionsPrivateLinkHub operations + :vartype private_endpoint_connections_private_link_hub: azure.mgmt.synapse.operations.PrivateEndpointConnectionsPrivateLinkHubOperations + :ivar workspace_managed_sql_server_blob_auditing_policies: WorkspaceManagedSqlServerBlobAuditingPolicies operations + :vartype workspace_managed_sql_server_blob_auditing_policies: azure.mgmt.synapse.operations.WorkspaceManagedSqlServerBlobAuditingPoliciesOperations + :ivar workspace_managed_sql_server_extended_blob_auditing_policies: WorkspaceManagedSqlServerExtendedBlobAuditingPolicies operations + :vartype workspace_managed_sql_server_extended_blob_auditing_policies: azure.mgmt.synapse.operations.WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations + :ivar workspace_managed_sql_server_security_alert_policy: WorkspaceManagedSqlServerSecurityAlertPolicy operations + :vartype workspace_managed_sql_server_security_alert_policy: azure.mgmt.synapse.operations.WorkspaceManagedSqlServerSecurityAlertPolicyOperations + :ivar workspace_managed_sql_server_vulnerability_assessments: WorkspaceManagedSqlServerVulnerabilityAssessments operations + :vartype workspace_managed_sql_server_vulnerability_assessments: azure.mgmt.synapse.operations.WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations + :ivar workspace_managed_sql_server_usages: WorkspaceManagedSqlServerUsages operations + :vartype workspace_managed_sql_server_usages: azure.mgmt.synapse.operations.WorkspaceManagedSqlServerUsagesOperations + :ivar workspace_managed_sql_server_recoverable_sqlpools: WorkspaceManagedSqlServerRecoverableSqlpools operations + :vartype workspace_managed_sql_server_recoverable_sqlpools: azure.mgmt.synapse.operations.WorkspaceManagedSqlServerRecoverableSqlpoolsOperations + :ivar keys: Keys operations + :vartype keys: azure.mgmt.synapse.operations.KeysOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -202,12 +250,28 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.sql_pool_vulnerability_assessment_rule_baselines = SqlPoolVulnerabilityAssessmentRuleBaselinesOperations( self._client, self.config, self._serialize, self._deserialize) + self.extended_sql_pool_blob_auditing_policies = ExtendedSqlPoolBlobAuditingPoliciesOperations( + 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.sql_pool_columns = SqlPoolColumnsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sql_pool_workload_group = SqlPoolWorkloadGroupOperations( + self._client, self.config, self._serialize, self._deserialize) + self.sql_pool_workload_classifier = SqlPoolWorkloadClassifierOperations( + self._client, self.config, self._serialize, self._deserialize) self.workspaces = WorkspacesOperations( self._client, self.config, self._serialize, self._deserialize) self.workspace_aad_admins = WorkspaceAadAdminsOperations( self._client, self.config, self._serialize, self._deserialize) + self.workspace_sql_aad_admins = WorkspaceSqlAadAdminsOperations( + self._client, self.config, self._serialize, self._deserialize) self.workspace_managed_identity_sql_control_settings = WorkspaceManagedIdentitySqlControlSettingsOperations( self._client, self.config, self._serialize, self._deserialize) + self.restorable_dropped_sql_pools = RestorableDroppedSqlPoolsOperations( + self._client, self.config, self._serialize, self._deserialize) self.integration_runtimes = IntegrationRuntimesOperations( self._client, self.config, self._serialize, self._deserialize) self.integration_runtime_node_ip_address = IntegrationRuntimeNodeIpAddressOperations( @@ -232,3 +296,19 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.private_link_hubs = PrivateLinkHubsOperations( self._client, self.config, self._serialize, self._deserialize) + self.private_endpoint_connections_private_link_hub = PrivateEndpointConnectionsPrivateLinkHubOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_blob_auditing_policies = WorkspaceManagedSqlServerBlobAuditingPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_extended_blob_auditing_policies = WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_security_alert_policy = WorkspaceManagedSqlServerSecurityAlertPolicyOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_vulnerability_assessments = WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_usages = WorkspaceManagedSqlServerUsagesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.workspace_managed_sql_server_recoverable_sqlpools = WorkspaceManagedSqlServerRecoverableSqlpoolsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.keys = KeysOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py index ac297f863a74..693a1f1b3e15 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/__init__.py @@ -22,15 +22,21 @@ from ._models_py3 import CmdkeySetup from ._models_py3 import ComponentSetup from ._models_py3 import CreateSqlPoolRestorePointDefinition + from ._models_py3 import CustomerManagedKeyDetails from ._models_py3 import CustomSetupBase from ._models_py3 import DataLakeStorageAccountDetails + from ._models_py3 import DataMaskingPolicy + from ._models_py3 import DataMaskingRule from ._models_py3 import DataWarehouseUserActivities + from ._models_py3 import EncryptionDetails from ._models_py3 import EntityReference from ._models_py3 import EnvironmentVariableSetup from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorContract, ErrorContractException from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse + from ._models_py3 import ExtendedServerBlobAuditingPolicy + from ._models_py3 import ExtendedSqlPoolBlobAuditingPolicy from ._models_py3 import GeoBackupPolicy from ._models_py3 import GetSsisObjectMetadataRequest from ._models_py3 import IntegrationRuntime @@ -52,6 +58,7 @@ from ._models_py3 import IntegrationRuntimeVNetProperties from ._models_py3 import IpFirewallRuleInfo from ._models_py3 import IpFirewallRuleProperties + from ._models_py3 import Key from ._models_py3 import LibraryRequirements from ._models_py3 import LinkedIntegrationRuntime from ._models_py3 import LinkedIntegrationRuntimeKeyAuthorization @@ -65,6 +72,7 @@ from ._models_py3 import ManagedIntegrationRuntimeNode from ._models_py3 import ManagedIntegrationRuntimeOperationResult from ._models_py3 import ManagedIntegrationRuntimeStatus + from ._models_py3 import ManagedVirtualNetworkSettings from ._models_py3 import MetadataSyncConfig from ._models_py3 import OperationMetaLogSpecification from ._models_py3 import OperationMetaMetricDimensionSpecification @@ -73,20 +81,24 @@ from ._models_py3 import OperationResource from ._models_py3 import PrivateEndpoint from ._models_py3 import PrivateEndpointConnection + from ._models_py3 import PrivateEndpointConnectionForPrivateLinkHub + from ._models_py3 import PrivateEndpointConnectionForPrivateLinkHubBasic from ._models_py3 import PrivateLinkHub from ._models_py3 import PrivateLinkHubPatchInfo from ._models_py3 import PrivateLinkResource from ._models_py3 import PrivateLinkResourceProperties from ._models_py3 import PrivateLinkServiceConnectionState from ._models_py3 import ProxyResource + from ._models_py3 import PurviewConfiguration from ._models_py3 import QueryInterval from ._models_py3 import QueryMetric from ._models_py3 import QueryStatistic + from ._models_py3 import RecoverableSqlPool from ._models_py3 import ReplaceAllFirewallRulesOperationResponse from ._models_py3 import ReplaceAllIpFirewallRulesRequest from ._models_py3 import ReplicationLink from ._models_py3 import Resource - from ._models_py3 import ResourceMoveDefinition + from ._models_py3 import RestorableDroppedSqlPool from ._models_py3 import RestorePoint from ._models_py3 import SecretBase from ._models_py3 import SecureString @@ -94,6 +106,10 @@ from ._models_py3 import SelfHostedIntegrationRuntimeNode from ._models_py3 import SelfHostedIntegrationRuntimeStatus from ._models_py3 import SensitivityLabel + from ._models_py3 import ServerBlobAuditingPolicy + from ._models_py3 import ServerSecurityAlertPolicy + from ._models_py3 import ServerUsage + from ._models_py3 import ServerVulnerabilityAssessment from ._models_py3 import Sku from ._models_py3 import SqlPool from ._models_py3 import SqlPoolBlobAuditingPolicy @@ -130,9 +146,13 @@ from ._models_py3 import VulnerabilityAssessmentRecurringScansProperties from ._models_py3 import VulnerabilityAssessmentScanError from ._models_py3 import VulnerabilityAssessmentScanRecord + from ._models_py3 import WorkloadClassifier + from ._models_py3 import WorkloadGroup from ._models_py3 import Workspace from ._models_py3 import WorkspaceAadAdminInfo + from ._models_py3 import WorkspaceKeyDetails from ._models_py3 import WorkspacePatchInfo + from ._models_py3 import WorkspaceRepositoryConfiguration except (SyntaxError, ImportError): from ._models import AutoPauseProperties from ._models import AutoScaleProperties @@ -146,15 +166,21 @@ from ._models import CmdkeySetup from ._models import ComponentSetup from ._models import CreateSqlPoolRestorePointDefinition + from ._models import CustomerManagedKeyDetails from ._models import CustomSetupBase from ._models import DataLakeStorageAccountDetails + from ._models import DataMaskingPolicy + from ._models import DataMaskingRule from ._models import DataWarehouseUserActivities + from ._models import EncryptionDetails from ._models import EntityReference from ._models import EnvironmentVariableSetup from ._models import ErrorAdditionalInfo from ._models import ErrorContract, ErrorContractException from ._models import ErrorDetail from ._models import ErrorResponse + from ._models import ExtendedServerBlobAuditingPolicy + from ._models import ExtendedSqlPoolBlobAuditingPolicy from ._models import GeoBackupPolicy from ._models import GetSsisObjectMetadataRequest from ._models import IntegrationRuntime @@ -176,6 +202,7 @@ from ._models import IntegrationRuntimeVNetProperties from ._models import IpFirewallRuleInfo from ._models import IpFirewallRuleProperties + from ._models import Key from ._models import LibraryRequirements from ._models import LinkedIntegrationRuntime from ._models import LinkedIntegrationRuntimeKeyAuthorization @@ -189,6 +216,7 @@ from ._models import ManagedIntegrationRuntimeNode from ._models import ManagedIntegrationRuntimeOperationResult from ._models import ManagedIntegrationRuntimeStatus + from ._models import ManagedVirtualNetworkSettings from ._models import MetadataSyncConfig from ._models import OperationMetaLogSpecification from ._models import OperationMetaMetricDimensionSpecification @@ -197,20 +225,24 @@ from ._models import OperationResource from ._models import PrivateEndpoint from ._models import PrivateEndpointConnection + from ._models import PrivateEndpointConnectionForPrivateLinkHub + from ._models import PrivateEndpointConnectionForPrivateLinkHubBasic from ._models import PrivateLinkHub from ._models import PrivateLinkHubPatchInfo from ._models import PrivateLinkResource from ._models import PrivateLinkResourceProperties from ._models import PrivateLinkServiceConnectionState from ._models import ProxyResource + from ._models import PurviewConfiguration from ._models import QueryInterval from ._models import QueryMetric from ._models import QueryStatistic + from ._models import RecoverableSqlPool from ._models import ReplaceAllFirewallRulesOperationResponse from ._models import ReplaceAllIpFirewallRulesRequest from ._models import ReplicationLink from ._models import Resource - from ._models import ResourceMoveDefinition + from ._models import RestorableDroppedSqlPool from ._models import RestorePoint from ._models import SecretBase from ._models import SecureString @@ -218,6 +250,10 @@ from ._models import SelfHostedIntegrationRuntimeNode from ._models import SelfHostedIntegrationRuntimeStatus from ._models import SensitivityLabel + from ._models import ServerBlobAuditingPolicy + from ._models import ServerSecurityAlertPolicy + from ._models import ServerUsage + from ._models import ServerVulnerabilityAssessment from ._models import Sku from ._models import SqlPool from ._models import SqlPoolBlobAuditingPolicy @@ -254,26 +290,47 @@ from ._models import VulnerabilityAssessmentRecurringScansProperties from ._models import VulnerabilityAssessmentScanError from ._models import VulnerabilityAssessmentScanRecord + from ._models import WorkloadClassifier + from ._models import WorkloadGroup from ._models import Workspace from ._models import WorkspaceAadAdminInfo + from ._models import WorkspaceKeyDetails from ._models import WorkspacePatchInfo + from ._models import WorkspaceRepositoryConfiguration from ._paged_models import BigDataPoolResourceInfoPaged +from ._paged_models import DataMaskingRulePaged +from ._paged_models import ExtendedServerBlobAuditingPolicyPaged +from ._paged_models import ExtendedSqlPoolBlobAuditingPolicyPaged +from ._paged_models import GeoBackupPolicyPaged from ._paged_models import IntegrationRuntimeResourcePaged from ._paged_models import IpFirewallRuleInfoPaged +from ._paged_models import KeyPaged +from ._paged_models import PrivateEndpointConnectionForPrivateLinkHubPaged from ._paged_models import PrivateEndpointConnectionPaged from ._paged_models import PrivateLinkHubPaged from ._paged_models import PrivateLinkResourcePaged +from ._paged_models import RecoverableSqlPoolPaged from ._paged_models import ReplicationLinkPaged +from ._paged_models import RestorableDroppedSqlPoolPaged from ._paged_models import RestorePointPaged from ._paged_models import SensitivityLabelPaged +from ._paged_models import ServerBlobAuditingPolicyPaged +from ._paged_models import ServerSecurityAlertPolicyPaged +from ._paged_models import ServerUsagePaged +from ._paged_models import ServerVulnerabilityAssessmentPaged +from ._paged_models import SqlPoolBlobAuditingPolicyPaged from ._paged_models import SqlPoolColumnPaged from ._paged_models import SqlPoolOperationPaged from ._paged_models import SqlPoolPaged from ._paged_models import SqlPoolSchemaPaged +from ._paged_models import SqlPoolSecurityAlertPolicyPaged from ._paged_models import SqlPoolTablePaged from ._paged_models import SqlPoolUsagePaged from ._paged_models import SqlPoolVulnerabilityAssessmentPaged +from ._paged_models import TransparentDataEncryptionPaged from ._paged_models import VulnerabilityAssessmentScanRecordPaged +from ._paged_models import WorkloadClassifierPaged +from ._paged_models import WorkloadGroupPaged from ._paged_models import WorkspacePaged from ._synapse_management_client_enums import ( NodeSize, @@ -295,6 +352,9 @@ VulnerabilityAssessmentScanTriggerType, VulnerabilityAssessmentScanState, SecurityAlertPolicyState, + DataMaskingState, + DataMaskingRuleState, + DataMaskingFunction, ResourceIdentityType, IntegrationRuntimeType, IntegrationRuntimeState, @@ -310,6 +370,7 @@ IntegrationRuntimeAutoUpdate, IntegrationRuntimeAuthKeyName, SsisObjectMetadataType, + SensitivityLabelSource, VulnerabilityAssessmentPolicyBaselineName, ) @@ -326,15 +387,21 @@ 'CmdkeySetup', 'ComponentSetup', 'CreateSqlPoolRestorePointDefinition', + 'CustomerManagedKeyDetails', 'CustomSetupBase', 'DataLakeStorageAccountDetails', + 'DataMaskingPolicy', + 'DataMaskingRule', 'DataWarehouseUserActivities', + 'EncryptionDetails', 'EntityReference', 'EnvironmentVariableSetup', 'ErrorAdditionalInfo', 'ErrorContract', 'ErrorContractException', 'ErrorDetail', 'ErrorResponse', + 'ExtendedServerBlobAuditingPolicy', + 'ExtendedSqlPoolBlobAuditingPolicy', 'GeoBackupPolicy', 'GetSsisObjectMetadataRequest', 'IntegrationRuntime', @@ -356,6 +423,7 @@ 'IntegrationRuntimeVNetProperties', 'IpFirewallRuleInfo', 'IpFirewallRuleProperties', + 'Key', 'LibraryRequirements', 'LinkedIntegrationRuntime', 'LinkedIntegrationRuntimeKeyAuthorization', @@ -369,6 +437,7 @@ 'ManagedIntegrationRuntimeNode', 'ManagedIntegrationRuntimeOperationResult', 'ManagedIntegrationRuntimeStatus', + 'ManagedVirtualNetworkSettings', 'MetadataSyncConfig', 'OperationMetaLogSpecification', 'OperationMetaMetricDimensionSpecification', @@ -377,20 +446,24 @@ 'OperationResource', 'PrivateEndpoint', 'PrivateEndpointConnection', + 'PrivateEndpointConnectionForPrivateLinkHub', + 'PrivateEndpointConnectionForPrivateLinkHubBasic', 'PrivateLinkHub', 'PrivateLinkHubPatchInfo', 'PrivateLinkResource', 'PrivateLinkResourceProperties', 'PrivateLinkServiceConnectionState', 'ProxyResource', + 'PurviewConfiguration', 'QueryInterval', 'QueryMetric', 'QueryStatistic', + 'RecoverableSqlPool', 'ReplaceAllFirewallRulesOperationResponse', 'ReplaceAllIpFirewallRulesRequest', 'ReplicationLink', 'Resource', - 'ResourceMoveDefinition', + 'RestorableDroppedSqlPool', 'RestorePoint', 'SecretBase', 'SecureString', @@ -398,6 +471,10 @@ 'SelfHostedIntegrationRuntimeNode', 'SelfHostedIntegrationRuntimeStatus', 'SensitivityLabel', + 'ServerBlobAuditingPolicy', + 'ServerSecurityAlertPolicy', + 'ServerUsage', + 'ServerVulnerabilityAssessment', 'Sku', 'SqlPool', 'SqlPoolBlobAuditingPolicy', @@ -434,14 +511,21 @@ 'VulnerabilityAssessmentRecurringScansProperties', 'VulnerabilityAssessmentScanError', 'VulnerabilityAssessmentScanRecord', + 'WorkloadClassifier', + 'WorkloadGroup', 'Workspace', 'WorkspaceAadAdminInfo', + 'WorkspaceKeyDetails', 'WorkspacePatchInfo', + 'WorkspaceRepositoryConfiguration', 'BigDataPoolResourceInfoPaged', 'IpFirewallRuleInfoPaged', 'SqlPoolPaged', + 'GeoBackupPolicyPaged', 'RestorePointPaged', 'ReplicationLinkPaged', + 'TransparentDataEncryptionPaged', + 'SqlPoolBlobAuditingPolicyPaged', 'SqlPoolOperationPaged', 'SqlPoolUsagePaged', 'SensitivityLabelPaged', @@ -450,11 +534,25 @@ 'SqlPoolColumnPaged', 'SqlPoolVulnerabilityAssessmentPaged', 'VulnerabilityAssessmentScanRecordPaged', + 'SqlPoolSecurityAlertPolicyPaged', + 'ExtendedSqlPoolBlobAuditingPolicyPaged', + 'DataMaskingRulePaged', + 'WorkloadGroupPaged', + 'WorkloadClassifierPaged', 'WorkspacePaged', + 'RestorableDroppedSqlPoolPaged', 'IntegrationRuntimeResourcePaged', 'PrivateLinkResourcePaged', 'PrivateEndpointConnectionPaged', 'PrivateLinkHubPaged', + 'PrivateEndpointConnectionForPrivateLinkHubPaged', + 'ServerBlobAuditingPolicyPaged', + 'ExtendedServerBlobAuditingPolicyPaged', + 'ServerSecurityAlertPolicyPaged', + 'ServerVulnerabilityAssessmentPaged', + 'ServerUsagePaged', + 'RecoverableSqlPoolPaged', + 'KeyPaged', 'NodeSize', 'NodeSizeFamily', 'ProvisioningState', @@ -474,6 +572,9 @@ 'VulnerabilityAssessmentScanTriggerType', 'VulnerabilityAssessmentScanState', 'SecurityAlertPolicyState', + 'DataMaskingState', + 'DataMaskingRuleState', + 'DataMaskingFunction', 'ResourceIdentityType', 'IntegrationRuntimeType', 'IntegrationRuntimeState', @@ -489,5 +590,6 @@ 'IntegrationRuntimeAutoUpdate', 'IntegrationRuntimeAuthKeyName', 'SsisObjectMetadataType', + 'SensitivityLabelSource', 'VulnerabilityAssessmentPolicyBaselineName', ] diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py index e82a36f58589..6b7215951bd4 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models.py @@ -129,16 +129,19 @@ def __init__(self, **kwargs): class Resource(Model): """Resource. + Common fields that are returned in the response for all Azure Resource + Manager resources. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -162,19 +165,21 @@ def __init__(self, **kwargs): class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -218,20 +223,23 @@ def __init__(self, **kwargs): class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. 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: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -270,13 +278,13 @@ class BigDataPoolResourceInfo(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -293,12 +301,22 @@ class BigDataPoolResourceInfo(TrackedResource): :param is_compute_isolation_enabled: Whether compute isolation is required or not. :type is_compute_isolation_enabled: bool + :param have_library_requirements_changed: Whether library requirements + changed. + :type have_library_requirements_changed: bool + :param session_level_packages_enabled: Whether session level packages + enabled. + :type session_level_packages_enabled: bool :param spark_events_folder: The Spark events folder :type spark_events_folder: str :param node_count: The number of nodes in the Big Data pool. :type node_count: int :param library_requirements: Library version requirements :type library_requirements: ~azure.mgmt.synapse.models.LibraryRequirements + :param spark_config_properties: Spark configuration file to specify + additional properties + :type spark_config_properties: + ~azure.mgmt.synapse.models.LibraryRequirements :param spark_version: The Apache Spark version. :type spark_version: str :param default_spark_log_folder: The default folder where Spark logs will @@ -306,7 +324,7 @@ class BigDataPoolResourceInfo(TrackedResource): :type default_spark_log_folder: str :param node_size: The level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', - 'Large', 'XLarge', 'XXLarge' + 'Large', 'XLarge', 'XXLarge', 'XXXLarge' :type node_size: str or ~azure.mgmt.synapse.models.NodeSize :param node_size_family: The kind of nodes that the Big Data pool provides. Possible values include: 'None', 'MemoryOptimized' @@ -331,9 +349,12 @@ class BigDataPoolResourceInfo(TrackedResource): 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'auto_pause': {'key': 'properties.autoPause', 'type': 'AutoPauseProperties'}, 'is_compute_isolation_enabled': {'key': 'properties.isComputeIsolationEnabled', 'type': 'bool'}, + 'have_library_requirements_changed': {'key': 'properties.haveLibraryRequirementsChanged', 'type': 'bool'}, + 'session_level_packages_enabled': {'key': 'properties.sessionLevelPackagesEnabled', 'type': 'bool'}, 'spark_events_folder': {'key': 'properties.sparkEventsFolder', 'type': 'str'}, 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, 'library_requirements': {'key': 'properties.libraryRequirements', 'type': 'LibraryRequirements'}, + 'spark_config_properties': {'key': 'properties.sparkConfigProperties', 'type': 'LibraryRequirements'}, 'spark_version': {'key': 'properties.sparkVersion', 'type': 'str'}, 'default_spark_log_folder': {'key': 'properties.defaultSparkLogFolder', 'type': 'str'}, 'node_size': {'key': 'properties.nodeSize', 'type': 'str'}, @@ -347,9 +368,12 @@ def __init__(self, **kwargs): self.creation_date = kwargs.get('creation_date', None) self.auto_pause = kwargs.get('auto_pause', None) self.is_compute_isolation_enabled = kwargs.get('is_compute_isolation_enabled', None) + self.have_library_requirements_changed = kwargs.get('have_library_requirements_changed', None) + self.session_level_packages_enabled = kwargs.get('session_level_packages_enabled', None) self.spark_events_folder = kwargs.get('spark_events_folder', None) self.node_count = kwargs.get('node_count', None) self.library_requirements = kwargs.get('library_requirements', None) + self.spark_config_properties = kwargs.get('spark_config_properties', None) self.spark_version = kwargs.get('spark_version', None) self.default_spark_log_folder = kwargs.get('default_spark_log_folder', None) self.node_size = kwargs.get('node_size', None) @@ -575,6 +599,33 @@ def __init__(self, **kwargs): self.restore_point_label = kwargs.get('restore_point_label', None) +class CustomerManagedKeyDetails(Model): + """Details of the customer managed key associated with the workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The customer managed key status on the workspace + :vartype status: str + :param key: The key object of the workspace + :type key: ~azure.mgmt.synapse.models.WorkspaceKeyDetails + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'WorkspaceKeyDetails'}, + } + + def __init__(self, **kwargs): + super(CustomerManagedKeyDetails, self).__init__(**kwargs) + self.status = None + self.key = kwargs.get('key', None) + + class DataLakeStorageAccountDetails(Model): """Details of the data lake storage account associated with the workspace. @@ -596,19 +647,21 @@ def __init__(self, **kwargs): class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -628,19 +681,210 @@ def __init__(self, **kwargs): super(ProxyResource, self).__init__(**kwargs) +class DataMaskingPolicy(ProxyResource): + """DataMaskingPolicy. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param data_masking_state: Required. The state of the data masking policy. + Possible values include: 'Disabled', 'Enabled' + :type data_masking_state: str or + ~azure.mgmt.synapse.models.DataMaskingState + :param exempt_principals: The list of the exempt principals. Specifies the + semicolon-separated list of database users for which the data masking + policy does not apply. The specified users receive data results without + masking for all of the database queries. + :type exempt_principals: str + :ivar application_principals: The list of the application principals. This + is a legacy parameter and is no longer used. + :vartype application_principals: str + :ivar masking_level: The masking level. This is a legacy parameter and is + no longer used. + :vartype masking_level: str + :ivar location: The location of the data masking policy. + :vartype location: str + :ivar kind: The kind of data masking policy. Metadata, used for Azure + portal. + :vartype kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_masking_state': {'required': True}, + 'application_principals': {'readonly': True}, + 'masking_level': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_masking_state': {'key': 'properties.dataMaskingState', 'type': 'DataMaskingState'}, + 'exempt_principals': {'key': 'properties.exemptPrincipals', 'type': 'str'}, + 'application_principals': {'key': 'properties.applicationPrincipals', 'type': 'str'}, + 'masking_level': {'key': 'properties.maskingLevel', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataMaskingPolicy, self).__init__(**kwargs) + self.data_masking_state = kwargs.get('data_masking_state', None) + self.exempt_principals = kwargs.get('exempt_principals', None) + self.application_principals = None + self.masking_level = None + self.location = None + self.kind = None + + +class DataMaskingRule(ProxyResource): + """Represents a Sql pool data masking rule. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar data_masking_rule_id: The rule Id. + :vartype data_masking_rule_id: str + :param alias_name: The alias name. This is a legacy parameter and is no + longer used. + :type alias_name: str + :param rule_state: The rule state. Used to delete a rule. To delete an + existing rule, specify the schemaName, tableName, columnName, + maskingFunction, and specify ruleState as disabled. However, if the rule + doesn't already exist, the rule will be created with ruleState set to + enabled, regardless of the provided value of ruleState. Possible values + include: 'Disabled', 'Enabled' + :type rule_state: str or ~azure.mgmt.synapse.models.DataMaskingRuleState + :param schema_name: Required. The schema name on which the data masking + rule is applied. + :type schema_name: str + :param table_name: Required. The table name on which the data masking rule + is applied. + :type table_name: str + :param column_name: Required. The column name on which the data masking + rule is applied. + :type column_name: str + :param masking_function: Required. The masking function that is used for + the data masking rule. Possible values include: 'Default', 'CCN', 'Email', + 'Number', 'SSN', 'Text' + :type masking_function: str or + ~azure.mgmt.synapse.models.DataMaskingFunction + :param number_from: The numberFrom property of the masking rule. Required + if maskingFunction is set to Number, otherwise this parameter will be + ignored. + :type number_from: str + :param number_to: The numberTo property of the data masking rule. Required + if maskingFunction is set to Number, otherwise this parameter will be + ignored. + :type number_to: str + :param prefix_size: If maskingFunction is set to Text, the number of + characters to show unmasked in the beginning of the string. Otherwise, + this parameter will be ignored. + :type prefix_size: str + :param suffix_size: If maskingFunction is set to Text, the number of + characters to show unmasked at the end of the string. Otherwise, this + parameter will be ignored. + :type suffix_size: str + :param replacement_string: If maskingFunction is set to Text, the + character to use for masking the unexposed part of the string. Otherwise, + this parameter will be ignored. + :type replacement_string: str + :ivar location: The location of the data masking rule. + :vartype location: str + :ivar kind: The kind of Data Masking Rule. Metadata, used for Azure + portal. + :vartype kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_masking_rule_id': {'readonly': True}, + 'schema_name': {'required': True}, + 'table_name': {'required': True}, + 'column_name': {'required': True}, + 'masking_function': {'required': True}, + 'location': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_masking_rule_id': {'key': 'properties.id', 'type': 'str'}, + 'alias_name': {'key': 'properties.aliasName', 'type': 'str'}, + 'rule_state': {'key': 'properties.ruleState', 'type': 'DataMaskingRuleState'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'column_name': {'key': 'properties.columnName', 'type': 'str'}, + 'masking_function': {'key': 'properties.maskingFunction', 'type': 'DataMaskingFunction'}, + 'number_from': {'key': 'properties.numberFrom', 'type': 'str'}, + 'number_to': {'key': 'properties.numberTo', 'type': 'str'}, + 'prefix_size': {'key': 'properties.prefixSize', 'type': 'str'}, + 'suffix_size': {'key': 'properties.suffixSize', 'type': 'str'}, + 'replacement_string': {'key': 'properties.replacementString', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataMaskingRule, self).__init__(**kwargs) + self.data_masking_rule_id = None + self.alias_name = kwargs.get('alias_name', None) + self.rule_state = kwargs.get('rule_state', None) + self.schema_name = kwargs.get('schema_name', None) + self.table_name = kwargs.get('table_name', None) + self.column_name = kwargs.get('column_name', None) + self.masking_function = kwargs.get('masking_function', None) + self.number_from = kwargs.get('number_from', None) + self.number_to = kwargs.get('number_to', None) + self.prefix_size = kwargs.get('prefix_size', None) + self.suffix_size = kwargs.get('suffix_size', None) + self.replacement_string = kwargs.get('replacement_string', None) + self.location = None + self.kind = None + + 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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar active_queries_count: Count of running and suspended queries. :vartype active_queries_count: int @@ -665,6 +909,33 @@ def __init__(self, **kwargs): self.active_queries_count = None +class EncryptionDetails(Model): + """Details of the encryption associated with the workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar double_encryption_enabled: Double Encryption enabled + :vartype double_encryption_enabled: bool + :param cmk: Customer Managed Key Details + :type cmk: ~azure.mgmt.synapse.models.CustomerManagedKeyDetails + """ + + _validation = { + 'double_encryption_enabled': {'readonly': True}, + } + + _attribute_map = { + 'double_encryption_enabled': {'key': 'doubleEncryptionEnabled', 'type': 'bool'}, + 'cmk': {'key': 'cmk', 'type': 'CustomerManagedKeyDetails'}, + } + + def __init__(self, **kwargs): + super(EncryptionDetails, self).__init__(**kwargs) + self.double_encryption_enabled = None + self.cmk = kwargs.get('cmk', None) + + class EntityReference(Model): """The entity reference. @@ -802,7 +1073,11 @@ def __init__(self, **kwargs): class ErrorResponse(Model): - """The resource management error response. + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. @@ -845,32 +1120,138 @@ def __init__(self, **kwargs): self.additional_info = None -class GeoBackupPolicy(ProxyResource): - """A database geo backup policy. +class ExtendedServerBlobAuditingPolicy(ProxyResource): + """An extended server blob auditing 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: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param state: Required. The state of the geo backup policy. Possible - values include: 'Disabled', 'Enabled' - :type state: str or ~azure.mgmt.synapse.models.GeoBackupPolicyState - :ivar storage_type: The storage type of the geo backup policy. - :vartype storage_type: str - :ivar kind: Kind of geo backup policy. This is metadata used for the - Azure portal experience. - :vartype kind: str - :ivar location: Backup policy location. - :vartype location: str + :param 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.synapse.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 + :param audit_actions_and_groups: Specifies the Actions-Groups and Actions + to audit. + The recommended set of action groups to use is the following combination - + this will audit all the queries and stored procedures executed against the + database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when + enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific + groups that cover your auditing needs. Using unnecessary groups could lead + to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures + executed against the database, and should not be used in combination with + other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action + Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note + that Actions cannot be specified for Server auditing policy). The + supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that in the above format can refer to an object like a + table, view, or stored procedure, or an entire database or schema. For the + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are + used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + 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. + When using REST API to configure auditing, Diagnostic Settings with + 'SQLSecurityAuditEvents' diagnostic logs category on the database should + be also created. + Note that for server level audit you should use the 'master' database as + {databaseName}. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/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_azure_monitor_target_enabled: bool + :param queue_delay_ms: Specifies the amount of time in milliseconds that + can elapse before audit actions are forced to be processed. + The default minimum value is 1000 (1 second). The maximum is + 2,147,483,647. + :type queue_delay_ms: int """ _validation = { @@ -878,39 +1259,275 @@ class GeoBackupPolicy(ProxyResource): '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'}, + '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'}, } def __init__(self, **kwargs): - super(GeoBackupPolicy, self).__init__(**kwargs) + super(ExtendedServerBlobAuditingPolicy, self).__init__(**kwargs) + self.predicate_expression = kwargs.get('predicate_expression', None) self.state = kwargs.get('state', None) - self.storage_type = None - self.kind = None - self.location = 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) -class GetSsisObjectMetadataRequest(Model): - """The request payload of get SSIS object metadata. +class ExtendedSqlPoolBlobAuditingPolicy(ProxyResource): + """An extended Sql pool blob auditing policy. - :param metadata_path: Metadata path. - :type metadata_path: str - """ + Variables are only populated by the server, and will be ignored when + sending a request. - _attribute_map = { - 'metadata_path': {'key': 'metadataPath', 'type': 'str'}, - } + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :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.synapse.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 + :param audit_actions_and_groups: Specifies the Actions-Groups and Actions + to audit. + The recommended set of action groups to use is the following combination - + this will audit all the queries and stored procedures executed against the + database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when + enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific + groups that cover your auditing needs. Using unnecessary groups could lead + to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures + executed against the database, and should not be used in combination with + other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action + Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note + that Actions cannot be specified for Server auditing policy). The + supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that in the above format can refer to an object like a + table, view, or stored procedure, or an entire database or schema. For the + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are + used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + 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. + When using REST API to configure auditing, Diagnostic Settings with + 'SQLSecurityAuditEvents' diagnostic logs category on the database should + be also created. + Note that for server level audit you should use the 'master' database as + {databaseName}. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/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_azure_monitor_target_enabled: bool + :param queue_delay_ms: Specifies the amount of time in milliseconds that + can elapse before audit actions are forced to be processed. + 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}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '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'}, + } + + def __init__(self, **kwargs): + super(ExtendedSqlPoolBlobAuditingPolicy, 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) + + +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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param state: Required. The state of the geo backup policy. Possible + values include: 'Disabled', 'Enabled' + :type state: str or ~azure.mgmt.synapse.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'}, + } + + def __init__(self, **kwargs): + super(GeoBackupPolicy, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.storage_type = None + self.kind = None + self.location = None + + +class GetSsisObjectMetadataRequest(Model): + """The request payload of get SSIS object metadata. + + :param metadata_path: Metadata path. + :type metadata_path: str + """ + + _attribute_map = { + 'metadata_path': {'key': 'metadataPath', 'type': 'str'}, + } def __init__(self, **kwargs): super(GetSsisObjectMetadataRequest, self).__init__(**kwargs) @@ -1305,13 +1922,13 @@ class SubResource(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1343,13 +1960,13 @@ class IntegrationRuntimeResource(SubResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1591,13 +2208,13 @@ class IpFirewallRuleInfo(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: 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 @@ -1669,6 +2286,47 @@ def __init__(self, **kwargs): self.start_ip_address = kwargs.get('start_ip_address', None) +class Key(ProxyResource): + """A workspace key. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param is_active_cmk: Used to activate the workspace after a customer + managed key is provided. + :type is_active_cmk: bool + :param key_vault_url: The Key Vault Url of the workspace key. + :type key_vault_url: 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'}, + 'is_active_cmk': {'key': 'properties.isActiveCMK', 'type': 'bool'}, + 'key_vault_url': {'key': 'properties.keyVaultUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Key, self).__init__(**kwargs) + self.is_active_cmk = kwargs.get('is_active_cmk', None) + self.key_vault_url = kwargs.get('key_vault_url', None) + + class LibraryRequirements(Model): """Spark pool library version requirements. @@ -1875,13 +2533,13 @@ class ManagedIdentitySqlControlSettingsModel(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param grant_sql_control_to_managed_identity: Grant sql control to managed identity @@ -2189,6 +2847,32 @@ def __init__(self, **kwargs): self.type = 'Managed' +class ManagedVirtualNetworkSettings(Model): + """Managed Virtual Network Settings. + + :param prevent_data_exfiltration: Prevent Data Exfiltration + :type prevent_data_exfiltration: bool + :param linked_access_check_on_target_resource: Linked Access Check On + Target Resource + :type linked_access_check_on_target_resource: bool + :param allowed_aad_tenant_ids_for_linking: Allowed Aad Tenant Ids For + Linking + :type allowed_aad_tenant_ids_for_linking: list[str] + """ + + _attribute_map = { + 'prevent_data_exfiltration': {'key': 'preventDataExfiltration', 'type': 'bool'}, + 'linked_access_check_on_target_resource': {'key': 'linkedAccessCheckOnTargetResource', 'type': 'bool'}, + 'allowed_aad_tenant_ids_for_linking': {'key': 'allowedAadTenantIdsForLinking', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(ManagedVirtualNetworkSettings, self).__init__(**kwargs) + self.prevent_data_exfiltration = kwargs.get('prevent_data_exfiltration', None) + self.linked_access_check_on_target_resource = kwargs.get('linked_access_check_on_target_resource', None) + self.allowed_aad_tenant_ids_for_linking = kwargs.get('allowed_aad_tenant_ids_for_linking', None) + + class MetadataSyncConfig(ProxyResource): """Metadata sync configuration. @@ -2197,16 +2881,18 @@ class MetadataSyncConfig(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param enabled: Indicates whether the metadata sync is enabled or disabled :type enabled: bool + :param sync_interval_in_minutes: The Sync Interval in minutes. + :type sync_interval_in_minutes: int """ _validation = { @@ -2220,11 +2906,13 @@ class MetadataSyncConfig(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'sync_interval_in_minutes': {'key': 'properties.syncIntervalInMinutes', 'type': 'int'}, } def __init__(self, **kwargs): super(MetadataSyncConfig, self).__init__(**kwargs) self.enabled = kwargs.get('enabled', None) + self.sync_interval_in_minutes = kwargs.get('sync_interval_in_minutes', None) class OperationMetaLogSpecification(Model): @@ -2431,13 +3119,13 @@ class PrivateEndpointConnection(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param private_endpoint: The private endpoint which the connection belongs to. @@ -2474,29 +3162,115 @@ def __init__(self, **kwargs): self.provisioning_state = None -class PrivateLinkHub(TrackedResource): - """A privateLinkHub. +class PrivateEndpointConnectionForPrivateLinkHubBasic(Model): + """Private Endpoint Connection For Private Link Hub - Basic. 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: identifier :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar provisioning_state: PrivateLinkHub provisioning state. Possible - values include: 'Succeeded', 'Failed' - :vartype provisioning_state: str or ~azure.mgmt.synapse.models.enum + :param private_endpoint: The private endpoint which the connection belongs + to. + :type private_endpoint: ~azure.mgmt.synapse.models.PrivateEndpoint + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.synapse.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: Provisioning state of the private endpoint + connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionForPrivateLinkHubBasic, self).__init__(**kwargs) + self.id = None + 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 PrivateEndpointConnectionForPrivateLinkHub(PrivateEndpointConnectionForPrivateLinkHubBasic): + """PrivateEndpointConnectionForPrivateLinkHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: identifier + :vartype id: str + :param private_endpoint: The private endpoint which the connection belongs + to. + :type private_endpoint: ~azure.mgmt.synapse.models.PrivateEndpoint + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.synapse.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: Provisioning state of the private endpoint + connection. + :vartype provisioning_state: str + :param name: + :type name: str + :param type: + :type type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrivateEndpointConnectionForPrivateLinkHub, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) + + +class PrivateLinkHub(TrackedResource): + """A privateLinkHub. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param provisioning_state: PrivateLinkHub provisioning state + :type provisioning_state: str + :ivar private_endpoint_connections: List of private endpoint connections + :vartype private_endpoint_connections: + list[~azure.mgmt.synapse.models.PrivateEndpointConnectionForPrivateLinkHubBasic] """ _validation = { @@ -2504,7 +3278,7 @@ class PrivateLinkHub(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -2514,11 +3288,13 @@ class PrivateLinkHub(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionForPrivateLinkHubBasic]'}, } def __init__(self, **kwargs): super(PrivateLinkHub, self).__init__(**kwargs) - self.provisioning_state = None + self.provisioning_state = kwargs.get('provisioning_state', None) + self.private_endpoint_connections = None class PrivateLinkHubPatchInfo(Model): @@ -2543,13 +3319,13 @@ class PrivateLinkResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar properties: The private link resource properties. :vartype properties: @@ -2615,9 +3391,8 @@ class PrivateLinkServiceConnectionState(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param status: The private link service connection status. Possible values - include: 'Approved', 'Pending', 'Rejected', 'Disconnected' - :type status: str or ~azure.mgmt.synapse.models.enum + :param status: The private link service connection status. + :type status: str :param description: The private link service connection description. :type description: str :ivar actions_required: The actions required for private link service @@ -2642,6 +3417,22 @@ def __init__(self, **kwargs): self.actions_required = None +class PurviewConfiguration(Model): + """Purview Configuration. + + :param purview_resource_id: Purview Resource ID + :type purview_resource_id: str + """ + + _attribute_map = { + 'purview_resource_id': {'key': 'purviewResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PurviewConfiguration, self).__init__(**kwargs) + self.purview_resource_id = kwargs.get('purview_resource_id', None) + + class QueryInterval(Model): """A database query. @@ -2744,6 +3535,60 @@ def __init__(self, **kwargs): self.intervals = None +class RecoverableSqlPool(ProxyResource): + """A recoverable sql pool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar edition: The edition of the database + :vartype edition: str + :ivar service_level_objective: The service level objective name of the + database + :vartype service_level_objective: str + :ivar elastic_pool_name: The elastic pool name of the database + :vartype elastic_pool_name: str + :ivar last_available_backup_date: The last available backup date of the + database (ISO8601 format) + :vartype last_available_backup_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'edition': {'readonly': True}, + 'service_level_objective': {'readonly': True}, + 'elastic_pool_name': {'readonly': True}, + 'last_available_backup_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'edition': {'key': 'properties.edition', 'type': 'str'}, + 'service_level_objective': {'key': 'properties.serviceLevelObjective', 'type': 'str'}, + 'elastic_pool_name': {'key': 'properties.elasticPoolName', 'type': 'str'}, + 'last_available_backup_date': {'key': 'properties.lastAvailableBackupDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(RecoverableSqlPool, self).__init__(**kwargs) + self.edition = None + self.service_level_objective = None + self.elastic_pool_name = None + self.last_available_backup_date = None + + class ReplaceAllFirewallRulesOperationResponse(Model): """An existing operation for replacing the firewall rules. @@ -2783,13 +3628,13 @@ class ReplicationLink(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar location: Location of the workspace that contains this firewall rule. @@ -2874,26 +3719,83 @@ def __init__(self, **kwargs): self.replication_state = None -class ResourceMoveDefinition(Model): - """Contains the information necessary to perform a resource move (rename). +class RestorableDroppedSqlPool(ProxyResource): + """A restorable dropped Sql pool. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param id: Required. The target ID for the resource - :type id: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar location: The geo-location where the resource lives + :vartype location: 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) + :vartype creation_date: datetime + :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) + :vartype earliest_restore_date: datetime """ _validation = { - 'id': {'required': True}, + '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}, + 'creation_date': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'earliest_restore_date': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + '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'}, + '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): - super(ResourceMoveDefinition, self).__init__(**kwargs) - self.id = kwargs.get('id', None) + super(RestorableDroppedSqlPool, self).__init__(**kwargs) + self.location = None + self.database_name = None + self.edition = None + self.max_size_bytes = None + self.service_level_objective = None + self.elastic_pool_name = None + self.creation_date = None + self.deletion_date = None + self.earliest_restore_date = None class RestorePoint(ProxyResource): @@ -2902,13 +3804,13 @@ class RestorePoint(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar location: Resource location. :vartype location: str @@ -3026,7 +3928,7 @@ class SelfHostedIntegrationRuntime(IntegrationRuntime): :type description: str :param type: Required. Constant filled by server. :type type: str - :param linked_info: + :param linked_info: Linked integration runtime type from data factory :type linked_info: ~azure.mgmt.synapse.models.LinkedIntegrationRuntimeType """ @@ -3199,6 +4101,9 @@ class SelfHostedIntegrationRuntimeStatus(IntegrationRuntimeStatus): :vartype create_time: datetime :ivar task_queue_id: The task queue id of the integration runtime. :vartype task_queue_id: str + :ivar node_communication_channel_encryption_mode: The node communication + Channel encryption mode + :vartype node_communication_channel_encryption_mode: str :ivar internal_channel_encryption: It is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). Possible values include: 'NotSet', @@ -3244,122 +4149,483 @@ class SelfHostedIntegrationRuntimeStatus(IntegrationRuntimeStatus): """ _validation = { - 'data_factory_name': {'readonly': True}, - 'state': {'readonly': True}, - 'type': {'required': True}, - 'create_time': {'readonly': True}, - 'task_queue_id': {'readonly': True}, - 'internal_channel_encryption': {'readonly': True}, - 'version': {'readonly': True}, - 'scheduled_update_date': {'readonly': True}, - 'update_delay_offset': {'readonly': True}, - 'local_time_zone_offset': {'readonly': True}, - 'capabilities': {'readonly': True}, - 'service_urls': {'readonly': True}, - 'auto_update': {'readonly': True}, - 'version_status': {'readonly': True}, - 'pushed_version': {'readonly': True}, - 'latest_version': {'readonly': True}, - 'auto_update_eta': {'readonly': True}, + 'data_factory_name': {'readonly': True}, + 'state': {'readonly': True}, + 'type': {'required': True}, + 'create_time': {'readonly': True}, + 'task_queue_id': {'readonly': True}, + 'node_communication_channel_encryption_mode': {'readonly': True}, + 'internal_channel_encryption': {'readonly': True}, + 'version': {'readonly': True}, + 'scheduled_update_date': {'readonly': True}, + 'update_delay_offset': {'readonly': True}, + 'local_time_zone_offset': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'service_urls': {'readonly': True}, + 'auto_update': {'readonly': True}, + 'version_status': {'readonly': True}, + 'pushed_version': {'readonly': True}, + 'latest_version': {'readonly': True}, + 'auto_update_eta': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'data_factory_name': {'key': 'dataFactoryName', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'create_time': {'key': 'typeProperties.createTime', 'type': 'iso-8601'}, + 'task_queue_id': {'key': 'typeProperties.taskQueueId', 'type': 'str'}, + 'node_communication_channel_encryption_mode': {'key': 'typeProperties.nodeCommunicationChannelEncryptionMode', 'type': 'str'}, + 'internal_channel_encryption': {'key': 'typeProperties.internalChannelEncryption', 'type': 'str'}, + 'version': {'key': 'typeProperties.version', 'type': 'str'}, + 'nodes': {'key': 'typeProperties.nodes', 'type': '[SelfHostedIntegrationRuntimeNode]'}, + 'scheduled_update_date': {'key': 'typeProperties.scheduledUpdateDate', 'type': 'iso-8601'}, + 'update_delay_offset': {'key': 'typeProperties.updateDelayOffset', 'type': 'str'}, + 'local_time_zone_offset': {'key': 'typeProperties.localTimeZoneOffset', 'type': 'str'}, + 'capabilities': {'key': 'typeProperties.capabilities', 'type': '{str}'}, + 'service_urls': {'key': 'typeProperties.serviceUrls', 'type': '[str]'}, + 'auto_update': {'key': 'typeProperties.autoUpdate', 'type': 'str'}, + 'version_status': {'key': 'typeProperties.versionStatus', 'type': 'str'}, + 'links': {'key': 'typeProperties.links', 'type': '[LinkedIntegrationRuntime]'}, + 'pushed_version': {'key': 'typeProperties.pushedVersion', 'type': 'str'}, + 'latest_version': {'key': 'typeProperties.latestVersion', 'type': 'str'}, + 'auto_update_eta': {'key': 'typeProperties.autoUpdateETA', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(SelfHostedIntegrationRuntimeStatus, self).__init__(**kwargs) + self.create_time = None + self.task_queue_id = None + self.node_communication_channel_encryption_mode = None + self.internal_channel_encryption = None + self.version = None + self.nodes = kwargs.get('nodes', None) + self.scheduled_update_date = None + self.update_delay_offset = None + self.local_time_zone_offset = None + self.capabilities = None + self.service_urls = None + self.auto_update = None + self.version_status = None + self.links = kwargs.get('links', None) + self.pushed_version = None + self.latest_version = None + self.auto_update_eta = None + self.type = 'SelfHosted' + + +class SensitivityLabel(ProxyResource): + """A sensitivity label. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param label_name: The label name. + :type label_name: str + :param label_id: The label ID. + :type label_id: str + :param information_type: The information type. + :type information_type: str + :param information_type_id: The information type ID. + :type information_type_id: str + :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for + recommended sensitivity label only. Specifies whether the sensitivity + recommendation on this column is disabled (dismissed) or not. + :vartype is_disabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_disabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'label_name': {'key': 'properties.labelName', 'type': 'str'}, + 'label_id': {'key': 'properties.labelId', 'type': 'str'}, + 'information_type': {'key': 'properties.informationType', 'type': 'str'}, + 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(SensitivityLabel, self).__init__(**kwargs) + self.label_name = kwargs.get('label_name', None) + self.label_id = kwargs.get('label_id', None) + self.information_type = kwargs.get('information_type', None) + self.information_type_id = kwargs.get('information_type_id', None) + self.is_disabled = None + + +class ServerBlobAuditingPolicy(ProxyResource): + """A server blob auditing 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :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.synapse.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 + :param audit_actions_and_groups: Specifies the Actions-Groups and Actions + to audit. + The recommended set of action groups to use is the following combination - + this will audit all the queries and stored procedures executed against the + database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when + enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific + groups that cover your auditing needs. Using unnecessary groups could lead + to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures + executed against the database, and should not be used in combination with + other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action + Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note + that Actions cannot be specified for Server auditing policy). The + supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that in the above format can refer to an object like a + table, view, or stored procedure, or an entire database or schema. For the + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are + used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + 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. + When using REST API to configure auditing, Diagnostic Settings with + 'SQLSecurityAuditEvents' diagnostic logs category on the database should + be also created. + Note that for server level audit you should use the 'master' database as + {databaseName}. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/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_azure_monitor_target_enabled: bool + :param queue_delay_ms: Specifies the amount of time in milliseconds that + can elapse before audit actions are forced to be processed. + 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}, + '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': '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'}, + } + + 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.retention_days = kwargs.get('retention_days', None) + self.audit_actions_and_groups = kwargs.get('audit_actions_and_groups', None) + self.storage_account_subscription_id = kwargs.get('storage_account_subscription_id', None) + self.is_storage_secondary_key_in_use = kwargs.get('is_storage_secondary_key_in_use', None) + self.is_azure_monitor_target_enabled = kwargs.get('is_azure_monitor_target_enabled', None) + self.queue_delay_ms = kwargs.get('queue_delay_ms', None) + + +class ServerSecurityAlertPolicy(ProxyResource): + """Workspace managed Sql server security alert 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :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 + server. Possible values include: 'New', 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.synapse.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 + :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. + :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. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + 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 + :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}, + 'state': {'required': True}, + 'creation_time': {'readonly': True}, } _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'data_factory_name': {'key': 'dataFactoryName', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'create_time': {'key': 'typeProperties.createTime', 'type': 'iso-8601'}, - 'task_queue_id': {'key': 'typeProperties.taskQueueId', 'type': 'str'}, - 'internal_channel_encryption': {'key': 'typeProperties.internalChannelEncryption', 'type': 'str'}, - 'version': {'key': 'typeProperties.version', 'type': 'str'}, - 'nodes': {'key': 'typeProperties.nodes', 'type': '[SelfHostedIntegrationRuntimeNode]'}, - 'scheduled_update_date': {'key': 'typeProperties.scheduledUpdateDate', 'type': 'iso-8601'}, - 'update_delay_offset': {'key': 'typeProperties.updateDelayOffset', 'type': 'str'}, - 'local_time_zone_offset': {'key': 'typeProperties.localTimeZoneOffset', 'type': 'str'}, - 'capabilities': {'key': 'typeProperties.capabilities', 'type': '{str}'}, - 'service_urls': {'key': 'typeProperties.serviceUrls', 'type': '[str]'}, - 'auto_update': {'key': 'typeProperties.autoUpdate', 'type': 'str'}, - 'version_status': {'key': 'typeProperties.versionStatus', 'type': 'str'}, - 'links': {'key': 'typeProperties.links', 'type': '[LinkedIntegrationRuntime]'}, - 'pushed_version': {'key': 'typeProperties.pushedVersion', 'type': 'str'}, - 'latest_version': {'key': 'typeProperties.latestVersion', 'type': 'str'}, - 'auto_update_eta': {'key': 'typeProperties.autoUpdateETA', 'type': 'iso-8601'}, + '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': 'bool'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, } def __init__(self, **kwargs): - super(SelfHostedIntegrationRuntimeStatus, self).__init__(**kwargs) - self.create_time = None - self.task_queue_id = None - self.internal_channel_encryption = None - self.version = None - self.nodes = kwargs.get('nodes', None) - self.scheduled_update_date = None - self.update_delay_offset = None - self.local_time_zone_offset = None - self.capabilities = None - self.service_urls = None - self.auto_update = None - self.version_status = None - self.links = kwargs.get('links', None) - self.pushed_version = None - self.latest_version = None - self.auto_update_eta = None - self.type = 'SelfHosted' + super(ServerSecurityAlertPolicy, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.disabled_alerts = kwargs.get('disabled_alerts', None) + self.email_addresses = kwargs.get('email_addresses', None) + self.email_account_admins = kwargs.get('email_account_admins', 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.creation_time = None -class SensitivityLabel(ProxyResource): - """A sensitivity label. +class ServerUsage(Model): + """Represents server metrics. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the server usage metric. + :vartype name: str + :ivar resource_name: The name of the resource. + :vartype resource_name: str + :ivar display_name: The metric display name. + :vartype display_name: str + :ivar current_value: The current value of the metric. + :vartype current_value: float + :ivar limit: The current limit of the metric. + :vartype limit: float + :ivar unit: The units of the metric. + :vartype unit: str + :ivar next_reset_time: The next reset time for the metric (ISO8601 + format). + :vartype next_reset_time: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(ServerUsage, self).__init__(**kwargs) + self.name = None + self.resource_name = None + self.display_name = None + self.current_value = None + self.limit = None + self.unit = None + self.next_reset_time = None + + +class ServerVulnerabilityAssessment(ProxyResource): + """A server vulnerability assessment. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param label_name: The label name. - :type label_name: str - :param label_id: The label ID. - :type label_id: str - :param information_type: The information type. - :type information_type: str - :param information_type_id: The information type ID. - :type information_type_id: str - :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for - recommended sensitivity label only. Specifies whether the sensitivity - recommendation on this column is disabled (dismissed) or not. - :vartype is_disabled: bool + :param storage_container_path: Required. A blob storage container path to + hold the scan results (e.g. + 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. + :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 + 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is + required. + :type storage_account_access_key: str + :param recurring_scans: The recurring scans settings + :type recurring_scans: + ~azure.mgmt.synapse.models.VulnerabilityAssessmentRecurringScansProperties """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'is_disabled': {'readonly': True}, + 'storage_container_path': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'label_name': {'key': 'properties.labelName', 'type': 'str'}, - 'label_id': {'key': 'properties.labelId', 'type': 'str'}, - 'information_type': {'key': 'properties.informationType', 'type': 'str'}, - 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, - 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + 'storage_container_path': {'key': 'properties.storageContainerPath', 'type': 'str'}, + 'storage_container_sas_key': {'key': 'properties.storageContainerSasKey', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'recurring_scans': {'key': 'properties.recurringScans', 'type': 'VulnerabilityAssessmentRecurringScansProperties'}, } def __init__(self, **kwargs): - super(SensitivityLabel, self).__init__(**kwargs) - self.label_name = kwargs.get('label_name', None) - self.label_id = kwargs.get('label_id', None) - self.information_type = kwargs.get('information_type', None) - self.information_type_id = kwargs.get('information_type_id', None) - self.is_disabled = None + super(ServerVulnerabilityAssessment, self).__init__(**kwargs) + self.storage_container_path = kwargs.get('storage_container_path', None) + self.storage_container_sas_key = kwargs.get('storage_container_sas_key', None) + self.storage_account_access_key = kwargs.get('storage_account_access_key', None) + self.recurring_scans = kwargs.get('recurring_scans', None) class Sku(Model): @@ -3400,13 +4666,13 @@ class SqlPool(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -3427,7 +4693,7 @@ class SqlPool(TrackedResource): :param status: Resource status :type status: str :param restore_point_in_time: Snapshot time to restore - :type restore_point_in_time: datetime + :type restore_point_in_time: str :param create_mode: What is this? :type create_mode: str :param creation_date: Date the SQL pool was created @@ -3454,7 +4720,7 @@ class SqlPool(TrackedResource): 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'str'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, } @@ -3481,13 +4747,13 @@ class SqlPoolBlobAuditingPolicy(ProxyResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar kind: Resource kind. :vartype kind: str @@ -3634,13 +4900,13 @@ class SqlPoolColumn(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param column_type: The column data type. Possible values include: 'image', 'text', 'uniqueidentifier', 'date', 'time', 'datetime2', @@ -3676,13 +4942,13 @@ class SqlPoolConnectionPolicy(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar kind: Resource kind. :vartype kind: str @@ -3747,13 +5013,13 @@ class SqlPoolOperation(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar database_name: The name of the Sql pool the operation is being performed on. @@ -3870,7 +5136,7 @@ class SqlPoolPatchInfo(Model): :param status: Resource status :type status: str :param restore_point_in_time: Snapshot time to restore - :type restore_point_in_time: datetime + :type restore_point_in_time: str :param create_mode: What is this? :type create_mode: str :param creation_date: Date the SQL pool was created @@ -3887,7 +5153,7 @@ class SqlPoolPatchInfo(Model): 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'str'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, } @@ -3914,13 +5180,13 @@ class SqlPoolSchema(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -3948,13 +5214,13 @@ class SqlPoolSecurityAlertPolicy(ProxyResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :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 @@ -4024,13 +5290,13 @@ class SqlPoolTable(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -4110,13 +5376,13 @@ class SqlPoolVulnerabilityAssessment(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param storage_container_path: A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It @@ -4169,13 +5435,13 @@ class SqlPoolVulnerabilityAssessmentRuleBaseline(ProxyResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param baseline_results: Required. The rule baseline result :type baseline_results: @@ -4229,13 +5495,13 @@ class SqlPoolVulnerabilityAssessmentScansExport(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar exported_report_location: Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). @@ -4741,13 +6007,13 @@ class TransparentDataEncryption(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar location: Resource location. :vartype location: str @@ -4903,13 +6169,13 @@ class VulnerabilityAssessmentScanRecord(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar scan_id: The scan ID. :vartype scan_id: str @@ -4975,6 +6241,131 @@ def __init__(self, **kwargs): self.number_of_failed_security_checks = None +class WorkloadClassifier(ProxyResource): + """Workload classifier operations for a data warehouse. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param member_name: Required. The workload classifier member name. + :type member_name: str + :param label: The workload classifier label. + :type label: str + :param context: The workload classifier context. + :type context: str + :param start_time: The workload classifier start time for classification. + :type start_time: str + :param end_time: The workload classifier end time for classification. + :type end_time: str + :param importance: The workload classifier importance. + :type importance: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'member_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'member_name': {'key': 'properties.memberName', 'type': 'str'}, + 'label': {'key': 'properties.label', 'type': 'str'}, + 'context': {'key': 'properties.context', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'str'}, + 'end_time': {'key': 'properties.endTime', 'type': 'str'}, + 'importance': {'key': 'properties.importance', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkloadClassifier, self).__init__(**kwargs) + self.member_name = kwargs.get('member_name', None) + self.label = kwargs.get('label', None) + self.context = kwargs.get('context', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.importance = kwargs.get('importance', None) + + +class WorkloadGroup(ProxyResource): + """Workload group operations for a sql pool. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param min_resource_percent: Required. The workload group minimum + percentage resource. + :type min_resource_percent: int + :param max_resource_percent: Required. The workload group cap percentage + resource. + :type max_resource_percent: int + :param min_resource_percent_per_request: Required. The workload group + request minimum grant percentage. + :type min_resource_percent_per_request: float + :param max_resource_percent_per_request: The workload group request + maximum grant percentage. + :type max_resource_percent_per_request: float + :param importance: The workload group importance level. + :type importance: str + :param query_execution_timeout: The workload group query execution + timeout. + :type query_execution_timeout: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'min_resource_percent': {'required': True}, + 'max_resource_percent': {'required': True}, + 'min_resource_percent_per_request': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'min_resource_percent': {'key': 'properties.minResourcePercent', 'type': 'int'}, + 'max_resource_percent': {'key': 'properties.maxResourcePercent', 'type': 'int'}, + 'min_resource_percent_per_request': {'key': 'properties.minResourcePercentPerRequest', 'type': 'float'}, + 'max_resource_percent_per_request': {'key': 'properties.maxResourcePercentPerRequest', 'type': 'float'}, + 'importance': {'key': 'properties.importance', 'type': 'str'}, + 'query_execution_timeout': {'key': 'properties.queryExecutionTimeout', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(WorkloadGroup, self).__init__(**kwargs) + self.min_resource_percent = kwargs.get('min_resource_percent', None) + self.max_resource_percent = kwargs.get('max_resource_percent', None) + self.min_resource_percent_per_request = kwargs.get('min_resource_percent_per_request', None) + self.max_resource_percent_per_request = kwargs.get('max_resource_percent_per_request', None) + self.importance = kwargs.get('importance', None) + self.query_execution_timeout = kwargs.get('query_execution_timeout', None) + + class Workspace(TrackedResource): """A workspace. @@ -4983,13 +6374,13 @@ class Workspace(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -5026,8 +6417,21 @@ class Workspace(TrackedResource): workspace :type private_endpoint_connections: list[~azure.mgmt.synapse.models.PrivateEndpointConnection] + :param encryption: The encryption details of the workspace + :type encryption: ~azure.mgmt.synapse.models.EncryptionDetails + :ivar workspace_uid: The workspace unique identifier + :vartype workspace_uid: str :ivar extra_properties: Workspace level configs and feature flags :vartype extra_properties: dict[str, object] + :param managed_virtual_network_settings: Managed Virtual Network Settings + :type managed_virtual_network_settings: + ~azure.mgmt.synapse.models.ManagedVirtualNetworkSettings + :param workspace_repository_configuration: Git integration settings + :type workspace_repository_configuration: + ~azure.mgmt.synapse.models.WorkspaceRepositoryConfiguration + :param purview_configuration: Purview Configuration + :type purview_configuration: + ~azure.mgmt.synapse.models.PurviewConfiguration :param identity: Identity of the workspace :type identity: ~azure.mgmt.synapse.models.ManagedIdentity """ @@ -5038,6 +6442,7 @@ class Workspace(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, + 'workspace_uid': {'readonly': True}, 'extra_properties': {'readonly': True}, } @@ -5056,7 +6461,12 @@ class Workspace(TrackedResource): 'connectivity_endpoints': {'key': 'properties.connectivityEndpoints', 'type': '{str}'}, 'managed_virtual_network': {'key': 'properties.managedVirtualNetwork', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionDetails'}, + 'workspace_uid': {'key': 'properties.workspaceUID', 'type': 'str'}, 'extra_properties': {'key': 'properties.extraProperties', 'type': '{object}'}, + 'managed_virtual_network_settings': {'key': 'properties.managedVirtualNetworkSettings', 'type': 'ManagedVirtualNetworkSettings'}, + 'workspace_repository_configuration': {'key': 'properties.workspaceRepositoryConfiguration', 'type': 'WorkspaceRepositoryConfiguration'}, + 'purview_configuration': {'key': 'properties.purviewConfiguration', 'type': 'PurviewConfiguration'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, } @@ -5071,7 +6481,12 @@ def __init__(self, **kwargs): self.connectivity_endpoints = kwargs.get('connectivity_endpoints', None) self.managed_virtual_network = kwargs.get('managed_virtual_network', None) self.private_endpoint_connections = kwargs.get('private_endpoint_connections', None) + self.encryption = kwargs.get('encryption', None) + self.workspace_uid = None self.extra_properties = None + self.managed_virtual_network_settings = kwargs.get('managed_virtual_network_settings', None) + self.workspace_repository_configuration = kwargs.get('workspace_repository_configuration', None) + self.purview_configuration = kwargs.get('purview_configuration', None) self.identity = kwargs.get('identity', None) @@ -5081,13 +6496,13 @@ class WorkspaceAadAdminInfo(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tenant_id: Tenant ID of the workspace active directory administrator @@ -5124,6 +6539,26 @@ def __init__(self, **kwargs): self.sid = kwargs.get('sid', None) +class WorkspaceKeyDetails(Model): + """Details of the customer managed key associated with the workspace. + + :param name: Workspace Key sub-resource name + :type name: str + :param key_vault_url: Workspace Key sub-resource key vault url + :type key_vault_url: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key_vault_url': {'key': 'keyVaultUrl', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceKeyDetails, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.key_vault_url = kwargs.get('key_vault_url', None) + + class WorkspacePatchInfo(Model): """Workspace patch details. @@ -5136,6 +6571,15 @@ class WorkspacePatchInfo(Model): :type identity: ~azure.mgmt.synapse.models.ManagedIdentity :param sql_administrator_login_password: SQL administrator login password :type sql_administrator_login_password: str + :param managed_virtual_network_settings: Managed Virtual Network Settings + :type managed_virtual_network_settings: + ~azure.mgmt.synapse.models.ManagedVirtualNetworkSettings + :param workspace_repository_configuration: Git integration settings + :type workspace_repository_configuration: + ~azure.mgmt.synapse.models.WorkspaceRepositoryConfiguration + :param purview_configuration: Purview Configuration + :type purview_configuration: + ~azure.mgmt.synapse.models.PurviewConfiguration :ivar provisioning_state: Resource provisioning state :vartype provisioning_state: str """ @@ -5148,6 +6592,9 @@ class WorkspacePatchInfo(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, 'sql_administrator_login_password': {'key': 'properties.sqlAdministratorLoginPassword', 'type': 'str'}, + 'managed_virtual_network_settings': {'key': 'properties.managedVirtualNetworkSettings', 'type': 'ManagedVirtualNetworkSettings'}, + 'workspace_repository_configuration': {'key': 'properties.workspaceRepositoryConfiguration', 'type': 'WorkspaceRepositoryConfiguration'}, + 'purview_configuration': {'key': 'properties.purviewConfiguration', 'type': 'PurviewConfiguration'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } @@ -5156,4 +6603,49 @@ def __init__(self, **kwargs): self.tags = kwargs.get('tags', None) self.identity = kwargs.get('identity', None) self.sql_administrator_login_password = kwargs.get('sql_administrator_login_password', None) + self.managed_virtual_network_settings = kwargs.get('managed_virtual_network_settings', None) + self.workspace_repository_configuration = kwargs.get('workspace_repository_configuration', None) + self.purview_configuration = kwargs.get('purview_configuration', None) self.provisioning_state = None + + +class WorkspaceRepositoryConfiguration(Model): + """Git integration settings. + + :param type: Type of workspace repositoryID configuration. Example + WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration + :type type: str + :param host_name: GitHub Enterprise host name. For example: + https://github.mydomain.com + :type host_name: str + :param account_name: Account name + :type account_name: str + :param project_name: VSTS project name + :type project_name: str + :param repository_name: Repository name + :type repository_name: str + :param collaboration_branch: Collaboration branch + :type collaboration_branch: str + :param root_folder: Root folder to use in the repository + :type root_folder: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'project_name': {'key': 'projectName', 'type': 'str'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'collaboration_branch': {'key': 'collaborationBranch', 'type': 'str'}, + 'root_folder': {'key': 'rootFolder', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(WorkspaceRepositoryConfiguration, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.host_name = kwargs.get('host_name', None) + self.account_name = kwargs.get('account_name', None) + self.project_name = kwargs.get('project_name', None) + self.repository_name = kwargs.get('repository_name', None) + self.collaboration_branch = kwargs.get('collaboration_branch', None) + self.root_folder = kwargs.get('root_folder', None) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py index c4f72918ef88..1ea749f90b92 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_models_py3.py @@ -129,16 +129,19 @@ def __init__(self, *, description: str=None, resource: str=None, provider: str=N class Resource(Model): """Resource. + Common fields that are returned in the response for all Azure Resource + Manager resources. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -162,19 +165,21 @@ def __init__(self, **kwargs) -> None: class AzureEntityResource(Resource): - """The resource model definition for a Azure Resource Manager resource with an - etag. + """Entity Resource. + + The resource model definition for an Azure Resource Manager resource with + an etag. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -218,20 +223,23 @@ def __init__(self, *, tags=None, **kwargs) -> None: class TrackedResource(Resource): - """The resource model definition for a ARM tracked top level resource. + """Tracked Resource. + + The resource model definition for an Azure Resource Manager tracked top + level resource which has 'tags' and a 'location'. 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: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -270,13 +278,13 @@ class BigDataPoolResourceInfo(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -293,12 +301,22 @@ class BigDataPoolResourceInfo(TrackedResource): :param is_compute_isolation_enabled: Whether compute isolation is required or not. :type is_compute_isolation_enabled: bool + :param have_library_requirements_changed: Whether library requirements + changed. + :type have_library_requirements_changed: bool + :param session_level_packages_enabled: Whether session level packages + enabled. + :type session_level_packages_enabled: bool :param spark_events_folder: The Spark events folder :type spark_events_folder: str :param node_count: The number of nodes in the Big Data pool. :type node_count: int :param library_requirements: Library version requirements :type library_requirements: ~azure.mgmt.synapse.models.LibraryRequirements + :param spark_config_properties: Spark configuration file to specify + additional properties + :type spark_config_properties: + ~azure.mgmt.synapse.models.LibraryRequirements :param spark_version: The Apache Spark version. :type spark_version: str :param default_spark_log_folder: The default folder where Spark logs will @@ -306,7 +324,7 @@ class BigDataPoolResourceInfo(TrackedResource): :type default_spark_log_folder: str :param node_size: The level of compute power that each node in the Big Data pool has. Possible values include: 'None', 'Small', 'Medium', - 'Large', 'XLarge', 'XXLarge' + 'Large', 'XLarge', 'XXLarge', 'XXXLarge' :type node_size: str or ~azure.mgmt.synapse.models.NodeSize :param node_size_family: The kind of nodes that the Big Data pool provides. Possible values include: 'None', 'MemoryOptimized' @@ -331,25 +349,31 @@ class BigDataPoolResourceInfo(TrackedResource): 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, 'auto_pause': {'key': 'properties.autoPause', 'type': 'AutoPauseProperties'}, 'is_compute_isolation_enabled': {'key': 'properties.isComputeIsolationEnabled', 'type': 'bool'}, + 'have_library_requirements_changed': {'key': 'properties.haveLibraryRequirementsChanged', 'type': 'bool'}, + 'session_level_packages_enabled': {'key': 'properties.sessionLevelPackagesEnabled', 'type': 'bool'}, 'spark_events_folder': {'key': 'properties.sparkEventsFolder', 'type': 'str'}, 'node_count': {'key': 'properties.nodeCount', 'type': 'int'}, 'library_requirements': {'key': 'properties.libraryRequirements', 'type': 'LibraryRequirements'}, + 'spark_config_properties': {'key': 'properties.sparkConfigProperties', 'type': 'LibraryRequirements'}, 'spark_version': {'key': 'properties.sparkVersion', 'type': 'str'}, 'default_spark_log_folder': {'key': 'properties.defaultSparkLogFolder', 'type': 'str'}, 'node_size': {'key': 'properties.nodeSize', 'type': 'str'}, 'node_size_family': {'key': 'properties.nodeSizeFamily', 'type': 'str'}, } - def __init__(self, *, location: str, tags=None, provisioning_state: str=None, auto_scale=None, creation_date=None, auto_pause=None, is_compute_isolation_enabled: bool=None, spark_events_folder: str=None, node_count: int=None, library_requirements=None, spark_version: str=None, default_spark_log_folder: str=None, node_size=None, node_size_family=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, provisioning_state: str=None, auto_scale=None, creation_date=None, auto_pause=None, is_compute_isolation_enabled: bool=None, have_library_requirements_changed: bool=None, session_level_packages_enabled: bool=None, spark_events_folder: str=None, node_count: int=None, library_requirements=None, spark_config_properties=None, spark_version: str=None, default_spark_log_folder: str=None, node_size=None, node_size_family=None, **kwargs) -> None: super(BigDataPoolResourceInfo, self).__init__(tags=tags, location=location, **kwargs) self.provisioning_state = provisioning_state self.auto_scale = auto_scale self.creation_date = creation_date self.auto_pause = auto_pause self.is_compute_isolation_enabled = is_compute_isolation_enabled + self.have_library_requirements_changed = have_library_requirements_changed + self.session_level_packages_enabled = session_level_packages_enabled self.spark_events_folder = spark_events_folder self.node_count = node_count self.library_requirements = library_requirements + self.spark_config_properties = spark_config_properties self.spark_version = spark_version self.default_spark_log_folder = default_spark_log_folder self.node_size = node_size @@ -575,6 +599,33 @@ def __init__(self, *, restore_point_label: str, **kwargs) -> None: self.restore_point_label = restore_point_label +class CustomerManagedKeyDetails(Model): + """Details of the customer managed key associated with the workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar status: The customer managed key status on the workspace + :vartype status: str + :param key: The key object of the workspace + :type key: ~azure.mgmt.synapse.models.WorkspaceKeyDetails + """ + + _validation = { + 'status': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'key': {'key': 'key', 'type': 'WorkspaceKeyDetails'}, + } + + def __init__(self, *, key=None, **kwargs) -> None: + super(CustomerManagedKeyDetails, self).__init__(**kwargs) + self.status = None + self.key = key + + class DataLakeStorageAccountDetails(Model): """Details of the data lake storage account associated with the workspace. @@ -596,19 +647,21 @@ def __init__(self, *, account_url: str=None, filesystem: str=None, **kwargs) -> class ProxyResource(Resource): - """The resource model definition for a ARM proxy resource. It will have - everything other than required location and tags. + """Proxy Resource. + + The resource model definition for a Azure Resource Manager proxy resource. + It will not have tags and a location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -628,19 +681,210 @@ def __init__(self, **kwargs) -> None: super(ProxyResource, self).__init__(**kwargs) +class DataMaskingPolicy(ProxyResource): + """DataMaskingPolicy. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param data_masking_state: Required. The state of the data masking policy. + Possible values include: 'Disabled', 'Enabled' + :type data_masking_state: str or + ~azure.mgmt.synapse.models.DataMaskingState + :param exempt_principals: The list of the exempt principals. Specifies the + semicolon-separated list of database users for which the data masking + policy does not apply. The specified users receive data results without + masking for all of the database queries. + :type exempt_principals: str + :ivar application_principals: The list of the application principals. This + is a legacy parameter and is no longer used. + :vartype application_principals: str + :ivar masking_level: The masking level. This is a legacy parameter and is + no longer used. + :vartype masking_level: str + :ivar location: The location of the data masking policy. + :vartype location: str + :ivar kind: The kind of data masking policy. Metadata, used for Azure + portal. + :vartype kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_masking_state': {'required': True}, + 'application_principals': {'readonly': True}, + 'masking_level': {'readonly': True}, + 'location': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_masking_state': {'key': 'properties.dataMaskingState', 'type': 'DataMaskingState'}, + 'exempt_principals': {'key': 'properties.exemptPrincipals', 'type': 'str'}, + 'application_principals': {'key': 'properties.applicationPrincipals', 'type': 'str'}, + 'masking_level': {'key': 'properties.maskingLevel', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, data_masking_state, exempt_principals: str=None, **kwargs) -> None: + super(DataMaskingPolicy, self).__init__(**kwargs) + self.data_masking_state = data_masking_state + self.exempt_principals = exempt_principals + self.application_principals = None + self.masking_level = None + self.location = None + self.kind = None + + +class DataMaskingRule(ProxyResource): + """Represents a Sql pool data masking rule. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar data_masking_rule_id: The rule Id. + :vartype data_masking_rule_id: str + :param alias_name: The alias name. This is a legacy parameter and is no + longer used. + :type alias_name: str + :param rule_state: The rule state. Used to delete a rule. To delete an + existing rule, specify the schemaName, tableName, columnName, + maskingFunction, and specify ruleState as disabled. However, if the rule + doesn't already exist, the rule will be created with ruleState set to + enabled, regardless of the provided value of ruleState. Possible values + include: 'Disabled', 'Enabled' + :type rule_state: str or ~azure.mgmt.synapse.models.DataMaskingRuleState + :param schema_name: Required. The schema name on which the data masking + rule is applied. + :type schema_name: str + :param table_name: Required. The table name on which the data masking rule + is applied. + :type table_name: str + :param column_name: Required. The column name on which the data masking + rule is applied. + :type column_name: str + :param masking_function: Required. The masking function that is used for + the data masking rule. Possible values include: 'Default', 'CCN', 'Email', + 'Number', 'SSN', 'Text' + :type masking_function: str or + ~azure.mgmt.synapse.models.DataMaskingFunction + :param number_from: The numberFrom property of the masking rule. Required + if maskingFunction is set to Number, otherwise this parameter will be + ignored. + :type number_from: str + :param number_to: The numberTo property of the data masking rule. Required + if maskingFunction is set to Number, otherwise this parameter will be + ignored. + :type number_to: str + :param prefix_size: If maskingFunction is set to Text, the number of + characters to show unmasked in the beginning of the string. Otherwise, + this parameter will be ignored. + :type prefix_size: str + :param suffix_size: If maskingFunction is set to Text, the number of + characters to show unmasked at the end of the string. Otherwise, this + parameter will be ignored. + :type suffix_size: str + :param replacement_string: If maskingFunction is set to Text, the + character to use for masking the unexposed part of the string. Otherwise, + this parameter will be ignored. + :type replacement_string: str + :ivar location: The location of the data masking rule. + :vartype location: str + :ivar kind: The kind of Data Masking Rule. Metadata, used for Azure + portal. + :vartype kind: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'data_masking_rule_id': {'readonly': True}, + 'schema_name': {'required': True}, + 'table_name': {'required': True}, + 'column_name': {'required': True}, + 'masking_function': {'required': True}, + 'location': {'readonly': True}, + 'kind': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_masking_rule_id': {'key': 'properties.id', 'type': 'str'}, + 'alias_name': {'key': 'properties.aliasName', 'type': 'str'}, + 'rule_state': {'key': 'properties.ruleState', 'type': 'DataMaskingRuleState'}, + 'schema_name': {'key': 'properties.schemaName', 'type': 'str'}, + 'table_name': {'key': 'properties.tableName', 'type': 'str'}, + 'column_name': {'key': 'properties.columnName', 'type': 'str'}, + 'masking_function': {'key': 'properties.maskingFunction', 'type': 'DataMaskingFunction'}, + 'number_from': {'key': 'properties.numberFrom', 'type': 'str'}, + 'number_to': {'key': 'properties.numberTo', 'type': 'str'}, + 'prefix_size': {'key': 'properties.prefixSize', 'type': 'str'}, + 'suffix_size': {'key': 'properties.suffixSize', 'type': 'str'}, + 'replacement_string': {'key': 'properties.replacementString', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + } + + def __init__(self, *, schema_name: str, table_name: str, column_name: str, masking_function, alias_name: str=None, rule_state=None, number_from: str=None, number_to: str=None, prefix_size: str=None, suffix_size: str=None, replacement_string: str=None, **kwargs) -> None: + super(DataMaskingRule, self).__init__(**kwargs) + self.data_masking_rule_id = None + self.alias_name = alias_name + self.rule_state = rule_state + self.schema_name = schema_name + self.table_name = table_name + self.column_name = column_name + self.masking_function = masking_function + self.number_from = number_from + self.number_to = number_to + self.prefix_size = prefix_size + self.suffix_size = suffix_size + self.replacement_string = replacement_string + self.location = None + self.kind = None + + 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 id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar active_queries_count: Count of running and suspended queries. :vartype active_queries_count: int @@ -665,6 +909,33 @@ def __init__(self, **kwargs) -> None: self.active_queries_count = None +class EncryptionDetails(Model): + """Details of the encryption associated with the workspace. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar double_encryption_enabled: Double Encryption enabled + :vartype double_encryption_enabled: bool + :param cmk: Customer Managed Key Details + :type cmk: ~azure.mgmt.synapse.models.CustomerManagedKeyDetails + """ + + _validation = { + 'double_encryption_enabled': {'readonly': True}, + } + + _attribute_map = { + 'double_encryption_enabled': {'key': 'doubleEncryptionEnabled', 'type': 'bool'}, + 'cmk': {'key': 'cmk', 'type': 'CustomerManagedKeyDetails'}, + } + + def __init__(self, *, cmk=None, **kwargs) -> None: + super(EncryptionDetails, self).__init__(**kwargs) + self.double_encryption_enabled = None + self.cmk = cmk + + class EntityReference(Model): """The entity reference. @@ -802,7 +1073,11 @@ def __init__(self, *, message: str=None, code: str=None, target: str=None, **kwa class ErrorResponse(Model): - """The resource management error response. + """Error Response. + + Common error response for all Azure Resource Manager APIs to return error + details for failed operations. (This also follows the OData error response + format.). Variables are only populated by the server, and will be ignored when sending a request. @@ -845,32 +1120,138 @@ def __init__(self, **kwargs) -> None: self.additional_info = None -class GeoBackupPolicy(ProxyResource): - """A database geo backup policy. +class ExtendedServerBlobAuditingPolicy(ProxyResource): + """An extended server blob auditing 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: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param state: Required. The state of the geo backup policy. Possible - values include: 'Disabled', 'Enabled' - :type state: str or ~azure.mgmt.synapse.models.GeoBackupPolicyState - :ivar storage_type: The storage type of the geo backup policy. - :vartype storage_type: str - :ivar kind: Kind of geo backup policy. This is metadata used for the - Azure portal experience. - :vartype kind: str - :ivar location: Backup policy location. - :vartype location: str + :param 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.synapse.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 + :param audit_actions_and_groups: Specifies the Actions-Groups and Actions + to audit. + The recommended set of action groups to use is the following combination - + this will audit all the queries and stored procedures executed against the + database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when + enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific + groups that cover your auditing needs. Using unnecessary groups could lead + to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures + executed against the database, and should not be used in combination with + other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action + Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note + that Actions cannot be specified for Server auditing policy). The + supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that in the above format can refer to an object like a + table, view, or stored procedure, or an entire database or schema. For the + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are + used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + 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. + When using REST API to configure auditing, Diagnostic Settings with + 'SQLSecurityAuditEvents' diagnostic logs category on the database should + be also created. + Note that for server level audit you should use the 'master' database as + {databaseName}. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/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_azure_monitor_target_enabled: bool + :param queue_delay_ms: Specifies the amount of time in milliseconds that + can elapse before audit actions are forced to be processed. + The default minimum value is 1000 (1 second). The maximum is + 2,147,483,647. + :type queue_delay_ms: int """ _validation = { @@ -878,43 +1259,279 @@ class GeoBackupPolicy(ProxyResource): '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'}, + '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'}, } - def __init__(self, *, state, **kwargs) -> None: - super(GeoBackupPolicy, self).__init__(**kwargs) + 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: + super(ExtendedServerBlobAuditingPolicy, self).__init__(**kwargs) + self.predicate_expression = predicate_expression self.state = state - self.storage_type = None - self.kind = None - self.location = None + 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 -class GetSsisObjectMetadataRequest(Model): - """The request payload of get SSIS object metadata. +class ExtendedSqlPoolBlobAuditingPolicy(ProxyResource): + """An extended Sql pool blob auditing policy. - :param metadata_path: Metadata path. - :type metadata_path: str - """ + Variables are only populated by the server, and will be ignored when + sending a request. - _attribute_map = { - 'metadata_path': {'key': 'metadataPath', 'type': 'str'}, - } + All required parameters must be populated in order to send to Azure. - def __init__(self, *, metadata_path: str=None, **kwargs) -> None: - super(GetSsisObjectMetadataRequest, self).__init__(**kwargs) - self.metadata_path = metadata_path + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :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.synapse.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 + :param audit_actions_and_groups: Specifies the Actions-Groups and Actions + to audit. + The recommended set of action groups to use is the following combination - + this will audit all the queries and stored procedures executed against the + database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when + enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific + groups that cover your auditing needs. Using unnecessary groups could lead + to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures + executed against the database, and should not be used in combination with + other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action + Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note + that Actions cannot be specified for Server auditing policy). The + supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that in the above format can refer to an object like a + table, view, or stored procedure, or an entire database or schema. For the + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are + used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + 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. + When using REST API to configure auditing, Diagnostic Settings with + 'SQLSecurityAuditEvents' diagnostic logs category on the database should + be also created. + Note that for server level audit you should use the 'master' database as + {databaseName}. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/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_azure_monitor_target_enabled: bool + :param queue_delay_ms: Specifies the amount of time in milliseconds that + can elapse before audit actions are forced to be processed. + 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}, + 'state': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + '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'}, + } + + 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: + super(ExtendedSqlPoolBlobAuditingPolicy, 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 + + +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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param state: Required. The state of the geo backup policy. Possible + values include: 'Disabled', 'Enabled' + :type state: str or ~azure.mgmt.synapse.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'}, + } + + def __init__(self, *, state, **kwargs) -> None: + super(GeoBackupPolicy, self).__init__(**kwargs) + self.state = state + self.storage_type = None + self.kind = None + self.location = None + + +class GetSsisObjectMetadataRequest(Model): + """The request payload of get SSIS object metadata. + + :param metadata_path: Metadata path. + :type metadata_path: str + """ + + _attribute_map = { + 'metadata_path': {'key': 'metadataPath', 'type': 'str'}, + } + + def __init__(self, *, metadata_path: str=None, **kwargs) -> None: + super(GetSsisObjectMetadataRequest, self).__init__(**kwargs) + self.metadata_path = metadata_path class IntegrationRuntime(Model): @@ -1305,13 +1922,13 @@ class SubResource(AzureEntityResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1343,13 +1960,13 @@ class IntegrationRuntimeResource(SubResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar etag: Resource Etag. :vartype etag: str @@ -1591,13 +2208,13 @@ class IpFirewallRuleInfo(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: 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 @@ -1669,6 +2286,47 @@ def __init__(self, *, end_ip_address: str=None, start_ip_address: str=None, **kw self.start_ip_address = start_ip_address +class Key(ProxyResource): + """A workspace key. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param is_active_cmk: Used to activate the workspace after a customer + managed key is provided. + :type is_active_cmk: bool + :param key_vault_url: The Key Vault Url of the workspace key. + :type key_vault_url: 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'}, + 'is_active_cmk': {'key': 'properties.isActiveCMK', 'type': 'bool'}, + 'key_vault_url': {'key': 'properties.keyVaultUrl', 'type': 'str'}, + } + + def __init__(self, *, is_active_cmk: bool=None, key_vault_url: str=None, **kwargs) -> None: + super(Key, self).__init__(**kwargs) + self.is_active_cmk = is_active_cmk + self.key_vault_url = key_vault_url + + class LibraryRequirements(Model): """Spark pool library version requirements. @@ -1875,13 +2533,13 @@ class ManagedIdentitySqlControlSettingsModel(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param grant_sql_control_to_managed_identity: Grant sql control to managed identity @@ -2189,6 +2847,32 @@ def __init__(self, *, additional_properties=None, **kwargs) -> None: self.type = 'Managed' +class ManagedVirtualNetworkSettings(Model): + """Managed Virtual Network Settings. + + :param prevent_data_exfiltration: Prevent Data Exfiltration + :type prevent_data_exfiltration: bool + :param linked_access_check_on_target_resource: Linked Access Check On + Target Resource + :type linked_access_check_on_target_resource: bool + :param allowed_aad_tenant_ids_for_linking: Allowed Aad Tenant Ids For + Linking + :type allowed_aad_tenant_ids_for_linking: list[str] + """ + + _attribute_map = { + 'prevent_data_exfiltration': {'key': 'preventDataExfiltration', 'type': 'bool'}, + 'linked_access_check_on_target_resource': {'key': 'linkedAccessCheckOnTargetResource', 'type': 'bool'}, + 'allowed_aad_tenant_ids_for_linking': {'key': 'allowedAadTenantIdsForLinking', 'type': '[str]'}, + } + + def __init__(self, *, prevent_data_exfiltration: bool=None, linked_access_check_on_target_resource: bool=None, allowed_aad_tenant_ids_for_linking=None, **kwargs) -> None: + super(ManagedVirtualNetworkSettings, self).__init__(**kwargs) + self.prevent_data_exfiltration = prevent_data_exfiltration + self.linked_access_check_on_target_resource = linked_access_check_on_target_resource + self.allowed_aad_tenant_ids_for_linking = allowed_aad_tenant_ids_for_linking + + class MetadataSyncConfig(ProxyResource): """Metadata sync configuration. @@ -2197,16 +2881,18 @@ class MetadataSyncConfig(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param enabled: Indicates whether the metadata sync is enabled or disabled :type enabled: bool + :param sync_interval_in_minutes: The Sync Interval in minutes. + :type sync_interval_in_minutes: int """ _validation = { @@ -2220,11 +2906,13 @@ class MetadataSyncConfig(ProxyResource): 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'enabled': {'key': 'properties.enabled', 'type': 'bool'}, + 'sync_interval_in_minutes': {'key': 'properties.syncIntervalInMinutes', 'type': 'int'}, } - def __init__(self, *, enabled: bool=None, **kwargs) -> None: + def __init__(self, *, enabled: bool=None, sync_interval_in_minutes: int=None, **kwargs) -> None: super(MetadataSyncConfig, self).__init__(**kwargs) self.enabled = enabled + self.sync_interval_in_minutes = sync_interval_in_minutes class OperationMetaLogSpecification(Model): @@ -2431,13 +3119,13 @@ class PrivateEndpointConnection(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param private_endpoint: The private endpoint which the connection belongs to. @@ -2474,29 +3162,115 @@ def __init__(self, *, private_endpoint=None, private_link_service_connection_sta self.provisioning_state = None -class PrivateLinkHub(TrackedResource): - """A privateLinkHub. +class PrivateEndpointConnectionForPrivateLinkHubBasic(Model): + """Private Endpoint Connection For Private Link Hub - Basic. 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: Fully qualified resource Id for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :ivar id: identifier :vartype id: str - :ivar name: The name of the resource - :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - :vartype type: str - :param tags: Resource tags. - :type tags: dict[str, str] - :param location: Required. The geo-location where the resource lives - :type location: str - :ivar provisioning_state: PrivateLinkHub provisioning state. Possible - values include: 'Succeeded', 'Failed' - :vartype provisioning_state: str or ~azure.mgmt.synapse.models.enum + :param private_endpoint: The private endpoint which the connection belongs + to. + :type private_endpoint: ~azure.mgmt.synapse.models.PrivateEndpoint + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.synapse.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: Provisioning state of the private endpoint + connection. + :vartype provisioning_state: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + } + + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, **kwargs) -> None: + super(PrivateEndpointConnectionForPrivateLinkHubBasic, self).__init__(**kwargs) + self.id = None + self.private_endpoint = private_endpoint + self.private_link_service_connection_state = private_link_service_connection_state + self.provisioning_state = None + + +class PrivateEndpointConnectionForPrivateLinkHub(PrivateEndpointConnectionForPrivateLinkHubBasic): + """PrivateEndpointConnectionForPrivateLinkHub. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: identifier + :vartype id: str + :param private_endpoint: The private endpoint which the connection belongs + to. + :type private_endpoint: ~azure.mgmt.synapse.models.PrivateEndpoint + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.synapse.models.PrivateLinkServiceConnectionState + :ivar provisioning_state: Provisioning state of the private endpoint + connection. + :vartype provisioning_state: str + :param name: + :type name: str + :param type: + :type type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_endpoint': {'key': 'properties.privateEndpoint', 'type': 'PrivateEndpoint'}, + 'private_link_service_connection_state': {'key': 'properties.privateLinkServiceConnectionState', 'type': 'PrivateLinkServiceConnectionState'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, private_endpoint=None, private_link_service_connection_state=None, name: str=None, type: str=None, **kwargs) -> None: + super(PrivateEndpointConnectionForPrivateLinkHub, self).__init__(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state, **kwargs) + self.name = name + self.type = type + + +class PrivateLinkHub(TrackedResource): + """A privateLinkHub. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: Required. The geo-location where the resource lives + :type location: str + :param provisioning_state: PrivateLinkHub provisioning state + :type provisioning_state: str + :ivar private_endpoint_connections: List of private endpoint connections + :vartype private_endpoint_connections: + list[~azure.mgmt.synapse.models.PrivateEndpointConnectionForPrivateLinkHubBasic] """ _validation = { @@ -2504,7 +3278,7 @@ class PrivateLinkHub(TrackedResource): 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, - 'provisioning_state': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, } _attribute_map = { @@ -2514,11 +3288,13 @@ class PrivateLinkHub(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnectionForPrivateLinkHubBasic]'}, } - def __init__(self, *, location: str, tags=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, provisioning_state: str=None, **kwargs) -> None: super(PrivateLinkHub, self).__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = None + self.provisioning_state = provisioning_state + self.private_endpoint_connections = None class PrivateLinkHubPatchInfo(Model): @@ -2543,13 +3319,13 @@ class PrivateLinkResource(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar properties: The private link resource properties. :vartype properties: @@ -2615,9 +3391,8 @@ class PrivateLinkServiceConnectionState(Model): Variables are only populated by the server, and will be ignored when sending a request. - :param status: The private link service connection status. Possible values - include: 'Approved', 'Pending', 'Rejected', 'Disconnected' - :type status: str or ~azure.mgmt.synapse.models.enum + :param status: The private link service connection status. + :type status: str :param description: The private link service connection description. :type description: str :ivar actions_required: The actions required for private link service @@ -2635,13 +3410,29 @@ class PrivateLinkServiceConnectionState(Model): 'actions_required': {'key': 'actionsRequired', 'type': 'str'}, } - def __init__(self, *, status=None, description: str=None, **kwargs) -> None: + def __init__(self, *, status: str=None, description: str=None, **kwargs) -> None: super(PrivateLinkServiceConnectionState, self).__init__(**kwargs) self.status = status self.description = description self.actions_required = None +class PurviewConfiguration(Model): + """Purview Configuration. + + :param purview_resource_id: Purview Resource ID + :type purview_resource_id: str + """ + + _attribute_map = { + 'purview_resource_id': {'key': 'purviewResourceId', 'type': 'str'}, + } + + def __init__(self, *, purview_resource_id: str=None, **kwargs) -> None: + super(PurviewConfiguration, self).__init__(**kwargs) + self.purview_resource_id = purview_resource_id + + class QueryInterval(Model): """A database query. @@ -2744,6 +3535,60 @@ def __init__(self, **kwargs) -> None: self.intervals = None +class RecoverableSqlPool(ProxyResource): + """A recoverable sql pool. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar edition: The edition of the database + :vartype edition: str + :ivar service_level_objective: The service level objective name of the + database + :vartype service_level_objective: str + :ivar elastic_pool_name: The elastic pool name of the database + :vartype elastic_pool_name: str + :ivar last_available_backup_date: The last available backup date of the + database (ISO8601 format) + :vartype last_available_backup_date: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'edition': {'readonly': True}, + 'service_level_objective': {'readonly': True}, + 'elastic_pool_name': {'readonly': True}, + 'last_available_backup_date': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'edition': {'key': 'properties.edition', 'type': 'str'}, + 'service_level_objective': {'key': 'properties.serviceLevelObjective', 'type': 'str'}, + 'elastic_pool_name': {'key': 'properties.elasticPoolName', 'type': 'str'}, + 'last_available_backup_date': {'key': 'properties.lastAvailableBackupDate', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(RecoverableSqlPool, self).__init__(**kwargs) + self.edition = None + self.service_level_objective = None + self.elastic_pool_name = None + self.last_available_backup_date = None + + class ReplaceAllFirewallRulesOperationResponse(Model): """An existing operation for replacing the firewall rules. @@ -2783,13 +3628,13 @@ class ReplicationLink(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar location: Location of the workspace that contains this firewall rule. @@ -2874,26 +3719,83 @@ def __init__(self, **kwargs) -> None: self.replication_state = None -class ResourceMoveDefinition(Model): - """Contains the information necessary to perform a resource move (rename). +class RestorableDroppedSqlPool(ProxyResource): + """A restorable dropped Sql pool. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. - :param id: Required. The target ID for the resource - :type id: str + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :ivar location: The geo-location where the resource lives + :vartype location: 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) + :vartype creation_date: datetime + :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) + :vartype earliest_restore_date: datetime """ _validation = { - 'id': {'required': True}, + '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}, + 'creation_date': {'readonly': True}, + 'deletion_date': {'readonly': True}, + 'earliest_restore_date': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'database_name': {'key': 'properties.databaseName', 'type': 'str'}, + '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'}, + '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, *, id: str, **kwargs) -> None: - super(ResourceMoveDefinition, self).__init__(**kwargs) - self.id = id + def __init__(self, **kwargs) -> None: + super(RestorableDroppedSqlPool, self).__init__(**kwargs) + self.location = None + self.database_name = None + self.edition = None + self.max_size_bytes = None + self.service_level_objective = None + self.elastic_pool_name = None + self.creation_date = None + self.deletion_date = None + self.earliest_restore_date = None class RestorePoint(ProxyResource): @@ -2902,13 +3804,13 @@ class RestorePoint(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar location: Resource location. :vartype location: str @@ -3026,7 +3928,7 @@ class SelfHostedIntegrationRuntime(IntegrationRuntime): :type description: str :param type: Required. Constant filled by server. :type type: str - :param linked_info: + :param linked_info: Linked integration runtime type from data factory :type linked_info: ~azure.mgmt.synapse.models.LinkedIntegrationRuntimeType """ @@ -3199,6 +4101,9 @@ class SelfHostedIntegrationRuntimeStatus(IntegrationRuntimeStatus): :vartype create_time: datetime :ivar task_queue_id: The task queue id of the integration runtime. :vartype task_queue_id: str + :ivar node_communication_channel_encryption_mode: The node communication + Channel encryption mode + :vartype node_communication_channel_encryption_mode: str :ivar internal_channel_encryption: It is used to set the encryption mode for node-node communication channel (when more than 2 self-hosted integration runtime nodes exist). Possible values include: 'NotSet', @@ -3244,122 +4149,483 @@ class SelfHostedIntegrationRuntimeStatus(IntegrationRuntimeStatus): """ _validation = { - 'data_factory_name': {'readonly': True}, - 'state': {'readonly': True}, - 'type': {'required': True}, - 'create_time': {'readonly': True}, - 'task_queue_id': {'readonly': True}, - 'internal_channel_encryption': {'readonly': True}, - 'version': {'readonly': True}, - 'scheduled_update_date': {'readonly': True}, - 'update_delay_offset': {'readonly': True}, - 'local_time_zone_offset': {'readonly': True}, - 'capabilities': {'readonly': True}, - 'service_urls': {'readonly': True}, - 'auto_update': {'readonly': True}, - 'version_status': {'readonly': True}, - 'pushed_version': {'readonly': True}, - 'latest_version': {'readonly': True}, - 'auto_update_eta': {'readonly': True}, + 'data_factory_name': {'readonly': True}, + 'state': {'readonly': True}, + 'type': {'required': True}, + 'create_time': {'readonly': True}, + 'task_queue_id': {'readonly': True}, + 'node_communication_channel_encryption_mode': {'readonly': True}, + 'internal_channel_encryption': {'readonly': True}, + 'version': {'readonly': True}, + 'scheduled_update_date': {'readonly': True}, + 'update_delay_offset': {'readonly': True}, + 'local_time_zone_offset': {'readonly': True}, + 'capabilities': {'readonly': True}, + 'service_urls': {'readonly': True}, + 'auto_update': {'readonly': True}, + 'version_status': {'readonly': True}, + 'pushed_version': {'readonly': True}, + 'latest_version': {'readonly': True}, + 'auto_update_eta': {'readonly': True}, + } + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'data_factory_name': {'key': 'dataFactoryName', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'create_time': {'key': 'typeProperties.createTime', 'type': 'iso-8601'}, + 'task_queue_id': {'key': 'typeProperties.taskQueueId', 'type': 'str'}, + 'node_communication_channel_encryption_mode': {'key': 'typeProperties.nodeCommunicationChannelEncryptionMode', 'type': 'str'}, + 'internal_channel_encryption': {'key': 'typeProperties.internalChannelEncryption', 'type': 'str'}, + 'version': {'key': 'typeProperties.version', 'type': 'str'}, + 'nodes': {'key': 'typeProperties.nodes', 'type': '[SelfHostedIntegrationRuntimeNode]'}, + 'scheduled_update_date': {'key': 'typeProperties.scheduledUpdateDate', 'type': 'iso-8601'}, + 'update_delay_offset': {'key': 'typeProperties.updateDelayOffset', 'type': 'str'}, + 'local_time_zone_offset': {'key': 'typeProperties.localTimeZoneOffset', 'type': 'str'}, + 'capabilities': {'key': 'typeProperties.capabilities', 'type': '{str}'}, + 'service_urls': {'key': 'typeProperties.serviceUrls', 'type': '[str]'}, + 'auto_update': {'key': 'typeProperties.autoUpdate', 'type': 'str'}, + 'version_status': {'key': 'typeProperties.versionStatus', 'type': 'str'}, + 'links': {'key': 'typeProperties.links', 'type': '[LinkedIntegrationRuntime]'}, + 'pushed_version': {'key': 'typeProperties.pushedVersion', 'type': 'str'}, + 'latest_version': {'key': 'typeProperties.latestVersion', 'type': 'str'}, + 'auto_update_eta': {'key': 'typeProperties.autoUpdateETA', 'type': 'iso-8601'}, + } + + def __init__(self, *, additional_properties=None, nodes=None, links=None, **kwargs) -> None: + super(SelfHostedIntegrationRuntimeStatus, self).__init__(additional_properties=additional_properties, **kwargs) + self.create_time = None + self.task_queue_id = None + self.node_communication_channel_encryption_mode = None + self.internal_channel_encryption = None + self.version = None + self.nodes = nodes + self.scheduled_update_date = None + self.update_delay_offset = None + self.local_time_zone_offset = None + self.capabilities = None + self.service_urls = None + self.auto_update = None + self.version_status = None + self.links = links + self.pushed_version = None + self.latest_version = None + self.auto_update_eta = None + self.type = 'SelfHosted' + + +class SensitivityLabel(ProxyResource): + """A sensitivity label. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param label_name: The label name. + :type label_name: str + :param label_id: The label ID. + :type label_id: str + :param information_type: The information type. + :type information_type: str + :param information_type_id: The information type ID. + :type information_type_id: str + :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for + recommended sensitivity label only. Specifies whether the sensitivity + recommendation on this column is disabled (dismissed) or not. + :vartype is_disabled: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'is_disabled': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'label_name': {'key': 'properties.labelName', 'type': 'str'}, + 'label_id': {'key': 'properties.labelId', 'type': 'str'}, + 'information_type': {'key': 'properties.informationType', 'type': 'str'}, + 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, + 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + } + + def __init__(self, *, label_name: str=None, label_id: str=None, information_type: str=None, information_type_id: str=None, **kwargs) -> None: + super(SensitivityLabel, self).__init__(**kwargs) + self.label_name = label_name + self.label_id = label_id + self.information_type = information_type + self.information_type_id = information_type_id + self.is_disabled = None + + +class ServerBlobAuditingPolicy(ProxyResource): + """A server blob auditing 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :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.synapse.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 + :param audit_actions_and_groups: Specifies the Actions-Groups and Actions + to audit. + The recommended set of action groups to use is the following combination - + this will audit all the queries and stored procedures executed against the + database, as well as successful and failed logins: + BATCH_COMPLETED_GROUP, + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP, + FAILED_DATABASE_AUTHENTICATION_GROUP. + This above combination is also the set that is configured by default when + enabling auditing from the Azure portal. + The supported action groups to audit are (note: choose only specific + groups that cover your auditing needs. Using unnecessary groups could lead + to very large quantities of audit records): + APPLICATION_ROLE_CHANGE_PASSWORD_GROUP + BACKUP_RESTORE_GROUP + DATABASE_LOGOUT_GROUP + DATABASE_OBJECT_CHANGE_GROUP + DATABASE_OBJECT_OWNERSHIP_CHANGE_GROUP + DATABASE_OBJECT_PERMISSION_CHANGE_GROUP + DATABASE_OPERATION_GROUP + DATABASE_PERMISSION_CHANGE_GROUP + DATABASE_PRINCIPAL_CHANGE_GROUP + DATABASE_PRINCIPAL_IMPERSONATION_GROUP + DATABASE_ROLE_MEMBER_CHANGE_GROUP + FAILED_DATABASE_AUTHENTICATION_GROUP + SCHEMA_OBJECT_ACCESS_GROUP + SCHEMA_OBJECT_CHANGE_GROUP + SCHEMA_OBJECT_OWNERSHIP_CHANGE_GROUP + SCHEMA_OBJECT_PERMISSION_CHANGE_GROUP + SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP + USER_CHANGE_PASSWORD_GROUP + BATCH_STARTED_GROUP + BATCH_COMPLETED_GROUP + These are groups that cover all sql statements and stored procedures + executed against the database, and should not be used in combination with + other groups as this will result in duplicate audit logs. + For more information, see [Database-Level Audit Action + Groups](https://docs.microsoft.com/en-us/sql/relational-databases/security/auditing/sql-server-audit-action-groups-and-actions#database-level-audit-action-groups). + For Database auditing policy, specific Actions can also be specified (note + that Actions cannot be specified for Server auditing policy). The + supported actions to audit are: + SELECT + UPDATE + INSERT + DELETE + EXECUTE + RECEIVE + REFERENCES + The general form for defining an action to be audited is: + {action} ON {object} BY {principal} + Note that in the above format can refer to an object like a + table, view, or stored procedure, or an entire database or schema. For the + latter cases, the forms DATABASE::{db_name} and SCHEMA::{schema_name} are + used, respectively. + For example: + SELECT on dbo.myTable by public + SELECT on DATABASE::myDatabase by public + SELECT on SCHEMA::mySchema by public + 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. + When using REST API to configure auditing, Diagnostic Settings with + 'SQLSecurityAuditEvents' diagnostic logs category on the database should + be also created. + Note that for server level audit you should use the 'master' database as + {databaseName}. + Diagnostic Settings URI format: + PUT + https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/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_azure_monitor_target_enabled: bool + :param queue_delay_ms: Specifies the amount of time in milliseconds that + can elapse before audit actions are forced to be processed. + 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}, + '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': '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'}, + } + + 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: + super(ServerBlobAuditingPolicy, self).__init__(**kwargs) + 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 + + +class ServerSecurityAlertPolicy(ProxyResource): + """Workspace managed Sql server security alert 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :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 + server. Possible values include: 'New', 'Enabled', 'Disabled' + :type state: str or ~azure.mgmt.synapse.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 + :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. + :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. + :type storage_endpoint: str + :param storage_account_access_key: Specifies the identifier key of the + 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 + :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}, + 'state': {'required': True}, + 'creation_time': {'readonly': True}, } _attribute_map = { - 'additional_properties': {'key': '', 'type': '{object}'}, - 'data_factory_name': {'key': 'dataFactoryName', 'type': 'str'}, - 'state': {'key': 'state', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'create_time': {'key': 'typeProperties.createTime', 'type': 'iso-8601'}, - 'task_queue_id': {'key': 'typeProperties.taskQueueId', 'type': 'str'}, - 'internal_channel_encryption': {'key': 'typeProperties.internalChannelEncryption', 'type': 'str'}, - 'version': {'key': 'typeProperties.version', 'type': 'str'}, - 'nodes': {'key': 'typeProperties.nodes', 'type': '[SelfHostedIntegrationRuntimeNode]'}, - 'scheduled_update_date': {'key': 'typeProperties.scheduledUpdateDate', 'type': 'iso-8601'}, - 'update_delay_offset': {'key': 'typeProperties.updateDelayOffset', 'type': 'str'}, - 'local_time_zone_offset': {'key': 'typeProperties.localTimeZoneOffset', 'type': 'str'}, - 'capabilities': {'key': 'typeProperties.capabilities', 'type': '{str}'}, - 'service_urls': {'key': 'typeProperties.serviceUrls', 'type': '[str]'}, - 'auto_update': {'key': 'typeProperties.autoUpdate', 'type': 'str'}, - 'version_status': {'key': 'typeProperties.versionStatus', 'type': 'str'}, - 'links': {'key': 'typeProperties.links', 'type': '[LinkedIntegrationRuntime]'}, - 'pushed_version': {'key': 'typeProperties.pushedVersion', 'type': 'str'}, - 'latest_version': {'key': 'typeProperties.latestVersion', 'type': 'str'}, - 'auto_update_eta': {'key': 'typeProperties.autoUpdateETA', 'type': 'iso-8601'}, + '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': 'bool'}, + 'storage_endpoint': {'key': 'properties.storageEndpoint', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'retention_days': {'key': 'properties.retentionDays', 'type': 'int'}, + 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, } - def __init__(self, *, additional_properties=None, nodes=None, links=None, **kwargs) -> None: - super(SelfHostedIntegrationRuntimeStatus, self).__init__(additional_properties=additional_properties, **kwargs) - self.create_time = None - self.task_queue_id = None - self.internal_channel_encryption = None - self.version = None - self.nodes = nodes - self.scheduled_update_date = None - self.update_delay_offset = None - self.local_time_zone_offset = None - self.capabilities = None - self.service_urls = None - self.auto_update = None - self.version_status = None - self.links = links - self.pushed_version = None - self.latest_version = None - self.auto_update_eta = None - self.type = 'SelfHosted' + 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.state = state + self.disabled_alerts = disabled_alerts + self.email_addresses = email_addresses + self.email_account_admins = email_account_admins + self.storage_endpoint = storage_endpoint + self.storage_account_access_key = storage_account_access_key + self.retention_days = retention_days + self.creation_time = None -class SensitivityLabel(ProxyResource): - """A sensitivity label. +class ServerUsage(Model): + """Represents server metrics. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the server usage metric. + :vartype name: str + :ivar resource_name: The name of the resource. + :vartype resource_name: str + :ivar display_name: The metric display name. + :vartype display_name: str + :ivar current_value: The current value of the metric. + :vartype current_value: float + :ivar limit: The current limit of the metric. + :vartype limit: float + :ivar unit: The units of the metric. + :vartype unit: str + :ivar next_reset_time: The next reset time for the metric (ISO8601 + format). + :vartype next_reset_time: datetime + """ + + _validation = { + 'name': {'readonly': True}, + 'resource_name': {'readonly': True}, + 'display_name': {'readonly': True}, + 'current_value': {'readonly': True}, + 'limit': {'readonly': True}, + 'unit': {'readonly': True}, + 'next_reset_time': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'resource_name': {'key': 'resourceName', 'type': 'str'}, + 'display_name': {'key': 'displayName', 'type': 'str'}, + 'current_value': {'key': 'currentValue', 'type': 'float'}, + 'limit': {'key': 'limit', 'type': 'float'}, + 'unit': {'key': 'unit', 'type': 'str'}, + 'next_reset_time': {'key': 'nextResetTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs) -> None: + super(ServerUsage, self).__init__(**kwargs) + self.name = None + self.resource_name = None + self.display_name = None + self.current_value = None + self.limit = None + self.unit = None + self.next_reset_time = None + + +class ServerVulnerabilityAssessment(ProxyResource): + """A server vulnerability assessment. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str - :param label_name: The label name. - :type label_name: str - :param label_id: The label ID. - :type label_id: str - :param information_type: The information type. - :type information_type: str - :param information_type_id: The information type ID. - :type information_type_id: str - :ivar is_disabled: Is sensitivity recommendation disabled. Applicable for - recommended sensitivity label only. Specifies whether the sensitivity - recommendation on this column is disabled (dismissed) or not. - :vartype is_disabled: bool + :param storage_container_path: Required. A blob storage container path to + hold the scan results (e.g. + 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. + :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 + 'StorageContainerSasKey' isn't specified, storageAccountAccessKey is + required. + :type storage_account_access_key: str + :param recurring_scans: The recurring scans settings + :type recurring_scans: + ~azure.mgmt.synapse.models.VulnerabilityAssessmentRecurringScansProperties """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'is_disabled': {'readonly': True}, + 'storage_container_path': {'required': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, - 'label_name': {'key': 'properties.labelName', 'type': 'str'}, - 'label_id': {'key': 'properties.labelId', 'type': 'str'}, - 'information_type': {'key': 'properties.informationType', 'type': 'str'}, - 'information_type_id': {'key': 'properties.informationTypeId', 'type': 'str'}, - 'is_disabled': {'key': 'properties.isDisabled', 'type': 'bool'}, + 'storage_container_path': {'key': 'properties.storageContainerPath', 'type': 'str'}, + 'storage_container_sas_key': {'key': 'properties.storageContainerSasKey', 'type': 'str'}, + 'storage_account_access_key': {'key': 'properties.storageAccountAccessKey', 'type': 'str'}, + 'recurring_scans': {'key': 'properties.recurringScans', 'type': 'VulnerabilityAssessmentRecurringScansProperties'}, } - def __init__(self, *, label_name: str=None, label_id: str=None, information_type: str=None, information_type_id: str=None, **kwargs) -> None: - super(SensitivityLabel, self).__init__(**kwargs) - self.label_name = label_name - self.label_id = label_id - self.information_type = information_type - self.information_type_id = information_type_id - self.is_disabled = None + def __init__(self, *, storage_container_path: str, storage_container_sas_key: str=None, storage_account_access_key: str=None, recurring_scans=None, **kwargs) -> None: + super(ServerVulnerabilityAssessment, self).__init__(**kwargs) + self.storage_container_path = storage_container_path + self.storage_container_sas_key = storage_container_sas_key + self.storage_account_access_key = storage_account_access_key + self.recurring_scans = recurring_scans class Sku(Model): @@ -3400,13 +4666,13 @@ class SqlPool(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -3427,7 +4693,7 @@ class SqlPool(TrackedResource): :param status: Resource status :type status: str :param restore_point_in_time: Snapshot time to restore - :type restore_point_in_time: datetime + :type restore_point_in_time: str :param create_mode: What is this? :type create_mode: str :param creation_date: Date the SQL pool was created @@ -3454,12 +4720,12 @@ class SqlPool(TrackedResource): 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'str'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, } - def __init__(self, *, location: str, tags=None, sku=None, max_size_bytes: int=None, collation: str=None, source_database_id: str=None, recoverable_database_id: str=None, provisioning_state: str=None, status: str=None, restore_point_in_time=None, create_mode: str=None, creation_date=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, sku=None, max_size_bytes: int=None, collation: str=None, source_database_id: str=None, recoverable_database_id: str=None, provisioning_state: str=None, status: str=None, restore_point_in_time: str=None, create_mode: str=None, creation_date=None, **kwargs) -> None: super(SqlPool, self).__init__(tags=tags, location=location, **kwargs) self.sku = sku self.max_size_bytes = max_size_bytes @@ -3481,13 +4747,13 @@ class SqlPoolBlobAuditingPolicy(ProxyResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar kind: Resource kind. :vartype kind: str @@ -3634,13 +4900,13 @@ class SqlPoolColumn(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param column_type: The column data type. Possible values include: 'image', 'text', 'uniqueidentifier', 'date', 'time', 'datetime2', @@ -3676,13 +4942,13 @@ class SqlPoolConnectionPolicy(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar kind: Resource kind. :vartype kind: str @@ -3747,13 +5013,13 @@ class SqlPoolOperation(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar database_name: The name of the Sql pool the operation is being performed on. @@ -3870,7 +5136,7 @@ class SqlPoolPatchInfo(Model): :param status: Resource status :type status: str :param restore_point_in_time: Snapshot time to restore - :type restore_point_in_time: datetime + :type restore_point_in_time: str :param create_mode: What is this? :type create_mode: str :param creation_date: Date the SQL pool was created @@ -3887,12 +5153,12 @@ class SqlPoolPatchInfo(Model): 'recoverable_database_id': {'key': 'properties.recoverableDatabaseId', 'type': 'str'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'status': {'key': 'properties.status', 'type': 'str'}, - 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'iso-8601'}, + 'restore_point_in_time': {'key': 'properties.restorePointInTime', 'type': 'str'}, 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'creation_date': {'key': 'properties.creationDate', 'type': 'iso-8601'}, } - def __init__(self, *, tags=None, location: str=None, sku=None, max_size_bytes: int=None, collation: str=None, source_database_id: str=None, recoverable_database_id: str=None, provisioning_state: str=None, status: str=None, restore_point_in_time=None, create_mode: str=None, creation_date=None, **kwargs) -> None: + def __init__(self, *, tags=None, location: str=None, sku=None, max_size_bytes: int=None, collation: str=None, source_database_id: str=None, recoverable_database_id: str=None, provisioning_state: str=None, status: str=None, restore_point_in_time: str=None, create_mode: str=None, creation_date=None, **kwargs) -> None: super(SqlPoolPatchInfo, self).__init__(**kwargs) self.tags = tags self.location = location @@ -3914,13 +5180,13 @@ class SqlPoolSchema(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -3948,13 +5214,13 @@ class SqlPoolSecurityAlertPolicy(ProxyResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :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 @@ -4024,13 +5290,13 @@ class SqlPoolTable(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str """ @@ -4110,13 +5376,13 @@ class SqlPoolVulnerabilityAssessment(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param storage_container_path: A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It @@ -4169,13 +5435,13 @@ class SqlPoolVulnerabilityAssessmentRuleBaseline(ProxyResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param baseline_results: Required. The rule baseline result :type baseline_results: @@ -4229,13 +5495,13 @@ class SqlPoolVulnerabilityAssessmentScansExport(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar exported_report_location: Location of the exported report (e.g. https://myStorage.blob.core.windows.net/VaScans/scans/serverName/databaseName/scan_scanId.xlsx). @@ -4741,13 +6007,13 @@ class TransparentDataEncryption(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar location: Resource location. :vartype location: str @@ -4903,13 +6169,13 @@ class VulnerabilityAssessmentScanRecord(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :ivar scan_id: The scan ID. :vartype scan_id: str @@ -4975,6 +6241,131 @@ def __init__(self, **kwargs) -> None: self.number_of_failed_security_checks = None +class WorkloadClassifier(ProxyResource): + """Workload classifier operations for a data warehouse. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param member_name: Required. The workload classifier member name. + :type member_name: str + :param label: The workload classifier label. + :type label: str + :param context: The workload classifier context. + :type context: str + :param start_time: The workload classifier start time for classification. + :type start_time: str + :param end_time: The workload classifier end time for classification. + :type end_time: str + :param importance: The workload classifier importance. + :type importance: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'member_name': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'member_name': {'key': 'properties.memberName', 'type': 'str'}, + 'label': {'key': 'properties.label', 'type': 'str'}, + 'context': {'key': 'properties.context', 'type': 'str'}, + 'start_time': {'key': 'properties.startTime', 'type': 'str'}, + 'end_time': {'key': 'properties.endTime', 'type': 'str'}, + 'importance': {'key': 'properties.importance', 'type': 'str'}, + } + + def __init__(self, *, member_name: str, label: str=None, context: str=None, start_time: str=None, end_time: str=None, importance: str=None, **kwargs) -> None: + super(WorkloadClassifier, self).__init__(**kwargs) + self.member_name = member_name + self.label = label + self.context = context + self.start_time = start_time + self.end_time = end_time + self.importance = importance + + +class WorkloadGroup(ProxyResource): + """Workload group operations for a sql pool. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + :vartype type: str + :param min_resource_percent: Required. The workload group minimum + percentage resource. + :type min_resource_percent: int + :param max_resource_percent: Required. The workload group cap percentage + resource. + :type max_resource_percent: int + :param min_resource_percent_per_request: Required. The workload group + request minimum grant percentage. + :type min_resource_percent_per_request: float + :param max_resource_percent_per_request: The workload group request + maximum grant percentage. + :type max_resource_percent_per_request: float + :param importance: The workload group importance level. + :type importance: str + :param query_execution_timeout: The workload group query execution + timeout. + :type query_execution_timeout: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'min_resource_percent': {'required': True}, + 'max_resource_percent': {'required': True}, + 'min_resource_percent_per_request': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'min_resource_percent': {'key': 'properties.minResourcePercent', 'type': 'int'}, + 'max_resource_percent': {'key': 'properties.maxResourcePercent', 'type': 'int'}, + 'min_resource_percent_per_request': {'key': 'properties.minResourcePercentPerRequest', 'type': 'float'}, + 'max_resource_percent_per_request': {'key': 'properties.maxResourcePercentPerRequest', 'type': 'float'}, + 'importance': {'key': 'properties.importance', 'type': 'str'}, + 'query_execution_timeout': {'key': 'properties.queryExecutionTimeout', 'type': 'int'}, + } + + def __init__(self, *, min_resource_percent: int, max_resource_percent: int, min_resource_percent_per_request: float, max_resource_percent_per_request: float=None, importance: str=None, query_execution_timeout: int=None, **kwargs) -> None: + super(WorkloadGroup, self).__init__(**kwargs) + self.min_resource_percent = min_resource_percent + self.max_resource_percent = max_resource_percent + self.min_resource_percent_per_request = min_resource_percent_per_request + self.max_resource_percent_per_request = max_resource_percent_per_request + self.importance = importance + self.query_execution_timeout = query_execution_timeout + + class Workspace(TrackedResource): """A workspace. @@ -4983,13 +6374,13 @@ class Workspace(TrackedResource): All required parameters must be populated in order to send to Azure. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tags: Resource tags. :type tags: dict[str, str] @@ -5026,8 +6417,21 @@ class Workspace(TrackedResource): workspace :type private_endpoint_connections: list[~azure.mgmt.synapse.models.PrivateEndpointConnection] + :param encryption: The encryption details of the workspace + :type encryption: ~azure.mgmt.synapse.models.EncryptionDetails + :ivar workspace_uid: The workspace unique identifier + :vartype workspace_uid: str :ivar extra_properties: Workspace level configs and feature flags :vartype extra_properties: dict[str, object] + :param managed_virtual_network_settings: Managed Virtual Network Settings + :type managed_virtual_network_settings: + ~azure.mgmt.synapse.models.ManagedVirtualNetworkSettings + :param workspace_repository_configuration: Git integration settings + :type workspace_repository_configuration: + ~azure.mgmt.synapse.models.WorkspaceRepositoryConfiguration + :param purview_configuration: Purview Configuration + :type purview_configuration: + ~azure.mgmt.synapse.models.PurviewConfiguration :param identity: Identity of the workspace :type identity: ~azure.mgmt.synapse.models.ManagedIdentity """ @@ -5038,6 +6442,7 @@ class Workspace(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, + 'workspace_uid': {'readonly': True}, 'extra_properties': {'readonly': True}, } @@ -5056,11 +6461,16 @@ class Workspace(TrackedResource): 'connectivity_endpoints': {'key': 'properties.connectivityEndpoints', 'type': '{str}'}, 'managed_virtual_network': {'key': 'properties.managedVirtualNetwork', 'type': 'str'}, 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'encryption': {'key': 'properties.encryption', 'type': 'EncryptionDetails'}, + 'workspace_uid': {'key': 'properties.workspaceUID', 'type': 'str'}, 'extra_properties': {'key': 'properties.extraProperties', 'type': '{object}'}, + 'managed_virtual_network_settings': {'key': 'properties.managedVirtualNetworkSettings', 'type': 'ManagedVirtualNetworkSettings'}, + 'workspace_repository_configuration': {'key': 'properties.workspaceRepositoryConfiguration', 'type': 'WorkspaceRepositoryConfiguration'}, + 'purview_configuration': {'key': 'properties.purviewConfiguration', 'type': 'PurviewConfiguration'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, } - def __init__(self, *, location: str, tags=None, default_data_lake_storage=None, sql_administrator_login_password: str=None, managed_resource_group_name: str=None, sql_administrator_login: str=None, virtual_network_profile=None, connectivity_endpoints=None, managed_virtual_network: str=None, private_endpoint_connections=None, identity=None, **kwargs) -> None: + def __init__(self, *, location: str, tags=None, default_data_lake_storage=None, sql_administrator_login_password: str=None, managed_resource_group_name: str=None, sql_administrator_login: str=None, virtual_network_profile=None, connectivity_endpoints=None, managed_virtual_network: str=None, private_endpoint_connections=None, encryption=None, managed_virtual_network_settings=None, workspace_repository_configuration=None, purview_configuration=None, identity=None, **kwargs) -> None: super(Workspace, self).__init__(tags=tags, location=location, **kwargs) self.default_data_lake_storage = default_data_lake_storage self.sql_administrator_login_password = sql_administrator_login_password @@ -5071,7 +6481,12 @@ def __init__(self, *, location: str, tags=None, default_data_lake_storage=None, self.connectivity_endpoints = connectivity_endpoints self.managed_virtual_network = managed_virtual_network self.private_endpoint_connections = private_endpoint_connections + self.encryption = encryption + self.workspace_uid = None self.extra_properties = None + self.managed_virtual_network_settings = managed_virtual_network_settings + self.workspace_repository_configuration = workspace_repository_configuration + self.purview_configuration = purview_configuration self.identity = identity @@ -5081,13 +6496,13 @@ class WorkspaceAadAdminInfo(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource Id for the resource. Ex - + :ivar id: Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} :vartype id: str :ivar name: The name of the resource :vartype name: str - :ivar type: The type of the resource. Ex- - Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + :ivar type: The type of the resource. E.g. + "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" :vartype type: str :param tenant_id: Tenant ID of the workspace active directory administrator @@ -5124,6 +6539,26 @@ def __init__(self, *, tenant_id: str=None, login: str=None, administrator_type: self.sid = sid +class WorkspaceKeyDetails(Model): + """Details of the customer managed key associated with the workspace. + + :param name: Workspace Key sub-resource name + :type name: str + :param key_vault_url: Workspace Key sub-resource key vault url + :type key_vault_url: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'key_vault_url': {'key': 'keyVaultUrl', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, key_vault_url: str=None, **kwargs) -> None: + super(WorkspaceKeyDetails, self).__init__(**kwargs) + self.name = name + self.key_vault_url = key_vault_url + + class WorkspacePatchInfo(Model): """Workspace patch details. @@ -5136,6 +6571,15 @@ class WorkspacePatchInfo(Model): :type identity: ~azure.mgmt.synapse.models.ManagedIdentity :param sql_administrator_login_password: SQL administrator login password :type sql_administrator_login_password: str + :param managed_virtual_network_settings: Managed Virtual Network Settings + :type managed_virtual_network_settings: + ~azure.mgmt.synapse.models.ManagedVirtualNetworkSettings + :param workspace_repository_configuration: Git integration settings + :type workspace_repository_configuration: + ~azure.mgmt.synapse.models.WorkspaceRepositoryConfiguration + :param purview_configuration: Purview Configuration + :type purview_configuration: + ~azure.mgmt.synapse.models.PurviewConfiguration :ivar provisioning_state: Resource provisioning state :vartype provisioning_state: str """ @@ -5148,12 +6592,60 @@ class WorkspacePatchInfo(Model): 'tags': {'key': 'tags', 'type': '{str}'}, 'identity': {'key': 'identity', 'type': 'ManagedIdentity'}, 'sql_administrator_login_password': {'key': 'properties.sqlAdministratorLoginPassword', 'type': 'str'}, + 'managed_virtual_network_settings': {'key': 'properties.managedVirtualNetworkSettings', 'type': 'ManagedVirtualNetworkSettings'}, + 'workspace_repository_configuration': {'key': 'properties.workspaceRepositoryConfiguration', 'type': 'WorkspaceRepositoryConfiguration'}, + 'purview_configuration': {'key': 'properties.purviewConfiguration', 'type': 'PurviewConfiguration'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, } - def __init__(self, *, tags=None, identity=None, sql_administrator_login_password: str=None, **kwargs) -> None: + def __init__(self, *, tags=None, identity=None, sql_administrator_login_password: str=None, managed_virtual_network_settings=None, workspace_repository_configuration=None, purview_configuration=None, **kwargs) -> None: super(WorkspacePatchInfo, self).__init__(**kwargs) self.tags = tags self.identity = identity self.sql_administrator_login_password = sql_administrator_login_password + self.managed_virtual_network_settings = managed_virtual_network_settings + self.workspace_repository_configuration = workspace_repository_configuration + self.purview_configuration = purview_configuration self.provisioning_state = None + + +class WorkspaceRepositoryConfiguration(Model): + """Git integration settings. + + :param type: Type of workspace repositoryID configuration. Example + WorkspaceVSTSConfiguration, WorkspaceGitHubConfiguration + :type type: str + :param host_name: GitHub Enterprise host name. For example: + https://github.mydomain.com + :type host_name: str + :param account_name: Account name + :type account_name: str + :param project_name: VSTS project name + :type project_name: str + :param repository_name: Repository name + :type repository_name: str + :param collaboration_branch: Collaboration branch + :type collaboration_branch: str + :param root_folder: Root folder to use in the repository + :type root_folder: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'host_name': {'key': 'hostName', 'type': 'str'}, + 'account_name': {'key': 'accountName', 'type': 'str'}, + 'project_name': {'key': 'projectName', 'type': 'str'}, + 'repository_name': {'key': 'repositoryName', 'type': 'str'}, + 'collaboration_branch': {'key': 'collaborationBranch', 'type': 'str'}, + 'root_folder': {'key': 'rootFolder', 'type': 'str'}, + } + + def __init__(self, *, type: str=None, host_name: str=None, account_name: str=None, project_name: str=None, repository_name: str=None, collaboration_branch: str=None, root_folder: str=None, **kwargs) -> None: + super(WorkspaceRepositoryConfiguration, self).__init__(**kwargs) + self.type = type + self.host_name = host_name + self.account_name = account_name + self.project_name = project_name + self.repository_name = repository_name + self.collaboration_branch = collaboration_branch + self.root_folder = root_folder diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_paged_models.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_paged_models.py index 707152412f3b..986b268c2818 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_paged_models.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_paged_models.py @@ -51,6 +51,19 @@ class SqlPoolPaged(Paged): def __init__(self, *args, **kwargs): super(SqlPoolPaged, self).__init__(*args, **kwargs) +class GeoBackupPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`GeoBackupPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[GeoBackupPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(GeoBackupPolicyPaged, self).__init__(*args, **kwargs) class RestorePointPaged(Paged): """ A paging container for iterating over a list of :class:`RestorePoint ` object @@ -77,6 +90,32 @@ class ReplicationLinkPaged(Paged): def __init__(self, *args, **kwargs): super(ReplicationLinkPaged, self).__init__(*args, **kwargs) +class TransparentDataEncryptionPaged(Paged): + """ + A paging container for iterating over a list of :class:`TransparentDataEncryption ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[TransparentDataEncryption]'} + } + + def __init__(self, *args, **kwargs): + + super(TransparentDataEncryptionPaged, self).__init__(*args, **kwargs) +class SqlPoolBlobAuditingPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`SqlPoolBlobAuditingPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SqlPoolBlobAuditingPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(SqlPoolBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) class SqlPoolOperationPaged(Paged): """ A paging container for iterating over a list of :class:`SqlPoolOperation ` object @@ -181,6 +220,71 @@ class VulnerabilityAssessmentScanRecordPaged(Paged): def __init__(self, *args, **kwargs): super(VulnerabilityAssessmentScanRecordPaged, self).__init__(*args, **kwargs) +class SqlPoolSecurityAlertPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`SqlPoolSecurityAlertPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[SqlPoolSecurityAlertPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(SqlPoolSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class ExtendedSqlPoolBlobAuditingPolicyPaged(Paged): + """ + A paging container for iterating over a list of :class:`ExtendedSqlPoolBlobAuditingPolicy ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ExtendedSqlPoolBlobAuditingPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ExtendedSqlPoolBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class DataMaskingRulePaged(Paged): + """ + A paging container for iterating over a list of :class:`DataMaskingRule ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataMaskingRule]'} + } + + def __init__(self, *args, **kwargs): + + super(DataMaskingRulePaged, self).__init__(*args, **kwargs) +class WorkloadGroupPaged(Paged): + """ + 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': '[WorkloadGroup]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadGroupPaged, self).__init__(*args, **kwargs) +class WorkloadClassifierPaged(Paged): + """ + 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': '[WorkloadClassifier]'} + } + + def __init__(self, *args, **kwargs): + + super(WorkloadClassifierPaged, self).__init__(*args, **kwargs) class WorkspacePaged(Paged): """ A paging container for iterating over a list of :class:`Workspace ` object @@ -194,6 +298,19 @@ class WorkspacePaged(Paged): def __init__(self, *args, **kwargs): super(WorkspacePaged, self).__init__(*args, **kwargs) +class RestorableDroppedSqlPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`RestorableDroppedSqlPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RestorableDroppedSqlPool]'} + } + + def __init__(self, *args, **kwargs): + + super(RestorableDroppedSqlPoolPaged, self).__init__(*args, **kwargs) class IntegrationRuntimeResourcePaged(Paged): """ A paging container for iterating over a list of :class:`IntegrationRuntimeResource ` object @@ -246,3 +363,107 @@ class PrivateLinkHubPaged(Paged): def __init__(self, *args, **kwargs): super(PrivateLinkHubPaged, self).__init__(*args, **kwargs) +class PrivateEndpointConnectionForPrivateLinkHubPaged(Paged): + """ + A paging container for iterating over a list of :class:`PrivateEndpointConnectionForPrivateLinkHub ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PrivateEndpointConnectionForPrivateLinkHub]'} + } + + def __init__(self, *args, **kwargs): + + super(PrivateEndpointConnectionForPrivateLinkHubPaged, self).__init__(*args, **kwargs) +class ServerBlobAuditingPolicyPaged(Paged): + """ + 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': '[ServerBlobAuditingPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class ExtendedServerBlobAuditingPolicyPaged(Paged): + """ + 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': '[ExtendedServerBlobAuditingPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ExtendedServerBlobAuditingPolicyPaged, self).__init__(*args, **kwargs) +class ServerSecurityAlertPolicyPaged(Paged): + """ + 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': '[ServerSecurityAlertPolicy]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerSecurityAlertPolicyPaged, self).__init__(*args, **kwargs) +class ServerVulnerabilityAssessmentPaged(Paged): + """ + 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': '[ServerVulnerabilityAssessment]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerVulnerabilityAssessmentPaged, self).__init__(*args, **kwargs) +class ServerUsagePaged(Paged): + """ + A paging container for iterating over a list of :class:`ServerUsage ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ServerUsage]'} + } + + def __init__(self, *args, **kwargs): + + super(ServerUsagePaged, self).__init__(*args, **kwargs) +class RecoverableSqlPoolPaged(Paged): + """ + A paging container for iterating over a list of :class:`RecoverableSqlPool ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[RecoverableSqlPool]'} + } + + def __init__(self, *args, **kwargs): + + super(RecoverableSqlPoolPaged, self).__init__(*args, **kwargs) +class KeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`Key ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Key]'} + } + + def __init__(self, *args, **kwargs): + + super(KeyPaged, self).__init__(*args, **kwargs) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py index 1f354d19a474..79dd8590ba62 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/models/_synapse_management_client_enums.py @@ -20,6 +20,7 @@ class NodeSize(str, Enum): large = "Large" xlarge = "XLarge" xx_large = "XXLarge" + xxx_large = "XXXLarge" class NodeSizeFamily(str, Enum): @@ -188,6 +189,28 @@ class SecurityAlertPolicyState(str, Enum): disabled = "Disabled" +class DataMaskingState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class DataMaskingRuleState(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + + +class DataMaskingFunction(str, Enum): + + default = "Default" + ccn = "CCN" + email = "Email" + number = "Number" + ssn = "SSN" + text = "Text" + + class ResourceIdentityType(str, Enum): none = "None" @@ -300,6 +323,12 @@ class SsisObjectMetadataType(str, Enum): environment = "Environment" +class SensitivityLabelSource(str, Enum): + + current = "current" + recommended = "recommended" + + class VulnerabilityAssessmentPolicyBaselineName(str, Enum): master = "master" diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py index 5c164434e399..b9da72420977 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/__init__.py @@ -32,9 +32,17 @@ from ._sql_pool_vulnerability_assessment_scans_operations import SqlPoolVulnerabilityAssessmentScansOperations from ._sql_pool_security_alert_policies_operations import SqlPoolSecurityAlertPoliciesOperations from ._sql_pool_vulnerability_assessment_rule_baselines_operations import SqlPoolVulnerabilityAssessmentRuleBaselinesOperations +from ._extended_sql_pool_blob_auditing_policies_operations import ExtendedSqlPoolBlobAuditingPoliciesOperations +from ._data_masking_policies_operations import DataMaskingPoliciesOperations +from ._data_masking_rules_operations import DataMaskingRulesOperations +from ._sql_pool_columns_operations import SqlPoolColumnsOperations +from ._sql_pool_workload_group_operations import SqlPoolWorkloadGroupOperations +from ._sql_pool_workload_classifier_operations import SqlPoolWorkloadClassifierOperations from ._workspaces_operations import WorkspacesOperations from ._workspace_aad_admins_operations import WorkspaceAadAdminsOperations +from ._workspace_sql_aad_admins_operations import WorkspaceSqlAadAdminsOperations from ._workspace_managed_identity_sql_control_settings_operations import WorkspaceManagedIdentitySqlControlSettingsOperations +from ._restorable_dropped_sql_pools_operations import RestorableDroppedSqlPoolsOperations from ._integration_runtimes_operations import IntegrationRuntimesOperations from ._integration_runtime_node_ip_address_operations import IntegrationRuntimeNodeIpAddressOperations from ._integration_runtime_object_metadata_operations import IntegrationRuntimeObjectMetadataOperations @@ -47,6 +55,14 @@ from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_hubs_operations import PrivateLinkHubsOperations +from ._private_endpoint_connections_private_link_hub_operations import PrivateEndpointConnectionsPrivateLinkHubOperations +from ._workspace_managed_sql_server_blob_auditing_policies_operations import WorkspaceManagedSqlServerBlobAuditingPoliciesOperations +from ._workspace_managed_sql_server_extended_blob_auditing_policies_operations import WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations +from ._workspace_managed_sql_server_security_alert_policy_operations import WorkspaceManagedSqlServerSecurityAlertPolicyOperations +from ._workspace_managed_sql_server_vulnerability_assessments_operations import WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations +from ._workspace_managed_sql_server_usages_operations import WorkspaceManagedSqlServerUsagesOperations +from ._workspace_managed_sql_server_recoverable_sqlpools_operations import WorkspaceManagedSqlServerRecoverableSqlpoolsOperations +from ._keys_operations import KeysOperations __all__ = [ 'BigDataPoolsOperations', @@ -72,9 +88,17 @@ 'SqlPoolVulnerabilityAssessmentScansOperations', 'SqlPoolSecurityAlertPoliciesOperations', 'SqlPoolVulnerabilityAssessmentRuleBaselinesOperations', + 'ExtendedSqlPoolBlobAuditingPoliciesOperations', + 'DataMaskingPoliciesOperations', + 'DataMaskingRulesOperations', + 'SqlPoolColumnsOperations', + 'SqlPoolWorkloadGroupOperations', + 'SqlPoolWorkloadClassifierOperations', 'WorkspacesOperations', 'WorkspaceAadAdminsOperations', + 'WorkspaceSqlAadAdminsOperations', 'WorkspaceManagedIdentitySqlControlSettingsOperations', + 'RestorableDroppedSqlPoolsOperations', 'IntegrationRuntimesOperations', 'IntegrationRuntimeNodeIpAddressOperations', 'IntegrationRuntimeObjectMetadataOperations', @@ -87,4 +111,12 @@ 'PrivateLinkResourcesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkHubsOperations', + 'PrivateEndpointConnectionsPrivateLinkHubOperations', + 'WorkspaceManagedSqlServerBlobAuditingPoliciesOperations', + 'WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations', + 'WorkspaceManagedSqlServerSecurityAlertPolicyOperations', + 'WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations', + 'WorkspaceManagedSqlServerUsagesOperations', + 'WorkspaceManagedSqlServerRecoverableSqlpoolsOperations', + 'KeysOperations', ] diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_big_data_pools_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_big_data_pools_operations.py index 026fb9921e96..9a98a9b674e2 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_big_data_pools_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_big_data_pools_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -413,7 +412,8 @@ def list_by_workspace( :return: An iterator like instance of BigDataPoolResourceInfo :rtype: ~azure.mgmt.synapse.models.BigDataPoolResourceInfoPaged[~azure.mgmt.synapse.models.BigDataPoolResourceInfo] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -454,9 +454,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_policies_operations.py new file mode 100644 index 000000000000..36324449ef68 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_policies_operations.py @@ -0,0 +1,189 @@ +# 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 DataMaskingPoliciesOperations(object): + """DataMaskingPoliciesOperations 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 this operation. Constant value: "2019-06-01-preview". + :ivar data_masking_policy_name: The name of the data masking policy for which the masking rule applies. Constant value: "Default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + self.data_masking_policy_name = "Default" + + self.config = config + + def create_or_update( + self, resource_group_name, workspace_name, sql_pool_name, data_masking_state, exempt_principals=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a Sql pool data masking policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param data_masking_state: The state of the data masking policy. + Possible values include: 'Disabled', 'Enabled' + :type data_masking_state: str or + ~azure.mgmt.synapse.models.DataMaskingState + :param exempt_principals: The list of the exempt principals. Specifies + the semicolon-separated list of database users for which the data + masking policy does not apply. The specified users receive data + results without masking for all of the database queries. + :type exempt_principals: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DataMaskingPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.DataMaskingPolicy or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + parameters = models.DataMaskingPolicy(data_masking_state=data_masking_state, exempt_principals=exempt_principals) + + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_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', min_length=1) + + # 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, 'DataMaskingPolicy') + + # 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]: + 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('DataMaskingPolicy', 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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}'} + + def get( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets a Sql pool data masking policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DataMaskingPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.DataMaskingPolicy 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_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', min_length=1) + + # 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('DataMaskingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_rules_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_rules_operations.py new file mode 100644 index 000000000000..29593198a344 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_data_masking_rules_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 DataMaskingRulesOperations(object): + """DataMaskingRulesOperations 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 this operation. Constant value: "2019-06-01-preview". + :ivar data_masking_policy_name: The name of the data masking policy for which the masking rule applies. Constant value: "Default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + self.data_masking_policy_name = "Default" + + self.config = config + + def create_or_update( + self, resource_group_name, workspace_name, sql_pool_name, data_masking_rule_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates a Sql pool data masking rule. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param data_masking_rule_name: The name of the data masking rule. + :type data_masking_rule_name: str + :param parameters: The required parameters for creating or updating a + data masking rule. + :type parameters: ~azure.mgmt.synapse.models.DataMaskingRule + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: DataMaskingRule or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.DataMaskingRule or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_name, 'str'), + 'dataMaskingRuleName': self._serialize.url("data_masking_rule_name", data_masking_rule_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'DataMaskingRule') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('DataMaskingRule', response) + if response.status_code == 201: + deserialized = self._deserialize('DataMaskingRule', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}'} + + def list_by_sql_pool( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of Sql pool data masking rules. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of DataMaskingRule + :rtype: + ~azure.mgmt.synapse.models.DataMaskingRulePaged[~azure.mgmt.synapse.models.DataMaskingRule] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_sql_pool.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'dataMaskingPolicyName': self._serialize.url("self.data_masking_policy_name", self.data_masking_policy_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', min_length=1) + + 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.DataMaskingRulePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_sql_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_extended_sql_pool_blob_auditing_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_extended_sql_pool_blob_auditing_policies_operations.py new file mode 100644 index 000000000000..9e7ddf27809f --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_extended_sql_pool_blob_auditing_policies_operations.py @@ -0,0 +1,262 @@ +# 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 ExtendedSqlPoolBlobAuditingPoliciesOperations(object): + """ExtendedSqlPoolBlobAuditingPoliciesOperations 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 this operation. Constant value: "2019-06-01-preview". + :ivar blob_auditing_policy_name: The name of the blob auditing policy. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + self.blob_auditing_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """Gets an extended Sql pool's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: ExtendedSqlPoolBlobAuditingPolicy or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.synapse.models.ExtendedSqlPoolBlobAuditingPolicy + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'blobAuditingPolicyName': self._serialize.url("self.blob_auditing_policy_name", self.blob_auditing_policy_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', min_length=1) + + # 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('ExtendedSqlPoolBlobAuditingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}'} + + def create_or_update( + self, resource_group_name, workspace_name, sql_pool_name, parameters, custom_headers=None, raw=False, **operation_config): + """Creates or updates an extended Sql pool's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param parameters: The extended Sql pool blob auditing policy. + :type parameters: + ~azure.mgmt.synapse.models.ExtendedSqlPoolBlobAuditingPolicy + :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: ExtendedSqlPoolBlobAuditingPolicy or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.synapse.models.ExtendedSqlPoolBlobAuditingPolicy + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'blobAuditingPolicyName': self._serialize.url("self.blob_auditing_policy_name", self.blob_auditing_policy_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', min_length=1) + + # 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, 'ExtendedSqlPoolBlobAuditingPolicy') + + # 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('ExtendedSqlPoolBlobAuditingPolicy', response) + if response.status_code == 201: + deserialized = self._deserialize('ExtendedSqlPoolBlobAuditingPolicy', 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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings/{blobAuditingPolicyName}'} + + def list_by_sql_pool( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """Lists extended auditing settings of a Sql pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of + ExtendedSqlPoolBlobAuditingPolicy + :rtype: + ~azure.mgmt.synapse.models.ExtendedSqlPoolBlobAuditingPolicyPaged[~azure.mgmt.synapse.models.ExtendedSqlPoolBlobAuditingPolicy] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_sql_pool.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_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', min_length=1) + + 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.ExtendedSqlPoolBlobAuditingPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_sql_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/extendedAuditingSettings'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_auth_keys_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_auth_keys_operations.py index 725ceabcb757..e5cd1f383799 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_auth_keys_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_auth_keys_operations.py @@ -48,7 +48,7 @@ def regenerate( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -125,7 +125,7 @@ def list( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_connection_infos_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_connection_infos_operations.py index 46d62e192ac0..11a08a6d202a 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_connection_infos_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_connection_infos_operations.py @@ -48,7 +48,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_credentials_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_credentials_operations.py index 0f0474d8ed7d..cdc6f4b9bed1 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_credentials_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_credentials_operations.py @@ -53,7 +53,7 @@ def sync( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_monitoring_data_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_monitoring_data_operations.py index a4d5954ce6f8..64b03baa3d6a 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_monitoring_data_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_monitoring_data_operations.py @@ -39,7 +39,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( + def list( self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): """Get integration runtime monitoring data. @@ -48,7 +48,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -64,7 +64,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = self.get.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -105,4 +105,4 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/monitoringData'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/monitoringData'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_node_ip_address_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_node_ip_address_operations.py index 215358348791..24f1be141338 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_node_ip_address_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_node_ip_address_operations.py @@ -48,7 +48,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_nodes_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_nodes_operations.py index 11f3e5b35592..23a9e3e2b06a 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_nodes_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_nodes_operations.py @@ -48,7 +48,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -119,7 +119,7 @@ def update( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -200,7 +200,7 @@ def delete( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_object_metadata_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_object_metadata_operations.py index 602073bd237e..e8f2b2b79f8b 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_object_metadata_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_object_metadata_operations.py @@ -12,6 +12,8 @@ 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 @@ -39,7 +41,7 @@ def __init__(self, client, config, serializer, deserializer): self.config = config - def get( + def list( self, resource_group_name, workspace_name, integration_runtime_name, metadata_path=None, custom_headers=None, raw=False, **operation_config): """Get integration runtime object metadata. @@ -48,7 +50,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -70,7 +72,7 @@ def get( get_metadata_request = models.GetSsisObjectMetadataRequest(metadata_path=metadata_path) # Construct URL - url = self.get.metadata['url'] + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -118,32 +120,11 @@ def get( return client_raw_response return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/getObjectMetadata'} + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/getObjectMetadata'} - def refresh( - self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): - """Refresh integration runtime object metadata. - Refresh the object metadata in an integration runtime. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace - :type workspace_name: str - :param integration_runtime_name: Integration runtime name - :type integration_runtime_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: SsisObjectMetadataStatusResponse or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.synapse.models.SsisObjectMetadataStatusResponse or - ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` - """ + def _refresh_initial( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.refresh.metadata['url'] path_format_arguments = { @@ -178,6 +159,7 @@ def refresh( raise exp deserialized = None + if response.status_code == 200: deserialized = self._deserialize('SsisObjectMetadataStatusResponse', response) @@ -186,4 +168,57 @@ def refresh( return client_raw_response return deserialized + + def refresh( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Refresh integration runtime object metadata. + + Refresh the object metadata in an integration runtime. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param integration_runtime_name: Integration runtime name + :type integration_runtime_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 + SsisObjectMetadataStatusResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.SsisObjectMetadataStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.SsisObjectMetadataStatusResponse]] + :raises: :class:`CloudError` + """ + raw_result = self._refresh_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + integration_runtime_name=integration_runtime_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('SsisObjectMetadataStatusResponse', 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) refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/refreshObjectMetadata'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_status_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_status_operations.py index 23519d2bd008..383bdc34fe84 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_status_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtime_status_operations.py @@ -48,7 +48,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py index a62304fb3fac..ebf248c486e5 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_integration_runtimes_operations.py @@ -50,7 +50,7 @@ def update( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -133,7 +133,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -261,7 +261,7 @@ def create( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -362,7 +362,7 @@ def delete( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -409,7 +409,7 @@ def upgrade( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_name: str @@ -468,7 +468,7 @@ def list_by_workspace( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -534,8 +534,55 @@ def internal_paging(next_link=None): return deserialized list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes'} - def start( + + def _start_initial( self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.start.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_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', min_length=1) + + # 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('IntegrationRuntimeStatusResponse', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def start( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, polling=True, **operation_config): """Start integration runtime. Start an integration runtime. @@ -543,23 +590,56 @@ def start( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_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: IntegrationRuntimeStatusResponse or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.synapse.models.IntegrationRuntimeStatusResponse or - ~msrest.pipeline.ClientRawResponse + :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 + IntegrationRuntimeStatusResponse or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.IntegrationRuntimeStatusResponse] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.IntegrationRuntimeStatusResponse]] :raises: :class:`CloudError` """ + raw_result = self._start_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + integration_runtime_name=integration_runtime_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('IntegrationRuntimeStatusResponse', 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) + start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/start'} + + + def _stop_initial( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.start.metadata['url'] + url = self.stop.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -574,7 +654,6 @@ def start( # 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: @@ -591,19 +670,12 @@ def start( exp.request_id = response.headers.get('x-ms-request-id') raise exp - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('IntegrationRuntimeStatusResponse', response) - if raw: - client_raw_response = ClientRawResponse(deserialized, response) + client_raw_response = ClientRawResponse(None, response) return client_raw_response - return deserialized - start.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/start'} - def stop( - self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, polling=True, **operation_config): """Stop integration runtime. Stop an integration runtime. @@ -611,21 +683,49 @@ def stop( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param integration_runtime_name: Integration runtime name :type integration_runtime_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 + :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._stop_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + integration_runtime_name=integration_runtime_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) + stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/stop'} + + + def _enable_interactive_query_initial( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): # Construct URL - url = self.stop.metadata['url'] + url = self.enable_interactive_query.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), @@ -659,4 +759,132 @@ def stop( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - stop.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/stop'} + + def enable_interactive_query( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Enable interactive query in integration runtime. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param integration_runtime_name: Integration runtime name + :type integration_runtime_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._enable_interactive_query_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + integration_runtime_name=integration_runtime_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) + enable_interactive_query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/enableInteractiveQuery'} + + + def _disable_interactive_query_initial( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.disable_interactive_query.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'integrationRuntimeName': self._serialize.url("integration_runtime_name", integration_runtime_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', min_length=1) + + # 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 disable_interactive_query( + self, resource_group_name, workspace_name, integration_runtime_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Disable interactive query in integration runtime. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace. + :type workspace_name: str + :param integration_runtime_name: Integration runtime name + :type integration_runtime_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._disable_interactive_query_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + integration_runtime_name=integration_runtime_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) + disable_interactive_query.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/disableInteractiveQuery'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_ip_firewall_rules_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_ip_firewall_rules_operations.py index 4a29b0e7bea0..600af9a1bde0 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_ip_firewall_rules_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_ip_firewall_rules_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -58,7 +57,8 @@ def list_by_workspace( :return: An iterator like instance of IpFirewallRuleInfo :rtype: ~azure.mgmt.synapse.models.IpFirewallRuleInfoPaged[~azure.mgmt.synapse.models.IpFirewallRuleInfo] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -99,9 +99,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -259,9 +257,7 @@ def _delete_initial( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None @@ -294,7 +290,8 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_keys_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_keys_operations.py new file mode 100644 index 000000000000..98dec25566de --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_keys_operations.py @@ -0,0 +1,314 @@ +# 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 .. import models + + +class KeysOperations(object): + """KeysOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def list_by_workspace( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Returns a list of keys in a workspace. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 Key + :rtype: + ~azure.mgmt.synapse.models.KeyPaged[~azure.mgmt.synapse.models.Key] + :raises: + :class:`ErrorContractException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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]: + raise models.ErrorContractException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.KeyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys'} + + def get( + self, resource_group_name, workspace_name, key_name, custom_headers=None, raw=False, **operation_config): + """Gets a workspace key. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param key_name: The name of the workspace key + :type key_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: Key or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.Key or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorContractException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'keyName': self._serialize.url("key_name", key_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', min_length=1) + + # 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]: + raise models.ErrorContractException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Key', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}'} + + def create_or_update( + self, resource_group_name, workspace_name, key_name, is_active_cmk=None, key_vault_url=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a workspace key. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param key_name: The name of the workspace key + :type key_name: str + :param is_active_cmk: Used to activate the workspace after a customer + managed key is provided. + :type is_active_cmk: bool + :param key_vault_url: The Key Vault Url of the workspace key. + :type key_vault_url: 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: Key or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.Key or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorContractException` + """ + key_properties = models.Key(is_active_cmk=is_active_cmk, key_vault_url=key_vault_url) + + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'keyName': self._serialize.url("key_name", key_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', min_length=1) + + # 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(key_properties, 'Key') + + # 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]: + raise models.ErrorContractException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Key', 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.Synapse/workspaces/{workspaceName}/keys/{keyName}'} + + def delete( + self, resource_group_name, workspace_name, key_name, custom_headers=None, raw=False, **operation_config): + """Deletes a workspace key. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param key_name: The name of the workspace key + :type key_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: Key or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.Key or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorContractException` + """ + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'keyName': self._serialize.url("key_name", key_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', min_length=1) + + # 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.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 204]: + raise models.ErrorContractException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Key', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/keys/{keyName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_operations.py index 804df34ae7e4..e6bea7ff62ac 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -120,7 +119,8 @@ def list( :return: list or ClientRawResponse if raw=true :rtype: list[~azure.mgmt.synapse.models.AvailableRpOperation] or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.list.metadata['url'] @@ -143,9 +143,7 @@ def list( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -208,7 +206,7 @@ def get_location_header_result( 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, 204]: + if response.status_code not in [200, 201, 202, 204]: raise models.ErrorContractException(self._deserialize, response) if raw: @@ -234,9 +232,11 @@ def get_azure_async_header_result( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: OperationResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.OperationResource or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get_azure_async_header_result.metadata['url'] @@ -266,16 +266,12 @@ def get_azure_async_header_result( 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, 404, 500]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 404]: + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('OperationResource', response) - if response.status_code == 500: - deserialized = self._deserialize('ErrorContract', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_operations.py index 960ae5865870..1d438ad2bda9 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_operations.py @@ -47,7 +47,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. @@ -107,7 +107,9 @@ def get( def _create_initial( - self, resource_group_name, workspace_name, private_endpoint_connection_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, workspace_name, private_endpoint_connection_name, private_endpoint=None, private_link_service_connection_state=None, custom_headers=None, raw=False, **operation_config): + request = models.PrivateEndpointConnection(private_endpoint=private_endpoint, private_link_service_connection_state=private_link_service_connection_state) + # Construct URL url = self.create.metadata['url'] path_format_arguments = { @@ -125,6 +127,7 @@ def _create_initial( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -132,8 +135,11 @@ def _create_initial( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + body_content = self._serialize.body(request, 'PrivateEndpointConnection') + # Construct and send request - request = self._client.put(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, 201]: @@ -153,17 +159,24 @@ def _create_initial( return deserialized def create( - self, resource_group_name, workspace_name, private_endpoint_connection_name, custom_headers=None, raw=False, polling=True, **operation_config): + self, resource_group_name, workspace_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. :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. :type private_endpoint_connection_name: str + :param private_endpoint: The private endpoint which the connection + belongs to. + :type private_endpoint: ~azure.mgmt.synapse.models.PrivateEndpoint + :param private_link_service_connection_state: Connection state of the + private endpoint connection. + :type private_link_service_connection_state: + ~azure.mgmt.synapse.models.PrivateLinkServiceConnectionState :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 @@ -183,6 +196,8 @@ def create( resource_group_name=resource_group_name, workspace_name=workspace_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 @@ -237,7 +252,7 @@ def _delete_initial( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202, 204]: raise models.ErrorContractException(self._deserialize, response) deserialized = None @@ -258,7 +273,7 @@ def delete( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param private_endpoint_connection_name: The name of the private endpoint connection. @@ -311,7 +326,7 @@ def list( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param workspace_name: The name of the workspace + :param workspace_name: The name of the workspace. :type workspace_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_private_link_hub_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_private_link_hub_operations.py new file mode 100644 index 000000000000..e48100631387 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_endpoint_connections_private_link_hub_operations.py @@ -0,0 +1,112 @@ +# 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 .. import models + + +class PrivateEndpointConnectionsPrivateLinkHubOperations(object): + """PrivateEndpointConnectionsPrivateLinkHubOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def list( + self, resource_group_name, private_link_hub_name, custom_headers=None, raw=False, **operation_config): + """Get all PrivateEndpointConnections in the PrivateLinkHub. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_link_hub_name: Name of the privateLinkHub + :type private_link_hub_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 + PrivateEndpointConnectionForPrivateLinkHub + :rtype: + ~azure.mgmt.synapse.models.PrivateEndpointConnectionForPrivateLinkHubPaged[~azure.mgmt.synapse.models.PrivateEndpointConnectionForPrivateLinkHub] + :raises: + :class:`ErrorContractException` + """ + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'privateLinkHubName': self._serialize.url("private_link_hub_name", private_link_hub_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', min_length=1) + + 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]: + raise models.ErrorContractException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.PrivateEndpointConnectionForPrivateLinkHubPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}/privateEndpointConnections'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_hubs_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_hubs_operations.py index c9d1815e0d7b..8179d6f40335 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_hubs_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_hubs_operations.py @@ -11,7 +11,8 @@ 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 @@ -54,7 +55,8 @@ def list_by_resource_group( :return: An iterator like instance of PrivateLinkHub :rtype: ~azure.mgmt.synapse.models.PrivateLinkHubPaged[~azure.mgmt.synapse.models.PrivateLinkHub] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -94,9 +96,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -107,7 +107,7 @@ def internal_paging(next_link=None): deserialized = models.PrivateLinkHubPaged(internal_paging, self._deserialize.dependencies, header_dict) return deserialized - list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHub'} + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs'} def get( self, resource_group_name, private_link_hub_name, custom_headers=None, raw=False, **operation_config): @@ -116,7 +116,7 @@ def get( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param private_link_hub_name: The name of the privateLinkHub + :param private_link_hub_name: Name of the privateLinkHub :type private_link_hub_name: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the @@ -177,7 +177,7 @@ def update( :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param private_link_hub_name: The name of the privateLinkHub + :param private_link_hub_name: Name of the privateLinkHub :type private_link_hub_name: str :param tags: Resource tags :type tags: dict[str, str] @@ -242,18 +242,17 @@ def update( update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}'} def create_or_update( - self, resource_group_name, private_link_hub_name, location, tags=None, custom_headers=None, raw=False, **operation_config): + self, private_link_hub_info, resource_group_name, private_link_hub_name, custom_headers=None, raw=False, **operation_config): """Creates or updates a privateLinkHub. + :param private_link_hub_info: PrivateLinkHub create or update request + properties + :type private_link_hub_info: ~azure.mgmt.synapse.models.PrivateLinkHub :param resource_group_name: The name of the resource group. The name is case insensitive. :type resource_group_name: str - :param private_link_hub_name: The name of the privateLinkHub + :param private_link_hub_name: Name of the privateLinkHub :type private_link_hub_name: str - :param location: The geo-location where the resource lives - :type location: str - :param tags: Resource tags. - :type tags: dict[str, str] :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -265,8 +264,6 @@ def create_or_update( :raises: :class:`ErrorContractException` """ - private_link_hub_info = models.PrivateLinkHub(tags=tags, location=location) - # Construct URL url = self.create_or_update.metadata['url'] path_format_arguments = { @@ -314,25 +311,9 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/privateLinkHubs/{privateLinkHubName}'} - def delete( - self, resource_group_name, private_link_hub_name, custom_headers=None, raw=False, **operation_config): - """Deletes a privateLinkHub. - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param private_link_hub_name: The name of the privateLinkHub - :type private_link_hub_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:`ErrorContractException` - """ + def _delete_initial( + self, resource_group_name, private_link_hub_name, custom_headers=None, raw=False, **operation_config): # Construct URL url = self.delete.metadata['url'] path_format_arguments = { @@ -359,12 +340,54 @@ def delete( 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]: + if response.status_code not in [200, 202, 204]: raise models.ErrorContractException(self._deserialize, response) if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + + def delete( + self, resource_group_name, private_link_hub_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a privateLinkHub. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param private_link_hub_name: Name of the privateLinkHub + :type private_link_hub_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:`ErrorContractException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + private_link_hub_name=private_link_hub_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.Synapse/privateLinkHubs/{privateLinkHubName}'} def list( @@ -379,7 +402,8 @@ def list( :return: An iterator like instance of PrivateLinkHub :rtype: ~azure.mgmt.synapse.models.PrivateLinkHubPaged[~azure.mgmt.synapse.models.PrivateLinkHub] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -418,9 +442,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_resources_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_resources_operations.py index 4635ad8474ca..7e43c3d860c6 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_resources_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_private_link_resources_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -58,7 +57,8 @@ def list( :return: An iterator like instance of PrivateLinkResource :rtype: ~azure.mgmt.synapse.models.PrivateLinkResourcePaged[~azure.mgmt.synapse.models.PrivateLinkResource] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -99,9 +99,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -136,7 +134,8 @@ def get( :return: PrivateLinkResource or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.PrivateLinkResource or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get.metadata['url'] @@ -167,9 +166,7 @@ def get( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_restorable_dropped_sql_pools_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_restorable_dropped_sql_pools_operations.py new file mode 100644 index 000000000000..72b1b0260f26 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_restorable_dropped_sql_pools_operations.py @@ -0,0 +1,176 @@ +# 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 .. import models + + +class RestorableDroppedSqlPoolsOperations(object): + """RestorableDroppedSqlPoolsOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, restorable_dropped_sql_pool_id, custom_headers=None, raw=False, **operation_config): + """Gets a deleted sql pool that can be restored. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param restorable_dropped_sql_pool_id: The id of the deleted Sql Pool + in the form of sqlPoolName,deletionTimeInFileTimeFormat + :type restorable_dropped_sql_pool_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: RestorableDroppedSqlPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.RestorableDroppedSqlPool or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorContractException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'restorableDroppedSqlPoolId': self._serialize.url("restorable_dropped_sql_pool_id", restorable_dropped_sql_pool_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', min_length=1) + + # 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]: + raise models.ErrorContractException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('RestorableDroppedSqlPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/restorableDroppedSqlPools/{restorableDroppedSqlPoolId}'} + + def list_by_workspace( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets a list of deleted Sql pools that can be restored. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 RestorableDroppedSqlPool + :rtype: + ~azure.mgmt.synapse.models.RestorableDroppedSqlPoolPaged[~azure.mgmt.synapse.models.RestorableDroppedSqlPool] + :raises: + :class:`ErrorContractException` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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]: + raise models.ErrorContractException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.RestorableDroppedSqlPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/restorableDroppedSqlPools'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_blob_auditing_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_blob_auditing_policies_operations.py index 47b9ce352c24..7912ae9c2675 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_blob_auditing_policies_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_blob_auditing_policies_operations.py @@ -184,3 +184,79 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings/{blobAuditingPolicyName}'} + + def list_by_sql_pool( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """Lists auditing settings of a Sql pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SqlPoolBlobAuditingPolicy + :rtype: + ~azure.mgmt.synapse.models.SqlPoolBlobAuditingPolicyPaged[~azure.mgmt.synapse.models.SqlPoolBlobAuditingPolicy] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_sql_pool.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_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', min_length=1) + + 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.SqlPoolBlobAuditingPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_sql_pool.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/auditingSettings'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_columns_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_columns_operations.py new file mode 100644 index 000000000000..fa04c3068dd0 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_columns_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 SqlPoolColumnsOperations(object): + """SqlPoolColumnsOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): + """Get Sql pool column. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_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: SqlPoolColumn or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.SqlPoolColumn 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_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') + } + 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', min_length=1) + + # 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('SqlPoolColumn', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_connection_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_connection_policies_operations.py index 25eab5422868..f8ec75f130b6 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_connection_policies_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_connection_policies_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -62,7 +61,8 @@ def get( :return: SqlPoolConnectionPolicy or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.SqlPoolConnectionPolicy or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get.metadata['url'] @@ -94,9 +94,7 @@ def get( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_geo_backup_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_geo_backup_policies_operations.py index 9c45397f22fd..e937d5a973b8 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_geo_backup_policies_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_geo_backup_policies_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -41,6 +40,83 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """List SQL pool geo backup policies. + + Get list of SQL pool geo backup policies. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of GeoBackupPolicy + :rtype: + ~azure.mgmt.synapse.models.GeoBackupPolicyPaged[~azure.mgmt.synapse.models.GeoBackupPolicy] + :raises: + :class:`ErrorContractException` + """ + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_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', min_length=1) + + 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]: + raise models.ErrorContractException(self._deserialize, response) + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.GeoBackupPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/geoBackupPolicies'} + def get( self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): """Get a SQL pool geo backup policy. @@ -62,7 +138,8 @@ def get( :return: GeoBackupPolicy or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.GeoBackupPolicy or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get.metadata['url'] @@ -94,9 +171,7 @@ def get( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py index 4567f45b5174..d647045e58cc 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_metadata_sync_configs_operations.py @@ -105,7 +105,7 @@ def get( get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/metadataSync/config'} def create( - self, resource_group_name, workspace_name, sql_pool_name, enabled=None, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, workspace_name, sql_pool_name, enabled=None, sync_interval_in_minutes=None, custom_headers=None, raw=False, **operation_config): """Set SQL pool metadata sync config. Set the metadata sync configuration for a SQL pool. @@ -120,6 +120,8 @@ def create( :param enabled: Indicates whether the metadata sync is enabled or disabled :type enabled: bool + :param sync_interval_in_minutes: The Sync Interval in minutes. + :type sync_interval_in_minutes: int :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -131,7 +133,7 @@ def create( :raises: :class:`ErrorContractException` """ - metadata_sync_configuration = models.MetadataSyncConfig(enabled=enabled) + metadata_sync_configuration = models.MetadataSyncConfig(enabled=enabled, sync_interval_in_minutes=sync_interval_in_minutes) # Construct URL url = self.create.metadata['url'] diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_operation_results_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_operation_results_operations.py index 29ad42bd76f4..6b1f5176c30b 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_operation_results_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_operation_results_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -61,7 +60,8 @@ def get_location_header_result( overrides`. :return: object or ClientRawResponse if raw=true :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get_location_header_result.metadata['url'] @@ -92,14 +92,14 @@ def get_location_header_result( 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 response.status_code not in [200, 202]: + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('object', response) + if response.status_code == 202: + deserialized = self._deserialize('object', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_replication_links_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_replication_links_operations.py index 9beb5a13ba00..0dc97c9a768d 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_replication_links_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_replication_links_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -60,7 +59,8 @@ def list( :return: An iterator like instance of ReplicationLink :rtype: ~azure.mgmt.synapse.models.ReplicationLinkPaged[~azure.mgmt.synapse.models.ReplicationLink] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -102,9 +102,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -116,3 +114,72 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/replicationLinks'} + + def get_by_name( + self, resource_group_name, workspace_name, sql_pool_name, link_id, custom_headers=None, raw=False, **operation_config): + """Get SQL pool replication link by name. + + Get SQL pool replication link by name. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param link_id: The ID of the replication link. + :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.synapse.models.ReplicationLink or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorContractException` + """ + # Construct URL + url = self.get_by_name.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_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', min_length=1) + + # 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]: + raise models.ErrorContractException(self._deserialize, response) + + 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_by_name.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/replicationLinks/{linkId}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_restore_points_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_restore_points_operations.py index 6968f5cf7a0a..04592cf3adc2 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_restore_points_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_restore_points_operations.py @@ -62,7 +62,8 @@ def list( :return: An iterator like instance of RestorePoint :rtype: ~azure.mgmt.synapse.models.RestorePointPaged[~azure.mgmt.synapse.models.RestorePoint] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -104,9 +105,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -227,3 +226,131 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints'} + + def get( + self, resource_group_name, workspace_name, sql_pool_name, restore_point_name, custom_headers=None, raw=False, **operation_config): + """Gets a restore point. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_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: RestorePoint or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.RestorePoint 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_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', min_length=1) + + # 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('RestorePoint', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}'} + + def delete( + self, resource_group_name, workspace_name, sql_pool_name, restore_point_name, custom_headers=None, raw=False, **operation_config): + """Deletes a restore point. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param restore_point_name: The name of the restore point. + :type restore_point_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.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'restorePointName': self._serialize.url("restore_point_name", restore_point_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', min_length=1) + + # 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]: + 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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/restorePoints/{restorePointName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_schemas_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_schemas_operations.py index 494a8374b914..cdebb2b74a23 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_schemas_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_schemas_operations.py @@ -121,3 +121,71 @@ def internal_paging(next_link=None): return deserialized list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas'} + + def get( + self, resource_group_name, workspace_name, sql_pool_name, schema_name, custom_headers=None, raw=False, **operation_config): + """Get Sql Pool schema. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_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: SqlPoolSchema or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.SqlPoolSchema 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_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', min_length=1) + + # 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('SqlPoolSchema', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_security_alert_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_security_alert_policies_operations.py index 1dfb1ad5c3c6..bccc62bdd332 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_security_alert_policies_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_security_alert_policies_operations.py @@ -41,6 +41,84 @@ def __init__(self, client, config, serializer, deserializer): self.config = config + def list( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """List Sql pool's security alert policies. + + Get a list of Sql pool's security alert policies. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SqlPoolSecurityAlertPolicy + :rtype: + ~azure.mgmt.synapse.models.SqlPoolSecurityAlertPolicyPaged[~azure.mgmt.synapse.models.SqlPoolSecurityAlertPolicy] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_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', min_length=1) + + 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.SqlPoolSecurityAlertPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/securityAlertPolicies'} + def get( self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): """Get a Sql pool's security alert policy. diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_sensitivity_labels_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_sensitivity_labels_operations.py index 22ac677faa4c..2daf1f254fbd 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_sensitivity_labels_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_sensitivity_labels_operations.py @@ -63,7 +63,8 @@ def list_current( :return: An iterator like instance of SensitivityLabel :rtype: ~azure.mgmt.synapse.models.SensitivityLabelPaged[~azure.mgmt.synapse.models.SensitivityLabel] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -107,9 +108,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -360,7 +359,7 @@ def delete( 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 @@ -370,6 +369,85 @@ def delete( return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'} + def get( + self, resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, sensitivity_label_source, custom_headers=None, raw=False, **operation_config): + """Gets the sensitivity label of a given column. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_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 sensitivity_label_source: The source of the sensitivity label. + Possible values include: 'current', 'recommended' + :type sensitivity_label_source: str or + ~azure.mgmt.synapse.models.SensitivityLabelSource + :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: SensitivityLabel or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.SensitivityLabel 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_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'), + 'sensitivityLabelSource': self._serialize.url("sensitivity_label_source", sensitivity_label_source, 'SensitivityLabelSource') + } + 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', min_length=1) + + # 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('SensitivityLabel', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}/columns/{columnName}/sensitivityLabels/{sensitivityLabelSource}'} + def enable_recommendation( self, resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, column_name, custom_headers=None, raw=False, **operation_config): """Enables sensitivity recommendations on a given column (recommendations diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_tables_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_tables_operations.py index b3c976f2f37e..632988a91303 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_tables_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_tables_operations.py @@ -124,3 +124,74 @@ def internal_paging(next_link=None): return deserialized list_by_schema.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables'} + + def get( + self, resource_group_name, workspace_name, sql_pool_name, schema_name, table_name, custom_headers=None, raw=False, **operation_config): + """Get Sql pool table. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_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: SqlPoolTable or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.SqlPoolTable 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'schemaName': self._serialize.url("schema_name", schema_name, 'str'), + 'tableName': self._serialize.url("table_name", table_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', min_length=1) + + # 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('SqlPoolTable', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/schemas/{schemaName}/tables/{tableName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_transparent_data_encryptions_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_transparent_data_encryptions_operations.py index 2fec55949720..2a0a4c6f7255 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_transparent_data_encryptions_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_transparent_data_encryptions_operations.py @@ -62,7 +62,8 @@ def get( :return: TransparentDataEncryption or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.TransparentDataEncryption or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get.metadata['url'] @@ -94,9 +95,7 @@ def get( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -136,7 +135,8 @@ def create_or_update( :return: TransparentDataEncryption or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.TransparentDataEncryption or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ parameters = models.TransparentDataEncryption(status=status) @@ -174,9 +174,7 @@ def create_or_update( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -190,3 +188,81 @@ def create_or_update( return deserialized create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/transparentDataEncryption/{transparentDataEncryptionName}'} + + def list( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """SQL pool's transparent data encryption configurations. + + Get list of SQL pool's transparent data encryption configurations. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of TransparentDataEncryption + :rtype: + ~azure.mgmt.synapse.models.TransparentDataEncryptionPaged[~azure.mgmt.synapse.models.TransparentDataEncryption] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_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', min_length=1) + + 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.TransparentDataEncryptionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/transparentDataEncryption'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_usages_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_usages_operations.py index e817cb97c5e4..77e27346ac56 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_usages_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_usages_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -60,7 +59,8 @@ def list( :return: An iterator like instance of SqlPoolUsage :rtype: ~azure.mgmt.synapse.models.SqlPoolUsagePaged[~azure.mgmt.synapse.models.SqlPoolUsage] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -102,9 +102,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_rule_baselines_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_rule_baselines_operations.py index d032c532c8d2..67ed59fb57e5 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_rule_baselines_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_rule_baselines_operations.py @@ -186,7 +186,7 @@ def delete( 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 @@ -195,3 +195,81 @@ def delete( client_raw_response = ClientRawResponse(None, response) return client_raw_response delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'} + + def get( + self, resource_group_name, workspace_name, sql_pool_name, rule_id, baseline_name, custom_headers=None, raw=False, **operation_config): + """Gets a SqlPool's vulnerability assessment rule baseline. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param rule_id: The vulnerability assessment rule ID. + :type rule_id: str + :param baseline_name: The name of the vulnerability assessment rule + baseline (default implies a baseline on a Sql pool level rule and + master for server level rule). Possible values include: 'master', + 'default' + :type baseline_name: str or + ~azure.mgmt.synapse.models.VulnerabilityAssessmentPolicyBaselineName + :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: SqlPoolVulnerabilityAssessmentRuleBaseline or + ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.synapse.models.SqlPoolVulnerabilityAssessmentRuleBaseline + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'ruleId': self._serialize.url("rule_id", rule_id, 'str'), + 'baselineName': self._serialize.url("baseline_name", baseline_name, 'VulnerabilityAssessmentPolicyBaselineName') + } + 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', min_length=1) + + # 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('SqlPoolVulnerabilityAssessmentRuleBaseline', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/rules/{ruleId}/baselines/{baselineName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_scans_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_scans_operations.py index 127f1b45b025..60a6e649d562 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_scans_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessment_scans_operations.py @@ -287,3 +287,74 @@ def export( return deserialized export.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/export'} + + def get( + self, resource_group_name, workspace_name, sql_pool_name, scan_id, custom_headers=None, raw=False, **operation_config): + """Gets a vulnerability assessment scan record of a Sql pool. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_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.synapse.models.VulnerabilityAssessmentScanRecord + 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_name, 'str'), + 'scanId': self._serialize.url("scan_id", scan_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', min_length=1) + + # 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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessments_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessments_operations.py index 8eae22c5cd15..28a3e2b1b27d 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessments_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_vulnerability_assessments_operations.py @@ -316,7 +316,7 @@ def delete( 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 diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_classifier_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_classifier_operations.py new file mode 100644 index 000000000000..f86fddf533a5 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_classifier_operations.py @@ -0,0 +1,407 @@ +# 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 SqlPoolWorkloadClassifierOperations(object): + """SqlPoolWorkloadClassifierOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers=None, raw=False, **operation_config): + """Get workload classifier. + + Get a workload classifier of Sql pool's workload group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param workload_group_name: The name of the workload group. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. + :type workload_classifier_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: WorkloadClassifier or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.WorkloadClassifier 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'workloadGroupName': self._serialize.url("workload_group_name", workload_group_name, 'str'), + 'workloadClassifierName': self._serialize.url("workload_classifier_name", workload_classifier_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', min_length=1) + + # 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('WorkloadClassifier', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}'} + + + def _create_or_update_initial( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'workloadGroupName': self._serialize.url("workload_group_name", workload_group_name, 'str'), + 'workloadClassifierName': self._serialize.url("workload_classifier_name", workload_classifier_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', min_length=1) + + # 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, 'WorkloadClassifier') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadClassifier', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadClassifier', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create Or Update workload classifier. + + Create Or Update workload classifier for a Sql pool's workload group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param workload_group_name: The name of the workload group. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. + :type workload_classifier_name: str + :param parameters: The properties of the workload classifier. + :type parameters: ~azure.mgmt.synapse.models.WorkloadClassifier + :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 WorkloadClassifier or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.WorkloadClassifier] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.WorkloadClassifier]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + sql_pool_name=sql_pool_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadClassifier', 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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}'} + + + def _delete_initial( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'workloadGroupName': self._serialize.url("workload_group_name", workload_group_name, 'str'), + 'workloadClassifierName': self._serialize.url("workload_classifier_name", workload_classifier_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', min_length=1) + + # 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, workspace_name, sql_pool_name, workload_group_name, workload_classifier_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Remove workload classifier. + + Remove workload classifier of a Sql pool's workload group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param workload_group_name: The name of the workload group. + :type workload_group_name: str + :param workload_classifier_name: The name of the workload classifier. + :type workload_classifier_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, + workspace_name=workspace_name, + sql_pool_name=sql_pool_name, + workload_group_name=workload_group_name, + workload_classifier_name=workload_classifier_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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers/{workloadClassifierName}'} + + def list( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers=None, raw=False, **operation_config): + """Sql pool's workload classifier. + + Get list of Sql pool's workload classifier for workload groups. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param workload_group_name: The name of the workload group. + :type workload_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: An iterator like instance of WorkloadClassifier + :rtype: + ~azure.mgmt.synapse.models.WorkloadClassifierPaged[~azure.mgmt.synapse.models.WorkloadClassifier] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'workloadGroupName': self._serialize.url("workload_group_name", workload_group_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', min_length=1) + + 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.WorkloadClassifierPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}/workloadClassifiers'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_group_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_group_operations.py new file mode 100644 index 000000000000..25b6974b8890 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pool_workload_group_operations.py @@ -0,0 +1,393 @@ +# 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 SqlPoolWorkloadGroupOperations(object): + """SqlPoolWorkloadGroupOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers=None, raw=False, **operation_config): + """Sql pool's workload group. + + Get a Sql pool's workload group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param workload_group_name: The name of the workload group. + :type workload_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: WorkloadGroup or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.WorkloadGroup 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'workloadGroupName': self._serialize.url("workload_group_name", workload_group_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', min_length=1) + + # 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('WorkloadGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}'} + + + def _create_or_update_initial( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, parameters, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'workloadGroupName': self._serialize.url("workload_group_name", workload_group_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', min_length=1) + + # 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, 'WorkloadGroup') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 201, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkloadGroup', response) + if response.status_code == 201: + deserialized = self._deserialize('WorkloadGroup', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create Or Update workload group. + + Create Or Update a Sql pool's workload group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param workload_group_name: The name of the workload group. + :type workload_group_name: str + :param parameters: The requested workload group state. + :type parameters: ~azure.mgmt.synapse.models.WorkloadGroup + :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 WorkloadGroup or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.WorkloadGroup] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.WorkloadGroup]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + sql_pool_name=sql_pool_name, + workload_group_name=workload_group_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkloadGroup', 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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}'} + + + def _delete_initial( + self, resource_group_name, workspace_name, sql_pool_name, workload_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_pool_name, 'str'), + 'workloadGroupName': self._serialize.url("workload_group_name", workload_group_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', min_length=1) + + # 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, workspace_name, sql_pool_name, workload_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Remove workload group. + + Remove Sql pool's workload group. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param workload_group_name: The name of the workload group. + :type workload_group_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, + workspace_name=workspace_name, + sql_pool_name=sql_pool_name, + workload_group_name=workload_group_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.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups/{workloadGroupName}'} + + def list( + self, resource_group_name, workspace_name, sql_pool_name, custom_headers=None, raw=False, **operation_config): + """Sql pool's workload groups. + + Get list of Sql pool's workload groups. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_pool_name: SQL pool name + :type sql_pool_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of WorkloadGroup + :rtype: + ~azure.mgmt.synapse.models.WorkloadGroupPaged[~azure.mgmt.synapse.models.WorkloadGroup] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlPoolName': self._serialize.url("sql_pool_name", sql_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', min_length=1) + + 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.WorkloadGroupPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/workloadGroups'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pools_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pools_operations.py index f0516d64e79f..7af48891038e 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pools_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_sql_pools_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -62,7 +61,8 @@ def get( :return: SqlPool or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.SqlPool or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get.metadata['url'] @@ -93,9 +93,7 @@ def get( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -131,7 +129,8 @@ def update( :return: SqlPool or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.SqlPool or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.update.metadata['url'] @@ -166,9 +165,7 @@ def update( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -405,7 +402,8 @@ def list_by_workspace( :return: An iterator like instance of SqlPool :rtype: ~azure.mgmt.synapse.models.SqlPoolPaged[~azure.mgmt.synapse.models.SqlPool] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -446,9 +444,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -493,9 +489,7 @@ def _pause_initial( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None @@ -530,7 +524,8 @@ def pause( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ raw_result = self._pause_initial( resource_group_name=resource_group_name, @@ -591,9 +586,7 @@ def _resume_initial( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None @@ -628,7 +621,8 @@ def resume( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[object] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[object]] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ raw_result = self._resume_initial( resource_group_name=resource_group_name, @@ -656,70 +650,3 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/resume'} - - def rename( - self, resource_group_name, workspace_name, sql_pool_name, id, custom_headers=None, raw=False, **operation_config): - """Rename a SQL pool. - - Rename a SQL pool. - - :param resource_group_name: The name of the resource group. The name - is case insensitive. - :type resource_group_name: str - :param workspace_name: The name of the workspace - :type workspace_name: str - :param sql_pool_name: SQL pool name - :type sql_pool_name: str - :param id: The target ID for the resource - :type 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` - """ - parameters = models.ResourceMoveDefinition(id=id) - - # Construct URL - url = self.rename.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), - 'sqlPoolName': self._serialize.url("sql_pool_name", sql_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', min_length=1) - - # 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, 'ResourceMoveDefinition') - - # 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]: - 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 - rename.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlPools/{sqlPoolName}/move'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_aad_admins_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_aad_admins_operations.py index 5d7a534ec839..c5c7b882e89f 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_aad_admins_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_aad_admins_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -58,7 +57,8 @@ def get( :return: WorkspaceAadAdminInfo or ClientRawResponse if raw=true :rtype: ~azure.mgmt.synapse.models.WorkspaceAadAdminInfo or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ # Construct URL url = self.get.metadata['url'] @@ -88,9 +88,7 @@ def get( 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 + raise models.ErrorContractException(self._deserialize, response) deserialized = None if response.status_code == 200: @@ -235,7 +233,7 @@ def _delete_initial( 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]: + if response.status_code not in [200, 202, 204]: raise models.ErrorContractException(self._deserialize, response) if raw: diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_identity_sql_control_settings_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_identity_sql_control_settings_operations.py index 3bbafefe441d..88e7ed965efa 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_identity_sql_control_settings_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_identity_sql_control_settings_operations.py @@ -160,7 +160,7 @@ def create_or_update( 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]: raise models.ErrorContractException(self._deserialize, response) deserialized = None diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_blob_auditing_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_blob_auditing_policies_operations.py new file mode 100644 index 000000000000..9f8f14741790 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_blob_auditing_policies_operations.py @@ -0,0 +1,289 @@ +# 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 WorkspaceManagedSqlServerBlobAuditingPoliciesOperations(object): + """WorkspaceManagedSqlServerBlobAuditingPoliciesOperations 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 this operation. Constant value: "2019-06-01-preview". + :ivar blob_auditing_policy_name: The name of the blob auditing policy. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + self.blob_auditing_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get server's blob auditing policy. + + Get a workspace managed sql server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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: ServerBlobAuditingPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.ServerBlobAuditingPolicy 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'blobAuditingPolicyName': self._serialize.url("self.blob_auditing_policy_name", self.blob_auditing_policy_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', min_length=1) + + # 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('ServerBlobAuditingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/auditingSettings/{blobAuditingPolicyName}'} + + + def _create_or_update_initial( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'blobAuditingPolicyName': self._serialize.url("self.blob_auditing_policy_name", self.blob_auditing_policy_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', min_length=1) + + # 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, 'ServerBlobAuditingPolicy') + + # 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('ServerBlobAuditingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or Update server's blob auditing policy. + + Create or Update a workspace managed sql server's blob auditing policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param parameters: Properties of extended blob auditing policy. + :type parameters: ~azure.mgmt.synapse.models.ServerBlobAuditingPolicy + :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 + ServerBlobAuditingPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.ServerBlobAuditingPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.ServerBlobAuditingPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServerBlobAuditingPolicy', 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.Synapse/workspaces/{workspaceName}/auditingSettings/{blobAuditingPolicyName}'} + + def list_by_workspace( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """List workspace server's blob auditing policies. + + List workspace managed sql server's blob auditing policies. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 ServerBlobAuditingPolicy + :rtype: + ~azure.mgmt.synapse.models.ServerBlobAuditingPolicyPaged[~azure.mgmt.synapse.models.ServerBlobAuditingPolicy] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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.ServerBlobAuditingPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/auditingSettings'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_extended_blob_auditing_policies_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_extended_blob_auditing_policies_operations.py new file mode 100644 index 000000000000..98652de3ef07 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_extended_blob_auditing_policies_operations.py @@ -0,0 +1,292 @@ +# 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 WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations(object): + """WorkspaceManagedSqlServerExtendedBlobAuditingPoliciesOperations 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 this operation. Constant value: "2019-06-01-preview". + :ivar blob_auditing_policy_name: The name of the blob auditing policy. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + self.blob_auditing_policy_name = "default" + + self.config = config + + def get( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get server's extended blob auditing policy. + + Get a workspace SQL server's extended blob auditing policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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: ExtendedServerBlobAuditingPolicy or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.synapse.models.ExtendedServerBlobAuditingPolicy 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'blobAuditingPolicyName': self._serialize.url("self.blob_auditing_policy_name", self.blob_auditing_policy_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', min_length=1) + + # 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('ExtendedServerBlobAuditingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/extendedAuditingSettings/{blobAuditingPolicyName}'} + + + def _create_or_update_initial( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'blobAuditingPolicyName': self._serialize.url("self.blob_auditing_policy_name", self.blob_auditing_policy_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', min_length=1) + + # 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, 'ExtendedServerBlobAuditingPolicy') + + # 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('ExtendedServerBlobAuditingPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or Update server's extended blob auditing policy. + + Create or Update a workspace managed sql server's extended blob + auditing policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param parameters: Properties of extended blob auditing policy. + :type parameters: + ~azure.mgmt.synapse.models.ExtendedServerBlobAuditingPolicy + :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 + ExtendedServerBlobAuditingPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.ExtendedServerBlobAuditingPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.ExtendedServerBlobAuditingPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ExtendedServerBlobAuditingPolicy', 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.Synapse/workspaces/{workspaceName}/extendedAuditingSettings/{blobAuditingPolicyName}'} + + def list_by_workspace( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """List server's extended blob auditing policies. + + List workspace managed sql server's extended blob auditing policies. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 ExtendedServerBlobAuditingPolicy + :rtype: + ~azure.mgmt.synapse.models.ExtendedServerBlobAuditingPolicyPaged[~azure.mgmt.synapse.models.ExtendedServerBlobAuditingPolicy] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_workspace.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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.ExtendedServerBlobAuditingPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_workspace.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/extendedAuditingSettings'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_recoverable_sqlpools_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_recoverable_sqlpools_operations.py new file mode 100644 index 000000000000..05e11100f599 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_recoverable_sqlpools_operations.py @@ -0,0 +1,182 @@ +# 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 WorkspaceManagedSqlServerRecoverableSqlpoolsOperations(object): + """WorkspaceManagedSqlServerRecoverableSqlpoolsOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get list of recoverable sql pools for the server. + + Get list of recoverable sql pools for workspace managed sql server. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 RecoverableSqlPool + :rtype: + ~azure.mgmt.synapse.models.RecoverableSqlPoolPaged[~azure.mgmt.synapse.models.RecoverableSqlPool] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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.RecoverableSqlPoolPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/recoverableSqlpools'} + + def get( + self, resource_group_name, workspace_name, sql_compute_name, custom_headers=None, raw=False, **operation_config): + """Get recoverable sql pools for the server. + + Get recoverable sql pools for workspace managed sql server. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param sql_compute_name: The name of the sql compute + :type sql_compute_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: RecoverableSqlPool or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.RecoverableSqlPool 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'sqlComputeName': self._serialize.url("sql_compute_name", sql_compute_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', min_length=1) + + # 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('RecoverableSqlPool', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/recoverableSqlPools/{sqlComputeName}'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_security_alert_policy_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_security_alert_policy_operations.py new file mode 100644 index 000000000000..42ad059d72a3 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_security_alert_policy_operations.py @@ -0,0 +1,291 @@ +# 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 WorkspaceManagedSqlServerSecurityAlertPolicyOperations(object): + """WorkspaceManagedSqlServerSecurityAlertPolicyOperations 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 this operation. Constant value: "2019-06-01-preview". + :ivar security_alert_policy_name: The name of the security alert policy. Constant value: "Default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + self.security_alert_policy_name = "Default" + + self.config = config + + def get( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get server's security alert policy. + + Get a workspace managed sql server's security alert policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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: ServerSecurityAlertPolicy or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.ServerSecurityAlertPolicy 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_policy_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', min_length=1) + + # 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('ServerSecurityAlertPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/securityAlertPolicies/{securityAlertPolicyName}'} + + + def _create_or_update_initial( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'securityAlertPolicyName': self._serialize.url("self.security_alert_policy_name", self.security_alert_policy_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', min_length=1) + + # 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, 'ServerSecurityAlertPolicy') + + # 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('ServerSecurityAlertPolicy', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Create or Update server's threat detection policy. + + Create or Update a workspace managed sql server's threat detection + policy. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param parameters: The workspace managed sql server security alert + policy. + :type parameters: ~azure.mgmt.synapse.models.ServerSecurityAlertPolicy + :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 + ServerSecurityAlertPolicy or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.ServerSecurityAlertPolicy] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.ServerSecurityAlertPolicy]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ServerSecurityAlertPolicy', 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.Synapse/workspaces/{workspaceName}/securityAlertPolicies/{securityAlertPolicyName}'} + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get server's threat detection policies. + + Get workspace managed sql server's threat detection policies. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 ServerSecurityAlertPolicy + :rtype: + ~azure.mgmt.synapse.models.ServerSecurityAlertPolicyPaged[~azure.mgmt.synapse.models.ServerSecurityAlertPolicy] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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.ServerSecurityAlertPolicyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/securityAlertPolicies'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_usages_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_usages_operations.py new file mode 100644 index 000000000000..c2a7fcb6577e --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_usages_operations.py @@ -0,0 +1,115 @@ +# 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 WorkspaceManagedSqlServerUsagesOperations(object): + """WorkspaceManagedSqlServerUsagesOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get list of usages metric for the server. + + Get list of server usages metric for workspace managed sql server. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 ServerUsage + :rtype: + ~azure.mgmt.synapse.models.ServerUsagePaged[~azure.mgmt.synapse.models.ServerUsage] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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.ServerUsagePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlUsages'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_vulnerability_assessments_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_vulnerability_assessments_operations.py new file mode 100644 index 000000000000..f96a81a07fb7 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_managed_sql_server_vulnerability_assessments_operations.py @@ -0,0 +1,317 @@ +# 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 WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations(object): + """WorkspaceManagedSqlServerVulnerabilityAssessmentsOperations 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 this operation. Constant value: "2019-06-01-preview". + :ivar vulnerability_assessment_name: The name of the vulnerability assessment. Constant value: "default". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + self.vulnerability_assessment_name = "default" + + self.config = config + + def get( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Get server's vulnerability assessment. + + Get workspace managed sql server's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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: ServerVulnerabilityAssessment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.synapse.models.ServerVulnerabilityAssessment 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_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', min_length=1) + + # 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('ServerVulnerabilityAssessment', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'} + + def create_or_update( + self, resource_group_name, workspace_name, parameters, custom_headers=None, raw=False, **operation_config): + """Create or Update server's vulnerability assessment. + + Create or Update workspace managed sql server's vulnerability + assessment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param parameters: Properties for vulnerability assessment. + :type parameters: + ~azure.mgmt.synapse.models.ServerVulnerabilityAssessment + :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: ServerVulnerabilityAssessment or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.synapse.models.ServerVulnerabilityAssessment or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_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', min_length=1) + + # 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, 'ServerVulnerabilityAssessment') + + # 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('ServerVulnerabilityAssessment', response) + if response.status_code == 201: + deserialized = self._deserialize('ServerVulnerabilityAssessment', 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.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'} + + def delete( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Remove server's vulnerability assessment. + + Remove workspace managed sql server's vulnerability assessment. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_name, 'str'), + 'vulnerabilityAssessmentName': self._serialize.url("self.vulnerability_assessment_name", self.vulnerability_assessment_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', min_length=1) + + # 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.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments/{vulnerabilityAssessmentName}'} + + def list( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Lists the vulnerability assessment policies associated with a server. + + Lists the vulnerability assessment policies associated with a workspace + managed sql server. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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 ServerVulnerabilityAssessment + :rtype: + ~azure.mgmt.synapse.models.ServerVulnerabilityAssessmentPaged[~azure.mgmt.synapse.models.ServerVulnerabilityAssessment] + :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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + 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.ServerVulnerabilityAssessmentPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/vulnerabilityAssessments'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_sql_aad_admins_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_sql_aad_admins_operations.py new file mode 100644 index 000000000000..83cd393bb491 --- /dev/null +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspace_sql_aad_admins_operations.py @@ -0,0 +1,284 @@ +# 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 msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class WorkspaceSqlAadAdminsOperations(object): + """WorkspaceSqlAadAdminsOperations 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 this operation. Constant value: "2019-06-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01-preview" + + self.config = config + + def get( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + """Gets a workspace SQL active directory admin. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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: WorkspaceAadAdminInfo or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.synapse.models.WorkspaceAadAdminInfo or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorContractException` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + # 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]: + raise models.ErrorContractException(self._deserialize, response) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceAadAdminInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory'} + + + def _create_or_update_initial( + self, resource_group_name, workspace_name, aad_admin_info, custom_headers=None, raw=False, **operation_config): + # 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', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + # 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(aad_admin_info, 'WorkspaceAadAdminInfo') + + # 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]: + raise models.ErrorContractException(self._deserialize, response) + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('WorkspaceAadAdminInfo', response) + if response.status_code == 202: + deserialized = self._deserialize('WorkspaceAadAdminInfo', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, workspace_name, aad_admin_info, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a workspace SQL active directory admin. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_name: str + :param aad_admin_info: Workspace active directory administrator + properties + :type aad_admin_info: ~azure.mgmt.synapse.models.WorkspaceAadAdminInfo + :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 WorkspaceAadAdminInfo + or ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.synapse.models.WorkspaceAadAdminInfo] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.synapse.models.WorkspaceAadAdminInfo]] + :raises: + :class:`ErrorContractException` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + aad_admin_info=aad_admin_info, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('WorkspaceAadAdminInfo', 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.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory'} + + + def _delete_initial( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'workspaceName': self._serialize.url("workspace_name", workspace_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', min_length=1) + + # 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]: + raise models.ErrorContractException(self._deserialize, response) + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, workspace_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a workspace SQL active directory admin. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param workspace_name: The name of the workspace + :type workspace_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:`ErrorContractException` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_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.Synapse/workspaces/{workspaceName}/sqlAdministrators/activeDirectory'} diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspaces_operations.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspaces_operations.py index 54c4310548e0..9b4aa1c3d02a 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspaces_operations.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/operations/_workspaces_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -56,7 +55,8 @@ def list_by_resource_group( :return: An iterator like instance of Workspace :rtype: ~azure.mgmt.synapse.models.WorkspacePaged[~azure.mgmt.synapse.models.Workspace] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -96,9 +96,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response @@ -482,7 +480,8 @@ def list( :return: An iterator like instance of Workspace :rtype: ~azure.mgmt.synapse.models.WorkspacePaged[~azure.mgmt.synapse.models.Workspace] - :raises: :class:`CloudError` + :raises: + :class:`ErrorContractException` """ def prepare_request(next_link=None): if not next_link: @@ -521,9 +520,7 @@ def internal_paging(next_link=None): 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 + raise models.ErrorContractException(self._deserialize, response) return response diff --git a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py index 85da2c00c1a6..266f5a486d79 100644 --- a/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py +++ b/sdk/synapse/azure-mgmt-synapse/azure/mgmt/synapse/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "0.4.0" +VERSION = "0.5.0"