code and test (#26239)
Co-authored-by: PythonSdkPipelines <PythonSdkPipelines>
This commit is contained in:
Родитель
84a4306cb6
Коммит
1cab43febd
|
@ -1,5 +1,24 @@
|
|||
# Release History
|
||||
|
||||
## 1.0.0 (2022-09-15)
|
||||
|
||||
### Features Added
|
||||
|
||||
- Model DnsForwardingRulesetPatch has a new parameter dns_resolver_outbound_endpoints
|
||||
|
||||
### Breaking Changes
|
||||
|
||||
- Parameter dns_resolver_outbound_endpoints of model DnsForwardingRuleset is now required
|
||||
- Parameter domain_name of model ForwardingRule is now required
|
||||
- Parameter id of model SubResource is now required
|
||||
- Parameter ip_address of model TargetDnsServer is now required
|
||||
- Parameter ip_configurations of model InboundEndpoint is now required
|
||||
- Parameter subnet of model IpConfiguration is now required
|
||||
- Parameter subnet of model OutboundEndpoint is now required
|
||||
- Parameter target_dns_servers of model ForwardingRule is now required
|
||||
- Parameter virtual_network of model DnsResolver is now required
|
||||
- Parameter virtual_network of model VirtualNetworkLink is now required
|
||||
|
||||
## 1.0.0b1 (2022-02-21)
|
||||
|
||||
* Initial Release
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
include _meta.json
|
||||
recursive-include tests *.py *.yaml
|
||||
recursive-include tests *.py *.json
|
||||
recursive-include samples *.py *.md
|
||||
include *.md
|
||||
include azure/__init__.py
|
||||
include azure/mgmt/__init__.py
|
||||
include LICENSE
|
||||
include azure/mgmt/dnsresolver/py.typed
|
||||
|
|
|
@ -12,8 +12,6 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
|
|||
|
||||
|
||||
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt)
|
||||
|
||||
|
||||
|
||||
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/)
|
||||
Code samples for this package can be found at [Dnsresolver Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"autorest": "3.7.2",
|
||||
"autorest": "3.8.4",
|
||||
"use": [
|
||||
"@autorest/python@5.12.0",
|
||||
"@autorest/modelerfour@4.19.3"
|
||||
"@autorest/python@6.1.5",
|
||||
"@autorest/modelerfour@4.23.5"
|
||||
],
|
||||
"commit": "78f1d9d2be5ae24a9bebb5a62158f04d9cb7f69f",
|
||||
"commit": "b749953e21e5c3f275d839862323920ef7bf716e",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
|
||||
"autorest_command": "autorest specification/dnsresolver/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/python@5.12.0 --use=@autorest/modelerfour@4.19.3 --version=3.7.2",
|
||||
"autorest_command": "autorest specification/dnsresolver/resource-manager/readme.md --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.1.5 --use=@autorest/modelerfour@4.23.5 --version=3.8.4 --version-tolerant=False",
|
||||
"readme": "specification/dnsresolver/resource-manager/readme.md"
|
||||
}
|
|
@ -10,9 +10,15 @@ from ._dns_resolver_management_client import DnsResolverManagementClient
|
|||
from ._version import VERSION
|
||||
|
||||
__version__ = VERSION
|
||||
__all__ = ['DnsResolverManagementClient']
|
||||
|
||||
# `._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()
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = ["DnsResolverManagementClient"]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
||||
|
|
|
@ -19,25 +19,25 @@ if TYPE_CHECKING:
|
|||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class DnsResolverManagementClientConfiguration(Configuration):
|
||||
class DnsResolverManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DnsResolverManagementClient.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
attributes.
|
||||
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The ID of the target subscription.
|
||||
:param subscription_id: The ID of the target subscription. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "TokenCredential",
|
||||
subscription_id: str,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
|
||||
super(DnsResolverManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version = kwargs.pop("api_version", "2022-07-01") # type: str
|
||||
|
||||
if credential is None:
|
||||
raise ValueError("Parameter 'credential' must not be None.")
|
||||
if subscription_id is None:
|
||||
|
@ -45,24 +45,25 @@ class DnsResolverManagementClientConfiguration(Configuration):
|
|||
|
||||
self.credential = credential
|
||||
self.subscription_id = subscription_id
|
||||
self.api_version = "2020-04-01-preview"
|
||||
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
|
||||
kwargs.setdefault('sdk_moniker', 'mgmt-dnsresolver/{}'.format(VERSION))
|
||||
self.api_version = api_version
|
||||
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
|
||||
kwargs.setdefault("sdk_moniker", "mgmt-dnsresolver/{}".format(VERSION))
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
self,
|
||||
**kwargs # type: Any
|
||||
self, **kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
|
||||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
|
||||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
|
||||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
|
||||
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
|
||||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get('authentication_policy')
|
||||
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
|
||||
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
|
||||
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
|
||||
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
|
||||
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
|
||||
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
|
||||
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 = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
|
||||
self.authentication_policy = ARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
||||
|
|
|
@ -7,45 +7,53 @@
|
|||
# --------------------------------------------------------------------------
|
||||
|
||||
from copy import deepcopy
|
||||
from typing import Any, Optional, TYPE_CHECKING
|
||||
from typing import Any, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import HttpRequest, HttpResponse
|
||||
from azure.mgmt.core import ARMPipelineClient
|
||||
from msrest import Deserializer, Serializer
|
||||
|
||||
from . import models
|
||||
from ._configuration import DnsResolverManagementClientConfiguration
|
||||
from .operations import DnsForwardingRulesetsOperations, DnsResolversOperations, ForwardingRulesOperations, InboundEndpointsOperations, OutboundEndpointsOperations, VirtualNetworkLinksOperations
|
||||
from ._serialization import Deserializer, Serializer
|
||||
from .operations import (
|
||||
DnsForwardingRulesetsOperations,
|
||||
DnsResolversOperations,
|
||||
ForwardingRulesOperations,
|
||||
InboundEndpointsOperations,
|
||||
OutboundEndpointsOperations,
|
||||
VirtualNetworkLinksOperations,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
class DnsResolverManagementClient:
|
||||
|
||||
class DnsResolverManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DNS Resolver Management Client.
|
||||
|
||||
:ivar dns_resolvers: DnsResolversOperations operations
|
||||
:vartype dns_resolvers: dns_resolver_management_client.operations.DnsResolversOperations
|
||||
:vartype dns_resolvers: azure.mgmt.dnsresolver.operations.DnsResolversOperations
|
||||
:ivar inbound_endpoints: InboundEndpointsOperations operations
|
||||
:vartype inbound_endpoints:
|
||||
dns_resolver_management_client.operations.InboundEndpointsOperations
|
||||
:vartype inbound_endpoints: azure.mgmt.dnsresolver.operations.InboundEndpointsOperations
|
||||
:ivar outbound_endpoints: OutboundEndpointsOperations operations
|
||||
:vartype outbound_endpoints:
|
||||
dns_resolver_management_client.operations.OutboundEndpointsOperations
|
||||
:vartype outbound_endpoints: azure.mgmt.dnsresolver.operations.OutboundEndpointsOperations
|
||||
:ivar dns_forwarding_rulesets: DnsForwardingRulesetsOperations operations
|
||||
:vartype dns_forwarding_rulesets:
|
||||
dns_resolver_management_client.operations.DnsForwardingRulesetsOperations
|
||||
azure.mgmt.dnsresolver.operations.DnsForwardingRulesetsOperations
|
||||
:ivar forwarding_rules: ForwardingRulesOperations operations
|
||||
:vartype forwarding_rules: dns_resolver_management_client.operations.ForwardingRulesOperations
|
||||
:vartype forwarding_rules: azure.mgmt.dnsresolver.operations.ForwardingRulesOperations
|
||||
:ivar virtual_network_links: VirtualNetworkLinksOperations operations
|
||||
:vartype virtual_network_links:
|
||||
dns_resolver_management_client.operations.VirtualNetworkLinksOperations
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:vartype virtual_network_links: azure.mgmt.dnsresolver.operations.VirtualNetworkLinksOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The ID of the target subscription.
|
||||
:param subscription_id: The ID of the target subscription. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is 'https://management.azure.com'.
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
|
||||
Retry-After header is present.
|
||||
"""
|
||||
|
@ -57,7 +65,9 @@ class DnsResolverManagementClient:
|
|||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DnsResolverManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
|
||||
self._config = DnsResolverManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
|
@ -65,18 +75,23 @@ class DnsResolverManagementClient:
|
|||
self._deserialize = Deserializer(client_models)
|
||||
self._serialize.client_side_validation = False
|
||||
self.dns_resolvers = DnsResolversOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.inbound_endpoints = InboundEndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.outbound_endpoints = OutboundEndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.dns_forwarding_rulesets = DnsForwardingRulesetsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.forwarding_rules = ForwardingRulesOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.virtual_network_links = VirtualNetworkLinksOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.inbound_endpoints = InboundEndpointsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.outbound_endpoints = OutboundEndpointsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.dns_forwarding_rulesets = DnsForwardingRulesetsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.forwarding_rules = ForwardingRulesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.virtual_network_links = VirtualNetworkLinksOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
|
||||
|
||||
def _send_request(
|
||||
self,
|
||||
request, # type: HttpRequest
|
||||
**kwargs: Any
|
||||
) -> HttpResponse:
|
||||
def _send_request(self, request: HttpRequest, **kwargs: Any) -> HttpResponse:
|
||||
"""Runs the network request through the client's chained policies.
|
||||
|
||||
>>> from azure.core.rest import HttpRequest
|
||||
|
@ -85,7 +100,7 @@ class DnsResolverManagementClient:
|
|||
>>> response = client._send_request(request)
|
||||
<HttpResponse: 200 OK>
|
||||
|
||||
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
|
||||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
|
||||
|
||||
:param request: The network request you want to make. Required.
|
||||
:type request: ~azure.core.rest.HttpRequest
|
||||
|
|
|
@ -28,4 +28,4 @@
|
|||
# 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
|
||||
pass
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -7,6 +7,7 @@
|
|||
|
||||
from azure.core.pipeline.transport import HttpRequest
|
||||
|
||||
|
||||
def _convert_request(request, files=None):
|
||||
data = request.content if not files else None
|
||||
request = HttpRequest(method=request.method, url=request.url, headers=request.headers, data=data)
|
||||
|
@ -14,6 +15,7 @@ def _convert_request(request, files=None):
|
|||
request.set_formdata_body(files)
|
||||
return request
|
||||
|
||||
|
||||
def _format_url_section(template, **kwargs):
|
||||
components = template.split("/")
|
||||
while components:
|
||||
|
@ -21,7 +23,5 @@ def _format_url_section(template, **kwargs):
|
|||
return template.format(**kwargs)
|
||||
except KeyError as key:
|
||||
formatted_components = template.split("/")
|
||||
components = [
|
||||
c for c in formatted_components if "{}".format(key.args[0]) not in c
|
||||
]
|
||||
components = [c for c in formatted_components if "{}".format(key.args[0]) not in c]
|
||||
template = "/".join(components)
|
||||
|
|
|
@ -6,4 +6,4 @@
|
|||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
VERSION = "1.0.0b1"
|
||||
VERSION = "1.0.0"
|
||||
|
|
|
@ -7,9 +7,15 @@
|
|||
# --------------------------------------------------------------------------
|
||||
|
||||
from ._dns_resolver_management_client import DnsResolverManagementClient
|
||||
__all__ = ['DnsResolverManagementClient']
|
||||
|
||||
# `._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()
|
||||
try:
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
|
||||
except ImportError:
|
||||
_patch_all = []
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = ["DnsResolverManagementClient"]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
|
||||
_patch_sdk()
|
||||
|
|
|
@ -19,25 +19,25 @@ if TYPE_CHECKING:
|
|||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class DnsResolverManagementClientConfiguration(Configuration):
|
||||
class DnsResolverManagementClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
|
||||
"""Configuration for DnsResolverManagementClient.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
attributes.
|
||||
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The ID of the target subscription.
|
||||
:param subscription_id: The ID of the target subscription. Required.
|
||||
:type subscription_id: str
|
||||
:keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
|
||||
super(DnsResolverManagementClientConfiguration, self).__init__(**kwargs)
|
||||
api_version = kwargs.pop("api_version", "2022-07-01") # type: str
|
||||
|
||||
if credential is None:
|
||||
raise ValueError("Parameter 'credential' must not be None.")
|
||||
if subscription_id is None:
|
||||
|
@ -45,23 +45,22 @@ class DnsResolverManagementClientConfiguration(Configuration):
|
|||
|
||||
self.credential = credential
|
||||
self.subscription_id = subscription_id
|
||||
self.api_version = "2020-04-01-preview"
|
||||
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
|
||||
kwargs.setdefault('sdk_moniker', 'mgmt-dnsresolver/{}'.format(VERSION))
|
||||
self.api_version = api_version
|
||||
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
|
||||
kwargs.setdefault("sdk_moniker", "mgmt-dnsresolver/{}".format(VERSION))
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
self,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
|
||||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
|
||||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
|
||||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
|
||||
self.http_logging_policy = kwargs.get('http_logging_policy') or ARMHttpLoggingPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
|
||||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get('authentication_policy')
|
||||
def _configure(self, **kwargs: Any) -> None:
|
||||
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
|
||||
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
|
||||
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
|
||||
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
|
||||
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get("retry_policy") or policies.AsyncRetryPolicy(**kwargs)
|
||||
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get("redirect_policy") or policies.AsyncRedirectPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get("authentication_policy")
|
||||
if self.credential and not self.authentication_policy:
|
||||
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs)
|
||||
self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(
|
||||
self.credential, *self.credential_scopes, **kwargs
|
||||
)
|
||||
|
|
|
@ -7,46 +7,54 @@
|
|||
# --------------------------------------------------------------------------
|
||||
|
||||
from copy import deepcopy
|
||||
from typing import Any, Awaitable, Optional, TYPE_CHECKING
|
||||
from typing import Any, Awaitable, TYPE_CHECKING
|
||||
|
||||
from azure.core.rest import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core import AsyncARMPipelineClient
|
||||
from msrest import Deserializer, Serializer
|
||||
|
||||
from .. import models
|
||||
from .._serialization import Deserializer, Serializer
|
||||
from ._configuration import DnsResolverManagementClientConfiguration
|
||||
from .operations import DnsForwardingRulesetsOperations, DnsResolversOperations, ForwardingRulesOperations, InboundEndpointsOperations, OutboundEndpointsOperations, VirtualNetworkLinksOperations
|
||||
from .operations import (
|
||||
DnsForwardingRulesetsOperations,
|
||||
DnsResolversOperations,
|
||||
ForwardingRulesOperations,
|
||||
InboundEndpointsOperations,
|
||||
OutboundEndpointsOperations,
|
||||
VirtualNetworkLinksOperations,
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
class DnsResolverManagementClient:
|
||||
|
||||
class DnsResolverManagementClient: # pylint: disable=client-accepts-api-version-keyword
|
||||
"""The DNS Resolver Management Client.
|
||||
|
||||
:ivar dns_resolvers: DnsResolversOperations operations
|
||||
:vartype dns_resolvers: dns_resolver_management_client.aio.operations.DnsResolversOperations
|
||||
:vartype dns_resolvers: azure.mgmt.dnsresolver.aio.operations.DnsResolversOperations
|
||||
:ivar inbound_endpoints: InboundEndpointsOperations operations
|
||||
:vartype inbound_endpoints:
|
||||
dns_resolver_management_client.aio.operations.InboundEndpointsOperations
|
||||
:vartype inbound_endpoints: azure.mgmt.dnsresolver.aio.operations.InboundEndpointsOperations
|
||||
:ivar outbound_endpoints: OutboundEndpointsOperations operations
|
||||
:vartype outbound_endpoints:
|
||||
dns_resolver_management_client.aio.operations.OutboundEndpointsOperations
|
||||
:vartype outbound_endpoints: azure.mgmt.dnsresolver.aio.operations.OutboundEndpointsOperations
|
||||
:ivar dns_forwarding_rulesets: DnsForwardingRulesetsOperations operations
|
||||
:vartype dns_forwarding_rulesets:
|
||||
dns_resolver_management_client.aio.operations.DnsForwardingRulesetsOperations
|
||||
azure.mgmt.dnsresolver.aio.operations.DnsForwardingRulesetsOperations
|
||||
:ivar forwarding_rules: ForwardingRulesOperations operations
|
||||
:vartype forwarding_rules:
|
||||
dns_resolver_management_client.aio.operations.ForwardingRulesOperations
|
||||
:vartype forwarding_rules: azure.mgmt.dnsresolver.aio.operations.ForwardingRulesOperations
|
||||
:ivar virtual_network_links: VirtualNetworkLinksOperations operations
|
||||
:vartype virtual_network_links:
|
||||
dns_resolver_management_client.aio.operations.VirtualNetworkLinksOperations
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
azure.mgmt.dnsresolver.aio.operations.VirtualNetworkLinksOperations
|
||||
:param credential: Credential needed for the client to connect to Azure. Required.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The ID of the target subscription.
|
||||
:param subscription_id: The ID of the target subscription. Required.
|
||||
:type subscription_id: str
|
||||
:param base_url: Service URL. Default value is 'https://management.azure.com'.
|
||||
:param base_url: Service URL. Default value is "https://management.azure.com".
|
||||
:type base_url: str
|
||||
:keyword api_version: Api Version. Default value is "2022-07-01". Note that overriding this
|
||||
default value may result in unsupported behavior.
|
||||
:paramtype api_version: str
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
|
||||
Retry-After header is present.
|
||||
"""
|
||||
|
@ -58,7 +66,9 @@ class DnsResolverManagementClient:
|
|||
base_url: str = "https://management.azure.com",
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self._config = DnsResolverManagementClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
|
||||
self._config = DnsResolverManagementClientConfiguration(
|
||||
credential=credential, subscription_id=subscription_id, **kwargs
|
||||
)
|
||||
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
|
@ -66,18 +76,23 @@ class DnsResolverManagementClient:
|
|||
self._deserialize = Deserializer(client_models)
|
||||
self._serialize.client_side_validation = False
|
||||
self.dns_resolvers = DnsResolversOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.inbound_endpoints = InboundEndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.outbound_endpoints = OutboundEndpointsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.dns_forwarding_rulesets = DnsForwardingRulesetsOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.forwarding_rules = ForwardingRulesOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.virtual_network_links = VirtualNetworkLinksOperations(self._client, self._config, self._serialize, self._deserialize)
|
||||
self.inbound_endpoints = InboundEndpointsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.outbound_endpoints = OutboundEndpointsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.dns_forwarding_rulesets = DnsForwardingRulesetsOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.forwarding_rules = ForwardingRulesOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
self.virtual_network_links = VirtualNetworkLinksOperations(
|
||||
self._client, self._config, self._serialize, self._deserialize
|
||||
)
|
||||
|
||||
|
||||
def _send_request(
|
||||
self,
|
||||
request: HttpRequest,
|
||||
**kwargs: Any
|
||||
) -> Awaitable[AsyncHttpResponse]:
|
||||
def _send_request(self, request: HttpRequest, **kwargs: Any) -> Awaitable[AsyncHttpResponse]:
|
||||
"""Runs the network request through the client's chained policies.
|
||||
|
||||
>>> from azure.core.rest import HttpRequest
|
||||
|
@ -86,7 +101,7 @@ class DnsResolverManagementClient:
|
|||
>>> response = await client._send_request(request)
|
||||
<AsyncHttpResponse: 200 OK>
|
||||
|
||||
For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart
|
||||
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
|
||||
|
||||
:param request: The network request you want to make. Required.
|
||||
:type request: ~azure.core.rest.HttpRequest
|
||||
|
|
|
@ -28,4 +28,4 @@
|
|||
# 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
|
||||
pass
|
||||
|
|
|
@ -13,11 +13,17 @@ from ._dns_forwarding_rulesets_operations import DnsForwardingRulesetsOperations
|
|||
from ._forwarding_rules_operations import ForwardingRulesOperations
|
||||
from ._virtual_network_links_operations import VirtualNetworkLinksOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
'DnsResolversOperations',
|
||||
'InboundEndpointsOperations',
|
||||
'OutboundEndpointsOperations',
|
||||
'DnsForwardingRulesetsOperations',
|
||||
'ForwardingRulesOperations',
|
||||
'VirtualNetworkLinksOperations',
|
||||
"DnsResolversOperations",
|
||||
"InboundEndpointsOperations",
|
||||
"OutboundEndpointsOperations",
|
||||
"DnsForwardingRulesetsOperations",
|
||||
"ForwardingRulesOperations",
|
||||
"VirtualNetworkLinksOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,3 +1,4 @@
|
|||
# pylint: disable=too-many-lines
|
||||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
@ -5,46 +6,138 @@
|
|||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
import functools
|
||||
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
|
||||
import warnings
|
||||
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, overload
|
||||
from urllib.parse import parse_qs, urljoin, urlparse
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.exceptions import (
|
||||
ClientAuthenticationError,
|
||||
HttpResponseError,
|
||||
ResourceExistsError,
|
||||
ResourceNotFoundError,
|
||||
ResourceNotModifiedError,
|
||||
map_error,
|
||||
)
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse
|
||||
from azure.core.rest import HttpRequest
|
||||
from azure.core.tracing.decorator import distributed_trace
|
||||
from azure.core.tracing.decorator_async import distributed_trace_async
|
||||
from azure.core.utils import case_insensitive_dict
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models as _models
|
||||
from ..._vendor import _convert_request
|
||||
from ...operations._forwarding_rules_operations import build_create_or_update_request, build_delete_request, build_get_request, build_list_request, build_update_request
|
||||
T = TypeVar('T')
|
||||
from ...operations._forwarding_rules_operations import (
|
||||
build_create_or_update_request,
|
||||
build_delete_request,
|
||||
build_get_request,
|
||||
build_list_request,
|
||||
build_update_request,
|
||||
)
|
||||
|
||||
T = TypeVar("T")
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
|
||||
class ForwardingRulesOperations:
|
||||
"""ForwardingRulesOperations async operations.
|
||||
"""
|
||||
.. warning::
|
||||
**DO NOT** instantiate this class directly.
|
||||
|
||||
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: ~dns_resolver_management_client.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.
|
||||
Instead, you should access the following operations through
|
||||
:class:`~azure.mgmt.dnsresolver.aio.DnsResolverManagementClient`'s
|
||||
:attr:`forwarding_rules` attribute.
|
||||
"""
|
||||
|
||||
models = _models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer) -> None:
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
def __init__(self, *args, **kwargs) -> None:
|
||||
input_args = list(args)
|
||||
self._client = input_args.pop(0) if input_args else kwargs.pop("client")
|
||||
self._config = input_args.pop(0) if input_args else kwargs.pop("config")
|
||||
self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
|
||||
self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")
|
||||
|
||||
@overload
|
||||
async def create_or_update(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
forwarding_rule_name: str,
|
||||
parameters: _models.ForwardingRule,
|
||||
if_match: Optional[str] = None,
|
||||
if_none_match: Optional[str] = None,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.ForwardingRule:
|
||||
"""Creates or updates a forwarding rule in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:param parameters: Parameters supplied to the CreateOrUpdate operation. Required.
|
||||
:type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:param if_match: ETag of the resource. Omit this value to always overwrite the current
|
||||
resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent
|
||||
changes. Default value is None.
|
||||
:type if_match: str
|
||||
:param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating
|
||||
an existing resource. Other values will be ignored. Default value is None.
|
||||
:type if_none_match: str
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def create_or_update(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
forwarding_rule_name: str,
|
||||
parameters: IO,
|
||||
if_match: Optional[str] = None,
|
||||
if_none_match: Optional[str] = None,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.ForwardingRule:
|
||||
"""Creates or updates a forwarding rule in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:param parameters: Parameters supplied to the CreateOrUpdate operation. Required.
|
||||
:type parameters: IO
|
||||
:param if_match: ETag of the resource. Omit this value to always overwrite the current
|
||||
resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent
|
||||
changes. Default value is None.
|
||||
:type if_match: str
|
||||
:param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating
|
||||
an existing resource. Other values will be ignored. Default value is None.
|
||||
:type if_none_match: str
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def create_or_update(
|
||||
|
@ -52,58 +145,83 @@ class ForwardingRulesOperations:
|
|||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
forwarding_rule_name: str,
|
||||
parameters: "_models.ForwardingRule",
|
||||
parameters: Union[_models.ForwardingRule, IO],
|
||||
if_match: Optional[str] = None,
|
||||
if_none_match: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> "_models.ForwardingRule":
|
||||
) -> _models.ForwardingRule:
|
||||
"""Creates or updates a forwarding rule in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset.
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule.
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:param parameters: Parameters supplied to the CreateOrUpdate operation.
|
||||
:type parameters: ~dns_resolver_management_client.models.ForwardingRule
|
||||
:param parameters: Parameters supplied to the CreateOrUpdate operation. Is either a model type
|
||||
or a IO type. Required.
|
||||
:type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRule or IO
|
||||
:param if_match: ETag of the resource. Omit this value to always overwrite the current
|
||||
resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent
|
||||
changes.
|
||||
changes. Default value is None.
|
||||
:type if_match: str
|
||||
:param if_none_match: Set to '*' to allow a new resource to be created, but to prevent updating
|
||||
an existing resource. Other values will be ignored.
|
||||
an existing resource. Other values will be ignored. Default value is None.
|
||||
:type if_none_match: str
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ForwardingRule, or the result of cls(response)
|
||||
:rtype: ~dns_resolver_management_client.models.ForwardingRule
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
:return: ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["_models.ForwardingRule"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
_json = self._serialize.body(parameters, 'ForwardingRule')
|
||||
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
|
||||
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
|
||||
cls = kwargs.pop("cls", None) # type: ClsType[_models.ForwardingRule]
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(parameters, (IO, bytes)):
|
||||
_content = parameters
|
||||
else:
|
||||
_json = self._serialize.body(parameters, "ForwardingRule")
|
||||
|
||||
request = build_create_or_update_request(
|
||||
subscription_id=self._config.subscription_id,
|
||||
resource_group_name=resource_group_name,
|
||||
dns_forwarding_ruleset_name=dns_forwarding_ruleset_name,
|
||||
forwarding_rule_name=forwarding_rule_name,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
subscription_id=self._config.subscription_id,
|
||||
if_match=if_match,
|
||||
if_none_match=if_none_match,
|
||||
template_url=self.create_or_update.metadata['url'],
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
content=_content,
|
||||
template_url=self.create_or_update.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.url = self._client.format_url(request.url) # type: ignore
|
||||
|
||||
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
|
||||
request, stream=False, **kwargs
|
||||
)
|
||||
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200, 201]:
|
||||
|
@ -111,18 +229,89 @@ class ForwardingRulesOperations:
|
|||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
if response.status_code == 200:
|
||||
deserialized = self._deserialize('ForwardingRule', pipeline_response)
|
||||
deserialized = self._deserialize("ForwardingRule", pipeline_response)
|
||||
|
||||
if response.status_code == 201:
|
||||
deserialized = self._deserialize('ForwardingRule', pipeline_response)
|
||||
deserialized = self._deserialize("ForwardingRule", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore
|
||||
create_or_update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}"} # type: ignore
|
||||
|
||||
@overload
|
||||
async def update(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
forwarding_rule_name: str,
|
||||
parameters: _models.ForwardingRulePatch,
|
||||
if_match: Optional[str] = None,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.ForwardingRule:
|
||||
"""Updates a forwarding rule in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:param parameters: Parameters supplied to the Update operation. Required.
|
||||
:type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRulePatch
|
||||
:param if_match: ETag of the resource. Omit this value to always overwrite the current
|
||||
resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent
|
||||
changes. Default value is None.
|
||||
:type if_match: str
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@overload
|
||||
async def update(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
forwarding_rule_name: str,
|
||||
parameters: IO,
|
||||
if_match: Optional[str] = None,
|
||||
*,
|
||||
content_type: str = "application/json",
|
||||
**kwargs: Any
|
||||
) -> _models.ForwardingRule:
|
||||
"""Updates a forwarding rule in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:param parameters: Parameters supplied to the Update operation. Required.
|
||||
:type parameters: IO
|
||||
:param if_match: ETag of the resource. Omit this value to always overwrite the current
|
||||
resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent
|
||||
changes. Default value is None.
|
||||
:type if_match: str
|
||||
:keyword content_type: Body Parameter content-type. Content type parameter for binary body.
|
||||
Default value is "application/json".
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
|
||||
@distributed_trace_async
|
||||
async def update(
|
||||
|
@ -130,71 +319,95 @@ class ForwardingRulesOperations:
|
|||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
forwarding_rule_name: str,
|
||||
parameters: "_models.ForwardingRulePatch",
|
||||
parameters: Union[_models.ForwardingRulePatch, IO],
|
||||
if_match: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> "_models.ForwardingRule":
|
||||
) -> _models.ForwardingRule:
|
||||
"""Updates a forwarding rule in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset.
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule.
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:param parameters: Parameters supplied to the Update operation.
|
||||
:type parameters: ~dns_resolver_management_client.models.ForwardingRulePatch
|
||||
:param parameters: Parameters supplied to the Update operation. Is either a model type or a IO
|
||||
type. Required.
|
||||
:type parameters: ~azure.mgmt.dnsresolver.models.ForwardingRulePatch or IO
|
||||
:param if_match: ETag of the resource. Omit this value to always overwrite the current
|
||||
resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent
|
||||
changes.
|
||||
changes. Default value is None.
|
||||
:type if_match: str
|
||||
:keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
|
||||
Default value is None.
|
||||
:paramtype content_type: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ForwardingRule, or the result of cls(response)
|
||||
:rtype: ~dns_resolver_management_client.models.ForwardingRule
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
:return: ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["_models.ForwardingRule"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
|
||||
_headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
_json = self._serialize.body(parameters, 'ForwardingRulePatch')
|
||||
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
|
||||
content_type = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # type: Optional[str]
|
||||
cls = kwargs.pop("cls", None) # type: ClsType[_models.ForwardingRule]
|
||||
|
||||
content_type = content_type or "application/json"
|
||||
_json = None
|
||||
_content = None
|
||||
if isinstance(parameters, (IO, bytes)):
|
||||
_content = parameters
|
||||
else:
|
||||
_json = self._serialize.body(parameters, "ForwardingRulePatch")
|
||||
|
||||
request = build_update_request(
|
||||
subscription_id=self._config.subscription_id,
|
||||
resource_group_name=resource_group_name,
|
||||
dns_forwarding_ruleset_name=dns_forwarding_ruleset_name,
|
||||
forwarding_rule_name=forwarding_rule_name,
|
||||
subscription_id=self._config.subscription_id,
|
||||
if_match=if_match,
|
||||
api_version=api_version,
|
||||
content_type=content_type,
|
||||
json=_json,
|
||||
if_match=if_match,
|
||||
template_url=self.update.metadata['url'],
|
||||
content=_content,
|
||||
template_url=self.update.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.url = self._client.format_url(request.url) # type: ignore
|
||||
|
||||
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
|
||||
request, stream=False, **kwargs
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
deserialized = self._deserialize('ForwardingRule', pipeline_response)
|
||||
deserialized = self._deserialize("ForwardingRule", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore
|
||||
|
||||
update.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}"} # type: ignore
|
||||
|
||||
@distributed_trace_async
|
||||
async def delete(
|
||||
async def delete( # pylint: disable=inconsistent-return-statements
|
||||
self,
|
||||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
|
@ -206,39 +419,53 @@ class ForwardingRulesOperations:
|
|||
undone.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset.
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule.
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:param if_match: ETag of the resource. Omit this value to always overwrite the current
|
||||
resource. Specify the last-seen ETag value to prevent accidentally overwriting any concurrent
|
||||
changes.
|
||||
changes. Default value is None.
|
||||
:type if_match: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: None, or the result of cls(response)
|
||||
:return: None or the result of cls(response)
|
||||
:rtype: None
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[None]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
|
||||
cls = kwargs.pop("cls", None) # type: ClsType[None]
|
||||
|
||||
|
||||
request = build_delete_request(
|
||||
subscription_id=self._config.subscription_id,
|
||||
resource_group_name=resource_group_name,
|
||||
dns_forwarding_ruleset_name=dns_forwarding_ruleset_name,
|
||||
forwarding_rule_name=forwarding_rule_name,
|
||||
subscription_id=self._config.subscription_id,
|
||||
if_match=if_match,
|
||||
template_url=self.delete.metadata['url'],
|
||||
api_version=api_version,
|
||||
template_url=self.delete.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.url = self._client.format_url(request.url) # type: ignore
|
||||
|
||||
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
|
||||
request, stream=False, **kwargs
|
||||
)
|
||||
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200, 204]:
|
||||
|
@ -248,117 +475,129 @@ class ForwardingRulesOperations:
|
|||
if cls:
|
||||
return cls(pipeline_response, None, {})
|
||||
|
||||
delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore
|
||||
|
||||
delete.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}"} # type: ignore
|
||||
|
||||
@distributed_trace_async
|
||||
async def get(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
forwarding_rule_name: str,
|
||||
**kwargs: Any
|
||||
) -> "_models.ForwardingRule":
|
||||
self, resource_group_name: str, dns_forwarding_ruleset_name: str, forwarding_rule_name: str, **kwargs: Any
|
||||
) -> _models.ForwardingRule:
|
||||
"""Gets properties of a forwarding rule in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset.
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param forwarding_rule_name: The name of the forwarding rule.
|
||||
:param forwarding_rule_name: The name of the forwarding rule. Required.
|
||||
:type forwarding_rule_name: str
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: ForwardingRule, or the result of cls(response)
|
||||
:rtype: ~dns_resolver_management_client.models.ForwardingRule
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
:return: ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.mgmt.dnsresolver.models.ForwardingRule
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["_models.ForwardingRule"]
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
|
||||
cls = kwargs.pop("cls", None) # type: ClsType[_models.ForwardingRule]
|
||||
|
||||
|
||||
request = build_get_request(
|
||||
subscription_id=self._config.subscription_id,
|
||||
resource_group_name=resource_group_name,
|
||||
dns_forwarding_ruleset_name=dns_forwarding_ruleset_name,
|
||||
forwarding_rule_name=forwarding_rule_name,
|
||||
template_url=self.get.metadata['url'],
|
||||
subscription_id=self._config.subscription_id,
|
||||
api_version=api_version,
|
||||
template_url=self.get.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.url = self._client.format_url(request.url) # type: ignore
|
||||
|
||||
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
|
||||
request, stream=False, **kwargs
|
||||
)
|
||||
|
||||
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)
|
||||
|
||||
deserialized = self._deserialize('ForwardingRule', pipeline_response)
|
||||
deserialized = self._deserialize("ForwardingRule", pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
|
||||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}'} # type: ignore
|
||||
|
||||
get.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules/{forwardingRuleName}"} # type: ignore
|
||||
|
||||
@distributed_trace
|
||||
def list(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
dns_forwarding_ruleset_name: str,
|
||||
top: Optional[int] = None,
|
||||
**kwargs: Any
|
||||
) -> AsyncIterable["_models.ForwardingRuleListResult"]:
|
||||
self, resource_group_name: str, dns_forwarding_ruleset_name: str, top: Optional[int] = None, **kwargs: Any
|
||||
) -> AsyncIterable["_models.ForwardingRule"]:
|
||||
"""Lists forwarding rules in a DNS forwarding ruleset.
|
||||
|
||||
:param resource_group_name: The name of the resource group. The name is case insensitive.
|
||||
Required.
|
||||
:type resource_group_name: str
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset.
|
||||
:param dns_forwarding_ruleset_name: The name of the DNS forwarding ruleset. Required.
|
||||
:type dns_forwarding_ruleset_name: str
|
||||
:param top: The maximum number of results to return. If not specified, returns up to 100
|
||||
results.
|
||||
results. Default value is None.
|
||||
:type top: int
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either ForwardingRuleListResult or the result of
|
||||
cls(response)
|
||||
:rtype:
|
||||
~azure.core.async_paging.AsyncItemPaged[~dns_resolver_management_client.models.ForwardingRuleListResult]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
:return: An iterator like instance of either ForwardingRule or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.dnsresolver.models.ForwardingRule]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["_models.ForwardingRuleListResult"]
|
||||
_headers = kwargs.pop("headers", {}) or {}
|
||||
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
|
||||
|
||||
api_version = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) # type: str
|
||||
cls = kwargs.pop("cls", None) # type: ClsType[_models.ForwardingRuleListResult]
|
||||
|
||||
error_map = {
|
||||
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
|
||||
401: ClientAuthenticationError,
|
||||
404: ResourceNotFoundError,
|
||||
409: ResourceExistsError,
|
||||
304: ResourceNotModifiedError,
|
||||
}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
error_map.update(kwargs.pop("error_map", {}) or {})
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
if not next_link:
|
||||
|
||||
|
||||
request = build_list_request(
|
||||
subscription_id=self._config.subscription_id,
|
||||
resource_group_name=resource_group_name,
|
||||
dns_forwarding_ruleset_name=dns_forwarding_ruleset_name,
|
||||
subscription_id=self._config.subscription_id,
|
||||
top=top,
|
||||
template_url=self.list.metadata['url'],
|
||||
api_version=api_version,
|
||||
template_url=self.list.metadata["url"],
|
||||
headers=_headers,
|
||||
params=_params,
|
||||
)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.url = self._client.format_url(request.url) # type: ignore
|
||||
|
||||
else:
|
||||
|
||||
request = build_list_request(
|
||||
subscription_id=self._config.subscription_id,
|
||||
resource_group_name=resource_group_name,
|
||||
dns_forwarding_ruleset_name=dns_forwarding_ruleset_name,
|
||||
top=top,
|
||||
template_url=next_link,
|
||||
)
|
||||
# make call to next link with the client's api-version
|
||||
_parsed_next_link = urlparse(next_link)
|
||||
_next_request_params = case_insensitive_dict(parse_qs(_parsed_next_link.query))
|
||||
_next_request_params["api-version"] = self._config.api_version
|
||||
request = HttpRequest("GET", urljoin(next_link, _parsed_next_link.path), params=_next_request_params)
|
||||
request = _convert_request(request)
|
||||
request.url = self._client.format_url(request.url)
|
||||
request.url = self._client.format_url(request.url) # type: ignore
|
||||
request.method = "GET"
|
||||
return request
|
||||
|
||||
|
@ -372,7 +611,9 @@ class ForwardingRulesOperations:
|
|||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
pipeline_response = await self._client._pipeline.run( # type: ignore # pylint: disable=protected-access
|
||||
request, stream=False, **kwargs
|
||||
)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
|
@ -381,8 +622,6 @@ class ForwardingRulesOperations:
|
|||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(get_next, extract_data)
|
||||
|
||||
return AsyncItemPaged(
|
||||
get_next, extract_data
|
||||
)
|
||||
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules'} # type: ignore
|
||||
list.metadata = {"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/dnsForwardingRulesets/{dnsForwardingRulesetName}/forwardingRules"} # type: ignore
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,20 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -36,48 +36,50 @@ from ._models_py3 import VirtualNetworkLink
|
|||
from ._models_py3 import VirtualNetworkLinkListResult
|
||||
from ._models_py3 import VirtualNetworkLinkPatch
|
||||
|
||||
|
||||
from ._dns_resolver_management_client_enums import (
|
||||
CreatedByType,
|
||||
DnsResolverState,
|
||||
ForwardingRuleState,
|
||||
IpAllocationMethod,
|
||||
ProvisioningState,
|
||||
)
|
||||
from ._dns_resolver_management_client_enums import CreatedByType
|
||||
from ._dns_resolver_management_client_enums import DnsResolverState
|
||||
from ._dns_resolver_management_client_enums import ForwardingRuleState
|
||||
from ._dns_resolver_management_client_enums import IpAllocationMethod
|
||||
from ._dns_resolver_management_client_enums import ProvisioningState
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
'CloudErrorBody',
|
||||
'DnsForwardingRuleset',
|
||||
'DnsForwardingRulesetListResult',
|
||||
'DnsForwardingRulesetPatch',
|
||||
'DnsResolver',
|
||||
'DnsResolverListResult',
|
||||
'DnsResolverPatch',
|
||||
'ForwardingRule',
|
||||
'ForwardingRuleListResult',
|
||||
'ForwardingRulePatch',
|
||||
'InboundEndpoint',
|
||||
'InboundEndpointListResult',
|
||||
'InboundEndpointPatch',
|
||||
'IpConfiguration',
|
||||
'OutboundEndpoint',
|
||||
'OutboundEndpointListResult',
|
||||
'OutboundEndpointPatch',
|
||||
'ProxyResource',
|
||||
'Resource',
|
||||
'SubResource',
|
||||
'SubResourceListResult',
|
||||
'SystemData',
|
||||
'TargetDnsServer',
|
||||
'TrackedResource',
|
||||
'VirtualNetworkDnsForwardingRuleset',
|
||||
'VirtualNetworkDnsForwardingRulesetListResult',
|
||||
'VirtualNetworkLink',
|
||||
'VirtualNetworkLinkListResult',
|
||||
'VirtualNetworkLinkPatch',
|
||||
'CreatedByType',
|
||||
'DnsResolverState',
|
||||
'ForwardingRuleState',
|
||||
'IpAllocationMethod',
|
||||
'ProvisioningState',
|
||||
"CloudErrorBody",
|
||||
"DnsForwardingRuleset",
|
||||
"DnsForwardingRulesetListResult",
|
||||
"DnsForwardingRulesetPatch",
|
||||
"DnsResolver",
|
||||
"DnsResolverListResult",
|
||||
"DnsResolverPatch",
|
||||
"ForwardingRule",
|
||||
"ForwardingRuleListResult",
|
||||
"ForwardingRulePatch",
|
||||
"InboundEndpoint",
|
||||
"InboundEndpointListResult",
|
||||
"InboundEndpointPatch",
|
||||
"IpConfiguration",
|
||||
"OutboundEndpoint",
|
||||
"OutboundEndpointListResult",
|
||||
"OutboundEndpointPatch",
|
||||
"ProxyResource",
|
||||
"Resource",
|
||||
"SubResource",
|
||||
"SubResourceListResult",
|
||||
"SystemData",
|
||||
"TargetDnsServer",
|
||||
"TrackedResource",
|
||||
"VirtualNetworkDnsForwardingRuleset",
|
||||
"VirtualNetworkDnsForwardingRulesetListResult",
|
||||
"VirtualNetworkLink",
|
||||
"VirtualNetworkLinkListResult",
|
||||
"VirtualNetworkLinkPatch",
|
||||
"CreatedByType",
|
||||
"DnsResolverState",
|
||||
"ForwardingRuleState",
|
||||
"IpAllocationMethod",
|
||||
"ProvisioningState",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
||||
|
|
|
@ -7,20 +7,19 @@
|
|||
# --------------------------------------------------------------------------
|
||||
|
||||
from enum import Enum
|
||||
from six import with_metaclass
|
||||
from azure.core import CaseInsensitiveEnumMeta
|
||||
|
||||
|
||||
class CreatedByType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""The type of identity that created the resource.
|
||||
"""
|
||||
class CreatedByType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The type of identity that created the resource."""
|
||||
|
||||
USER = "User"
|
||||
APPLICATION = "Application"
|
||||
MANAGED_IDENTITY = "ManagedIdentity"
|
||||
KEY = "Key"
|
||||
|
||||
class DnsResolverState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
|
||||
class DnsResolverState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The current status of the DNS resolver. This is a read-only property and any attempt to set
|
||||
this value will be ignored.
|
||||
"""
|
||||
|
@ -28,23 +27,23 @@ class DnsResolverState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
|||
CONNECTED = "Connected"
|
||||
DISCONNECTED = "Disconnected"
|
||||
|
||||
class ForwardingRuleState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""The state of forwarding rule.
|
||||
"""
|
||||
|
||||
class ForwardingRuleState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The state of forwarding rule."""
|
||||
|
||||
ENABLED = "Enabled"
|
||||
DISABLED = "Disabled"
|
||||
|
||||
class IpAllocationMethod(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""Private IP address allocation method.
|
||||
"""
|
||||
|
||||
class IpAllocationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""Private IP address allocation method."""
|
||||
|
||||
STATIC = "Static"
|
||||
DYNAMIC = "Dynamic"
|
||||
|
||||
class ProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):
|
||||
"""The current provisioning state of the resource.
|
||||
"""
|
||||
|
||||
class ProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta):
|
||||
"""The current provisioning state of the resource."""
|
||||
|
||||
CREATING = "Creating"
|
||||
UPDATING = "Updating"
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,20 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
|
@ -13,11 +13,17 @@ from ._dns_forwarding_rulesets_operations import DnsForwardingRulesetsOperations
|
|||
from ._forwarding_rules_operations import ForwardingRulesOperations
|
||||
from ._virtual_network_links_operations import VirtualNetworkLinksOperations
|
||||
|
||||
from ._patch import __all__ as _patch_all
|
||||
from ._patch import * # type: ignore # pylint: disable=unused-wildcard-import
|
||||
from ._patch import patch_sdk as _patch_sdk
|
||||
|
||||
__all__ = [
|
||||
'DnsResolversOperations',
|
||||
'InboundEndpointsOperations',
|
||||
'OutboundEndpointsOperations',
|
||||
'DnsForwardingRulesetsOperations',
|
||||
'ForwardingRulesOperations',
|
||||
'VirtualNetworkLinksOperations',
|
||||
"DnsResolversOperations",
|
||||
"InboundEndpointsOperations",
|
||||
"OutboundEndpointsOperations",
|
||||
"DnsForwardingRulesetsOperations",
|
||||
"ForwardingRulesOperations",
|
||||
"VirtualNetworkLinksOperations",
|
||||
]
|
||||
__all__.extend([p for p in _patch_all if p not in __all__])
|
||||
_patch_sdk()
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,20 @@
|
|||
# ------------------------------------
|
||||
# Copyright (c) Microsoft Corporation.
|
||||
# Licensed under the MIT License.
|
||||
# ------------------------------------
|
||||
"""Customize generated code here.
|
||||
|
||||
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
||||
from typing import List
|
||||
|
||||
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
|
||||
|
||||
|
||||
def patch_sdk():
|
||||
"""Do not remove from this file.
|
||||
|
||||
`patch_sdk` is a last resort escape hatch that allows you to do customizations
|
||||
you can't accomplish using the techniques described in
|
||||
https://aka.ms/azsdk/python/dpcodegen/python/customize
|
||||
"""
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -45,12 +45,12 @@ setup(
|
|||
author='Microsoft Corporation',
|
||||
author_email='azpysdkhelp@microsoft.com',
|
||||
url='https://github.com/Azure/azure-sdk-for-python',
|
||||
keywords="azure, azure sdk", # update with search keywords relevant to the azure service / product
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Programming Language :: Python',
|
||||
"Programming Language :: Python :: 3 :: Only",
|
||||
'Programming Language :: Python :: 3 :: Only',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'Programming Language :: Python :: 3.9',
|
||||
|
@ -64,10 +64,14 @@ setup(
|
|||
'azure',
|
||||
'azure.mgmt',
|
||||
]),
|
||||
include_package_data=True,
|
||||
package_data={
|
||||
'pytyped': ['py.typed'],
|
||||
},
|
||||
install_requires=[
|
||||
'msrest>=0.6.21',
|
||||
'msrest>=0.7.1',
|
||||
'azure-common~=1.1',
|
||||
'azure-mgmt-core>=1.3.0,<2.0.0',
|
||||
'azure-mgmt-core>=1.3.2,<2.0.0',
|
||||
],
|
||||
python_requires=">=3.6"
|
||||
python_requires=">=3.7"
|
||||
)
|
||||
|
|
|
@ -296,7 +296,7 @@ opentelemetry-sdk<2.0.0,>=1.5.0,!=1.10a0
|
|||
#override azure-mgmt-storage msrest>=0.7.1
|
||||
#override azure-mgmt-batch msrest>=0.7.1
|
||||
#override azure-mgmt-appconfiguration msrest>=0.7.1
|
||||
#override azure-mgmt-dnsresolver msrest>=0.6.21
|
||||
#override azure-mgmt-dnsresolver msrest>=0.7.1
|
||||
#override azure-mgmt-appplatform msrest>=0.6.21
|
||||
#override azure-mgmt-cosmosdb msrest>=0.7.1
|
||||
#override azure-mgmt-mobilenetwork msrest>=0.6.21
|
||||
|
@ -452,6 +452,7 @@ opentelemetry-sdk<2.0.0,>=1.5.0,!=1.10a0
|
|||
#override azure-mgmt-devtestlabs msrest>=0.7.1
|
||||
#override azure-mgmt-devtestlabs azure-mgmt-core>=1.3.2,<2.0.0
|
||||
#override azure-mgmt-search msrest>=0.7.1
|
||||
#override azure-mgmt-dnsresolver azure-mgmt-core>=1.3.2,<2.0.0
|
||||
#override azure-mgmt-search azure-mgmt-core>=1.3.2,<2.0.0
|
||||
#override azure-mgmt-notificationhubs azure-mgmt-core>=1.3.2,<2.0.0
|
||||
#override azure-mgmt-commerce msrest>=0.7.1
|
||||
|
|
Загрузка…
Ссылка в новой задаче