From a1d776194872604ee085c745ca8293d7f9625ee5 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 6 Oct 2021 07:32:21 +0000 Subject: [PATCH] CodeGen from PR 16289 in Azure/azure-rest-api-specs Dev sql microsoft.sql 2021 05 01 preview release (#16289) * add base for Microsoft.sql * Update Readme.md * update version in swagger example files * remove ss * update swagger files * update readme.md * add missing json files * update custom-words.txt to address the spelling check * remove 201 define in ServerUpdate.json * Sync sql 2021 05 01 with main branch (#16236) * Update comment.yml for publish pr (#16166) * Update comment.yml * Update comment.yml * Bump dependencies (#16170) * bump avocado * bump mocha * remove submodule (#16171) * add azure-resource-manager-schema to servicelinker (#16176) Co-authored-by: Nan Jiang * Update pr assignment config (#16175) * [Synapse] - fix scheme for Artifacts and update readme to include KQL scripts for October release (#16035) * [Synapse] - fix scheme for Notebook, Spark Job definition and SQL script * Update dataset, linked service and pipeline * Update release tag for october release * Correct type of result limit * Add arguments for SynapseSparkJobActivityTypeProperties Co-authored-by: Dongwei Wang * fix (#16164) Merging the change to have accurate Swagger * Remove requirement of identity field in the request for TURN. (#15966) * Remove requirement of identity field in the request. * Update PR * Address comment * change api version in readme for sdk release (#16187) * Add blockchain to latest profile * Add additional types * api version change Co-authored-by: Mark Cowlishaw Co-authored-by: Ping Zhu * [Search] Rename types for better SDK code (#16039) * Rename types for better SDK code * Rename Speller and Captions search options * Reorder parameters to have consistency across APIs * Remove 'SearchIndexer' prefix from projection selectors Remove 'global' prefix from default flags on custom entities * Change enum name AdlsGen2->AzureDataLakeStorageGen2 Change property name storageContainer->storageContainerName * move additional .NET SDK renames to the REST spec * Revert changes in KnowledgeStore which has GAed * Revert changes in CustomEntityLookupSkill which has GAed * Revert changes in SIKSBlobProjectionSelector which has GAed * Revert changes in SearchIndexerDataSourceType which has GAed * Rename ignoreResetRequirements->skipIndexerResetRequirementForCache * fix validStreamingUnits (#16143) Co-authored-by: Roslyn Lu * Fix schemas readme files (#16207) * Fix schemas readme files * fix ref * add resourcemanager in module-name (#16206) * add resourcemanager in module-name * add go track2 repo in readme.md * fix * Minor description update for createorupdate & update slot (#15457) * add scmMinTlsVersion * modify description for createorupdate & update slot for all API versions Co-authored-by: Edwin Diaz * [Hub Generated] Review request for Microsoft.Security to add version preview/2021-08-01-preview (#16096) * Adds base for updating Microsoft.Security from version stable/2021-07-01 to version 2021-08-01-preview * Updates readme * Updates API version in new specs and examples * First pass at Microsoft.Security/standards for review/preview * Addressing Round-1 feedback, adding missing descriptions and changing scoping to match ProxyResource type * First pass for Microsoft.Security\standardComponents * Changes to fix a typo in an example spec * Added Microsoft.Security/standardAssignments * Fix naming convention issue * Removed types based on Hila's feedback * Changes to data model for both API calls * Fix example errors and typos * Add systemData to Microsoft.Security/standards * Changes to fix systemData linting * un-nest systemData fields in examples * More systemData placement * Naming convention name to assignments from standardAssignment * Additional example added * Changes to address descriptive comments on field types * Add systemData readOnly * prettier-fix against examples * Cleaned types to ref standard v2 common-types entry similar to securityForIoT * Re-added v2 folder? * Missed a change here? * Cleanup of v2 type completely, updated readme.md * Adds suppression to readme * Adds suppression to readme * Change modification to suppress operations linting Co-authored-by: Adam Holliday * Yifanzhou/api version change (#16191) * remove Catalog * update 2021-05-01-preview * delete 2021-09-01 * Update readme.md * Update purviewcatalog.json * change read-only property (#16209) Co-authored-by: Parv Saxena * Update account.json - make CollectionReferece type writable (#16208) * Update account.json Updating the CollectionReference to be writeable to unblock the customers. * Update account.json Need the default set in the client SDK * Fixed an event name typo in its description. (#16227) * Introduce new API version for Microsoft.ProviderHub 2021-09-01-preview (#15723) * Introduce new API version for Microsoft.ProviderHub 2021-09-01-preview * Add PrivateResourceProviderConfigurations * Add PrivateRP examples * Fix enum type. * Fix enum again * Prettier * Fix prettier error * Add readme.md + prettier * Fix * Fix avocado error * Modify interface * Fix issue * Make it private preview * Remove private RP changes * Update SKU settings Co-authored-by: REDMOND\lakshv Co-authored-by: He Huang <47040595+hjhhh3000vitae@users.noreply.github.com> * fluidrelay_readme_config (#16192) fluidrelay_readme_config * Add community gallery proxy resource (#16043) * [Hub Generated] Public private branch 'dev-storagecache-Microsoft.StorageCache-2021-09-01' (#16152) * Adds base for updating Microsoft.StorageCache from version stable/2021-05-01 to version 2021-09-01 * Updates readme * Updates API version in new specs and examples * 2021-09-01 API * Fix LintDiff Co-authored-by: rebecca337 <80353400+rebecca337@users.noreply.github.com> Co-authored-by: Rebecca Dupuis * Fix S360 bugs for swagger FSPG 2020-02-14-preview, 2021-06-01-preview and 2021-06-01 APIs (#15946) * Changed FSPG RestartParameter.failoverMode from string to enum for API 2021-06-01, 2021-06-01-preview, and 2021-06-15-privatepreview * Change enum first letter to lower case * Change to upper case * Fix S360 bugs for swagger FSPG 2020-02-14-preview, 2021-06-01-preview and 2021-06-01 APIs * Add email reminder when PR makes changes in Synapse (#16116) * add email reminder to synapse * fix for comment * ServiceBus add batch tag (#16229) * add code owner to synapse (#16230) * [Datafactory] Power Query model changes for multiple queries (#16158) * [Synapse] Add release tag for management SDK Oct. release (#16213) * update release tag * fix for avocado Co-authored-by: Tianen <347142915@qq.com> Co-authored-by: Zhenglai Zhang Co-authored-by: Lei Ni <7233663+leni-msft@users.noreply.github.com> Co-authored-by: najian Co-authored-by: Nan Jiang Co-authored-by: Ray Chen Co-authored-by: Dongwei Wang Co-authored-by: Dongwei Wang Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: AriZavala2 <77034370+AriZavala2@users.noreply.github.com> Co-authored-by: PingZhu2232 <36140352+PingZhu2232@users.noreply.github.com> Co-authored-by: Mark Cowlishaw Co-authored-by: Ping Zhu Co-authored-by: Mohit Chakraborty <8271806+Mohit-Chakraborty@users.noreply.github.com> Co-authored-by: Roslyn Lu Co-authored-by: Roslyn Lu Co-authored-by: JiahuiPeng <46921893+804873052@users.noreply.github.com> Co-authored-by: edwin-msft <71858592+edwin-msft@users.noreply.github.com> Co-authored-by: Edwin Diaz Co-authored-by: dochollidayxx Co-authored-by: Adam Holliday Co-authored-by: yifan-zhou922 <78060542+yifan-zhou922@users.noreply.github.com> Co-authored-by: Parv Saxena Co-authored-by: Parv Saxena Co-authored-by: hvermis Co-authored-by: xuepingd <75347475+xuepingd@users.noreply.github.com> Co-authored-by: laxmankumar12 Co-authored-by: REDMOND\lakshv Co-authored-by: He Huang <47040595+hjhhh3000vitae@users.noreply.github.com> Co-authored-by: Zed Lei <59104634+RAY-316@users.noreply.github.com> Co-authored-by: kangsun-ctrl <69279251+kangsun-ctrl@users.noreply.github.com> Co-authored-by: brpanask <64860651+brpanask@users.noreply.github.com> Co-authored-by: rebecca337 <80353400+rebecca337@users.noreply.github.com> Co-authored-by: Rebecca Dupuis Co-authored-by: xunsun-commits <84804232+xunsun-commits@users.noreply.github.com> Co-authored-by: Wan Yang Co-authored-by: soma-ms <84877933+soma-ms@users.noreply.github.com> * remove blank line * address comments * address the description comment * update the swagger * remove ManagedInstances_ListOutboundNetworkDependenciesByManagedInstance * Update from microsoft.sql 2021-05-01-preview to base branch (#16184) * Update comment.yml for publish pr (#16166) * Update comment.yml * Update comment.yml * Bump dependencies (#16170) * bump avocado * bump mocha * remove submodule (#16171) * add azure-resource-manager-schema to servicelinker (#16176) Co-authored-by: Nan Jiang * Update pr assignment config (#16175) * [Synapse] - fix scheme for Artifacts and update readme to include KQL scripts for October release (#16035) * [Synapse] - fix scheme for Notebook, Spark Job definition and SQL script * Update dataset, linked service and pipeline * Update release tag for october release * Correct type of result limit * Add arguments for SynapseSparkJobActivityTypeProperties Co-authored-by: Dongwei Wang * fix (#16164) Merging the change to have accurate Swagger * update swagger files * update readme.md * add missing json files * update custom-words.txt to address the spelling check * remove 201 define in ServerUpdate.json * remove blank line * address comments * address the description comment * update the swagger * remove ManagedInstances_ListOutboundNetworkDependenciesByManagedInstance Co-authored-by: Tianen <347142915@qq.com> Co-authored-by: Zhenglai Zhang Co-authored-by: Lei Ni <7233663+leni-msft@users.noreply.github.com> Co-authored-by: najian Co-authored-by: Nan Jiang Co-authored-by: Ray Chen Co-authored-by: Dongwei Wang Co-authored-by: Dongwei Wang Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: Tianen <347142915@qq.com> Co-authored-by: Zhenglai Zhang Co-authored-by: Lei Ni <7233663+leni-msft@users.noreply.github.com> Co-authored-by: najian Co-authored-by: Nan Jiang Co-authored-by: Ray Chen Co-authored-by: Dongwei Wang Co-authored-by: Dongwei Wang Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: AriZavala2 <77034370+AriZavala2@users.noreply.github.com> Co-authored-by: PingZhu2232 <36140352+PingZhu2232@users.noreply.github.com> Co-authored-by: Mark Cowlishaw Co-authored-by: Ping Zhu Co-authored-by: Mohit Chakraborty <8271806+Mohit-Chakraborty@users.noreply.github.com> Co-authored-by: Roslyn Lu Co-authored-by: Roslyn Lu Co-authored-by: JiahuiPeng <46921893+804873052@users.noreply.github.com> Co-authored-by: edwin-msft <71858592+edwin-msft@users.noreply.github.com> Co-authored-by: Edwin Diaz Co-authored-by: dochollidayxx Co-authored-by: Adam Holliday Co-authored-by: yifan-zhou922 <78060542+yifan-zhou922@users.noreply.github.com> Co-authored-by: Parv Saxena Co-authored-by: Parv Saxena Co-authored-by: hvermis Co-authored-by: xuepingd <75347475+xuepingd@users.noreply.github.com> Co-authored-by: laxmankumar12 Co-authored-by: REDMOND\lakshv Co-authored-by: He Huang <47040595+hjhhh3000vitae@users.noreply.github.com> Co-authored-by: Zed Lei <59104634+RAY-316@users.noreply.github.com> Co-authored-by: kangsun-ctrl <69279251+kangsun-ctrl@users.noreply.github.com> Co-authored-by: brpanask <64860651+brpanask@users.noreply.github.com> Co-authored-by: rebecca337 <80353400+rebecca337@users.noreply.github.com> Co-authored-by: Rebecca Dupuis Co-authored-by: xunsun-commits <84804232+xunsun-commits@users.noreply.github.com> Co-authored-by: Wan Yang Co-authored-by: soma-ms <84877933+soma-ms@users.noreply.github.com> --- sdk/sql/azure-mgmt-sql/_meta.json | 2 +- .../azure/mgmt/sql/_metadata.json | 3 +- .../azure/mgmt/sql/_sql_management_client.py | 15 +- .../azure-mgmt-sql/azure/mgmt/sql/_version.py | 2 +- .../mgmt/sql/aio/_sql_management_client.py | 15 +- .../azure/mgmt/sql/aio/operations/__init__.py | 6 +- .../_ledger_digest_uploads_operations.py | 212 +++++++++++++---- ...rver_security_alert_policies_operations.py | 10 +- ...rver_security_alert_policies_operations.py | 10 +- .../aio/operations/_sync_groups_operations.py | 4 +- ...t_data_encryption_activities_operations.py | 127 ----------- ...transparent_data_encryptions_operations.py | 187 ++++++++++----- .../azure/mgmt/sql/models/__init__.py | 25 +- .../azure/mgmt/sql/models/_models.py | 182 ++++++--------- .../azure/mgmt/sql/models/_models_py3.py | 188 ++++++--------- .../models/_sql_management_client_enums.py | 20 +- .../azure/mgmt/sql/operations/__init__.py | 6 +- .../_ledger_digest_uploads_operations.py | 214 ++++++++++++++---- ...rver_security_alert_policies_operations.py | 10 +- ...rver_security_alert_policies_operations.py | 10 +- .../sql/operations/_sync_groups_operations.py | 4 +- ...t_data_encryption_activities_operations.py | 132 ----------- ...transparent_data_encryptions_operations.py | 188 ++++++++++----- 23 files changed, 795 insertions(+), 777 deletions(-) delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py delete mode 100644 sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py diff --git a/sdk/sql/azure-mgmt-sql/_meta.json b/sdk/sql/azure-mgmt-sql/_meta.json index 05c8c8d78316..89dcdce3b570 100644 --- a/sdk/sql/azure-mgmt-sql/_meta.json +++ b/sdk/sql/azure-mgmt-sql/_meta.json @@ -4,7 +4,7 @@ "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "cc268fe6b328f3857edb3ec9bce796e7ffc11f85", + "commit": "50aff77e7d04154b16b0be1e0acc8b184ac4b47f", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest_command": "autorest specification/sql/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "readme": "specification/sql/resource-manager/readme.md" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json index 4d0c4303c3ab..1b29f061f6dd 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json @@ -110,8 +110,6 @@ "service_objectives": "ServiceObjectivesOperations", "elastic_pool_activities": "ElasticPoolActivitiesOperations", "elastic_pool_database_activities": "ElasticPoolDatabaseActivitiesOperations", - "transparent_data_encryptions": "TransparentDataEncryptionsOperations", - "transparent_data_encryption_activities": "TransparentDataEncryptionActivitiesOperations", "server_usages": "ServerUsagesOperations", "extended_database_blob_auditing_policies": "ExtendedDatabaseBlobAuditingPoliciesOperations", "extended_server_blob_auditing_policies": "ExtendedServerBlobAuditingPoliciesOperations", @@ -208,6 +206,7 @@ "virtual_network_rules": "VirtualNetworkRulesOperations", "workload_classifiers": "WorkloadClassifiersOperations", "workload_groups": "WorkloadGroupsOperations", + "transparent_data_encryptions": "TransparentDataEncryptionsOperations", "backup_short_term_retention_policies": "BackupShortTermRetentionPoliciesOperations", "database_extensions": "DatabaseExtensionsOperations", "database_operations": "DatabaseOperationsOperations", diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py index 7cc74c21d044..83ca21e5de7f 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_sql_management_client.py @@ -31,8 +31,6 @@ from .operations import ServiceObjectivesOperations from .operations import ElasticPoolActivitiesOperations from .operations import ElasticPoolDatabaseActivitiesOperations -from .operations import TransparentDataEncryptionsOperations -from .operations import TransparentDataEncryptionActivitiesOperations from .operations import ServerUsagesOperations from .operations import ExtendedDatabaseBlobAuditingPoliciesOperations from .operations import ExtendedServerBlobAuditingPoliciesOperations @@ -129,6 +127,7 @@ from .operations import VirtualNetworkRulesOperations from .operations import WorkloadClassifiersOperations from .operations import WorkloadGroupsOperations +from .operations import TransparentDataEncryptionsOperations from .operations import BackupShortTermRetentionPoliciesOperations from .operations import DatabaseExtensionsOperations from .operations import DatabaseOperationsOperations @@ -169,10 +168,6 @@ class SqlManagementClient(object): :vartype elastic_pool_activities: azure.mgmt.sql.operations.ElasticPoolActivitiesOperations :ivar elastic_pool_database_activities: ElasticPoolDatabaseActivitiesOperations operations :vartype elastic_pool_database_activities: azure.mgmt.sql.operations.ElasticPoolDatabaseActivitiesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: azure.mgmt.sql.operations.TransparentDataEncryptionsOperations - :ivar transparent_data_encryption_activities: TransparentDataEncryptionActivitiesOperations operations - :vartype transparent_data_encryption_activities: azure.mgmt.sql.operations.TransparentDataEncryptionActivitiesOperations :ivar server_usages: ServerUsagesOperations operations :vartype server_usages: azure.mgmt.sql.operations.ServerUsagesOperations :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations operations @@ -365,6 +360,8 @@ class SqlManagementClient(object): :vartype workload_classifiers: azure.mgmt.sql.operations.WorkloadClassifiersOperations :ivar workload_groups: WorkloadGroupsOperations operations :vartype workload_groups: azure.mgmt.sql.operations.WorkloadGroupsOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: azure.mgmt.sql.operations.TransparentDataEncryptionsOperations :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations operations :vartype backup_short_term_retention_policies: azure.mgmt.sql.operations.BackupShortTermRetentionPoliciesOperations :ivar database_extensions: DatabaseExtensionsOperations operations @@ -435,10 +432,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryption_activities = TransparentDataEncryptionActivitiesOperations( - self._client, self._config, self._serialize, self._deserialize) self.server_usages = ServerUsagesOperations( self._client, self._config, self._serialize, self._deserialize) self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( @@ -631,6 +624,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.workload_groups = WorkloadGroupsOperations( self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize) self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.database_extensions = DatabaseExtensionsOperations( diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py index 42cbaea39a1c..c78e629b6f08 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.1" +VERSION = "0.9.0" diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py index c43d2b6edb43..48e25a82edfc 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/_sql_management_client.py @@ -29,8 +29,6 @@ from .operations import ServiceObjectivesOperations from .operations import ElasticPoolActivitiesOperations from .operations import ElasticPoolDatabaseActivitiesOperations -from .operations import TransparentDataEncryptionsOperations -from .operations import TransparentDataEncryptionActivitiesOperations from .operations import ServerUsagesOperations from .operations import ExtendedDatabaseBlobAuditingPoliciesOperations from .operations import ExtendedServerBlobAuditingPoliciesOperations @@ -127,6 +125,7 @@ from .operations import VirtualNetworkRulesOperations from .operations import WorkloadClassifiersOperations from .operations import WorkloadGroupsOperations +from .operations import TransparentDataEncryptionsOperations from .operations import BackupShortTermRetentionPoliciesOperations from .operations import DatabaseExtensionsOperations from .operations import DatabaseOperationsOperations @@ -167,10 +166,6 @@ class SqlManagementClient(object): :vartype elastic_pool_activities: azure.mgmt.sql.aio.operations.ElasticPoolActivitiesOperations :ivar elastic_pool_database_activities: ElasticPoolDatabaseActivitiesOperations operations :vartype elastic_pool_database_activities: azure.mgmt.sql.aio.operations.ElasticPoolDatabaseActivitiesOperations - :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations - :vartype transparent_data_encryptions: azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations - :ivar transparent_data_encryption_activities: TransparentDataEncryptionActivitiesOperations operations - :vartype transparent_data_encryption_activities: azure.mgmt.sql.aio.operations.TransparentDataEncryptionActivitiesOperations :ivar server_usages: ServerUsagesOperations operations :vartype server_usages: azure.mgmt.sql.aio.operations.ServerUsagesOperations :ivar extended_database_blob_auditing_policies: ExtendedDatabaseBlobAuditingPoliciesOperations operations @@ -363,6 +358,8 @@ class SqlManagementClient(object): :vartype workload_classifiers: azure.mgmt.sql.aio.operations.WorkloadClassifiersOperations :ivar workload_groups: WorkloadGroupsOperations operations :vartype workload_groups: azure.mgmt.sql.aio.operations.WorkloadGroupsOperations + :ivar transparent_data_encryptions: TransparentDataEncryptionsOperations operations + :vartype transparent_data_encryptions: azure.mgmt.sql.aio.operations.TransparentDataEncryptionsOperations :ivar backup_short_term_retention_policies: BackupShortTermRetentionPoliciesOperations operations :vartype backup_short_term_retention_policies: azure.mgmt.sql.aio.operations.BackupShortTermRetentionPoliciesOperations :ivar database_extensions: DatabaseExtensionsOperations operations @@ -432,10 +429,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.elastic_pool_database_activities = ElasticPoolDatabaseActivitiesOperations( self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryptions = TransparentDataEncryptionsOperations( - self._client, self._config, self._serialize, self._deserialize) - self.transparent_data_encryption_activities = TransparentDataEncryptionActivitiesOperations( - self._client, self._config, self._serialize, self._deserialize) self.server_usages = ServerUsagesOperations( self._client, self._config, self._serialize, self._deserialize) self.extended_database_blob_auditing_policies = ExtendedDatabaseBlobAuditingPoliciesOperations( @@ -628,6 +621,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.workload_groups = WorkloadGroupsOperations( self._client, self._config, self._serialize, self._deserialize) + self.transparent_data_encryptions = TransparentDataEncryptionsOperations( + self._client, self._config, self._serialize, self._deserialize) self.backup_short_term_retention_policies = BackupShortTermRetentionPoliciesOperations( self._client, self._config, self._serialize, self._deserialize) self.database_extensions = DatabaseExtensionsOperations( diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py index 92dc7fbad3cb..829699e399fe 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/__init__.py @@ -18,8 +18,6 @@ from ._service_objectives_operations import ServiceObjectivesOperations from ._elastic_pool_activities_operations import ElasticPoolActivitiesOperations from ._elastic_pool_database_activities_operations import ElasticPoolDatabaseActivitiesOperations -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations -from ._transparent_data_encryption_activities_operations import TransparentDataEncryptionActivitiesOperations from ._server_usages_operations import ServerUsagesOperations from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations @@ -116,6 +114,7 @@ from ._virtual_network_rules_operations import VirtualNetworkRulesOperations from ._workload_classifiers_operations import WorkloadClassifiersOperations from ._workload_groups_operations import WorkloadGroupsOperations +from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from ._database_extensions_operations import DatabaseExtensionsOperations from ._database_operations_operations import DatabaseOperationsOperations @@ -140,8 +139,6 @@ 'ServiceObjectivesOperations', 'ElasticPoolActivitiesOperations', 'ElasticPoolDatabaseActivitiesOperations', - 'TransparentDataEncryptionsOperations', - 'TransparentDataEncryptionActivitiesOperations', 'ServerUsagesOperations', 'ExtendedDatabaseBlobAuditingPoliciesOperations', 'ExtendedServerBlobAuditingPoliciesOperations', @@ -238,6 +235,7 @@ 'VirtualNetworkRulesOperations', 'WorkloadClassifiersOperations', 'WorkloadGroupsOperations', + 'TransparentDataEncryptionsOperations', 'BackupShortTermRetentionPoliciesOperations', 'DatabaseExtensionsOperations', 'DatabaseOperationsOperations', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py index f68bf89ad335..91146f456188 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_ledger_digest_uploads_operations.py @@ -12,7 +12,9 @@ from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling from ... import models as _models @@ -108,7 +110,7 @@ async def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore - async def create_or_update( + async def _create_or_update_initial( self, resource_group_name: str, server_name: str, @@ -117,25 +119,6 @@ async def create_or_update( parameters: "_models.LedgerDigestUploads", **kwargs: Any ) -> Optional["_models.LedgerDigestUploads"]: - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -146,7 +129,7 @@ async def create_or_update( accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -184,7 +167,90 @@ async def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + + async def begin_create_or_update( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, "_models.LedgerDigestUploadsName"], + parameters: "_models.LedgerDigestUploads", + **kwargs: Any + ) -> AsyncLROPoller["_models.LedgerDigestUploads"]: + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore def list_by_database( self, @@ -265,7 +331,7 @@ async def get_next(next_link=None): ) list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads'} # type: ignore - async def disable( + async def _disable_initial( self, resource_group_name: str, server_name: str, @@ -273,23 +339,6 @@ async def disable( ledger_digest_uploads: Union[str, "_models.LedgerDigestUploadsName"], **kwargs: Any ) -> Optional["_models.LedgerDigestUploads"]: - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -299,7 +348,7 @@ async def disable( accept = "application/json" # Construct URL - url = self.disable.metadata['url'] # type: ignore + url = self._disable_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -333,4 +382,83 @@ async def disable( return cls(pipeline_response, deserialized, {}) return deserialized - disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + _disable_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + + async def begin_disable( + self, + resource_group_name: str, + server_name: str, + database_name: str, + ledger_digest_uploads: Union[str, "_models.LedgerDigestUploadsName"], + **kwargs: Any + ) -> AsyncLROPoller["_models.LedgerDigestUploads"]: + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._disable_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py index 55e5422d21dc..3bfa09c9a56b 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_managed_server_security_alert_policies_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], **kwargs: Any ) -> "_models.ManagedServerSecurityAlertPolicy": """Get a managed server's threat detection policy. @@ -58,7 +58,7 @@ async def get( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ManagedServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy @@ -110,7 +110,7 @@ async def _create_or_update_initial( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ManagedServerSecurityAlertPolicy", **kwargs: Any ) -> Optional["_models.ManagedServerSecurityAlertPolicy"]: @@ -167,7 +167,7 @@ async def begin_create_or_update( self, resource_group_name: str, managed_instance_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ManagedServerSecurityAlertPolicy", **kwargs: Any ) -> AsyncLROPoller["_models.ManagedServerSecurityAlertPolicy"]: @@ -179,7 +179,7 @@ async def begin_create_or_update( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The managed server security alert policy. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py index 991d0be5e5c8..8086f41e9c49 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_server_security_alert_policies_operations.py @@ -47,7 +47,7 @@ async def get( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], **kwargs: Any ) -> "_models.ServerSecurityAlertPolicy": """Get a server's security alert policy. @@ -58,7 +58,7 @@ async def get( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy @@ -110,7 +110,7 @@ async def _create_or_update_initial( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ServerSecurityAlertPolicy", **kwargs: Any ) -> Optional["_models.ServerSecurityAlertPolicy"]: @@ -167,7 +167,7 @@ async def begin_create_or_update( self, resource_group_name: str, server_name: str, - security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"], + security_alert_policy_name: Union[str, "_models.SecurityAlertPolicyName"], parameters: "_models.ServerSecurityAlertPolicy", **kwargs: Any ) -> AsyncLROPoller["_models.ServerSecurityAlertPolicy"]: @@ -179,7 +179,7 @@ async def begin_create_or_update( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The server security alert policy. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py index 2a714c6b13da..f3c72b6ac894 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_sync_groups_operations.py @@ -325,7 +325,7 @@ def list_logs( sync_group_name: str, start_time: str, end_time: str, - type: Union[str, "_models.Enum77"], + type: Union[str, "_models.Enum75"], continuation_token_parameter: Optional[str] = None, **kwargs: Any ) -> AsyncIterable["_models.SyncGroupLogListResult"]: @@ -345,7 +345,7 @@ def list_logs( :param end_time: Get logs generated before this time. :type end_time: str :param type: The types of logs to retrieve. - :type type: str or ~azure.mgmt.sql.models.Enum77 + :type type: str or ~azure.mgmt.sql.models.Enum75 :param continuation_token_parameter: The continuation token for this operation. :type continuation_token_parameter: str :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py deleted file mode 100644 index ee95b2c2ae88..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryption_activities_operations.py +++ /dev/null @@ -1,127 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union -import warnings - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models - -T = TypeVar('T') -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - -class TransparentDataEncryptionActivitiesOperations: - """TransparentDataEncryptionActivitiesOperations async operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.sql.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer) -> None: - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_configuration( - self, - resource_group_name: str, - server_name: str, - database_name: str, - transparent_data_encryption_name: Union[str, "_models.TransparentDataEncryptionName"], - **kwargs: Any - ) -> AsyncIterable["_models.TransparentDataEncryptionActivityListResult"]: - """Returns a database's transparent data encryption operation result. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database for which the transparent data encryption - applies. - :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TransparentDataEncryptionActivityListResult or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.TransparentDataEncryptionActivityListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryptionActivityListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - async def extract_data(pipeline_response): - deserialized = self._deserialize('TransparentDataEncryptionActivityListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged( - get_next, extract_data - ) - list_by_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py index 8894320e1575..9da319aff594 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/aio/operations/_transparent_data_encryptions_operations.py @@ -5,9 +5,10 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union +from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union import warnings +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest @@ -40,53 +41,47 @@ def __init__(self, client, config, serializer, deserializer) -> None: self._deserialize = deserializer self._config = config - async def create_or_update( + async def get( self, resource_group_name: str, server_name: str, database_name: str, - transparent_data_encryption_name: Union[str, "_models.TransparentDataEncryptionName"], - parameters: "_models.TransparentDataEncryption", + tde_name: Union[str, "_models.TransparentDataEncryptionName"], **kwargs: Any - ) -> "_models.TransparentDataEncryption": - """Creates or updates a database's transparent data encryption configuration. + ) -> "_models.LogicalDatabaseTransparentDataEncryption": + """Gets a logical database's transparent data encryption. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database for which setting the transparent data - encryption applies. + :param database_name: The name of the logical database for which the transparent data + encryption is defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The required parameters for creating or updating transparent data - encryption. - :type parameters: ~azure.mgmt.sql.models.TransparentDataEncryption + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryption"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-02-01-preview" accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -96,74 +91,69 @@ async def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TransparentDataEncryption') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore - async def get( + async def create_or_update( self, resource_group_name: str, server_name: str, database_name: str, - transparent_data_encryption_name: Union[str, "_models.TransparentDataEncryptionName"], + tde_name: Union[str, "_models.TransparentDataEncryptionName"], + parameters: "_models.LogicalDatabaseTransparentDataEncryption", **kwargs: Any - ) -> "_models.TransparentDataEncryption": - """Gets a database's transparent data encryption configuration. + ) -> Optional["_models.LogicalDatabaseTransparentDataEncryption"]: + """Updates a logical database's transparent data encryption configuration. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database for which the transparent data encryption - applies. + :param database_name: The name of the logical database for which the security alert policy is + defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogicalDatabaseTransparentDataEncryption"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -173,20 +163,109 @@ async def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LogicalDatabaseTransparentDataEncryption') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore + + def list_by_database( + self, + resource_group_name: str, + server_name: str, + database_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.LogicalDatabaseTransparentDataEncryptionListResult"]: + """Gets a list of the logical database's transparent data encryption. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the logical database for which the transparent data + encryption is defined. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LogicalDatabaseTransparentDataEncryptionListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py index db89bafe250b..3ea0341a7c9c 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/__init__.py @@ -124,6 +124,8 @@ from ._models_py3 import LicenseTypeCapability from ._models_py3 import LocationCapabilities from ._models_py3 import LogSizeCapability + from ._models_py3 import LogicalDatabaseTransparentDataEncryption + from ._models_py3 import LogicalDatabaseTransparentDataEncryptionListResult from ._models_py3 import LogicalServerSecurityAlertPolicyListResult from ._models_py3 import LongTermRetentionBackup from ._models_py3 import LongTermRetentionBackupListResult @@ -323,9 +325,6 @@ from ._models_py3 import TopQueries from ._models_py3 import TopQueriesListResult from ._models_py3 import TrackedResource - from ._models_py3 import TransparentDataEncryption - from ._models_py3 import TransparentDataEncryptionActivity - from ._models_py3 import TransparentDataEncryptionActivityListResult from ._models_py3 import UnlinkParameters from ._models_py3 import UpdateLongTermRetentionBackupParameters from ._models_py3 import UpdateManagedInstanceDnsServersOperation @@ -465,6 +464,8 @@ from ._models import LicenseTypeCapability # type: ignore from ._models import LocationCapabilities # type: ignore from ._models import LogSizeCapability # type: ignore + from ._models import LogicalDatabaseTransparentDataEncryption # type: ignore + from ._models import LogicalDatabaseTransparentDataEncryptionListResult # type: ignore from ._models import LogicalServerSecurityAlertPolicyListResult # type: ignore from ._models import LongTermRetentionBackup # type: ignore from ._models import LongTermRetentionBackupListResult # type: ignore @@ -664,9 +665,6 @@ from ._models import TopQueries # type: ignore from ._models import TopQueriesListResult # type: ignore from ._models import TrackedResource # type: ignore - from ._models import TransparentDataEncryption # type: ignore - from ._models import TransparentDataEncryptionActivity # type: ignore - from ._models import TransparentDataEncryptionActivityListResult # type: ignore from ._models import UnlinkParameters # type: ignore from ._models import UpdateLongTermRetentionBackupParameters # type: ignore from ._models import UpdateManagedInstanceDnsServersOperation # type: ignore @@ -728,7 +726,7 @@ ElasticPoolLicenseType, ElasticPoolState, EncryptionProtectorName, - Enum77, + Enum75, FailoverGroupReplicationRole, GeoBackupPolicyName, GeoBackupPolicyState, @@ -789,7 +787,6 @@ SampleName, SecondaryType, SecurityAlertPolicyName, - SecurityAlertPolicyNameAutoGenerated, SecurityAlertPolicyState, SecurityAlertsPolicyState, SecurityEventType, @@ -816,10 +813,8 @@ SyncMemberState, TableTemporalType, TargetBackupStorageRedundancy, - TransparentDataEncryptionActivityStatus, TransparentDataEncryptionName, TransparentDataEncryptionState, - TransparentDataEncryptionStatus, UnitDefinitionType, UnitType, UpsertManagedServerOperationStepStatus, @@ -948,6 +943,8 @@ 'LicenseTypeCapability', 'LocationCapabilities', 'LogSizeCapability', + 'LogicalDatabaseTransparentDataEncryption', + 'LogicalDatabaseTransparentDataEncryptionListResult', 'LogicalServerSecurityAlertPolicyListResult', 'LongTermRetentionBackup', 'LongTermRetentionBackupListResult', @@ -1147,9 +1144,6 @@ 'TopQueries', 'TopQueriesListResult', 'TrackedResource', - 'TransparentDataEncryption', - 'TransparentDataEncryptionActivity', - 'TransparentDataEncryptionActivityListResult', 'UnlinkParameters', 'UpdateLongTermRetentionBackupParameters', 'UpdateManagedInstanceDnsServersOperation', @@ -1209,7 +1203,7 @@ 'ElasticPoolLicenseType', 'ElasticPoolState', 'EncryptionProtectorName', - 'Enum77', + 'Enum75', 'FailoverGroupReplicationRole', 'GeoBackupPolicyName', 'GeoBackupPolicyState', @@ -1270,7 +1264,6 @@ 'SampleName', 'SecondaryType', 'SecurityAlertPolicyName', - 'SecurityAlertPolicyNameAutoGenerated', 'SecurityAlertPolicyState', 'SecurityAlertsPolicyState', 'SecurityEventType', @@ -1297,10 +1290,8 @@ 'SyncMemberState', 'TableTemporalType', 'TargetBackupStorageRedundancy', - 'TransparentDataEncryptionActivityStatus', 'TransparentDataEncryptionName', 'TransparentDataEncryptionState', - 'TransparentDataEncryptionStatus', 'UnitDefinitionType', 'UnitType', 'UpsertManagedServerOperationStepStatus', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py index 5dd8f1a0f817..5ba2a66d5a46 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models.py @@ -6150,6 +6150,73 @@ def __init__( self.reason = kwargs.get('reason', None) +class LogicalDatabaseTransparentDataEncryption(ProxyResource): + """A logical database transparent data encryption state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Specifies the state of the transparent data encryption. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryption, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + + +class LogicalDatabaseTransparentDataEncryptionListResult(msrest.serialization.Model): + """A list of transparent data encryptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LogicalDatabaseTransparentDataEncryption]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryptionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class LogicalServerSecurityAlertPolicyListResult(msrest.serialization.Model): """A list of the server's security alert policies. @@ -15097,121 +15164,6 @@ def __init__( self.next_link = None -class TransparentDataEncryption(ProxyResource): - """Represents a database transparent data encryption configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :param status: The status of the database transparent data encryption. Possible values include: - "Enabled", "Disabled". - :type status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = kwargs.get('status', None) - - -class TransparentDataEncryptionActivity(ProxyResource): - """Represents a database transparent data encryption Scan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :ivar status: The status of the database. Possible values include: "Encrypting", "Decrypting". - :vartype status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionActivityStatus - :ivar percent_complete: The percent complete of the transparent data encryption scan for a - database. - :vartype percent_complete: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'status': {'readonly': True}, - 'percent_complete': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryptionActivity, self).__init__(**kwargs) - self.location = None - self.status = None - self.percent_complete = None - - -class TransparentDataEncryptionActivityListResult(msrest.serialization.Model): - """Represents the response to a list database transparent data encryption activity request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The list of database transparent data encryption activities. - :type value: list[~azure.mgmt.sql.models.TransparentDataEncryptionActivity] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[TransparentDataEncryptionActivity]'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryptionActivityListResult, self).__init__(**kwargs) - self.value = kwargs['value'] - - class UnlinkParameters(msrest.serialization.Model): """Represents the parameters for Unlink Replication Link request. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py index 2c17ba58eb75..aa4c856367d2 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_models_py3.py @@ -6504,6 +6504,75 @@ def __init__( self.reason = reason +class LogicalDatabaseTransparentDataEncryption(ProxyResource): + """A logical database transparent data encryption state. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Resource ID. + :vartype id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param state: Specifies the state of the transparent data encryption. Possible values include: + "Enabled", "Disabled". + :type state: str or ~azure.mgmt.sql.models.TransparentDataEncryptionState + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'str'}, + } + + def __init__( + self, + *, + state: Optional[Union[str, "TransparentDataEncryptionState"]] = None, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryption, self).__init__(**kwargs) + self.state = state + + +class LogicalDatabaseTransparentDataEncryptionListResult(msrest.serialization.Model): + """A list of transparent data encryptions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Array of results. + :vartype value: list[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption] + :ivar next_link: Link to retrieve next page of results. + :vartype next_link: str + """ + + _validation = { + 'value': {'readonly': True}, + 'next_link': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LogicalDatabaseTransparentDataEncryption]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(LogicalDatabaseTransparentDataEncryptionListResult, self).__init__(**kwargs) + self.value = None + self.next_link = None + + class LogicalServerSecurityAlertPolicyListResult(msrest.serialization.Model): """A list of the server's security alert policies. @@ -15866,125 +15935,6 @@ def __init__( self.next_link = None -class TransparentDataEncryption(ProxyResource): - """Represents a database transparent data encryption configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :param status: The status of the database transparent data encryption. Possible values include: - "Enabled", "Disabled". - :type status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionStatus - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - } - - def __init__( - self, - *, - status: Optional[Union[str, "TransparentDataEncryptionStatus"]] = None, - **kwargs - ): - super(TransparentDataEncryption, self).__init__(**kwargs) - self.location = None - self.status = status - - -class TransparentDataEncryptionActivity(ProxyResource): - """Represents a database transparent data encryption Scan. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Resource ID. - :vartype id: str - :ivar name: Resource name. - :vartype name: str - :ivar type: Resource type. - :vartype type: str - :ivar location: Resource location. - :vartype location: str - :ivar status: The status of the database. Possible values include: "Encrypting", "Decrypting". - :vartype status: str or ~azure.mgmt.sql.models.TransparentDataEncryptionActivityStatus - :ivar percent_complete: The percent complete of the transparent data encryption scan for a - database. - :vartype percent_complete: float - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'location': {'readonly': True}, - 'status': {'readonly': True}, - 'percent_complete': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'status': {'key': 'properties.status', 'type': 'str'}, - 'percent_complete': {'key': 'properties.percentComplete', 'type': 'float'}, - } - - def __init__( - self, - **kwargs - ): - super(TransparentDataEncryptionActivity, self).__init__(**kwargs) - self.location = None - self.status = None - self.percent_complete = None - - -class TransparentDataEncryptionActivityListResult(msrest.serialization.Model): - """Represents the response to a list database transparent data encryption activity request. - - All required parameters must be populated in order to send to Azure. - - :param value: Required. The list of database transparent data encryption activities. - :type value: list[~azure.mgmt.sql.models.TransparentDataEncryptionActivity] - """ - - _validation = { - 'value': {'required': True}, - } - - _attribute_map = { - 'value': {'key': 'value', 'type': '[TransparentDataEncryptionActivity]'}, - } - - def __init__( - self, - *, - value: List["TransparentDataEncryptionActivity"], - **kwargs - ): - super(TransparentDataEncryptionActivityListResult, self).__init__(**kwargs) - self.value = value - - class UnlinkParameters(msrest.serialization.Model): """Represents the parameters for Unlink Replication Link request. diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py index a9a95e2d3790..4a2dbebfc910 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/models/_sql_management_client_enums.py @@ -411,7 +411,7 @@ class EncryptionProtectorName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum CURRENT = "current" -class Enum77(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): +class Enum75(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): ALL = "All" ERROR = "Error" @@ -903,10 +903,6 @@ class SecondaryType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): class SecurityAlertPolicyName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - DEFAULT = "default" - -class SecurityAlertPolicyNameAutoGenerated(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - DEFAULT = "Default" class SecurityAlertPolicyState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): @@ -1181,13 +1177,6 @@ class TargetBackupStorageRedundancy(with_metaclass(_CaseInsensitiveEnumMeta, str LOCAL = "Local" ZONE = "Zone" -class TransparentDataEncryptionActivityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the database. - """ - - ENCRYPTING = "Encrypting" - DECRYPTING = "Decrypting" - class TransparentDataEncryptionName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): CURRENT = "current" @@ -1199,13 +1188,6 @@ class TransparentDataEncryptionState(with_metaclass(_CaseInsensitiveEnumMeta, st ENABLED = "Enabled" DISABLED = "Disabled" -class TransparentDataEncryptionStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The status of the database transparent data encryption. - """ - - ENABLED = "Enabled" - DISABLED = "Disabled" - class UnitDefinitionType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The unit of the metric. """ diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py index 92dc7fbad3cb..829699e399fe 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/__init__.py @@ -18,8 +18,6 @@ from ._service_objectives_operations import ServiceObjectivesOperations from ._elastic_pool_activities_operations import ElasticPoolActivitiesOperations from ._elastic_pool_database_activities_operations import ElasticPoolDatabaseActivitiesOperations -from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations -from ._transparent_data_encryption_activities_operations import TransparentDataEncryptionActivitiesOperations from ._server_usages_operations import ServerUsagesOperations from ._extended_database_blob_auditing_policies_operations import ExtendedDatabaseBlobAuditingPoliciesOperations from ._extended_server_blob_auditing_policies_operations import ExtendedServerBlobAuditingPoliciesOperations @@ -116,6 +114,7 @@ from ._virtual_network_rules_operations import VirtualNetworkRulesOperations from ._workload_classifiers_operations import WorkloadClassifiersOperations from ._workload_groups_operations import WorkloadGroupsOperations +from ._transparent_data_encryptions_operations import TransparentDataEncryptionsOperations from ._backup_short_term_retention_policies_operations import BackupShortTermRetentionPoliciesOperations from ._database_extensions_operations import DatabaseExtensionsOperations from ._database_operations_operations import DatabaseOperationsOperations @@ -140,8 +139,6 @@ 'ServiceObjectivesOperations', 'ElasticPoolActivitiesOperations', 'ElasticPoolDatabaseActivitiesOperations', - 'TransparentDataEncryptionsOperations', - 'TransparentDataEncryptionActivitiesOperations', 'ServerUsagesOperations', 'ExtendedDatabaseBlobAuditingPoliciesOperations', 'ExtendedServerBlobAuditingPoliciesOperations', @@ -238,6 +235,7 @@ 'VirtualNetworkRulesOperations', 'WorkloadClassifiersOperations', 'WorkloadGroupsOperations', + 'TransparentDataEncryptionsOperations', 'BackupShortTermRetentionPoliciesOperations', 'DatabaseExtensionsOperations', 'DatabaseOperationsOperations', diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py index db8e2947abab..3f74b2164b24 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_ledger_digest_uploads_operations.py @@ -12,7 +12,9 @@ from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling from .. import models as _models @@ -113,7 +115,7 @@ def get( return deserialized get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore - def create_or_update( + def _create_or_update_initial( self, resource_group_name, # type: str server_name, # type: str @@ -123,25 +125,6 @@ def create_or_update( **kwargs # type: Any ): # type: (...) -> Optional["_models.LedgerDigestUploads"] - """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :param parameters: - :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -152,7 +135,7 @@ def create_or_update( accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self._create_or_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -190,7 +173,91 @@ def create_or_update( return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + _create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore + + def begin_create_or_update( + self, + resource_group_name, # type: str + server_name, # type: str + database_name, # type: str + ledger_digest_uploads, # type: Union[str, "_models.LedgerDigestUploadsName"] + parameters, # type: "_models.LedgerDigestUploads" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.LedgerDigestUploads"] + """Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :param parameters: + :type parameters: ~azure.mgmt.sql.models.LedgerDigestUploads + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + parameters=parameters, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}'} # type: ignore def list_by_database( self, @@ -272,7 +339,7 @@ def get_next(next_link=None): ) list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads'} # type: ignore - def disable( + def _disable_initial( self, resource_group_name, # type: str server_name, # type: str @@ -281,23 +348,6 @@ def disable( **kwargs # type: Any ): # type: (...) -> Optional["_models.LedgerDigestUploads"] - """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger - instance. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database. - :type database_name: str - :param ledger_digest_uploads: - :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: LedgerDigestUploads, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.LedgerDigestUploads or None - :raises: ~azure.core.exceptions.HttpResponseError - """ cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LedgerDigestUploads"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError @@ -307,7 +357,7 @@ def disable( accept = "application/json" # Construct URL - url = self.disable.metadata['url'] # type: ignore + url = self._disable_initial.metadata['url'] # type: ignore path_format_arguments = { 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), @@ -341,4 +391,84 @@ def disable( return cls(pipeline_response, deserialized, {}) return deserialized - disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + _disable_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore + + def begin_disable( + self, + resource_group_name, # type: str + server_name, # type: str + database_name, # type: str + ledger_digest_uploads, # type: Union[str, "_models.LedgerDigestUploadsName"] + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.LedgerDigestUploads"] + """Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger + instance. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the database. + :type database_name: str + :param ledger_digest_uploads: + :type ledger_digest_uploads: str or ~azure.mgmt.sql.models.LedgerDigestUploadsName + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either LedgerDigestUploads or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.sql.models.LedgerDigestUploads] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LedgerDigestUploads"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._disable_initial( + resource_group_name=resource_group_name, + server_name=server_name, + database_name=database_name, + ledger_digest_uploads=ledger_digest_uploads, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('LedgerDigestUploads', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'ledgerDigestUploads': self._serialize.url("ledger_digest_uploads", ledger_digest_uploads, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_disable.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py index aef6ed163ac5..429162531975 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_managed_server_security_alert_policies_operations.py @@ -51,7 +51,7 @@ def get( self, resource_group_name, # type: str managed_instance_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] **kwargs # type: Any ): # type: (...) -> "_models.ManagedServerSecurityAlertPolicy" @@ -63,7 +63,7 @@ def get( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ManagedServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy @@ -115,7 +115,7 @@ def _create_or_update_initial( self, resource_group_name, # type: str managed_instance_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ManagedServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -173,7 +173,7 @@ def begin_create_or_update( self, resource_group_name, # type: str managed_instance_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ManagedServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -186,7 +186,7 @@ def begin_create_or_update( :param managed_instance_name: The name of the managed instance. :type managed_instance_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The managed server security alert policy. :type parameters: ~azure.mgmt.sql.models.ManagedServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py index 34ca09e756df..3534bc825bf3 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_server_security_alert_policies_operations.py @@ -51,7 +51,7 @@ def get( self, resource_group_name, # type: str server_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] **kwargs # type: Any ): # type: (...) -> "_models.ServerSecurityAlertPolicy" @@ -63,7 +63,7 @@ def get( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the security alert policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :keyword callable cls: A custom type or function that will be passed the direct response :return: ServerSecurityAlertPolicy, or the result of cls(response) :rtype: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy @@ -115,7 +115,7 @@ def _create_or_update_initial( self, resource_group_name, # type: str server_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -173,7 +173,7 @@ def begin_create_or_update( self, resource_group_name, # type: str server_name, # type: str - security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyNameAutoGenerated"] + security_alert_policy_name, # type: Union[str, "_models.SecurityAlertPolicyName"] parameters, # type: "_models.ServerSecurityAlertPolicy" **kwargs # type: Any ): @@ -186,7 +186,7 @@ def begin_create_or_update( :param server_name: The name of the server. :type server_name: str :param security_alert_policy_name: The name of the threat detection policy. - :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyNameAutoGenerated + :type security_alert_policy_name: str or ~azure.mgmt.sql.models.SecurityAlertPolicyName :param parameters: The server security alert policy. :type parameters: ~azure.mgmt.sql.models.ServerSecurityAlertPolicy :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py index a3256265690f..0a61693e5942 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_sync_groups_operations.py @@ -333,7 +333,7 @@ def list_logs( sync_group_name, # type: str start_time, # type: str end_time, # type: str - type, # type: Union[str, "_models.Enum77"] + type, # type: Union[str, "_models.Enum75"] continuation_token_parameter=None, # type: Optional[str] **kwargs # type: Any ): @@ -354,7 +354,7 @@ def list_logs( :param end_time: Get logs generated before this time. :type end_time: str :param type: The types of logs to retrieve. - :type type: str or ~azure.mgmt.sql.models.Enum77 + :type type: str or ~azure.mgmt.sql.models.Enum75 :param continuation_token_parameter: The continuation token for this operation. :type continuation_token_parameter: str :keyword callable cls: A custom type or function that will be passed the direct response diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py deleted file mode 100644 index ec34c61315c6..000000000000 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryption_activities_operations.py +++ /dev/null @@ -1,132 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from typing import TYPE_CHECKING -import warnings - -from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.pipeline.transport import HttpRequest, HttpResponse -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models - -if TYPE_CHECKING: - # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union - - T = TypeVar('T') - ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -class TransparentDataEncryptionActivitiesOperations(object): - """TransparentDataEncryptionActivitiesOperations operations. - - You should not instantiate this class directly. Instead, you should create a Client instance that - instantiates it for you and attaches it as an attribute. - - :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.sql.models - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = _models - - def __init__(self, client, config, serializer, deserializer): - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self._config = config - - def list_by_configuration( - self, - resource_group_name, # type: str - server_name, # type: str - database_name, # type: str - transparent_data_encryption_name, # type: Union[str, "_models.TransparentDataEncryptionName"] - **kwargs # type: Any - ): - # type: (...) -> Iterable["_models.TransparentDataEncryptionActivityListResult"] - """Returns a database's transparent data encryption operation result. - - :param resource_group_name: The name of the resource group that contains the resource. You can - obtain this value from the Azure Resource Manager API or the portal. - :type resource_group_name: str - :param server_name: The name of the server. - :type server_name: str - :param database_name: The name of the database for which the transparent data encryption - applies. - :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :keyword callable cls: A custom type or function that will be passed the direct response - :return: An iterator like instance of either TransparentDataEncryptionActivityListResult or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.TransparentDataEncryptionActivityListResult] - :raises: ~azure.core.exceptions.HttpResponseError - """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryptionActivityListResult"] - error_map = { - 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError - } - error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - accept = "application/json" - - def prepare_request(next_link=None): - # Construct headers - header_parameters = {} # type: Dict[str, Any] - header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - - if not next_link: - # Construct URL - url = self.list_by_configuration.metadata['url'] # type: ignore - path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), - 'serverName': self._serialize.url("server_name", server_name, 'str'), - 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), - } - url = self._client.format_url(url, **path_format_arguments) - # Construct parameters - query_parameters = {} # type: Dict[str, Any] - query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') - - request = self._client.get(url, query_parameters, header_parameters) - else: - url = next_link - query_parameters = {} # type: Dict[str, Any] - request = self._client.get(url, query_parameters, header_parameters) - return request - - def extract_data(pipeline_response): - deserialized = self._deserialize('TransparentDataEncryptionActivityListResult', pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) - return None, iter(list_of_elem) - - def get_next(next_link=None): - request = prepare_request(next_link) - - pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged( - get_next, extract_data - ) - list_by_configuration.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}/operationResults'} # type: ignore diff --git a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py index df0ecaabf571..ff414142d1c4 100644 --- a/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py +++ b/sdk/sql/azure-mgmt-sql/azure/mgmt/sql/operations/_transparent_data_encryptions_operations.py @@ -9,6 +9,7 @@ import warnings from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpRequest, HttpResponse from azure.mgmt.core.exceptions import ARMErrorFormat @@ -17,7 +18,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Generic, Optional, TypeVar, Union + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -44,54 +45,48 @@ def __init__(self, client, config, serializer, deserializer): self._deserialize = deserializer self._config = config - def create_or_update( + def get( self, resource_group_name, # type: str server_name, # type: str database_name, # type: str - transparent_data_encryption_name, # type: Union[str, "_models.TransparentDataEncryptionName"] - parameters, # type: "_models.TransparentDataEncryption" + tde_name, # type: Union[str, "_models.TransparentDataEncryptionName"] **kwargs # type: Any ): - # type: (...) -> "_models.TransparentDataEncryption" - """Creates or updates a database's transparent data encryption configuration. + # type: (...) -> "_models.LogicalDatabaseTransparentDataEncryption" + """Gets a logical database's transparent data encryption. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database for which setting the transparent data - encryption applies. + :param database_name: The name of the logical database for which the transparent data + encryption is defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName - :param parameters: The required parameters for creating or updating transparent data - encryption. - :type parameters: ~azure.mgmt.sql.models.TransparentDataEncryption + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryption"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" - content_type = kwargs.pop("content_type", "application/json") + api_version = "2021-02-01-preview" accept = "application/json" # Construct URL - url = self.create_or_update.metadata['url'] # type: ignore + url = self.get.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -101,75 +96,70 @@ def create_or_update( # Construct headers header_parameters = {} # type: Dict[str, Any] - header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(parameters, 'TransparentDataEncryption') - body_content_kwargs['content'] = body_content - request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + request = self._client.get(url, query_parameters, header_parameters) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200, 201]: + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - if response.status_code == 200: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) - - if response.status_code == 201: - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore - def get( + def create_or_update( self, resource_group_name, # type: str server_name, # type: str database_name, # type: str - transparent_data_encryption_name, # type: Union[str, "_models.TransparentDataEncryptionName"] + tde_name, # type: Union[str, "_models.TransparentDataEncryptionName"] + parameters, # type: "_models.LogicalDatabaseTransparentDataEncryption" **kwargs # type: Any ): - # type: (...) -> "_models.TransparentDataEncryption" - """Gets a database's transparent data encryption configuration. + # type: (...) -> Optional["_models.LogicalDatabaseTransparentDataEncryption"] + """Updates a logical database's transparent data encryption configuration. :param resource_group_name: The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. :type resource_group_name: str :param server_name: The name of the server. :type server_name: str - :param database_name: The name of the database for which the transparent data encryption - applies. + :param database_name: The name of the logical database for which the security alert policy is + defined. :type database_name: str - :param transparent_data_encryption_name: The name of the transparent data encryption - configuration. - :type transparent_data_encryption_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param tde_name: The name of the transparent data encryption configuration. + :type tde_name: str or ~azure.mgmt.sql.models.TransparentDataEncryptionName + :param parameters: The database transparent data encryption. + :type parameters: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption :keyword callable cls: A custom type or function that will be passed the direct response - :return: TransparentDataEncryption, or the result of cls(response) - :rtype: ~azure.mgmt.sql.models.TransparentDataEncryption + :return: LogicalDatabaseTransparentDataEncryption, or the result of cls(response) + :rtype: ~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryption or None :raises: ~azure.core.exceptions.HttpResponseError """ - cls = kwargs.pop('cls', None) # type: ClsType["_models.TransparentDataEncryption"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.LogicalDatabaseTransparentDataEncryption"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2014-04-01" + api_version = "2021-02-01-preview" + content_type = kwargs.pop("content_type", "application/json") accept = "application/json" # Construct URL - url = self.get.metadata['url'] # type: ignore + url = self.create_or_update.metadata['url'] # type: ignore path_format_arguments = { - 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), 'serverName': self._serialize.url("server_name", server_name, 'str'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), - 'transparentDataEncryptionName': self._serialize.url("transparent_data_encryption_name", transparent_data_encryption_name, 'str'), + 'tdeName': self._serialize.url("tde_name", tde_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), } url = self._client.format_url(url, **path_format_arguments) @@ -179,20 +169,110 @@ def get( # Construct headers header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') - request = self._client.get(url, query_parameters, header_parameters) + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(parameters, 'LogicalDatabaseTransparentDataEncryption') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) response = pipeline_response.http_response - if response.status_code not in [200]: + if response.status_code not in [200, 201, 202]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize('TransparentDataEncryption', pipeline_response) + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryption', pipeline_response) if cls: return cls(pipeline_response, deserialized, {}) return deserialized - get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{transparentDataEncryptionName}'} # type: ignore + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}'} # type: ignore + + def list_by_database( + self, + resource_group_name, # type: str + server_name, # type: str + database_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.LogicalDatabaseTransparentDataEncryptionListResult"] + """Gets a list of the logical database's transparent data encryption. + + :param resource_group_name: The name of the resource group that contains the resource. You can + obtain this value from the Azure Resource Manager API or the portal. + :type resource_group_name: str + :param server_name: The name of the server. + :type server_name: str + :param database_name: The name of the logical database for which the transparent data + encryption is defined. + :type database_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either LogicalDatabaseTransparentDataEncryptionListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.sql.models.LogicalDatabaseTransparentDataEncryptionListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.LogicalDatabaseTransparentDataEncryptionListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-02-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_by_database.metadata['url'] # type: ignore + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'serverName': self._serialize.url("server_name", server_name, 'str'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize('LogicalDatabaseTransparentDataEncryptionListResult', pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged( + get_next, extract_data + ) + list_by_database.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption'} # type: ignore