Skip to content

Commit

Permalink
CodeGen from PR 14067 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
postgresql readme t2 config (Azure#14067)
  • Loading branch information
SDKAuto committed Apr 26, 2021
1 parent 9585622 commit 840dcc6
Show file tree
Hide file tree
Showing 63 changed files with 3,230 additions and 4,043 deletions.
1 change: 1 addition & 0 deletions sdk/rdbms/azure-mgmt-rdbms/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
8 changes: 8 additions & 0 deletions sdk/rdbms/azure-mgmt-rdbms/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"autorest": "3.3.0",
"use": "@autorest/python@5.6.6",
"commit": "f1d8c4ebb54fdc1301eb2f2a465982cf58b54f69",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/postgresql/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.6.6 --version=3.3.0",
"readme": "specification/postgresql/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# --------------------------------------------------------------------------

from ._postgre_sql_management_client import PostgreSQLManagementClient
from ._version import VERSION

__version__ = VERSION
__all__ = ['PostgreSQLManagementClient']

try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from ._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any

from azure.core.credentials import TokenCredential

VERSION = "unknown"

class PostgreSQLManagementClientConfiguration(Configuration):
"""Configuration for PostgreSQLManagementClient.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "",
"total_api_version_list": ["2017-12-01", "2018-06-01", "2020-01-01"],
"total_api_version_list": ["2020-02-14-preview", "2020-11-05-preview", "2021-03-31-privatepreview"],
"client": {
"name": "PostgreSQLManagementClient",
"filename": "_postgre_sql_management_client",
Expand All @@ -9,7 +9,9 @@
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": true,
"client_side_validation": 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\": [\"PostgreSQLManagementClientConfiguration\"]}}, \"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\": [\"PostgreSQLManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -28,51 +30,82 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"signature": "subscription_id: str,",
"description": "The ID of the target subscription.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"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
"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\"]}}}"
},
"operation_groups": {
"servers": "ServersOperations",
"replicas": "ReplicasOperations",
"firewall_rules": "FirewallRulesOperations",
"virtual_network_rules": "VirtualNetworkRulesOperations",
"databases": "DatabasesOperations",
"configurations": "ConfigurationsOperations",
"server_parameters": "ServerParametersOperations",
"log_files": "LogFilesOperations",
"server_administrators": "ServerAdministratorsOperations",
"recoverable_servers": "RecoverableServersOperations",
"server_based_performance_tier": "ServerBasedPerformanceTierOperations",
"location_based_performance_tier": "LocationBasedPerformanceTierOperations",
"check_name_availability": "CheckNameAvailabilityOperations",
"location_based_capabilities": "LocationBasedCapabilitiesOperations",
"virtual_network_subnet_usage": "VirtualNetworkSubnetUsageOperations",
"operations": "Operations",
"server_security_alert_policies": "ServerSecurityAlertPoliciesOperations",
"private_endpoint_connections": "PrivateEndpointConnectionsOperations",
"private_link_resources": "PrivateLinkResourcesOperations",
"server_keys": "ServerKeysOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
"databases": "DatabasesOperations",
"get_private_dns_zone_suffix": "GetPrivateDnsZoneSuffixOperations"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,18 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import PostgreSQLManagementClientConfiguration
from .operations import ServersOperations
from .operations import ReplicasOperations
from .operations import FirewallRulesOperations
from .operations import VirtualNetworkRulesOperations
from .operations import DatabasesOperations
from .operations import ConfigurationsOperations
from .operations import ServerParametersOperations
from .operations import LogFilesOperations
from .operations import ServerAdministratorsOperations
from .operations import RecoverableServersOperations
from .operations import ServerBasedPerformanceTierOperations
from .operations import LocationBasedPerformanceTierOperations
from .operations import CheckNameAvailabilityOperations
from .operations import LocationBasedCapabilitiesOperations
from .operations import VirtualNetworkSubnetUsageOperations
from .operations import Operations
from .operations import ServerSecurityAlertPoliciesOperations
from .operations import PrivateEndpointConnectionsOperations
from .operations import PrivateLinkResourcesOperations
from .operations import ServerKeysOperations
from .operations import DatabasesOperations
from .operations import GetPrivateDnsZoneSuffixOperations
from . import models


Expand All @@ -44,40 +36,22 @@ class PostgreSQLManagementClient(object):
:ivar servers: ServersOperations operations
:vartype servers: azure.mgmt.rdbms.postgresql.operations.ServersOperations
:ivar replicas: ReplicasOperations operations
:vartype replicas: azure.mgmt.rdbms.postgresql.operations.ReplicasOperations
:ivar firewall_rules: FirewallRulesOperations operations
:vartype firewall_rules: azure.mgmt.rdbms.postgresql.operations.FirewallRulesOperations
:ivar virtual_network_rules: VirtualNetworkRulesOperations operations
:vartype virtual_network_rules: azure.mgmt.rdbms.postgresql.operations.VirtualNetworkRulesOperations
:ivar databases: DatabasesOperations operations
:vartype databases: azure.mgmt.rdbms.postgresql.operations.DatabasesOperations
:ivar configurations: ConfigurationsOperations operations
:vartype configurations: azure.mgmt.rdbms.postgresql.operations.ConfigurationsOperations
:ivar server_parameters: ServerParametersOperations operations
:vartype server_parameters: azure.mgmt.rdbms.postgresql.operations.ServerParametersOperations
:ivar log_files: LogFilesOperations operations
:vartype log_files: azure.mgmt.rdbms.postgresql.operations.LogFilesOperations
:ivar server_administrators: ServerAdministratorsOperations operations
:vartype server_administrators: azure.mgmt.rdbms.postgresql.operations.ServerAdministratorsOperations
:ivar recoverable_servers: RecoverableServersOperations operations
:vartype recoverable_servers: azure.mgmt.rdbms.postgresql.operations.RecoverableServersOperations
:ivar server_based_performance_tier: ServerBasedPerformanceTierOperations operations
:vartype server_based_performance_tier: azure.mgmt.rdbms.postgresql.operations.ServerBasedPerformanceTierOperations
:ivar location_based_performance_tier: LocationBasedPerformanceTierOperations operations
:vartype location_based_performance_tier: azure.mgmt.rdbms.postgresql.operations.LocationBasedPerformanceTierOperations
:ivar check_name_availability: CheckNameAvailabilityOperations operations
:vartype check_name_availability: azure.mgmt.rdbms.postgresql.operations.CheckNameAvailabilityOperations
:ivar location_based_capabilities: LocationBasedCapabilitiesOperations operations
:vartype location_based_capabilities: azure.mgmt.rdbms.postgresql.operations.LocationBasedCapabilitiesOperations
:ivar virtual_network_subnet_usage: VirtualNetworkSubnetUsageOperations operations
:vartype virtual_network_subnet_usage: azure.mgmt.rdbms.postgresql.operations.VirtualNetworkSubnetUsageOperations
:ivar operations: Operations operations
:vartype operations: azure.mgmt.rdbms.postgresql.operations.Operations
:ivar server_security_alert_policies: ServerSecurityAlertPoliciesOperations operations
:vartype server_security_alert_policies: azure.mgmt.rdbms.postgresql.operations.ServerSecurityAlertPoliciesOperations
:ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations
:vartype private_endpoint_connections: azure.mgmt.rdbms.postgresql.operations.PrivateEndpointConnectionsOperations
:ivar private_link_resources: PrivateLinkResourcesOperations operations
:vartype private_link_resources: azure.mgmt.rdbms.postgresql.operations.PrivateLinkResourcesOperations
:ivar server_keys: ServerKeysOperations operations
:vartype server_keys: azure.mgmt.rdbms.postgresql.operations.ServerKeysOperations
:ivar databases: DatabasesOperations operations
:vartype databases: azure.mgmt.rdbms.postgresql.operations.DatabasesOperations
:ivar get_private_dns_zone_suffix: GetPrivateDnsZoneSuffixOperations operations
:vartype get_private_dns_zone_suffix: azure.mgmt.rdbms.postgresql.operations.GetPrivateDnsZoneSuffixOperations
:param credential: Credential needed for the client to connect to Azure.
:type credential: ~azure.core.credentials.TokenCredential
:param subscription_id: The ID of the target subscription.
Expand All @@ -101,45 +75,46 @@ def __init__(

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._serialize.client_side_validation = False
self._deserialize = Deserializer(client_models)

self.servers = ServersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.replicas = ReplicasOperations(
self._client, self._config, self._serialize, self._deserialize)
self.firewall_rules = FirewallRulesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.virtual_network_rules = VirtualNetworkRulesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.databases = DatabasesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.configurations = ConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.server_parameters = ServerParametersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.log_files = LogFilesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.server_administrators = ServerAdministratorsOperations(
self._client, self._config, self._serialize, self._deserialize)
self.recoverable_servers = RecoverableServersOperations(
self._client, self._config, self._serialize, self._deserialize)
self.server_based_performance_tier = ServerBasedPerformanceTierOperations(
self._client, self._config, self._serialize, self._deserialize)
self.location_based_performance_tier = LocationBasedPerformanceTierOperations(
self._client, self._config, self._serialize, self._deserialize)
self.check_name_availability = CheckNameAvailabilityOperations(
self._client, self._config, self._serialize, self._deserialize)
self.operations = Operations(
self.location_based_capabilities = LocationBasedCapabilitiesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.server_security_alert_policies = ServerSecurityAlertPoliciesOperations(
self.virtual_network_subnet_usage = VirtualNetworkSubnetUsageOperations(
self._client, self._config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize)
self.private_link_resources = PrivateLinkResourcesOperations(
self.databases = DatabasesOperations(
self._client, self._config, self._serialize, self._deserialize)
self.server_keys = ServerKeysOperations(
self.get_private_dns_zone_suffix = GetPrivateDnsZoneSuffixOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.
:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# 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.
# --------------------------------------------------------------------------

VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy

from .._version import VERSION

if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from azure.core.credentials_async import AsyncTokenCredential

VERSION = "unknown"

class PostgreSQLManagementClientConfiguration(Configuration):
"""Configuration for PostgreSQLManagementClient.
Expand Down
Loading

0 comments on commit 840dcc6

Please sign in to comment.