Skip to content

Commit

Permalink
CodeGen from PR 16968 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Release microsoft.sql 2021 08 01 preview (Azure#16968)

* Adds base for updating Microsoft.Sql from version preview/2021-05-01-preview to version 2021-08-01-preview

* Updates readme

* Updates API version in new specs and examples

* update default client tag to v5

* Generate the 2021-08-01-preview files from DSMainDev and commit

* add new added ipv6 and example files

* change "jobExecutionId": "5555-6666-7777-8888-999999999999" to "jobExecutionId": "5A86BF65-43AC-F258-2524-9E92992F97CA" in example files to pass the type validator

* Add ListOperations.json example file

* pass formatter npm pretty

* update instanceFailoverGroups in the type of example files

* remove ipv6 batch replace api due to arm concern. it will be in next version.

* add x-ms-enum
  • Loading branch information
SDKAuto committed Dec 16, 2021
1 parent 8801ffd commit 4cd1b7a
Show file tree
Hide file tree
Showing 258 changed files with 49,613 additions and 29,703 deletions.
10 changes: 5 additions & 5 deletions sdk/sql/azure-mgmt-sql/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"autorest": "3.4.5",
"autorest": "3.7.2",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
"@autorest/python@5.12.0",
"@autorest/modelerfour@4.19.3"
],
"commit": "cc268fe6b328f3857edb3ec9bce796e7ffc11f85",
"commit": "9e2df512436b17898884852d2fd2c757a945b58b",
"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",
"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.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
"readme": "specification/sql/resource-manager/readme.md"
}
9 changes: 4 additions & 5 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
__version__ = VERSION
__all__ = ['SqlManagementClient']

try:
from ._patch import patch_sdk # type: ignore
patch_sdk()
except ImportError:
pass
# `._patch.py` is used for handwritten extensions to the generated code
# Example: https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
from ._patch import patch_sdk
patch_sdk()
6 changes: 3 additions & 3 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy

from ._version import VERSION

Expand Down Expand Up @@ -40,11 +40,11 @@ def __init__(
**kwargs # type: Any
):
# type: (...) -> None
super(SqlManagementClientConfiguration, self).__init__(**kwargs)
if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
super(SqlManagementClientConfiguration, self).__init__(**kwargs)

self.credential = credential
self.subscription_id = subscription_id
Expand All @@ -67,4 +67,4 @@ def _configure(
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
self.authentication_policy = kwargs.get('authentication_policy')
if self.credential and not self.authentication_policy:
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
39 changes: 18 additions & 21 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_metadata.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"chosen_version": "",
"total_api_version_list": ["2014-04-01", "2020-11-01-preview", "2021-02-01-preview"],
"total_api_version_list": ["2014-04-01", "2020-11-01-preview", "2021-02-01-preview", "2021-05-01-preview"],
"client": {
"name": "SqlManagementClient",
"filename": "_sql_management_client",
"description": "The Azure SQL Database management API provides a RESTful set of web services that interact with Azure SQL Database services to manage your databases. The API enables you to create, retrieve, update, and delete databases.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"host_value": "\"https://management.azure.com\"",
"parameterized_host_template": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SqlManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SqlManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SqlManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"], \"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"SqlManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}}}"
},
"global_parameters": {
"sync": {
Expand Down Expand Up @@ -54,7 +54,7 @@
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"signature": "base_url=\"https://management.azure.com\", # type: str",
"description": "Service URL",
"docstring_type": "str",
"required": false
Expand All @@ -74,7 +74,7 @@
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"signature": "base_url: str = \"https://management.azure.com\",",
"description": "Service URL",
"docstring_type": "str",
"required": false
Expand All @@ -91,15 +91,13 @@
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
"credential_call_sync": "ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"credential_call_async": "AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)",
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMChallengeAuthenticationPolicy\", \"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\", \"AsyncARMChallengeAuthenticationPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"recoverable_databases": "RecoverableDatabasesOperations",
"server_connection_policies": "ServerConnectionPoliciesOperations",
"data_masking_policies": "DataMaskingPoliciesOperations",
"data_masking_rules": "DataMaskingRulesOperations",
"geo_backup_policies": "GeoBackupPoliciesOperations",
Expand All @@ -110,8 +108,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",
Expand Down Expand Up @@ -145,8 +141,6 @@
"job_target_groups": "JobTargetGroupsOperations",
"job_versions": "JobVersionsOperations",
"capabilities": "CapabilitiesOperations",
"long_term_retention_backups": "LongTermRetentionBackupsOperations",
"long_term_retention_managed_instance_backups": "LongTermRetentionManagedInstanceBackupsOperations",
"long_term_retention_policies": "LongTermRetentionPoliciesOperations",
"maintenance_window_options": "MaintenanceWindowOptionsOperations",
"maintenance_windows": "MaintenanceWindowsOperations",
Expand All @@ -173,13 +167,11 @@
"managed_instance_operations": "ManagedInstanceOperationsOperations",
"managed_instance_private_endpoint_connections": "ManagedInstancePrivateEndpointConnectionsOperations",
"managed_instance_private_link_resources": "ManagedInstancePrivateLinkResourcesOperations",
"managed_instances": "ManagedInstancesOperations",
"managed_instance_tde_certificates": "ManagedInstanceTdeCertificatesOperations",
"managed_instance_vulnerability_assessments": "ManagedInstanceVulnerabilityAssessmentsOperations",
"managed_restorable_dropped_database_backup_short_term_retention_policies": "ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesOperations",
"managed_server_security_alert_policies": "ManagedServerSecurityAlertPoliciesOperations",
"operations": "Operations",
"operations_health": "OperationsHealthOperations",
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
"private_link_resources": "PrivateLinkResourcesOperations",
"recoverable_managed_databases": "RecoverableManagedDatabasesOperations",
Expand Down Expand Up @@ -208,15 +200,20 @@
"virtual_network_rules": "VirtualNetworkRulesOperations",
"workload_classifiers": "WorkloadClassifiersOperations",
"workload_groups": "WorkloadGroupsOperations",
"transparent_data_encryptions": "TransparentDataEncryptionsOperations",
"backup_short_term_retention_policies": "BackupShortTermRetentionPoliciesOperations",
"database_extensions": "DatabaseExtensionsOperations",
"database_operations": "DatabaseOperationsOperations",
"database_usages": "DatabaseUsagesOperations",
"ledger_digest_uploads": "LedgerDigestUploadsOperations",
"outbound_firewall_rules": "OutboundFirewallRulesOperations",
"servers": "ServersOperations",
"usages": "UsagesOperations",
"long_term_retention_backups": "LongTermRetentionBackupsOperations",
"long_term_retention_managed_instance_backups": "LongTermRetentionManagedInstanceBackupsOperations",
"managed_instances": "ManagedInstancesOperations",
"restorable_dropped_databases": "RestorableDroppedDatabasesOperations",
"restorable_dropped_managed_databases": "RestorableDroppedManagedDatabasesOperations",
"servers": "ServersOperations",
"usages": "UsagesOperations"
"server_connection_policies": "ServerConnectionPoliciesOperations"
}
}
31 changes: 31 additions & 0 deletions sdk/sql/azure-mgmt-sql/azure/mgmt/sql/_patch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
# --------------------------------------------------------------------------

# This file is used for handwritten extensions to the generated code. Example:
# https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/customize_code/how-to-patch-sdk-code.md
def patch_sdk():
pass
Loading

0 comments on commit 4cd1b7a

Please sign in to comment.