Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sdk/containerservice/azure-mgmt-containerservice/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "eca8060c5746b3b092c50580b59de31fe749d669",
"commit": "56dd7a25da810cec4b24e37bdab651e776319ea0",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/containerservice/resource-manager/readme.md --models-mode=msrest --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.8.4 --version-tolerant=False",
"autorest_command": "autorest specification/containerservice/resource-manager/readme.md --models-mode=msrest --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.8.4 --version-tolerant=False",
"readme": "specification/containerservice/resource-manager/readme.md"
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['ContainerServiceClient']

__all__ = ["ContainerServiceClient"]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

VERSION = "unknown"


class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for ContainerServiceClient.

Expand All @@ -33,14 +34,9 @@ class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too
: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(ContainerServiceClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-07-02-preview") # type: str
api_version = kwargs.pop("api_version", "2022-07-02-preview") # type: str

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -50,23 +46,24 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-containerservice/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".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
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,27 @@
from . import models
from .._serialization import Deserializer, Serializer
from ._configuration import ContainerServiceClientConfiguration
from .operations import AgentPoolsOperations, FleetMembersOperations, FleetsOperations, MaintenanceConfigurationsOperations, ManagedClusterSnapshotsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations, TrustedAccessRoleBindingsOperations, TrustedAccessRolesOperations
from .operations import (
AgentPoolsOperations,
FleetMembersOperations,
FleetsOperations,
MaintenanceConfigurationsOperations,
ManagedClusterSnapshotsOperations,
ManagedClustersOperations,
Operations,
PrivateEndpointConnectionsOperations,
PrivateLinkResourcesOperations,
ResolvePrivateLinkServiceIdOperations,
SnapshotsOperations,
TrustedAccessRoleBindingsOperations,
TrustedAccessRolesOperations,
)

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


class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""The Container Service Client.

Expand Down Expand Up @@ -81,25 +96,23 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._config = ContainerServiceClientConfiguration(
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)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.managed_clusters = ManagedClustersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.maintenance_configurations = MaintenanceConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.agent_pools = AgentPoolsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -109,9 +122,7 @@ def __init__(
self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.snapshots = SnapshotsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -121,19 +132,10 @@ def __init__(
self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.fleets = FleetsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.fleet_members = FleetMembersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize)
self.fleet_members = FleetMembersOperations(self._client, self._config, self._serialize, self._deserialize)


def _send_request(
self,
request: 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@

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)
if files:
request.set_formdata_body(files)
return request


def _format_url_section(template, **kwargs):
components = template.split("/")
while components:
try:
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)
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
except ImportError:
_patch_all = []
from ._patch import patch_sdk as _patch_sdk
__all__ = ['ContainerServiceClient']

__all__ = ["ContainerServiceClient"]
__all__.extend([p for p in _patch_all if p not in __all__])

_patch_sdk()
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

VERSION = "unknown"


class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too-many-instance-attributes
"""Configuration for ContainerServiceClient.

Expand All @@ -33,14 +34,9 @@ class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too
: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(ContainerServiceClientConfiguration, self).__init__(**kwargs)
api_version = kwargs.pop('api_version', "2022-07-02-preview") # type: str
api_version = kwargs.pop("api_version", "2022-07-02-preview") # type: str

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
Expand All @@ -50,22 +46,21 @@ def __init__(
self.credential = credential
self.subscription_id = subscription_id
self.api_version = api_version
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-containerservice/{}'.format(VERSION))
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
kwargs.setdefault("sdk_moniker", "mgmt-containerservice/{}".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
)
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,27 @@
from .. import models
from ..._serialization import Deserializer, Serializer
from ._configuration import ContainerServiceClientConfiguration
from .operations import AgentPoolsOperations, FleetMembersOperations, FleetsOperations, MaintenanceConfigurationsOperations, ManagedClusterSnapshotsOperations, ManagedClustersOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, ResolvePrivateLinkServiceIdOperations, SnapshotsOperations, TrustedAccessRoleBindingsOperations, TrustedAccessRolesOperations
from .operations import (
AgentPoolsOperations,
FleetMembersOperations,
FleetsOperations,
MaintenanceConfigurationsOperations,
ManagedClusterSnapshotsOperations,
ManagedClustersOperations,
Operations,
PrivateEndpointConnectionsOperations,
PrivateLinkResourcesOperations,
ResolvePrivateLinkServiceIdOperations,
SnapshotsOperations,
TrustedAccessRoleBindingsOperations,
TrustedAccessRolesOperations,
)

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


class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyword,too-many-instance-attributes
"""The Container Service Client.

Expand Down Expand Up @@ -82,25 +97,23 @@ def __init__(
base_url: str = "https://management.azure.com",
**kwargs: Any
) -> None:
self._config = ContainerServiceClientConfiguration(credential=credential, subscription_id=subscription_id, **kwargs)
self._config = ContainerServiceClientConfiguration(
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)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
self._serialize.client_side_validation = False
self.operations = Operations(
self._client, self._config, self._serialize, self._deserialize
)
self.operations = Operations(self._client, self._config, self._serialize, self._deserialize)
self.managed_clusters = ManagedClustersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.maintenance_configurations = MaintenanceConfigurationsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.agent_pools = AgentPoolsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.agent_pools = AgentPoolsOperations(self._client, self._config, self._serialize, self._deserialize)
self.private_endpoint_connections = PrivateEndpointConnectionsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -110,9 +123,7 @@ def __init__(
self.resolve_private_link_service_id = ResolvePrivateLinkServiceIdOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.snapshots = SnapshotsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.snapshots = SnapshotsOperations(self._client, self._config, self._serialize, self._deserialize)
self.managed_cluster_snapshots = ManagedClusterSnapshotsOperations(
self._client, self._config, self._serialize, self._deserialize
)
Expand All @@ -122,19 +133,10 @@ def __init__(
self.trusted_access_role_bindings = TrustedAccessRoleBindingsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.fleets = FleetsOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.fleet_members = FleetMembersOperations(
self._client, self._config, self._serialize, self._deserialize
)
self.fleets = FleetsOperations(self._client, self._config, self._serialize, self._deserialize)
self.fleet_members = FleetMembersOperations(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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

__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.
Expand Down
Loading