Skip to content

Commit 55fd0ea

Browse files
author
ftran
committed
add 04-01 api
1 parent 692f7b8 commit 55fd0ea

39 files changed

Lines changed: 17128 additions & 258 deletions

src/fleet/azext_fleet/vendored_sdks/_container_service_fleet_mgmt_client.py

Lines changed: 128 additions & 123 deletions
Large diffs are not rendered by default.

src/fleet/azext_fleet/vendored_sdks/_serialization.py

Lines changed: 42 additions & 134 deletions
Large diffs are not rendered by default.

src/fleet/azext_fleet/vendored_sdks/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "3.0.0"
9+
VERSION = "3.1.0"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
# pylint: disable=wrong-import-position
9+
10+
from typing import TYPE_CHECKING
11+
12+
if TYPE_CHECKING:
13+
from ._patch import * # pylint: disable=unused-wildcard-import
14+
15+
from ._container_service_fleet_mgmt_client import ContainerServiceFleetMgmtClient # type: ignore
16+
from ._version import VERSION
17+
18+
__version__ = VERSION
19+
20+
try:
21+
from ._patch import __all__ as _patch_all
22+
from ._patch import *
23+
except ImportError:
24+
_patch_all = []
25+
from ._patch import patch_sdk as _patch_sdk
26+
27+
__all__ = [
28+
"ContainerServiceFleetMgmtClient",
29+
]
30+
__all__.extend([p for p in _patch_all if p not in __all__]) # pyright: ignore
31+
32+
_patch_sdk()
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from typing import Any, TYPE_CHECKING
10+
11+
from azure.core.pipeline import policies
12+
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
13+
14+
from ._version import VERSION
15+
16+
if TYPE_CHECKING:
17+
from azure.core.credentials import TokenCredential
18+
19+
20+
class ContainerServiceFleetMgmtClientConfiguration: # pylint: disable=too-many-instance-attributes,name-too-long
21+
"""Configuration for ContainerServiceFleetMgmtClient.
22+
23+
Note that all parameters used to create this instance are saved as instance
24+
attributes.
25+
26+
:param credential: Credential needed for the client to connect to Azure. Required.
27+
:type credential: ~azure.core.credentials.TokenCredential
28+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
29+
:type subscription_id: str
30+
:keyword api_version: Api Version. Default value is "2025-04-01-preview". Note that overriding
31+
this default value may result in unsupported behavior.
32+
:paramtype api_version: str
33+
"""
34+
35+
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
36+
api_version: str = kwargs.pop("api_version", "2025-04-01-preview")
37+
38+
if credential is None:
39+
raise ValueError("Parameter 'credential' must not be None.")
40+
if subscription_id is None:
41+
raise ValueError("Parameter 'subscription_id' must not be None.")
42+
43+
self.credential = credential
44+
self.subscription_id = subscription_id
45+
self.api_version = api_version
46+
self.credential_scopes = kwargs.pop("credential_scopes", ["https://management.azure.com/.default"])
47+
kwargs.setdefault("sdk_moniker", "mgmt-containerservicefleet/{}".format(VERSION))
48+
self.polling_interval = kwargs.get("polling_interval", 30)
49+
self._configure(**kwargs)
50+
51+
def _configure(self, **kwargs: Any) -> None:
52+
self.user_agent_policy = kwargs.get("user_agent_policy") or policies.UserAgentPolicy(**kwargs)
53+
self.headers_policy = kwargs.get("headers_policy") or policies.HeadersPolicy(**kwargs)
54+
self.proxy_policy = kwargs.get("proxy_policy") or policies.ProxyPolicy(**kwargs)
55+
self.logging_policy = kwargs.get("logging_policy") or policies.NetworkTraceLoggingPolicy(**kwargs)
56+
self.http_logging_policy = kwargs.get("http_logging_policy") or ARMHttpLoggingPolicy(**kwargs)
57+
self.custom_hook_policy = kwargs.get("custom_hook_policy") or policies.CustomHookPolicy(**kwargs)
58+
self.redirect_policy = kwargs.get("redirect_policy") or policies.RedirectPolicy(**kwargs)
59+
self.retry_policy = kwargs.get("retry_policy") or policies.RetryPolicy(**kwargs)
60+
self.authentication_policy = kwargs.get("authentication_policy")
61+
if self.credential and not self.authentication_policy:
62+
self.authentication_policy = ARMChallengeAuthenticationPolicy(
63+
self.credential, *self.credential_scopes, **kwargs
64+
)
Lines changed: 167 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# Code generated by Microsoft (R) AutoRest Code Generator.
6+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
7+
# --------------------------------------------------------------------------
8+
9+
from copy import deepcopy
10+
from typing import Any, Optional, TYPE_CHECKING, cast
11+
from typing_extensions import Self
12+
13+
from azure.core.pipeline import policies
14+
from azure.core.rest import HttpRequest, HttpResponse
15+
from azure.core.settings import settings
16+
from azure.mgmt.core import ARMPipelineClient
17+
from azure.mgmt.core.policies import ARMAutoResourceProviderRegistrationPolicy
18+
from azure.mgmt.core.tools import get_arm_endpoints
19+
20+
from . import models as _models
21+
from ._configuration import ContainerServiceFleetMgmtClientConfiguration
22+
from ._utils.serialization import Deserializer, Serializer
23+
from .operations import (
24+
AutoUpgradeProfileOperationsOperations,
25+
AutoUpgradeProfilesOperations,
26+
FleetMembersOperations,
27+
FleetUpdateStrategiesOperations,
28+
FleetsOperations,
29+
GatesOperations,
30+
Operations,
31+
UpdateRunsOperations,
32+
)
33+
34+
if TYPE_CHECKING:
35+
from azure.core.credentials import TokenCredential
36+
37+
38+
class ContainerServiceFleetMgmtClient: # pylint: disable=too-many-instance-attributes
39+
"""Azure Kubernetes Fleet Manager api client.
40+
41+
:ivar operations: Operations operations
42+
:vartype operations: azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.Operations
43+
:ivar fleets: FleetsOperations operations
44+
:vartype fleets:
45+
azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.FleetsOperations
46+
:ivar auto_upgrade_profiles: AutoUpgradeProfilesOperations operations
47+
:vartype auto_upgrade_profiles:
48+
azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.AutoUpgradeProfilesOperations
49+
:ivar auto_upgrade_profile_operations: AutoUpgradeProfileOperationsOperations operations
50+
:vartype auto_upgrade_profile_operations:
51+
azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.AutoUpgradeProfileOperationsOperations
52+
:ivar gates: GatesOperations operations
53+
:vartype gates: azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.GatesOperations
54+
:ivar fleet_members: FleetMembersOperations operations
55+
:vartype fleet_members:
56+
azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.FleetMembersOperations
57+
:ivar update_runs: UpdateRunsOperations operations
58+
:vartype update_runs:
59+
azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.UpdateRunsOperations
60+
:ivar fleet_update_strategies: FleetUpdateStrategiesOperations operations
61+
:vartype fleet_update_strategies:
62+
azure.mgmt.containerservicefleet.v2025_04_01_preview.operations.FleetUpdateStrategiesOperations
63+
:param credential: Credential needed for the client to connect to Azure. Required.
64+
:type credential: ~azure.core.credentials.TokenCredential
65+
:param subscription_id: The ID of the target subscription. The value must be an UUID. Required.
66+
:type subscription_id: str
67+
:param base_url: Service URL. Default value is None.
68+
:type base_url: str
69+
:keyword api_version: Api Version. Default value is "2025-04-01-preview". Note that overriding
70+
this default value may result in unsupported behavior.
71+
:paramtype api_version: str
72+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
73+
Retry-After header is present.
74+
"""
75+
76+
def __init__(
77+
self, credential: "TokenCredential", subscription_id: str, base_url: Optional[str] = None, **kwargs: Any
78+
) -> None:
79+
_cloud = kwargs.pop("cloud_setting", None) or settings.current.azure_cloud # type: ignore
80+
_endpoints = get_arm_endpoints(_cloud)
81+
if not base_url:
82+
base_url = _endpoints["resource_manager"]
83+
credential_scopes = kwargs.pop("credential_scopes", _endpoints["credential_scopes"])
84+
self._config = ContainerServiceFleetMgmtClientConfiguration(
85+
credential=credential, subscription_id=subscription_id, credential_scopes=credential_scopes, **kwargs
86+
)
87+
88+
_policies = kwargs.pop("policies", None)
89+
if _policies is None:
90+
_policies = [
91+
policies.RequestIdPolicy(**kwargs),
92+
self._config.headers_policy,
93+
self._config.user_agent_policy,
94+
self._config.proxy_policy,
95+
policies.ContentDecodePolicy(**kwargs),
96+
ARMAutoResourceProviderRegistrationPolicy(),
97+
self._config.redirect_policy,
98+
self._config.retry_policy,
99+
self._config.authentication_policy,
100+
self._config.custom_hook_policy,
101+
self._config.logging_policy,
102+
policies.DistributedTracingPolicy(**kwargs),
103+
policies.SensitiveHeaderCleanupPolicy(**kwargs) if self._config.redirect_policy else None,
104+
self._config.http_logging_policy,
105+
]
106+
self._client: ARMPipelineClient = ARMPipelineClient(base_url=cast(str, base_url), policies=_policies, **kwargs)
107+
108+
client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)}
109+
self._serialize = Serializer(client_models)
110+
self._deserialize = Deserializer(client_models)
111+
self._serialize.client_side_validation = False
112+
self.operations = Operations(
113+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
114+
)
115+
self.fleets = FleetsOperations(
116+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
117+
)
118+
self.auto_upgrade_profiles = AutoUpgradeProfilesOperations(
119+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
120+
)
121+
self.auto_upgrade_profile_operations = AutoUpgradeProfileOperationsOperations(
122+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
123+
)
124+
self.gates = GatesOperations(
125+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
126+
)
127+
self.fleet_members = FleetMembersOperations(
128+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
129+
)
130+
self.update_runs = UpdateRunsOperations(
131+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
132+
)
133+
self.fleet_update_strategies = FleetUpdateStrategiesOperations(
134+
self._client, self._config, self._serialize, self._deserialize, "2025-04-01-preview"
135+
)
136+
137+
def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse:
138+
"""Runs the network request through the client's chained policies.
139+
140+
>>> from azure.core.rest import HttpRequest
141+
>>> request = HttpRequest("GET", "https://www.example.org/")
142+
<HttpRequest [GET], url: 'https://www.example.org/'>
143+
>>> response = client._send_request(request)
144+
<HttpResponse: 200 OK>
145+
146+
For more information on this code flow, see https://aka.ms/azsdk/dpcodegen/python/send_request
147+
148+
:param request: The network request you want to make. Required.
149+
:type request: ~azure.core.rest.HttpRequest
150+
:keyword bool stream: Whether the response payload will be streamed. Defaults to False.
151+
:return: The response of your network call. Does not do error handling on your response.
152+
:rtype: ~azure.core.rest.HttpResponse
153+
"""
154+
155+
request_copy = deepcopy(request)
156+
request_copy.url = self._client.format_url(request_copy.url)
157+
return self._client.send_request(request_copy, stream=stream, **kwargs) # type: ignore
158+
159+
def close(self) -> None:
160+
self._client.close()
161+
162+
def __enter__(self) -> Self:
163+
self._client.__enter__()
164+
return self
165+
166+
def __exit__(self, *exc_details: Any) -> None:
167+
self._client.__exit__(*exc_details)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for license information.
5+
# --------------------------------------------------------------------------
6+
"""Customize generated code here.
7+
8+
Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize
9+
"""
10+
from typing import List
11+
12+
__all__: List[str] = [] # Add all objects you want publicly available to users at this package level
13+
14+
15+
def patch_sdk():
16+
"""Do not remove from this file.
17+
18+
`patch_sdk` is a last resort escape hatch that allows you to do customizations
19+
you can't accomplish using the techniques described in
20+
https://aka.ms/azsdk/python/dpcodegen/python/customize
21+
"""
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
# Code generated by Microsoft (R) AutoRest Code Generator.
5+
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
6+
# --------------------------------------------------------------------------

0 commit comments

Comments
 (0)