Skip to content

Commit

Permalink
CodeGen from PR 24245 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
[Hub Generated] Review request for Microsoft.ContainerService/aks to add version preview/2023-05-02-preview (Azure#24245)

* Adds base for updating Microsoft.ContainerService/aks from version preview/2023-04-02-preview to version 2023-05-02-preview

* Updates readme

* Updates API version in new specs and examples

* uppdate readmes

* add network monitoring

* fix RPC-Put-V1-11

* fix python config

---------

Co-authored-by: msyyc <[email protected]>
  • Loading branch information
SDKAuto and msyyc committed Jun 9, 2023
1 parent 60f20f7 commit 9c55ac7
Show file tree
Hide file tree
Showing 123 changed files with 27,403 additions and 398 deletions.
6 changes: 3 additions & 3 deletions sdk/containerservice/azure-mgmt-containerservice/_meta.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"commit": "288939a1c67efd5f129124ea0912ca17ff7b9d90",
"commit": "6914c95db58c8dd037faf07bcc21475fc19c57f3",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest": "3.9.2",
"use": [
"@autorest/python@6.4.12",
"@autorest/python@6.5.0",
"@autorest/[email protected]"
],
"autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.4.12 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"autorest_command": "autorest specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md --generate-sample=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.5.0 --use=@autorest/[email protected] --version=3.9.2 --version-tolerant=False",
"readme": "specification/containerservice/resource-manager/Microsoft.ContainerService/aks/readme.md"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
# license information.
# --------------------------------------------------------------------------

VERSION = "23.0.0"
VERSION = "0.1.0"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from .v2017_07_01.models import *
from .v2019_04_01.models import *
from .v2019_04_30.models import *
from .v2022_09_02_preview.models import *
from .v2023_04_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2017-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:
super(ContainerServiceClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2017-07-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

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._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyw
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2017-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.
"""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2017-07-01",
"total_api_version_list": ["2017-07-01", "2019-04-01"],
"total_api_version_list": ["2017-07-01"],
"client": {
"name": "ContainerServiceClient",
"filename": "_container_service_client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "23.0.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,23 @@ class ContainerServiceClientConfiguration(Configuration): # pylint: disable=too
:param subscription_id: Subscription credentials which uniquely identify Microsoft Azure
subscription. The subscription ID forms part of the URI for every service call. Required.
:type subscription_id: str
:keyword api_version: Api Version. Default value is "2017-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:
super(ContainerServiceClientConfiguration, self).__init__(**kwargs)
api_version: str = kwargs.pop("api_version", "2017-07-01")

if credential is None:
raise ValueError("Parameter 'credential' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")

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._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class ContainerServiceClient: # pylint: disable=client-accepts-api-version-keyw
:type subscription_id: str
:param base_url: Service URL. Default value is "https://management.azure.com".
:type base_url: str
:keyword api_version: Api Version. Default value is "2017-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.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# --------------------------------------------------------------------------
from io import IOBase
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
import urllib.parse

from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
Expand Down Expand Up @@ -35,7 +36,6 @@
build_delete_request,
build_get_request,
build_list_by_resource_group_request,
build_list_orchestrators_request,
build_list_request,
)

Expand Down Expand Up @@ -104,7 +104,18 @@ def prepare_request(next_link=None):
request.url = self._client.format_url(request.url)

else:
request = HttpRequest("GET", next_link)
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
Expand Down Expand Up @@ -611,7 +622,18 @@ def prepare_request(next_link=None):
request.url = self._client.format_url(request.url)

else:
request = HttpRequest("GET", next_link)
# make call to next link with the client's api-version
_parsed_next_link = urllib.parse.urlparse(next_link)
_next_request_params = case_insensitive_dict(
{
key: [urllib.parse.quote(v) for v in value]
for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items()
}
)
_next_request_params["api-version"] = self._config.api_version
request = HttpRequest(
"GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)
request.method = "GET"
Expand Down Expand Up @@ -644,71 +666,3 @@ async def get_next(next_link=None):
list_by_resource_group.metadata = {
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices"
}

@distributed_trace_async
async def list_orchestrators(
self, location: str, resource_type: Optional[str] = None, **kwargs: Any
) -> _models.OrchestratorVersionProfileListResult:
"""Gets a list of supported orchestrators in the specified subscription.
Gets a list of supported orchestrators in the specified subscription. The operation returns
properties of each orchestrator including version, available upgrades and whether that version
or upgrades are in preview.
:param location: The name of a supported Azure region. Required.
:type location: str
:param resource_type: resource type for which the list of orchestrators needs to be returned.
Default value is None.
:type resource_type: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: OrchestratorVersionProfileListResult or the result of cls(response)
:rtype: ~azure.mgmt.containerservice.v2017_07_01.models.OrchestratorVersionProfileListResult
:raises ~azure.core.exceptions.HttpResponseError:
"""
error_map = {
401: ClientAuthenticationError,
404: ResourceNotFoundError,
409: ResourceExistsError,
304: ResourceNotModifiedError,
}
error_map.update(kwargs.pop("error_map", {}) or {})

_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})

api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2019-04-01"))
cls: ClsType[_models.OrchestratorVersionProfileListResult] = kwargs.pop("cls", None)

request = build_list_orchestrators_request(
location=location,
subscription_id=self._config.subscription_id,
resource_type=resource_type,
api_version=api_version,
template_url=self.list_orchestrators.metadata["url"],
headers=_headers,
params=_params,
)
request = _convert_request(request)
request.url = self._client.format_url(request.url)

_stream = False
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
request, stream=_stream, **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("OrchestratorVersionProfileListResult", pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized

list_orchestrators.metadata = {
"url": "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
from ._models_py3 import ContainerServiceVMDiagnostics
from ._models_py3 import ContainerServiceWindowsProfile
from ._models_py3 import KeyVaultSecretRef
from ._models_py3 import OrchestratorProfile
from ._models_py3 import OrchestratorVersionProfile
from ._models_py3 import OrchestratorVersionProfileListResult
from ._models_py3 import Resource

from ._container_service_client_enums import ContainerServiceOrchestratorTypes
Expand All @@ -49,9 +46,6 @@
"ContainerServiceVMDiagnostics",
"ContainerServiceWindowsProfile",
"KeyVaultSecretRef",
"OrchestratorProfile",
"OrchestratorVersionProfile",
"OrchestratorVersionProfileListResult",
"Resource",
"ContainerServiceOrchestratorTypes",
"ContainerServiceStorageProfileTypes",
Expand Down
Loading

0 comments on commit 9c55ac7

Please sign in to comment.