From 561d2e515e64c87efd7eb3b51cb50ec1cea5c1e2 Mon Sep 17 00:00:00 2001 From: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:32:55 +0530 Subject: [PATCH 1/5] testing --- sdk/ml/azure-ai-ml/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index 6890cd8fc09d..2d6fba0136ad 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.25.0 (Unreleased) ### Features Added + - Test ### Bugs Fixed From f230ef72cff4340b9f4d34a0bb6acfae0ce8d38b Mon Sep 17 00:00:00 2001 From: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:25:07 +0530 Subject: [PATCH 2/5] api review comment for kwargs in job entity --- sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py index 0413eb447630..b181636ed722 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job.py @@ -17,16 +17,10 @@ from azure.ai.ml._restclient.v2023_04_01_preview.models import JobBase, JobService from azure.ai.ml._restclient.v2023_04_01_preview.models import JobType as RestJobType from azure.ai.ml._restclient.v2024_01_01_preview.models import JobBase as JobBase_2401 -from azure.ai.ml._restclient.v2024_01_01_preview.models import ( - JobType as RestJobType_20240101Preview, -) +from azure.ai.ml._restclient.v2024_01_01_preview.models import JobType as RestJobType_20240101Preview from azure.ai.ml._utils._html_utils import make_link, to_html from azure.ai.ml._utils.utils import dump_yaml_to_file -from azure.ai.ml.constants._common import ( - BASE_PATH_CONTEXT_KEY, - PARAMS_OVERRIDE_KEY, - CommonYamlFields, -) +from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY, PARAMS_OVERRIDE_KEY, CommonYamlFields from azure.ai.ml.constants._compute import ComputeType from azure.ai.ml.constants._job.job import JobServices, JobType from azure.ai.ml.entities._mixins import TelemetryMixin @@ -76,8 +70,6 @@ class Job(Resource, ComponentTranslatableMixin, TelemetryMixin): :type services: Optional[dict[str, ~azure.ai.ml.entities.JobService]] :param compute: Information about the compute resources associated with the job. :type compute: Optional[str] - :keyword kwargs: A dictionary of additional configuration parameters. - :paramtype kwargs: dict """ def __init__( From 3f360f9d0a05f4ec74283edbb6d546cc96b22544 Mon Sep 17 00:00:00 2001 From: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:27:26 +0530 Subject: [PATCH 3/5] remove unuse entry in change log --- sdk/ml/azure-ai-ml/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/sdk/ml/azure-ai-ml/CHANGELOG.md b/sdk/ml/azure-ai-ml/CHANGELOG.md index 281b8a69859e..9cc7e26d35b2 100644 --- a/sdk/ml/azure-ai-ml/CHANGELOG.md +++ b/sdk/ml/azure-ai-ml/CHANGELOG.md @@ -7,7 +7,6 @@ ## 1.25.0 (2025-02-11) ### Features Added - - Test ### Bugs Fixed - #39187 - Submitting a Command job created using the __call__ method on another Command is missing outputs. From 299b73a7b2d98b0a4739126f332082deac0d4d2b Mon Sep 17 00:00:00 2001 From: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com> Date: Tue, 5 Aug 2025 10:20:09 +0530 Subject: [PATCH 4/5] adding 2024-04 data plane --- .../v2024-04-01-dataplanepreview/__init__.py | 18 + .../_azure_machine_learning_workspaces.py | 98 ++ .../_configuration.py | 70 ++ .../v2024-04-01-dataplanepreview/_patch.py | 31 + .../v2024-04-01-dataplanepreview/_vendor.py | 27 + .../v2024-04-01-dataplanepreview/_version.py | 9 + .../aio/__init__.py | 15 + .../aio/_azure_machine_learning_workspaces.py | 91 ++ .../aio/_configuration.py | 66 + .../aio/_patch.py | 31 + .../aio/operations/__init__.py | 15 + .../_deployment_templates_operations.py | 291 +++++ .../aio/operations/_indexes_operations.py | 638 ++++++++++ .../models/__init__.py | 46 + .../models/_models.py | 653 ++++++++++ .../models/_models_py3.py | 715 +++++++++++ .../operations/__init__.py | 15 + .../_deployment_templates_operations.py | 422 +++++++ .../operations/_indexes_operations.py | 891 ++++++++++++++ .../v2024-04-01-dataplanepreview/py.typed | 1 + .../azure-ai-assets.json | 1082 +++++++++++++++++ .../resource-manager/readme.md | 10 + 22 files changed, 5235 insertions(+) create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/__init__.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_configuration.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_patch.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_vendor.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_version.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/__init__.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_configuration.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_patch.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/__init__.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/__init__.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py create mode 100644 sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/py.typed create mode 100644 sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/__init__.py new file mode 100644 index 000000000000..da46614477a9 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/__init__.py @@ -0,0 +1,18 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces +from ._version import VERSION + +__version__ = VERSION +__all__ = ['AzureMachineLearningWorkspaces'] + +# `._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() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py new file mode 100644 index 000000000000..8b36bafdf50c --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py @@ -0,0 +1,98 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import TYPE_CHECKING + +from msrest import Deserializer, Serializer + +from azure.mgmt.core import ARMPipelineClient + +from . import models +from ._configuration import AzureMachineLearningWorkspacesConfiguration +from .operations import DeploymentTemplatesOperations, IndexesOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + from azure.core.rest import HttpRequest, HttpResponse + +class AzureMachineLearningWorkspaces(object): + """AzureMachineLearningWorkspaces. + + :ivar deployment_templates: DeploymentTemplatesOperations operations + :vartype deployment_templates: + azure.mgmt.machinelearningservices.operations.DeploymentTemplatesOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.mgmt.machinelearningservices.operations.IndexesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: Api Version. The default value is "2024-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + **kwargs # type: Any + ): + # type: (...) -> None + _base_url = '{endpoint}/genericasset/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}' + self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **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.deployment_templates = DeploymentTemplatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + + + def _send_request( + self, + request, # type: HttpRequest + **kwargs # type: Any + ): + # type: (...) -> HttpResponse + """Runs the network request through the client's chained policies. + + >>> from azure.core.rest import HttpRequest + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.HttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + def close(self): + # type: () -> None + self._client.close() + + def __enter__(self): + # type: () -> AzureMachineLearningWorkspaces + self._client.__enter__() + return self + + def __exit__(self, *exc_details): + # type: (Any) -> None + self._client.__exit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_configuration.py new file mode 100644 index 000000000000..8fa69b940a93 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_configuration.py @@ -0,0 +1,70 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy + +from ._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any + + from azure.core.credentials import TokenCredential + + +class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for AzureMachineLearningWorkspaces. + + 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. + :type credential: ~azure.core.credentials.TokenCredential + :keyword api_version: Api Version. The default value is "2024-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential, # type: "TokenCredential" + **kwargs # type: Any + ): + # type: (...) -> None + super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.format(VERSION)) + self._configure(**kwargs) + + def _configure( + 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') + if self.credential and not self.authentication_policy: + self.authentication_policy = ARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# 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 \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_vendor.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_vendor.py new file mode 100644 index 000000000000..138f663c53a4 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_vendor.py @@ -0,0 +1,27 @@ +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +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 + ] + template = "/".join(components) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_version.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_version.py new file mode 100644 index 000000000000..eae7c95b6fbd --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_version.py @@ -0,0 +1,9 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +VERSION = "0.1.0" diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/__init__.py new file mode 100644 index 000000000000..f67ccda966f1 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._azure_machine_learning_workspaces import AzureMachineLearningWorkspaces +__all__ = ['AzureMachineLearningWorkspaces'] + +# `._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() diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py new file mode 100644 index 000000000000..b7f897ae9ea2 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py @@ -0,0 +1,91 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from copy import deepcopy +from typing import Any, Awaitable, TYPE_CHECKING + +from msrest import Deserializer, Serializer + +from azure.core.rest import AsyncHttpResponse, HttpRequest +from azure.mgmt.core import AsyncARMPipelineClient + +from .. import models +from ._configuration import AzureMachineLearningWorkspacesConfiguration +from .operations import DeploymentTemplatesOperations, IndexesOperations + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + +class AzureMachineLearningWorkspaces: + """AzureMachineLearningWorkspaces. + + :ivar deployment_templates: DeploymentTemplatesOperations operations + :vartype deployment_templates: + azure.mgmt.machinelearningservices.aio.operations.DeploymentTemplatesOperations + :ivar indexes: IndexesOperations operations + :vartype indexes: azure.mgmt.machinelearningservices.aio.operations.IndexesOperations + :param credential: Credential needed for the client to connect to Azure. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: Api Version. The default value is "2024-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + **kwargs: Any + ) -> None: + _base_url = '{endpoint}/genericasset/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}' + self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **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.deployment_templates = DeploymentTemplatesOperations(self._client, self._config, self._serialize, self._deserialize) + self.indexes = IndexesOperations(self._client, self._config, self._serialize, self._deserialize) + + + 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 + >>> request = HttpRequest("GET", "https://www.example.org/") + + >>> response = await client._send_request(request) + + + For more information on this code flow, see https://aka.ms/azsdk/python/protocol/quickstart + + :param request: The network request you want to make. Required. + :type request: ~azure.core.rest.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to False. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.rest.AsyncHttpResponse + """ + + request_copy = deepcopy(request) + request_copy.url = self._client.format_url(request_copy.url) + return self._client.send_request(request_copy, **kwargs) + + async def close(self) -> None: + await self._client.close() + + async def __aenter__(self) -> "AzureMachineLearningWorkspaces": + await self._client.__aenter__() + return self + + async def __aexit__(self, *exc_details) -> None: + await self._client.__aexit__(*exc_details) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_configuration.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_configuration.py new file mode 100644 index 000000000000..5d736a5ab04b --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_configuration.py @@ -0,0 +1,66 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from typing import Any, TYPE_CHECKING + +from azure.core.configuration import Configuration +from azure.core.pipeline import policies +from azure.mgmt.core.policies import ARMHttpLoggingPolicy, AsyncARMChallengeAuthenticationPolicy + +from .._version import VERSION + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from azure.core.credentials_async import AsyncTokenCredential + + +class AzureMachineLearningWorkspacesConfiguration(Configuration): # pylint: disable=too-many-instance-attributes + """Configuration for AzureMachineLearningWorkspaces. + + 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. + :type credential: ~azure.core.credentials_async.AsyncTokenCredential + :keyword api_version: Api Version. The default value is "2024-04-01-preview". Note that + overriding this default value may result in unsupported behavior. + :paramtype api_version: str + """ + + def __init__( + self, + credential: "AsyncTokenCredential", + **kwargs: Any + ) -> None: + super(AzureMachineLearningWorkspacesConfiguration, self).__init__(**kwargs) + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + if credential is None: + raise ValueError("Parameter 'credential' must not be None.") + + self.credential = credential + self.api_version = api_version + self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) + kwargs.setdefault('sdk_moniker', 'mgmt-machinelearningservices/{}'.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') + if self.credential and not self.authentication_policy: + self.authentication_policy = AsyncARMChallengeAuthenticationPolicy(self.credential, *self.credential_scopes, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_patch.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_patch.py new file mode 100644 index 000000000000..74e48ecd07cf --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_patch.py @@ -0,0 +1,31 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# +# Copyright (c) Microsoft Corporation. All rights reserved. +# +# The MIT License (MIT) +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the ""Software""), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +# IN THE SOFTWARE. +# +# -------------------------------------------------------------------------- + +# 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 \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/__init__.py new file mode 100644 index 000000000000..f5baa9e7ddee --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._deployment_templates_operations import DeploymentTemplatesOperations +from ._indexes_operations import IndexesOperations + +__all__ = [ + 'DeploymentTemplatesOperations', + 'IndexesOperations', +] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py new file mode 100644 index 000000000000..365e5e4e3204 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py @@ -0,0 +1,291 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, Callable, Dict, Optional, TypeVar + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._deployment_templates_operations import build_create_request, build_delete_generic_asset_request, build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class DeploymentTemplatesOperations: + """DeploymentTemplatesOperations async operations. + + 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: ~azure.mgmt.machinelearningservices.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. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace_async + async def create( # pylint: disable=inconsistent-return-statements + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + registry_name: str, + name: str, + version: str, + body: "_models.DeploymentTemplate", + **kwargs: Any + ) -> None: + """Creates a deployment template version. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param name: Name of the deployment template. + :type name: str + :param version: Version of the deployment template. + :type version: str + :param body: Properties of a Deployment Template Version. + :type body: ~azure.mgmt.machinelearningservices.models.DeploymentTemplate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'DeploymentTemplate') + + request = build_create_request( + registry_name=registry_name, + name=name, + version=version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + create.metadata = {'url': "/registries/{registryName}/{name}/versions/{version}"} # type: ignore + + + @distributed_trace_async + async def get( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + registry_name: str, + name: str, + version: str, + asset_resource_tenant_id: Optional[str] = None, + **kwargs: Any + ) -> "_models.DeploymentTemplate": + """Get a specific version of a deployment template. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param name: Name of the deployment template. + :type name: str + :param version: Version of the deployment template. + :type version: str + :param asset_resource_tenant_id: Asset resource tenant ID. + :type asset_resource_tenant_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_request( + registry_name=registry_name, + name=name, + version=version, + api_version=api_version, + asset_resource_tenant_id=asset_resource_tenant_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}"} # type: ignore + + + @distributed_trace_async + async def delete_generic_asset( # pylint: disable=inconsistent-return-statements + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + registry_name: str, + type: str, + name: str, + version: str, + **kwargs: Any + ) -> None: + """Delete a specific version of a deployment template. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param type: The type of the deployment template. + :type type: str + :param name: Name of the deployment template. + :type name: str + :param version: Version of the deployment template. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_delete_generic_asset_request( + registry_name=registry_name, + type=type, + name=name, + version=version, + api_version=api_version, + template_url=self.delete_generic_asset.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_generic_asset.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}"} # type: ignore + diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py new file mode 100644 index 000000000000..ad51dea1bcc8 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py @@ -0,0 +1,638 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._indexes_operations import build_create_or_update_request, build_get_latest_request, build_get_next_version_request, build_get_request, build_list_latest_request, build_list_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class IndexesOperations: + """IndexesOperations async operations. + + 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: ~azure.mgmt.machinelearningservices.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. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_latest( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + workspace_name1: str, + top: Optional[int] = None, + skip: Optional[int] = 0, + maxpagesize: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.PagedIndex"]: + """List the latest version of each index. Latest is defined by most recent created by date. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param top: The number of result items to return. + :type top: int + :param skip: The number of result items to skip. + :type skip: int + :param maxpagesize: The maximum number of result items per page. + :type maxpagesize: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PagedIndex or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PagedIndex] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagedIndex"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_latest_request( + workspace_name1=workspace_name1, + api_version=api_version, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=self.list_latest.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + + request = build_list_latest_request( + workspace_name1=workspace_name1, + api_version=api_version, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=next_link, + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PagedIndex", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_latest.metadata = {'url': "/workspaces/{workspaceName}/indexes"} # type: ignore + + @distributed_trace_async + async def get_latest( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + workspace_name1: str, + name: str, + **kwargs: Any + ) -> "_models.Index": + """Get latest version of the Index. Latest is defined by most recent created by date. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Index, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.Index + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Index"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_latest_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + template_url=self.get_latest.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Index', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_latest.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}"} # type: ignore + + + @distributed_trace_async + async def get_next_version( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + workspace_name1: str, + name: str, + **kwargs: Any + ) -> "_models.VersionInfo": + """Get next Index version as defined by the server. The server keeps track of all versions that + are string-representations of integers. If one exists, the nextVersion will be a string + representation of the highest integer value + 1. Otherwise, the nextVersion will default to + '1'. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VersionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.VersionInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VersionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_next_version_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + template_url=self.get_next_version.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VersionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_next_version.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}:getNextVersion"} # type: ignore + + + @distributed_trace + def list( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + workspace_name1: str, + name: str, + list_view_type: str = "ActiveOnly", + order_by: Optional[str] = None, + tags: Optional[str] = None, + top: Optional[int] = None, + skip: Optional[int] = 0, + maxpagesize: Optional[int] = None, + **kwargs: Any + ) -> AsyncIterable["_models.PagedIndex"]: + """List the versions of an Index given the name. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :param list_view_type: View type for including/excluding (for example) archived entities. + :type list_view_type: str + :param order_by: Ordering of list: Please choose orderby value from ['createdAt', + 'lastModifiedAt']. + :type order_by: str + :param tags: Comma-separated list of tag names (and optionally values). Example: + tag1,tag2=value2. + :type tags: str + :param top: The number of result items to return. + :type top: int + :param skip: The number of result items to skip. + :type skip: int + :param maxpagesize: The maximum number of result items per page. + :type maxpagesize: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PagedIndex or the result of cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PagedIndex] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagedIndex"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + list_view_type=list_view_type, + order_by=order_by, + tags=tags, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + + request = build_list_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + list_view_type=list_view_type, + order_by=order_by, + tags=tags, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=next_link, + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PagedIndex", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}/versions"} # type: ignore + + @distributed_trace_async + async def get( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + workspace_name1: str, + name: str, + version: str, + **kwargs: Any + ) -> "_models.Index": + """Get a specific version of an Index. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :param version: Version of the index. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Index, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.Index + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Index"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_request( + workspace_name1=workspace_name1, + name=name, + version=version, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Index', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}/versions/{version}"} # type: ignore + + + @distributed_trace_async + async def create_or_update( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + workspace_name: str, + workspace_name1: str, + name: str, + version: str, + body: "_models.Index", + **kwargs: Any + ) -> "_models.Index": + """Creates or updates a IndexVersion. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :param version: Version of the index. + :type version: str + :param body: Properties of an Index Version. + :type body: ~azure.mgmt.machinelearningservices.models.Index + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Index, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.Index + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Index"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'Index') + + request = build_create_or_update_request( + workspace_name1=workspace_name1, + name=name, + version=version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Index', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Index', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}/versions/{version}"} # type: ignore + diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py new file mode 100644 index 000000000000..df6baa360afc --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py @@ -0,0 +1,46 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AssetVersion + from ._models_py3 import AzureCoreFoundationsError + from ._models_py3 import AzureCoreFoundationsErrorResponse + from ._models_py3 import AzureCoreFoundationsInnerError + from ._models_py3 import DeploymentTemplate + from ._models_py3 import Index + from ._models_py3 import OnlineRequestSettings + from ._models_py3 import PagedIndex + from ._models_py3 import ProbeSettings + from ._models_py3 import SystemData + from ._models_py3 import VersionInfo +except (SyntaxError, ImportError): + from ._models import AssetVersion # type: ignore + from ._models import AzureCoreFoundationsError # type: ignore + from ._models import AzureCoreFoundationsErrorResponse # type: ignore + from ._models import AzureCoreFoundationsInnerError # type: ignore + from ._models import DeploymentTemplate # type: ignore + from ._models import Index # type: ignore + from ._models import OnlineRequestSettings # type: ignore + from ._models import PagedIndex # type: ignore + from ._models import ProbeSettings # type: ignore + from ._models import SystemData # type: ignore + from ._models import VersionInfo # type: ignore + +__all__ = [ + 'AssetVersion', + 'AzureCoreFoundationsError', + 'AzureCoreFoundationsErrorResponse', + 'AzureCoreFoundationsInnerError', + 'DeploymentTemplate', + 'Index', + 'OnlineRequestSettings', + 'PagedIndex', + 'ProbeSettings', + 'SystemData', + 'VersionInfo', +] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py new file mode 100644 index 000000000000..41ce8779e63a --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py @@ -0,0 +1,653 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AssetVersion(msrest.serialization.Model): + """AssetVersion Definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Required. Fully qualified resource Id: + azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index. + :vartype id: str + :ivar stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :vartype stage: str + :ivar description: Description information of the asset. + :vartype description: str + :ivar system_data: Metadata containing createdBy and modifiedBy information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'required': True, 'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :paramtype stage: str + :keyword description: Description information of the asset. + :paramtype description: str + :keyword tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :paramtype tags: dict[str, str] + :keyword properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :paramtype properties: dict[str, str] + """ + super(AssetVersion, self).__init__(**kwargs) + self.id = None + self.stage = kwargs.get('stage', "Development") + self.description = kwargs.get('description', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) + + +class AzureCoreFoundationsError(msrest.serialization.Model): + """The error object. + + All required parameters must be populated in order to send to Azure. + + :ivar code: Required. One of a server-defined set of error codes. + :vartype code: str + :ivar message: Required. A human-readable representation of the error. + :vartype message: str + :ivar target: The target of the error. + :vartype target: str + :ivar details: An array of details about specific errors that led to this reported error. + :vartype details: list[~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError] + :ivar innererror: An object containing more specific information than the current object about + the error. + :vartype innererror: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[AzureCoreFoundationsError]'}, + 'innererror': {'key': 'innererror', 'type': 'AzureCoreFoundationsInnerError'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword code: Required. One of a server-defined set of error codes. + :paramtype code: str + :keyword message: Required. A human-readable representation of the error. + :paramtype message: str + :keyword target: The target of the error. + :paramtype target: str + :keyword details: An array of details about specific errors that led to this reported error. + :paramtype details: list[~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError] + :keyword innererror: An object containing more specific information than the current object + about the error. + :paramtype innererror: + ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + super(AzureCoreFoundationsError, self).__init__(**kwargs) + self.code = kwargs['code'] + self.message = kwargs['message'] + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + self.innererror = kwargs.get('innererror', None) + + +class AzureCoreFoundationsErrorResponse(msrest.serialization.Model): + """A response containing error details. + + All required parameters must be populated in order to send to Azure. + + :ivar error: Required. The error object. + :vartype error: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'AzureCoreFoundationsError'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword error: Required. The error object. + :paramtype error: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError + """ + super(AzureCoreFoundationsErrorResponse, self).__init__(**kwargs) + self.error = kwargs['error'] + + +class AzureCoreFoundationsInnerError(msrest.serialization.Model): + """An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. + + :ivar code: One of a server-defined set of error codes. + :vartype code: str + :ivar innererror: Inner error. + :vartype innererror: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'AzureCoreFoundationsInnerError'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword code: One of a server-defined set of error codes. + :paramtype code: str + :keyword innererror: Inner error. + :paramtype innererror: + ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + super(AzureCoreFoundationsInnerError, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.innererror = kwargs.get('innererror', None) + + +class DeploymentTemplate(msrest.serialization.Model): + """DeploymentTemplate resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Required. Fully qualified resource Id: + azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index. + :vartype id: str + :ivar stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :vartype stage: str + :ivar description: Description information of the asset. + :vartype description: str + :ivar system_data: Metadata containing createdBy and modifiedBy information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar deployment_template_type: Required. The type of deployment template. + :vartype deployment_template_type: str + :ivar environment_id: Required. The ID of the environment asset. + :vartype environment_id: str + :ivar environment_variables: Environment variables for the deployment. + :vartype environment_variables: dict[str, str] + :ivar allowed_environment_variable_overrides: List of environment variable names that can be + overridden. + :vartype allowed_environment_variable_overrides: list[str] + :ivar model_mount_path: Path where the model will be mounted. + :vartype model_mount_path: str + :ivar request_settings: Request settings for online deployment. + :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings + :ivar liveness_probe: Liveness probe settings. + :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :ivar readiness_probe: Readiness probe settings. + :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :ivar allowed_instance_type: Required. List of allowed instance types for the deployment. + :vartype allowed_instance_type: list[str] + :ivar default_instance_type: Required. Default instance type for the deployment. + :vartype default_instance_type: str + :ivar instance_count: Required. Number of instances for the deployment. + :vartype instance_count: int + :ivar scoring_path: Path for scoring requests. + :vartype scoring_path: str + :ivar scoring_port: Port for scoring requests. + :vartype scoring_port: int + """ + + _validation = { + 'id': {'required': True, 'readonly': True}, + 'system_data': {'readonly': True}, + 'deployment_template_type': {'required': True}, + 'environment_id': {'required': True}, + 'allowed_instance_type': {'required': True}, + 'default_instance_type': {'required': True}, + 'instance_count': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'deployment_template_type': {'key': 'deploymentTemplateType', 'type': 'str'}, + 'environment_id': {'key': 'environmentId', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, + 'allowed_environment_variable_overrides': {'key': 'allowedEnvironmentVariableOverrides', 'type': '[str]'}, + 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, + 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, + 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, + 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, + 'allowed_instance_type': {'key': 'allowedInstanceType', 'type': '[str]'}, + 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, + 'instance_count': {'key': 'instanceCount', 'type': 'int'}, + 'scoring_path': {'key': 'scoringPath', 'type': 'str'}, + 'scoring_port': {'key': 'scoringPort', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :paramtype stage: str + :keyword description: Description information of the asset. + :paramtype description: str + :keyword tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :paramtype tags: dict[str, str] + :keyword properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :paramtype properties: dict[str, str] + :keyword deployment_template_type: Required. The type of deployment template. + :paramtype deployment_template_type: str + :keyword environment_id: Required. The ID of the environment asset. + :paramtype environment_id: str + :keyword environment_variables: Environment variables for the deployment. + :paramtype environment_variables: dict[str, str] + :keyword allowed_environment_variable_overrides: List of environment variable names that can be + overridden. + :paramtype allowed_environment_variable_overrides: list[str] + :keyword model_mount_path: Path where the model will be mounted. + :paramtype model_mount_path: str + :keyword request_settings: Request settings for online deployment. + :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings + :keyword liveness_probe: Liveness probe settings. + :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :keyword readiness_probe: Readiness probe settings. + :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :keyword allowed_instance_type: Required. List of allowed instance types for the deployment. + :paramtype allowed_instance_type: list[str] + :keyword default_instance_type: Required. Default instance type for the deployment. + :paramtype default_instance_type: str + :keyword instance_count: Required. Number of instances for the deployment. + :paramtype instance_count: int + :keyword scoring_path: Path for scoring requests. + :paramtype scoring_path: str + :keyword scoring_port: Port for scoring requests. + :paramtype scoring_port: int + """ + super(DeploymentTemplate, self).__init__(**kwargs) + self.id = None + self.stage = kwargs.get('stage', "Development") + self.description = kwargs.get('description', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) + self.deployment_template_type = kwargs['deployment_template_type'] + self.environment_id = kwargs['environment_id'] + self.environment_variables = kwargs.get('environment_variables', None) + self.allowed_environment_variable_overrides = kwargs.get('allowed_environment_variable_overrides', None) + self.model_mount_path = kwargs.get('model_mount_path', None) + self.request_settings = kwargs.get('request_settings', None) + self.liveness_probe = kwargs.get('liveness_probe', None) + self.readiness_probe = kwargs.get('readiness_probe', None) + self.allowed_instance_type = kwargs['allowed_instance_type'] + self.default_instance_type = kwargs['default_instance_type'] + self.instance_count = kwargs['instance_count'] + self.scoring_path = kwargs.get('scoring_path', None) + self.scoring_port = kwargs.get('scoring_port', None) + + +class Index(msrest.serialization.Model): + """Index resource Definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Required. Fully qualified resource Id: + azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index. + :vartype id: str + :ivar stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :vartype stage: str + :ivar description: Description information of the asset. + :vartype description: str + :ivar system_data: Metadata containing createdBy and modifiedBy information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar storage_uri: Required. Default workspace blob storage Uri. Should work across storage + types and auth scenarios. + :vartype storage_uri: str + """ + + _validation = { + 'id': {'required': True, 'readonly': True}, + 'system_data': {'readonly': True}, + 'storage_uri': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :paramtype stage: str + :keyword description: Description information of the asset. + :paramtype description: str + :keyword tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :paramtype tags: dict[str, str] + :keyword properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :paramtype properties: dict[str, str] + :keyword storage_uri: Required. Default workspace blob storage Uri. Should work across storage + types and auth scenarios. + :paramtype storage_uri: str + """ + super(Index, self).__init__(**kwargs) + self.id = None + self.stage = kwargs.get('stage', "Development") + self.description = kwargs.get('description', None) + self.system_data = None + self.tags = kwargs.get('tags', None) + self.properties = kwargs.get('properties', None) + self.storage_uri = kwargs['storage_uri'] + + +class OnlineRequestSettings(msrest.serialization.Model): + """Settings for online request configuration. + + All required parameters must be populated in order to send to Azure. + + :ivar request_timeout: Required. The timeout duration for requests. + :vartype request_timeout: ~datetime.timedelta + :ivar max_concurrent_requests_per_instance: Required. The maximum number of concurrent requests + per instance. + :vartype max_concurrent_requests_per_instance: int + """ + + _validation = { + 'request_timeout': {'required': True}, + 'max_concurrent_requests_per_instance': {'required': True}, + } + + _attribute_map = { + 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword request_timeout: Required. The timeout duration for requests. + :paramtype request_timeout: ~datetime.timedelta + :keyword max_concurrent_requests_per_instance: Required. The maximum number of concurrent + requests per instance. + :paramtype max_concurrent_requests_per_instance: int + """ + super(OnlineRequestSettings, self).__init__(**kwargs) + self.request_timeout = kwargs['request_timeout'] + self.max_concurrent_requests_per_instance = kwargs['max_concurrent_requests_per_instance'] + + +class PagedIndex(msrest.serialization.Model): + """Paged collection of IndexVersion items. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Required. The list of Indexes. + :vartype value: list[~azure.mgmt.machinelearningservices.models.Index] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Index]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: Required. The list of Indexes. + :paramtype value: list[~azure.mgmt.machinelearningservices.models.Index] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super(PagedIndex, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + +class ProbeSettings(msrest.serialization.Model): + """Settings for probe configuration. + + All required parameters must be populated in order to send to Azure. + + :ivar initial_delay: The initial delay before starting probes. + :vartype initial_delay: ~datetime.timedelta + :ivar period: Required. The period between probe executions. + :vartype period: ~datetime.timedelta + :ivar timeout: Required. The timeout duration for each probe. + :vartype timeout: ~datetime.timedelta + :ivar failure_threshold: Required. The number of consecutive failures required to consider the + probe as failed. + :vartype failure_threshold: int + :ivar success_threshold: Required. The number of consecutive successes required to consider the + probe as successful. + :vartype success_threshold: int + :ivar path: Required. The path for the probe request. + :vartype path: str + :ivar port: Required. The port number for the probe. + :vartype port: int + :ivar scheme: Required. The scheme for the probe (e.g., HTTP, HTTPS). + :vartype scheme: str + :ivar http_method: Required. The HTTP method for the probe request. + :vartype http_method: str + """ + + _validation = { + 'period': {'required': True}, + 'timeout': {'required': True}, + 'failure_threshold': {'required': True}, + 'success_threshold': {'required': True}, + 'path': {'required': True}, + 'port': {'required': True}, + 'scheme': {'required': True}, + 'http_method': {'required': True}, + } + + _attribute_map = { + 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, + 'period': {'key': 'period', 'type': 'duration'}, + 'timeout': {'key': 'timeout', 'type': 'duration'}, + 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, + 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'scheme': {'key': 'scheme', 'type': 'str'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword initial_delay: The initial delay before starting probes. + :paramtype initial_delay: ~datetime.timedelta + :keyword period: Required. The period between probe executions. + :paramtype period: ~datetime.timedelta + :keyword timeout: Required. The timeout duration for each probe. + :paramtype timeout: ~datetime.timedelta + :keyword failure_threshold: Required. The number of consecutive failures required to consider + the probe as failed. + :paramtype failure_threshold: int + :keyword success_threshold: Required. The number of consecutive successes required to consider + the probe as successful. + :paramtype success_threshold: int + :keyword path: Required. The path for the probe request. + :paramtype path: str + :keyword port: Required. The port number for the probe. + :paramtype port: int + :keyword scheme: Required. The scheme for the probe (e.g., HTTP, HTTPS). + :paramtype scheme: str + :keyword http_method: Required. The HTTP method for the probe request. + :paramtype http_method: str + """ + super(ProbeSettings, self).__init__(**kwargs) + self.initial_delay = kwargs.get('initial_delay', None) + self.period = kwargs['period'] + self.timeout = kwargs['timeout'] + self.failure_threshold = kwargs['failure_threshold'] + self.success_threshold = kwargs['success_threshold'] + self.path = kwargs['path'] + self.port = kwargs['port'] + self.scheme = kwargs['scheme'] + self.http_method = kwargs['http_method'] + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp the resource was created at. + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The identity type that created the resource. + :vartype created_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SystemData, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.created_by_type = None + self.last_modified_at = None + + +class VersionInfo(msrest.serialization.Model): + """Next version definition. + + All required parameters must be populated in order to send to Azure. + + :ivar next_version: Next version as defined by the server. The server keeps track of all + versions that are string-representations of integers. If one exists, the nextVersion will be a + string representation of the highest integer value + 1. Otherwise, the nextVersion will default + to '1'. + :vartype next_version: long + :ivar latest_version: Required. Current latest version of the resource. + :vartype latest_version: str + """ + + _validation = { + 'latest_version': {'required': True}, + } + + _attribute_map = { + 'next_version': {'key': 'nextVersion', 'type': 'long'}, + 'latest_version': {'key': 'latestVersion', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword next_version: Next version as defined by the server. The server keeps track of all + versions that are string-representations of integers. If one exists, the nextVersion will be a + string representation of the highest integer value + 1. Otherwise, the nextVersion will default + to '1'. + :paramtype next_version: long + :keyword latest_version: Required. Current latest version of the resource. + :paramtype latest_version: str + """ + super(VersionInfo, self).__init__(**kwargs) + self.next_version = kwargs.get('next_version', None) + self.latest_version = kwargs['latest_version'] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py new file mode 100644 index 000000000000..a8f0258aef02 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py @@ -0,0 +1,715 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +import datetime +from typing import Dict, List, Optional + +from azure.core.exceptions import HttpResponseError +import msrest.serialization + + +class AssetVersion(msrest.serialization.Model): + """AssetVersion Definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Required. Fully qualified resource Id: + azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index. + :vartype id: str + :ivar stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :vartype stage: str + :ivar description: Description information of the asset. + :vartype description: str + :ivar system_data: Metadata containing createdBy and modifiedBy information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + """ + + _validation = { + 'id': {'required': True, 'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + } + + def __init__( + self, + *, + stage: Optional[str] = "Development", + description: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :paramtype stage: str + :keyword description: Description information of the asset. + :paramtype description: str + :keyword tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :paramtype tags: dict[str, str] + :keyword properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :paramtype properties: dict[str, str] + """ + super(AssetVersion, self).__init__(**kwargs) + self.id = None + self.stage = stage + self.description = description + self.system_data = None + self.tags = tags + self.properties = properties + + +class AzureCoreFoundationsError(msrest.serialization.Model): + """The error object. + + All required parameters must be populated in order to send to Azure. + + :ivar code: Required. One of a server-defined set of error codes. + :vartype code: str + :ivar message: Required. A human-readable representation of the error. + :vartype message: str + :ivar target: The target of the error. + :vartype target: str + :ivar details: An array of details about specific errors that led to this reported error. + :vartype details: list[~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError] + :ivar innererror: An object containing more specific information than the current object about + the error. + :vartype innererror: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + + _validation = { + 'code': {'required': True}, + 'message': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[AzureCoreFoundationsError]'}, + 'innererror': {'key': 'innererror', 'type': 'AzureCoreFoundationsInnerError'}, + } + + def __init__( + self, + *, + code: str, + message: str, + target: Optional[str] = None, + details: Optional[List["AzureCoreFoundationsError"]] = None, + innererror: Optional["AzureCoreFoundationsInnerError"] = None, + **kwargs + ): + """ + :keyword code: Required. One of a server-defined set of error codes. + :paramtype code: str + :keyword message: Required. A human-readable representation of the error. + :paramtype message: str + :keyword target: The target of the error. + :paramtype target: str + :keyword details: An array of details about specific errors that led to this reported error. + :paramtype details: list[~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError] + :keyword innererror: An object containing more specific information than the current object + about the error. + :paramtype innererror: + ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + super(AzureCoreFoundationsError, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + self.innererror = innererror + + +class AzureCoreFoundationsErrorResponse(msrest.serialization.Model): + """A response containing error details. + + All required parameters must be populated in order to send to Azure. + + :ivar error: Required. The error object. + :vartype error: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError + """ + + _validation = { + 'error': {'required': True}, + } + + _attribute_map = { + 'error': {'key': 'error', 'type': 'AzureCoreFoundationsError'}, + } + + def __init__( + self, + *, + error: "AzureCoreFoundationsError", + **kwargs + ): + """ + :keyword error: Required. The error object. + :paramtype error: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsError + """ + super(AzureCoreFoundationsErrorResponse, self).__init__(**kwargs) + self.error = error + + +class AzureCoreFoundationsInnerError(msrest.serialization.Model): + """An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors. + + :ivar code: One of a server-defined set of error codes. + :vartype code: str + :ivar innererror: Inner error. + :vartype innererror: ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'innererror': {'key': 'innererror', 'type': 'AzureCoreFoundationsInnerError'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + innererror: Optional["AzureCoreFoundationsInnerError"] = None, + **kwargs + ): + """ + :keyword code: One of a server-defined set of error codes. + :paramtype code: str + :keyword innererror: Inner error. + :paramtype innererror: + ~azure.mgmt.machinelearningservices.models.AzureCoreFoundationsInnerError + """ + super(AzureCoreFoundationsInnerError, self).__init__(**kwargs) + self.code = code + self.innererror = innererror + + +class DeploymentTemplate(msrest.serialization.Model): + """DeploymentTemplate resource definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Required. Fully qualified resource Id: + azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index. + :vartype id: str + :ivar stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :vartype stage: str + :ivar description: Description information of the asset. + :vartype description: str + :ivar system_data: Metadata containing createdBy and modifiedBy information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar deployment_template_type: Required. The type of deployment template. + :vartype deployment_template_type: str + :ivar environment_id: Required. The ID of the environment asset. + :vartype environment_id: str + :ivar environment_variables: Environment variables for the deployment. + :vartype environment_variables: dict[str, str] + :ivar allowed_environment_variable_overrides: List of environment variable names that can be + overridden. + :vartype allowed_environment_variable_overrides: list[str] + :ivar model_mount_path: Path where the model will be mounted. + :vartype model_mount_path: str + :ivar request_settings: Request settings for online deployment. + :vartype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings + :ivar liveness_probe: Liveness probe settings. + :vartype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :ivar readiness_probe: Readiness probe settings. + :vartype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :ivar allowed_instance_type: Required. List of allowed instance types for the deployment. + :vartype allowed_instance_type: list[str] + :ivar default_instance_type: Required. Default instance type for the deployment. + :vartype default_instance_type: str + :ivar instance_count: Required. Number of instances for the deployment. + :vartype instance_count: int + :ivar scoring_path: Path for scoring requests. + :vartype scoring_path: str + :ivar scoring_port: Port for scoring requests. + :vartype scoring_port: int + """ + + _validation = { + 'id': {'required': True, 'readonly': True}, + 'system_data': {'readonly': True}, + 'deployment_template_type': {'required': True}, + 'environment_id': {'required': True}, + 'allowed_instance_type': {'required': True}, + 'default_instance_type': {'required': True}, + 'instance_count': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'deployment_template_type': {'key': 'deploymentTemplateType', 'type': 'str'}, + 'environment_id': {'key': 'environmentId', 'type': 'str'}, + 'environment_variables': {'key': 'environmentVariables', 'type': '{str}'}, + 'allowed_environment_variable_overrides': {'key': 'allowedEnvironmentVariableOverrides', 'type': '[str]'}, + 'model_mount_path': {'key': 'modelMountPath', 'type': 'str'}, + 'request_settings': {'key': 'requestSettings', 'type': 'OnlineRequestSettings'}, + 'liveness_probe': {'key': 'livenessProbe', 'type': 'ProbeSettings'}, + 'readiness_probe': {'key': 'readinessProbe', 'type': 'ProbeSettings'}, + 'allowed_instance_type': {'key': 'allowedInstanceType', 'type': '[str]'}, + 'default_instance_type': {'key': 'defaultInstanceType', 'type': 'str'}, + 'instance_count': {'key': 'instanceCount', 'type': 'int'}, + 'scoring_path': {'key': 'scoringPath', 'type': 'str'}, + 'scoring_port': {'key': 'scoringPort', 'type': 'int'}, + } + + def __init__( + self, + *, + deployment_template_type: str, + environment_id: str, + allowed_instance_type: List[str], + default_instance_type: str, + instance_count: int, + stage: Optional[str] = "Development", + description: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional[Dict[str, str]] = None, + environment_variables: Optional[Dict[str, str]] = None, + allowed_environment_variable_overrides: Optional[List[str]] = None, + model_mount_path: Optional[str] = None, + request_settings: Optional["OnlineRequestSettings"] = None, + liveness_probe: Optional["ProbeSettings"] = None, + readiness_probe: Optional["ProbeSettings"] = None, + scoring_path: Optional[str] = None, + scoring_port: Optional[int] = None, + **kwargs + ): + """ + :keyword stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :paramtype stage: str + :keyword description: Description information of the asset. + :paramtype description: str + :keyword tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :paramtype tags: dict[str, str] + :keyword properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :paramtype properties: dict[str, str] + :keyword deployment_template_type: Required. The type of deployment template. + :paramtype deployment_template_type: str + :keyword environment_id: Required. The ID of the environment asset. + :paramtype environment_id: str + :keyword environment_variables: Environment variables for the deployment. + :paramtype environment_variables: dict[str, str] + :keyword allowed_environment_variable_overrides: List of environment variable names that can be + overridden. + :paramtype allowed_environment_variable_overrides: list[str] + :keyword model_mount_path: Path where the model will be mounted. + :paramtype model_mount_path: str + :keyword request_settings: Request settings for online deployment. + :paramtype request_settings: ~azure.mgmt.machinelearningservices.models.OnlineRequestSettings + :keyword liveness_probe: Liveness probe settings. + :paramtype liveness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :keyword readiness_probe: Readiness probe settings. + :paramtype readiness_probe: ~azure.mgmt.machinelearningservices.models.ProbeSettings + :keyword allowed_instance_type: Required. List of allowed instance types for the deployment. + :paramtype allowed_instance_type: list[str] + :keyword default_instance_type: Required. Default instance type for the deployment. + :paramtype default_instance_type: str + :keyword instance_count: Required. Number of instances for the deployment. + :paramtype instance_count: int + :keyword scoring_path: Path for scoring requests. + :paramtype scoring_path: str + :keyword scoring_port: Port for scoring requests. + :paramtype scoring_port: int + """ + super(DeploymentTemplate, self).__init__(**kwargs) + self.id = None + self.stage = stage + self.description = description + self.system_data = None + self.tags = tags + self.properties = properties + self.deployment_template_type = deployment_template_type + self.environment_id = environment_id + self.environment_variables = environment_variables + self.allowed_environment_variable_overrides = allowed_environment_variable_overrides + self.model_mount_path = model_mount_path + self.request_settings = request_settings + self.liveness_probe = liveness_probe + self.readiness_probe = readiness_probe + self.allowed_instance_type = allowed_instance_type + self.default_instance_type = default_instance_type + self.instance_count = instance_count + self.scoring_path = scoring_path + self.scoring_port = scoring_port + + +class Index(msrest.serialization.Model): + """Index resource Definition. + + Variables are only populated by the server, and will be ignored when sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Required. Fully qualified resource Id: + azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index. + :vartype id: str + :ivar stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :vartype stage: str + :ivar description: Description information of the asset. + :vartype description: str + :ivar system_data: Metadata containing createdBy and modifiedBy information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :vartype tags: dict[str, str] + :ivar properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :vartype properties: dict[str, str] + :ivar storage_uri: Required. Default workspace blob storage Uri. Should work across storage + types and auth scenarios. + :vartype storage_uri: str + """ + + _validation = { + 'id': {'required': True, 'readonly': True}, + 'system_data': {'readonly': True}, + 'storage_uri': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'stage': {'key': 'stage', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'storage_uri': {'key': 'storageUri', 'type': 'str'}, + } + + def __init__( + self, + *, + storage_uri: str, + stage: Optional[str] = "Development", + description: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs + ): + """ + :keyword stage: Update stage to 'Archive' to archive the asset. Default is Development, which + means the asset is under development. + :paramtype stage: str + :keyword description: Description information of the asset. + :paramtype description: str + :keyword tags: A set of tags. Asset's tags. Unlike properties, tags are fully mutable. + :paramtype tags: dict[str, str] + :keyword properties: Asset's properties. Unlike tags, properties are add-only. Once added, a + property cannot be removed. + :paramtype properties: dict[str, str] + :keyword storage_uri: Required. Default workspace blob storage Uri. Should work across storage + types and auth scenarios. + :paramtype storage_uri: str + """ + super(Index, self).__init__(**kwargs) + self.id = None + self.stage = stage + self.description = description + self.system_data = None + self.tags = tags + self.properties = properties + self.storage_uri = storage_uri + + +class OnlineRequestSettings(msrest.serialization.Model): + """Settings for online request configuration. + + All required parameters must be populated in order to send to Azure. + + :ivar request_timeout: Required. The timeout duration for requests. + :vartype request_timeout: ~datetime.timedelta + :ivar max_concurrent_requests_per_instance: Required. The maximum number of concurrent requests + per instance. + :vartype max_concurrent_requests_per_instance: int + """ + + _validation = { + 'request_timeout': {'required': True}, + 'max_concurrent_requests_per_instance': {'required': True}, + } + + _attribute_map = { + 'request_timeout': {'key': 'requestTimeout', 'type': 'duration'}, + 'max_concurrent_requests_per_instance': {'key': 'maxConcurrentRequestsPerInstance', 'type': 'int'}, + } + + def __init__( + self, + *, + request_timeout: datetime.timedelta, + max_concurrent_requests_per_instance: int, + **kwargs + ): + """ + :keyword request_timeout: Required. The timeout duration for requests. + :paramtype request_timeout: ~datetime.timedelta + :keyword max_concurrent_requests_per_instance: Required. The maximum number of concurrent + requests per instance. + :paramtype max_concurrent_requests_per_instance: int + """ + super(OnlineRequestSettings, self).__init__(**kwargs) + self.request_timeout = request_timeout + self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance + + +class PagedIndex(msrest.serialization.Model): + """Paged collection of IndexVersion items. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Required. The list of Indexes. + :vartype value: list[~azure.mgmt.machinelearningservices.models.Index] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[Index]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["Index"], + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: Required. The list of Indexes. + :paramtype value: list[~azure.mgmt.machinelearningservices.models.Index] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super(PagedIndex, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class ProbeSettings(msrest.serialization.Model): + """Settings for probe configuration. + + All required parameters must be populated in order to send to Azure. + + :ivar initial_delay: The initial delay before starting probes. + :vartype initial_delay: ~datetime.timedelta + :ivar period: Required. The period between probe executions. + :vartype period: ~datetime.timedelta + :ivar timeout: Required. The timeout duration for each probe. + :vartype timeout: ~datetime.timedelta + :ivar failure_threshold: Required. The number of consecutive failures required to consider the + probe as failed. + :vartype failure_threshold: int + :ivar success_threshold: Required. The number of consecutive successes required to consider the + probe as successful. + :vartype success_threshold: int + :ivar path: Required. The path for the probe request. + :vartype path: str + :ivar port: Required. The port number for the probe. + :vartype port: int + :ivar scheme: Required. The scheme for the probe (e.g., HTTP, HTTPS). + :vartype scheme: str + :ivar http_method: Required. The HTTP method for the probe request. + :vartype http_method: str + """ + + _validation = { + 'period': {'required': True}, + 'timeout': {'required': True}, + 'failure_threshold': {'required': True}, + 'success_threshold': {'required': True}, + 'path': {'required': True}, + 'port': {'required': True}, + 'scheme': {'required': True}, + 'http_method': {'required': True}, + } + + _attribute_map = { + 'initial_delay': {'key': 'initialDelay', 'type': 'duration'}, + 'period': {'key': 'period', 'type': 'duration'}, + 'timeout': {'key': 'timeout', 'type': 'duration'}, + 'failure_threshold': {'key': 'failureThreshold', 'type': 'int'}, + 'success_threshold': {'key': 'successThreshold', 'type': 'int'}, + 'path': {'key': 'path', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + 'scheme': {'key': 'scheme', 'type': 'str'}, + 'http_method': {'key': 'httpMethod', 'type': 'str'}, + } + + def __init__( + self, + *, + period: datetime.timedelta, + timeout: datetime.timedelta, + failure_threshold: int, + success_threshold: int, + path: str, + port: int, + scheme: str, + http_method: str, + initial_delay: Optional[datetime.timedelta] = None, + **kwargs + ): + """ + :keyword initial_delay: The initial delay before starting probes. + :paramtype initial_delay: ~datetime.timedelta + :keyword period: Required. The period between probe executions. + :paramtype period: ~datetime.timedelta + :keyword timeout: Required. The timeout duration for each probe. + :paramtype timeout: ~datetime.timedelta + :keyword failure_threshold: Required. The number of consecutive failures required to consider + the probe as failed. + :paramtype failure_threshold: int + :keyword success_threshold: Required. The number of consecutive successes required to consider + the probe as successful. + :paramtype success_threshold: int + :keyword path: Required. The path for the probe request. + :paramtype path: str + :keyword port: Required. The port number for the probe. + :paramtype port: int + :keyword scheme: Required. The scheme for the probe (e.g., HTTP, HTTPS). + :paramtype scheme: str + :keyword http_method: Required. The HTTP method for the probe request. + :paramtype http_method: str + """ + super(ProbeSettings, self).__init__(**kwargs) + self.initial_delay = initial_delay + self.period = period + self.timeout = timeout + self.failure_threshold = failure_threshold + self.success_threshold = success_threshold + self.path = path + self.port = port + self.scheme = scheme + self.http_method = http_method + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar created_at: The timestamp the resource was created at. + :vartype created_at: ~datetime.datetime + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The identity type that created the resource. + :vartype created_by_type: str + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime + """ + + _validation = { + 'created_at': {'readonly': True}, + 'created_by': {'readonly': True}, + 'created_by_type': {'readonly': True}, + 'last_modified_at': {'readonly': True}, + } + + _attribute_map = { + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(SystemData, self).__init__(**kwargs) + self.created_at = None + self.created_by = None + self.created_by_type = None + self.last_modified_at = None + + +class VersionInfo(msrest.serialization.Model): + """Next version definition. + + All required parameters must be populated in order to send to Azure. + + :ivar next_version: Next version as defined by the server. The server keeps track of all + versions that are string-representations of integers. If one exists, the nextVersion will be a + string representation of the highest integer value + 1. Otherwise, the nextVersion will default + to '1'. + :vartype next_version: long + :ivar latest_version: Required. Current latest version of the resource. + :vartype latest_version: str + """ + + _validation = { + 'latest_version': {'required': True}, + } + + _attribute_map = { + 'next_version': {'key': 'nextVersion', 'type': 'long'}, + 'latest_version': {'key': 'latestVersion', 'type': 'str'}, + } + + def __init__( + self, + *, + latest_version: str, + next_version: Optional[int] = None, + **kwargs + ): + """ + :keyword next_version: Next version as defined by the server. The server keeps track of all + versions that are string-representations of integers. If one exists, the nextVersion will be a + string representation of the highest integer value + 1. Otherwise, the nextVersion will default + to '1'. + :paramtype next_version: long + :keyword latest_version: Required. Current latest version of the resource. + :paramtype latest_version: str + """ + super(VersionInfo, self).__init__(**kwargs) + self.next_version = next_version + self.latest_version = latest_version diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/__init__.py new file mode 100644 index 000000000000..f5baa9e7ddee --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/__init__.py @@ -0,0 +1,15 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- + +from ._deployment_templates_operations import DeploymentTemplatesOperations +from ._indexes_operations import IndexesOperations + +__all__ = [ + 'DeploymentTemplatesOperations', + 'IndexesOperations', +] diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py new file mode 100644 index 000000000000..0fb971981833 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py @@ -0,0 +1,422 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_create_request( + registry_name, # type: str + name, # type: str + version, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/registries/{registryName}/{name}/versions/{version}") + path_format_arguments = { + "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + "version": _SERIALIZER.url("version", version, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + registry_name, # type: str + name, # type: str + version, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + asset_resource_tenant_id = kwargs.pop('asset_resource_tenant_id', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}") + path_format_arguments = { + "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + "version": _SERIALIZER.url("version", version, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if asset_resource_tenant_id is not None: + _query_parameters['assetResourceTenantId'] = _SERIALIZER.query("asset_resource_tenant_id", asset_resource_tenant_id, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_delete_generic_asset_request( + registry_name, # type: str + type, # type: str + name, # type: str + version, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}") + path_format_arguments = { + "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), + "type": _SERIALIZER.url("type", type, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + "version": _SERIALIZER.url("version", version, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="DELETE", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class DeploymentTemplatesOperations(object): + """DeploymentTemplatesOperations operations. + + 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: ~azure.mgmt.machinelearningservices.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. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def create( # pylint: disable=inconsistent-return-statements + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + registry_name, # type: str + name, # type: str + version, # type: str + body, # type: "_models.DeploymentTemplate" + **kwargs # type: Any + ): + # type: (...) -> None + """Creates a deployment template version. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param name: Name of the deployment template. + :type name: str + :param version: Version of the deployment template. + :type version: str + :param body: Properties of a Deployment Template Version. + :type body: ~azure.mgmt.machinelearningservices.models.DeploymentTemplate + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'DeploymentTemplate') + + request = build_create_request( + registry_name=registry_name, + name=name, + version=version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + create.metadata = {'url': "/registries/{registryName}/{name}/versions/{version}"} # type: ignore + + + @distributed_trace + def get( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + registry_name, # type: str + name, # type: str + version, # type: str + asset_resource_tenant_id=None, # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> "_models.DeploymentTemplate" + """Get a specific version of a deployment template. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param name: Name of the deployment template. + :type name: str + :param version: Version of the deployment template. + :type version: str + :param asset_resource_tenant_id: Asset resource tenant ID. + :type asset_resource_tenant_id: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: DeploymentTemplate, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.DeploymentTemplate + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.DeploymentTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_request( + registry_name=registry_name, + name=name, + version=version, + api_version=api_version, + asset_resource_tenant_id=asset_resource_tenant_id, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('DeploymentTemplate', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}"} # type: ignore + + + @distributed_trace + def delete_generic_asset( # pylint: disable=inconsistent-return-statements + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + registry_name, # type: str + type, # type: str + name, # type: str + version, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + """Delete a specific version of a deployment template. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param type: The type of the deployment template. + :type type: str + :param name: Name of the deployment template. + :type name: str + :param version: Version of the deployment template. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: None, or the result of cls(response) + :rtype: None + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_delete_generic_asset_request( + registry_name=registry_name, + type=type, + name=name, + version=version, + api_version=api_version, + template_url=self.delete_generic_asset.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + delete_generic_asset.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}"} # type: ignore + diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py new file mode 100644 index 000000000000..530c67c48cd6 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py @@ -0,0 +1,891 @@ +# pylint: disable=too-many-lines +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# -------------------------------------------------------------------------- +from typing import TYPE_CHECKING + +from msrest import Serializer + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpResponse +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat + +from .. import models as _models +from .._vendor import _convert_request, _format_url_section + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +_SERIALIZER = Serializer() +_SERIALIZER.client_side_validation = False +# fmt: off + +def build_list_latest_request( + workspace_name1, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + top = kwargs.pop('top', None) # type: Optional[int] + skip = kwargs.pop('skip', 0) # type: Optional[int] + maxpagesize = kwargs.pop('maxpagesize', None) # type: Optional[int] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes") + path_format_arguments = { + "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if top is not None: + _query_parameters['top'] = _SERIALIZER.query("top", top, 'int') + if skip is not None: + _query_parameters['skip'] = _SERIALIZER.query("skip", skip, 'int') + if maxpagesize is not None: + _query_parameters['maxpagesize'] = _SERIALIZER.query("maxpagesize", maxpagesize, 'int') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_latest_request( + workspace_name1, # type: str + name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}") + path_format_arguments = { + "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_next_version_request( + workspace_name1, # type: str + name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}:getNextVersion") + path_format_arguments = { + "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="POST", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_list_request( + workspace_name1, # type: str + name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + list_view_type = kwargs.pop('list_view_type', "ActiveOnly") # type: str + order_by = kwargs.pop('order_by', None) # type: Optional[str] + tags = kwargs.pop('tags', None) # type: Optional[str] + top = kwargs.pop('top', None) # type: Optional[int] + skip = kwargs.pop('skip', 0) # type: Optional[int] + maxpagesize = kwargs.pop('maxpagesize', None) # type: Optional[int] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}/versions") + path_format_arguments = { + "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + if order_by is not None: + _query_parameters['orderBy'] = _SERIALIZER.query("order_by", order_by, 'str') + if tags is not None: + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + if top is not None: + _query_parameters['top'] = _SERIALIZER.query("top", top, 'int') + if skip is not None: + _query_parameters['skip'] = _SERIALIZER.query("skip", skip, 'int') + if maxpagesize is not None: + _query_parameters['maxpagesize'] = _SERIALIZER.query("maxpagesize", maxpagesize, 'int') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_get_request( + workspace_name1, # type: str + name, # type: str + version, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}/versions/{version}") + path_format_arguments = { + "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + "version": _SERIALIZER.url("version", version, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + +def build_create_or_update_request( + workspace_name1, # type: str + name, # type: str + version, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}/versions/{version}") + path_format_arguments = { + "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), + "version": _SERIALIZER.url("version", version, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if content_type is not None: + _header_parameters['Content-Type'] = _SERIALIZER.header("content_type", content_type, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="PUT", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + +# fmt: on +class IndexesOperations(object): + """IndexesOperations operations. + + 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: ~azure.mgmt.machinelearningservices.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. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + @distributed_trace + def list_latest( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + workspace_name1, # type: str + top=None, # type: Optional[int] + skip=0, # type: Optional[int] + maxpagesize=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PagedIndex"] + """List the latest version of each index. Latest is defined by most recent created by date. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param top: The number of result items to return. + :type top: int + :param skip: The number of result items to skip. + :type skip: int + :param maxpagesize: The maximum number of result items per page. + :type maxpagesize: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PagedIndex or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PagedIndex] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagedIndex"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_latest_request( + workspace_name1=workspace_name1, + api_version=api_version, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=self.list_latest.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + + request = build_list_latest_request( + workspace_name1=workspace_name1, + api_version=api_version, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=next_link, + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PagedIndex", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_latest.metadata = {'url': "/workspaces/{workspaceName}/indexes"} # type: ignore + + @distributed_trace + def get_latest( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + workspace_name1, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Index" + """Get latest version of the Index. Latest is defined by most recent created by date. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Index, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.Index + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Index"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_latest_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + template_url=self.get_latest.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Index', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_latest.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}"} # type: ignore + + + @distributed_trace + def get_next_version( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + workspace_name1, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.VersionInfo" + """Get next Index version as defined by the server. The server keeps track of all versions that + are string-representations of integers. If one exists, the nextVersion will be a string + representation of the highest integer value + 1. Otherwise, the nextVersion will default to + '1'. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: VersionInfo, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.VersionInfo + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.VersionInfo"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_next_version_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + template_url=self.get_next_version.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('VersionInfo', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get_next_version.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}:getNextVersion"} # type: ignore + + + @distributed_trace + def list( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + workspace_name1, # type: str + name, # type: str + list_view_type="ActiveOnly", # type: str + order_by=None, # type: Optional[str] + tags=None, # type: Optional[str] + top=None, # type: Optional[int] + skip=0, # type: Optional[int] + maxpagesize=None, # type: Optional[int] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PagedIndex"] + """List the versions of an Index given the name. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :param list_view_type: View type for including/excluding (for example) archived entities. + :type list_view_type: str + :param order_by: Ordering of list: Please choose orderby value from ['createdAt', + 'lastModifiedAt']. + :type order_by: str + :param tags: Comma-separated list of tag names (and optionally values). Example: + tag1,tag2=value2. + :type tags: str + :param top: The number of result items to return. + :type top: int + :param skip: The number of result items to skip. + :type skip: int + :param maxpagesize: The maximum number of result items per page. + :type maxpagesize: int + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PagedIndex or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PagedIndex] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagedIndex"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + list_view_type=list_view_type, + order_by=order_by, + tags=tags, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=self.list.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + + request = build_list_request( + workspace_name1=workspace_name1, + name=name, + api_version=api_version, + list_view_type=list_view_type, + order_by=order_by, + tags=tags, + top=top, + skip=skip, + maxpagesize=maxpagesize, + template_url=next_link, + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PagedIndex", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}/versions"} # type: ignore + + @distributed_trace + def get( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + workspace_name1, # type: str + name, # type: str + version, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.Index" + """Get a specific version of an Index. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :param version: Version of the index. + :type version: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Index, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.Index + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Index"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + + request = build_get_request( + workspace_name1=workspace_name1, + name=name, + version=version, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('Index', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}/versions/{version}"} # type: ignore + + + @distributed_trace + def create_or_update( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + workspace_name1, # type: str + name, # type: str + version, # type: str + body, # type: "_models.Index" + **kwargs # type: Any + ): + # type: (...) -> "_models.Index" + """Creates or updates a IndexVersion. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param workspace_name: The name of the AzureML workspace or AI project. + :type workspace_name: str + :param workspace_name1: The name of the AzureML workspace or AI project. + :type workspace_name1: str + :param name: Name of the index. + :type name: str + :param version: Version of the index. + :type version: str + :param body: Properties of an Index Version. + :type body: ~azure.mgmt.machinelearningservices.models.Index + :keyword callable cls: A custom type or function that will be passed the direct response + :return: Index, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.Index + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.Index"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'Index') + + request = build_create_or_update_request( + workspace_name1=workspace_name1, + name=name, + version=version, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self.create_or_update.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + request, + stream=False, + **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200, 201]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + if response.status_code == 200: + deserialized = self._deserialize('Index', pipeline_response) + + if response.status_code == 201: + deserialized = self._deserialize('Index', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + create_or_update.metadata = {'url': "/workspaces/{workspaceName}/indexes/{name}/versions/{version}"} # type: ignore + diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/py.typed b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/py.typed new file mode 100644 index 000000000000..e5aff4f83af8 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/py.typed @@ -0,0 +1 @@ +# Marker file for PEP 561. \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json new file mode 100644 index 000000000000..3770d1f60557 --- /dev/null +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json @@ -0,0 +1,1082 @@ +{ + "swagger": "2.0", + "info": { + "title": "Azure Machine Learning Data Plane Services", + "version": "2024-04-01-preview", + "x-typespec-generated": [ + { + "emitter": "@azure-tools/typespec-autorest" + } + ] + }, + "schemes": [ + "https" + ], + "x-ms-parameterized-host": { + "hostTemplate": "{endpoint}/genericasset/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", + "useSchemePrefix": false, + "parameters": [ + { + "name": "endpoint", + "in": "path", + "description": "Supported Azure-AI asset endpoints.", + "required": true, + "type": "string", + "format": "uri", + "x-ms-skip-url-encoding": true + }, + { + "name": "subscriptionId", + "in": "path", + "description": "The ID of the target subscription.", + "required": true, + "type": "string" + }, + { + "name": "resourceGroupName", + "in": "path", + "description": "The name of the Resource Group.", + "required": true, + "type": "string" + }, + { + "name": "workspaceName", + "in": "path", + "description": "The name of the AzureML workspace or AI project.", + "required": true, + "type": "string" + } + ] + }, + "produces": [ + "application/json" + ], + "consumes": [ + "application/json" + ], + "security": [ + { + "OAuth2Auth": [ + "https://ml.azure.com/.default" + ] + } + ], + "securityDefinitions": { + "OAuth2Auth": { + "type": "oauth2", + "flow": "implicit", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize", + "scopes": { + "https://ml.azure.com/.default": "" + } + } + }, + "tags": [], + "paths": { + "/registries/{registryName}/{name}/versions/{version}": { + "post": { + "operationId": "DeploymentTemplates_Create", + "description": "Creates a deployment template version.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "registryName", + "in": "path", + "description": "The name of the AzureML registry.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the deployment template.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + }, + { + "name": "version", + "in": "path", + "description": "Version of the deployment template.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Properties of a Deployment Template Version.", + "required": true, + "schema": { + "$ref": "#/definitions/DeploymentTemplate" + } + } + ], + "responses": { + "202": { + "description": "The request has been accepted for processing, but processing has not yet completed." + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}": { + "get": { + "operationId": "DeploymentTemplates_Get", + "description": "Get a specific version of a deployment template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "registryName", + "in": "path", + "description": "The name of the AzureML registry.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the deployment template.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + }, + { + "name": "version", + "in": "path", + "description": "Version of the deployment template.", + "required": true, + "type": "string" + }, + { + "name": "assetResourceTenantId", + "in": "query", + "description": "Asset resource tenant ID.", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/DeploymentTemplate" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}": { + "delete": { + "operationId": "DeploymentTemplates_DeleteGenericAsset", + "description": "Delete a specific version of a deployment template.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "registryName", + "in": "path", + "description": "The name of the AzureML registry.", + "required": true, + "type": "string" + }, + { + "name": "type", + "in": "path", + "description": "The type of the deployment template.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the deployment template.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + }, + { + "name": "version", + "in": "path", + "description": "Version of the deployment template.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded." + }, + "204": { + "description": "There is no content to send for this request, but the headers may be useful. " + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + } + } + }, + "/workspaces/{workspaceName}/indexes": { + "get": { + "operationId": "Indexes_ListLatest", + "description": "List the latest version of each index. Latest is defined by most recent created by date.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workspaceName", + "in": "path", + "description": "The name of the AzureML workspace or AI project.", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedIndex" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_ListLatest - generated by [MaximumSet] rule": { + "$ref": "./examples/Indexes_ListLatest_MaximumSet_Gen.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/workspaces/{workspaceName}/indexes/{name}": { + "get": { + "operationId": "Indexes_GetLatest", + "description": "Get latest version of the Index. Latest is defined by most recent created by date.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workspaceName", + "in": "path", + "description": "The name of the AzureML workspace or AI project.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the index.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_GetLatest - generated by [MaximumSet] rule": { + "$ref": "./examples/Indexes_GetLatest_MaximumSet_Gen.json" + } + } + } + }, + "/workspaces/{workspaceName}/indexes/{name}:getNextVersion": { + "post": { + "operationId": "Indexes_GetNextVersion", + "description": "Get next Index version as defined by the server. The server keeps track of all versions that are string-representations of integers. If one exists, the nextVersion will be a string representation of the highest integer value + 1. Otherwise, the nextVersion will default to '1'.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workspaceName", + "in": "path", + "description": "The name of the AzureML workspace or AI project.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the index.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/VersionInfo" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_GetNextVersion - generated by [MaximumSet] rule": { + "$ref": "./examples/Indexes_GetNextVersion_MaximumSet_Gen.json" + } + } + } + }, + "/workspaces/{workspaceName}/indexes/{name}/versions": { + "get": { + "operationId": "Indexes_List", + "description": "List the versions of an Index given the name.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workspaceName", + "in": "path", + "description": "The name of the AzureML workspace or AI project.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the index.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + }, + { + "name": "listViewType", + "in": "query", + "description": "View type for including/excluding (for example) archived entities.", + "required": true, + "type": "string", + "default": "ActiveOnly" + }, + { + "name": "orderBy", + "in": "query", + "description": "Ordering of list: Please choose orderby value from ['createdAt', 'lastModifiedAt'].", + "required": false, + "type": "string" + }, + { + "name": "tags", + "in": "query", + "description": "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2.", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/Azure.Core.TopQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.SkipQueryParameter" + }, + { + "$ref": "#/parameters/Azure.Core.MaxPageSizeQueryParameter" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedIndex" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_List - generated by [MaximumSet] rule": { + "$ref": "./examples/Indexes_List_MaximumSet_Gen.json" + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/workspaces/{workspaceName}/indexes/{name}/versions/{version}": { + "get": { + "operationId": "Indexes_Get", + "description": "Get a specific version of an Index.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workspaceName", + "in": "path", + "description": "The name of the AzureML workspace or AI project.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the index.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + }, + { + "name": "version", + "in": "path", + "description": "Version of the index.", + "required": true, + "type": "string" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_Get - generated by [MaximumSet] rule": { + "$ref": "./examples/Indexes_Get_MaximumSet_Gen.json" + } + } + }, + "put": { + "operationId": "Indexes_CreateOrUpdate", + "description": "Creates or updates a IndexVersion.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "workspaceName", + "in": "path", + "description": "The name of the AzureML workspace or AI project.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "path", + "description": "Name of the index.", + "required": true, + "type": "string", + "maxLength": 254, + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9-_]*$" + }, + { + "name": "version", + "in": "path", + "description": "Version of the index.", + "required": true, + "type": "string" + }, + { + "name": "body", + "in": "body", + "description": "Properties of an Index Version.", + "required": true, + "schema": { + "$ref": "#/definitions/Index" + } + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "201": { + "description": "The request has succeeded and a new resource has been created as a result.", + "schema": { + "$ref": "#/definitions/Index" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-examples": { + "Indexes_CreateOrUpdate - generated by [MaximumSet] rule": { + "$ref": "./examples/Indexes_CreateOrUpdate_MaximumSet_Gen.json" + } + } + } + } + }, + "definitions": { + "AssetVersion": { + "type": "object", + "description": "AssetVersion Definition", + "properties": { + "id": { + "type": "string", + "description": "Fully qualified resource Id: azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index.", + "readOnly": true + }, + "stage": { + "type": "string", + "description": "Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development.", + "default": "Development" + }, + "description": { + "type": "string", + "description": "Description information of the asset." + }, + "systemData": { + "$ref": "#/definitions/SystemData", + "description": "Metadata containing createdBy and modifiedBy information.", + "readOnly": true + }, + "tags": { + "type": "object", + "description": "Asset's tags. Unlike properties, tags are fully mutable.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "type": "object", + "description": "Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", + "additionalProperties": { + "type": "string" + } + } + }, + "required": [ + "id" + ] + }, + "Azure.Core.Foundations.Error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "message": { + "type": "string", + "description": "A human-readable representation of the error." + }, + "target": { + "type": "string", + "description": "The target of the error." + }, + "details": { + "type": "array", + "description": "An array of details about specific errors that led to this reported error.", + "items": { + "$ref": "#/definitions/Azure.Core.Foundations.Error" + } + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "An object containing more specific information than the current object about the error." + } + }, + "required": [ + "code", + "message" + ] + }, + "Azure.Core.Foundations.ErrorResponse": { + "type": "object", + "description": "A response containing error details.", + "properties": { + "error": { + "$ref": "#/definitions/Azure.Core.Foundations.Error", + "description": "The error object." + } + }, + "required": [ + "error" + ] + }, + "Azure.Core.Foundations.InnerError": { + "type": "object", + "description": "An object containing more specific information about the error. As per Azure REST API guidelines - https://aka.ms/AzureRestApiGuidelines#handling-errors.", + "properties": { + "code": { + "type": "string", + "description": "One of a server-defined set of error codes." + }, + "innererror": { + "$ref": "#/definitions/Azure.Core.Foundations.InnerError", + "description": "Inner error." + } + } + }, + "DeploymentTemplate": { + "type": "object", + "description": "DeploymentTemplate resource definition", + "properties": { + "id": { + "type": "string", + "description": "Fully qualified resource Id: azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index.", + "readOnly": true + }, + "stage": { + "type": "string", + "description": "Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development.", + "default": "Development" + }, + "description": { + "type": "string", + "description": "Description information of the asset." + }, + "systemData": { + "$ref": "#/definitions/SystemData", + "description": "Metadata containing createdBy and modifiedBy information.", + "readOnly": true + }, + "tags": { + "type": "object", + "description": "Asset's tags. Unlike properties, tags are fully mutable.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "type": "object", + "description": "Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", + "additionalProperties": { + "type": "string" + } + }, + "deploymentTemplateType": { + "type": "string", + "description": "The type of deployment template." + }, + "environmentId": { + "type": "string", + "description": "The ID of the environment asset." + }, + "environmentVariables": { + "type": "object", + "description": "Environment variables for the deployment.", + "additionalProperties": { + "type": "string" + } + }, + "allowedEnvironmentVariableOverrides": { + "type": "array", + "description": "List of environment variable names that can be overridden.", + "items": { + "type": "string" + } + }, + "modelMountPath": { + "type": "string", + "description": "Path where the model will be mounted." + }, + "requestSettings": { + "$ref": "#/definitions/OnlineRequestSettings", + "description": "Request settings for online deployment." + }, + "livenessProbe": { + "$ref": "#/definitions/ProbeSettings", + "description": "Liveness probe settings." + }, + "readinessProbe": { + "$ref": "#/definitions/ProbeSettings", + "description": "Readiness probe settings." + }, + "allowedInstanceType": { + "type": "array", + "description": "List of allowed instance types for the deployment.", + "items": { + "type": "string" + } + }, + "defaultInstanceType": { + "type": "string", + "description": "Default instance type for the deployment." + }, + "instanceCount": { + "type": "integer", + "format": "int32", + "description": "Number of instances for the deployment." + }, + "scoringPath": { + "type": "string", + "description": "Path for scoring requests." + }, + "scoringPort": { + "type": "integer", + "format": "int32", + "description": "Port for scoring requests." + } + }, + "required": [ + "id", + "deploymentTemplateType", + "environmentId", + "allowedInstanceType", + "defaultInstanceType", + "instanceCount" + ] + }, + "Index": { + "type": "object", + "description": "Index resource Definition", + "properties": { + "id": { + "type": "string", + "description": "Fully qualified resource Id: azureml://workspace/{workspaceName}/indexes/{name}/versions/{version} of the index.", + "readOnly": true + }, + "stage": { + "type": "string", + "description": "Update stage to 'Archive' to archive the asset. Default is Development, which means the asset is under development.", + "default": "Development" + }, + "description": { + "type": "string", + "description": "Description information of the asset." + }, + "systemData": { + "$ref": "#/definitions/SystemData", + "description": "Metadata containing createdBy and modifiedBy information.", + "readOnly": true + }, + "tags": { + "type": "object", + "description": "Asset's tags. Unlike properties, tags are fully mutable.", + "additionalProperties": { + "type": "string" + } + }, + "properties": { + "type": "object", + "description": "Asset's properties. Unlike tags, properties are add-only. Once added, a property cannot be removed.", + "additionalProperties": { + "type": "string" + } + }, + "storageUri": { + "type": "string", + "description": "Default workspace blob storage Uri. Should work across storage types and auth scenarios." + } + }, + "required": [ + "id", + "storageUri" + ] + }, + "OnlineRequestSettings": { + "type": "object", + "description": "Settings for online request configuration.", + "properties": { + "requestTimeout": { + "type": "string", + "format": "duration", + "description": "The timeout duration for requests." + }, + "maxConcurrentRequestsPerInstance": { + "type": "integer", + "format": "int32", + "description": "The maximum number of concurrent requests per instance." + } + }, + "required": [ + "requestTimeout", + "maxConcurrentRequestsPerInstance" + ] + }, + "PagedIndex": { + "type": "object", + "description": "Paged collection of IndexVersion items.", + "properties": { + "value": { + "type": "array", + "description": "The list of Indexes.", + "items": { + "$ref": "#/definitions/Index" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, + "ProbeSettings": { + "type": "object", + "description": "Settings for probe configuration.", + "properties": { + "initialDelay": { + "type": "string", + "format": "duration", + "description": "The initial delay before starting probes." + }, + "period": { + "type": "string", + "format": "duration", + "description": "The period between probe executions." + }, + "timeout": { + "type": "string", + "format": "duration", + "description": "The timeout duration for each probe." + }, + "failureThreshold": { + "type": "integer", + "format": "int32", + "description": "The number of consecutive failures required to consider the probe as failed." + }, + "successThreshold": { + "type": "integer", + "format": "int32", + "description": "The number of consecutive successes required to consider the probe as successful." + }, + "path": { + "type": "string", + "description": "The path for the probe request." + }, + "port": { + "type": "integer", + "format": "int32", + "description": "The port number for the probe." + }, + "scheme": { + "type": "string", + "description": "The scheme for the probe (e.g., HTTP, HTTPS)." + }, + "httpMethod": { + "type": "string", + "description": "The HTTP method for the probe request." + } + }, + "required": [ + "period", + "timeout", + "failureThreshold", + "successThreshold", + "path", + "port", + "scheme", + "httpMethod" + ] + }, + "SystemData": { + "type": "object", + "description": "Metadata pertaining to creation and last modification of the resource.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp the resource was created at.", + "readOnly": true + }, + "createdBy": { + "type": "string", + "description": "The identity that created the resource.", + "readOnly": true + }, + "createdByType": { + "type": "string", + "description": "The identity type that created the resource.", + "readOnly": true + }, + "lastModifiedAt": { + "type": "string", + "format": "date-time", + "description": "The timestamp of resource last modification (UTC)", + "readOnly": true + } + } + }, + "VersionInfo": { + "type": "object", + "description": "Next version definition.", + "properties": { + "nextVersion": { + "type": "integer", + "format": "int64", + "description": "Next version as defined by the server. The server keeps track of all versions that are string-representations of integers. If one exists, the nextVersion will be a string representation of the highest integer value + 1. Otherwise, the nextVersion will default to '1'." + }, + "latestVersion": { + "type": "string", + "description": "Current latest version of the resource." + } + }, + "required": [ + "latestVersion" + ] + } + }, + "parameters": { + "Azure.Core.Foundations.ApiVersionParameter": { + "name": "api-version", + "in": "query", + "description": "The API version to use for this operation.", + "required": true, + "type": "string", + "minLength": 1, + "x-ms-parameter-location": "method", + "x-ms-client-name": "apiVersion" + }, + "Azure.Core.MaxPageSizeQueryParameter": { + "name": "maxpagesize", + "in": "query", + "description": "The maximum number of result items per page.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + }, + "Azure.Core.SkipQueryParameter": { + "name": "skip", + "in": "query", + "description": "The number of result items to skip.", + "required": false, + "type": "integer", + "format": "int32", + "default": 0, + "x-ms-parameter-location": "method" + }, + "Azure.Core.TopQueryParameter": { + "name": "top", + "in": "query", + "description": "The number of result items to return.", + "required": false, + "type": "integer", + "format": "int32", + "x-ms-parameter-location": "method" + } + } +} \ No newline at end of file diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/readme.md b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/readme.md index d9f8037103da..991afc83e542 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/readme.md +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/readme.md @@ -306,6 +306,16 @@ input-file: output-folder: $(python-sdks-folder)/v2025_01_01_preview ``` +### Tag: v2024-04-01-dataplanepreview + +These settings apply only when `--tag=v2024-04-01-dataplanepreview` is specified on the command line. + +```yaml $(tag) == 'v2024-04-01-dataplanepreview' +input-file: + - Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json +output-folder: $(python-sdks-folder)/v2024-04-01-dataplanepreview +``` + ### Tag: multiapi These settings apply only when `--multiapi` is specified on the command line. From 8381053ef27e2587e1285f2634a3d49638a476e2 Mon Sep 17 00:00:00 2001 From: Amit Chauhan <70937115+achauhan-scc@users.noreply.github.com> Date: Tue, 12 Aug 2025 13:38:15 +0530 Subject: [PATCH 5/5] regenerating rest client --- .../_azure_machine_learning_workspaces.py | 2 +- .../aio/_azure_machine_learning_workspaces.py | 2 +- .../_deployment_templates_operations.py | 168 +++++++++++-- .../aio/operations/_indexes_operations.py | 44 +--- .../models/__init__.py | 3 + .../models/_models.py | 35 +++ .../models/_models_py3.py | 38 +++ .../_deployment_templates_operations.py | 226 ++++++++++++++++-- .../operations/_indexes_operations.py | 68 ++---- .../azure-ai-assets.json | 137 +++++++++-- 10 files changed, 571 insertions(+), 152 deletions(-) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py index 8b36bafdf50c..d23563bb6cec 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/_azure_machine_learning_workspaces.py @@ -45,7 +45,7 @@ def __init__( **kwargs # type: Any ): # type: (...) -> None - _base_url = '{endpoint}/genericasset/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}' + _base_url = '{endpoint}/genericasset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices' self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) self._client = ARMPipelineClient(base_url=_base_url, config=self._config, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py index b7f897ae9ea2..6c461af5d5c1 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/_azure_machine_learning_workspaces.py @@ -42,7 +42,7 @@ def __init__( credential: "AsyncTokenCredential", **kwargs: Any ) -> None: - _base_url = '{endpoint}/genericasset/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}' + _base_url = '{endpoint}/genericasset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices' self._config = AzureMachineLearningWorkspacesConfiguration(credential=credential, **kwargs) self._client = AsyncARMPipelineClient(base_url=_base_url, config=self._config, **kwargs) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py index 365e5e4e3204..e5e8da0764f8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_deployment_templates_operations.py @@ -6,18 +6,20 @@ # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -from typing import Any, Callable, Dict, Optional, TypeVar +from typing import Any, AsyncIterable, Callable, Dict, Optional, TypeVar +from azure.core.async_paging import AsyncItemPaged, AsyncList from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, 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.mgmt.core.exceptions import ARMErrorFormat from ... import models as _models from ..._vendor import _convert_request -from ...operations._deployment_templates_operations import build_create_request, build_delete_generic_asset_request, build_get_request +from ...operations._deployment_templates_operations import build_create_request, build_delete_deployment_template_request, build_get_request, build_list_deployment_templates_request T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] @@ -49,7 +51,6 @@ async def create( # pylint: disable=inconsistent-return-statements endpoint: str, subscription_id: str, resource_group_name: str, - workspace_name: str, registry_name: str, name: str, version: str, @@ -64,8 +65,6 @@ async def create( # pylint: disable=inconsistent-return-statements :type subscription_id: str :param resource_group_name: The name of the Resource Group. :type resource_group_name: str - :param workspace_name: The name of the AzureML workspace or AI project. - :type workspace_name: str :param registry_name: The name of the AzureML registry. :type registry_name: str :param name: Name of the deployment template. @@ -104,7 +103,6 @@ async def create( # pylint: disable=inconsistent-return-statements "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -126,13 +124,150 @@ async def create( # pylint: disable=inconsistent-return-statements create.metadata = {'url': "/registries/{registryName}/{name}/versions/{version}"} # type: ignore + @distributed_trace + def list_deployment_templates( + self, + endpoint: str, + subscription_id: str, + resource_group_name: str, + registry_name: str, + name: Optional[str] = None, + tags: Optional[str] = None, + continuation_token_parameter: Optional[str] = None, + continuation_token_from_header: Optional[str] = None, + count: Optional[int] = None, + stage: Optional[str] = None, + list_view_type: Optional[str] = "ActiveOnly", + **kwargs: Any + ) -> AsyncIterable["_models.PagedDeploymentTemplate"]: + """List deployment templates. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param name: Filter by deployment template name. + :type name: str + :param tags: Comma-separated list of tag names (and optionally values). Example: + tag1,tag2=value2. + :type tags: str + :param continuation_token_parameter: Continuation token for pagination. + :type continuation_token_parameter: str + :param continuation_token_from_header: Continuation token for pagination (from header). + :type continuation_token_from_header: str + :param count: Maximum number of items to return. + :type count: int + :param stage: Filter by deployment template stage. + :type stage: str + :param list_view_type: View type for including/excluding (for example) archived entities. + :type list_view_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PagedDeploymentTemplate or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.machinelearningservices.models.PagedDeploymentTemplate] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagedDeploymentTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_deployment_templates_request( + registry_name=registry_name, + api_version=api_version, + name=name, + tags=tags, + continuation_token_parameter=continuation_token_parameter, + continuation_token_from_header=continuation_token_from_header, + count=count, + stage=stage, + list_view_type=list_view_type, + template_url=self.list_deployment_templates.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + + request = build_list_deployment_templates_request( + registry_name=registry_name, + api_version=api_version, + name=name, + tags=tags, + continuation_token_parameter=continuation_token_parameter, + continuation_token_from_header=continuation_token_from_header, + count=count, + stage=stage, + list_view_type=list_view_type, + template_url=next_link, + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + request.method = "GET" + return request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("PagedDeploymentTemplate", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return AsyncItemPaged( + get_next, extract_data + ) + list_deployment_templates.metadata = {'url': "/registries/{registryName}/deploymenttemplates"} # type: ignore + @distributed_trace_async async def get( self, endpoint: str, subscription_id: str, resource_group_name: str, - workspace_name: str, registry_name: str, name: str, version: str, @@ -147,8 +282,6 @@ async def get( :type subscription_id: str :param resource_group_name: The name of the Resource Group. :type resource_group_name: str - :param workspace_name: The name of the AzureML workspace or AI project. - :type workspace_name: str :param registry_name: The name of the AzureML registry. :type registry_name: str :param name: Name of the deployment template. @@ -184,7 +317,6 @@ async def get( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -211,14 +343,12 @@ async def get( @distributed_trace_async - async def delete_generic_asset( # pylint: disable=inconsistent-return-statements + async def delete_deployment_template( # pylint: disable=inconsistent-return-statements self, endpoint: str, subscription_id: str, resource_group_name: str, - workspace_name: str, registry_name: str, - type: str, name: str, version: str, **kwargs: Any @@ -231,12 +361,8 @@ async def delete_generic_asset( # pylint: disable=inconsistent-return-statement :type subscription_id: str :param resource_group_name: The name of the Resource Group. :type resource_group_name: str - :param workspace_name: The name of the AzureML workspace or AI project. - :type workspace_name: str :param registry_name: The name of the AzureML registry. :type registry_name: str - :param type: The type of the deployment template. - :type type: str :param name: Name of the deployment template. :type name: str :param version: Version of the deployment template. @@ -255,20 +381,18 @@ async def delete_generic_asset( # pylint: disable=inconsistent-return-statement api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - request = build_delete_generic_asset_request( + request = build_delete_deployment_template_request( registry_name=registry_name, - type=type, name=name, version=version, api_version=api_version, - template_url=self.delete_generic_asset.metadata['url'], + template_url=self.delete_deployment_template.metadata['url'], ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -287,5 +411,5 @@ async def delete_generic_asset( # pylint: disable=inconsistent-return-statement if cls: return cls(pipeline_response, None, {}) - delete_generic_asset.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}"} # type: ignore + delete_deployment_template.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py index ad51dea1bcc8..b7d651235d82 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/aio/operations/_indexes_operations.py @@ -52,7 +52,6 @@ def list_latest( subscription_id: str, resource_group_name: str, workspace_name: str, - workspace_name1: str, top: Optional[int] = None, skip: Optional[int] = 0, maxpagesize: Optional[int] = None, @@ -68,8 +67,6 @@ def list_latest( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param top: The number of result items to return. :type top: int :param skip: The number of result items to skip. @@ -93,7 +90,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_latest_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, api_version=api_version, top=top, skip=skip, @@ -105,14 +102,13 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) else: request = build_list_latest_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, api_version=api_version, top=top, skip=skip, @@ -124,7 +120,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -132,7 +127,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.method = "GET" return request @@ -174,7 +168,6 @@ async def get_latest( subscription_id: str, resource_group_name: str, workspace_name: str, - workspace_name1: str, name: str, **kwargs: Any ) -> "_models.Index": @@ -188,8 +181,6 @@ async def get_latest( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -207,7 +198,7 @@ async def get_latest( request = build_get_latest_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, template_url=self.get_latest.metadata['url'], @@ -217,7 +208,6 @@ async def get_latest( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -250,7 +240,6 @@ async def get_next_version( subscription_id: str, resource_group_name: str, workspace_name: str, - workspace_name1: str, name: str, **kwargs: Any ) -> "_models.VersionInfo": @@ -267,8 +256,6 @@ async def get_next_version( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -286,7 +273,7 @@ async def get_next_version( request = build_get_next_version_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, template_url=self.get_next_version.metadata['url'], @@ -296,7 +283,6 @@ async def get_next_version( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -329,7 +315,6 @@ def list( subscription_id: str, resource_group_name: str, workspace_name: str, - workspace_name1: str, name: str, list_view_type: str = "ActiveOnly", order_by: Optional[str] = None, @@ -349,8 +334,6 @@ def list( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :param list_view_type: View type for including/excluding (for example) archived entities. @@ -384,7 +367,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, list_view_type=list_view_type, @@ -400,14 +383,13 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) else: request = build_list_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, list_view_type=list_view_type, @@ -423,7 +405,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -431,7 +412,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.method = "GET" return request @@ -473,7 +453,6 @@ async def get( subscription_id: str, resource_group_name: str, workspace_name: str, - workspace_name1: str, name: str, version: str, **kwargs: Any @@ -488,8 +467,6 @@ async def get( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :param version: Version of the index. @@ -509,7 +486,7 @@ async def get( request = build_get_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, version=version, api_version=api_version, @@ -520,7 +497,6 @@ async def get( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -553,7 +529,6 @@ async def create_or_update( subscription_id: str, resource_group_name: str, workspace_name: str, - workspace_name1: str, name: str, version: str, body: "_models.Index", @@ -569,8 +544,6 @@ async def create_or_update( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :param version: Version of the index. @@ -594,7 +567,7 @@ async def create_or_update( _json = self._serialize.body(body, 'Index') request = build_create_or_update_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, version=version, api_version=api_version, @@ -607,7 +580,6 @@ async def create_or_update( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py index df6baa360afc..52efbb78ee95 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/__init__.py @@ -14,6 +14,7 @@ from ._models_py3 import DeploymentTemplate from ._models_py3 import Index from ._models_py3 import OnlineRequestSettings + from ._models_py3 import PagedDeploymentTemplate from ._models_py3 import PagedIndex from ._models_py3 import ProbeSettings from ._models_py3 import SystemData @@ -26,6 +27,7 @@ from ._models import DeploymentTemplate # type: ignore from ._models import Index # type: ignore from ._models import OnlineRequestSettings # type: ignore + from ._models import PagedDeploymentTemplate # type: ignore from ._models import PagedIndex # type: ignore from ._models import ProbeSettings # type: ignore from ._models import SystemData # type: ignore @@ -39,6 +41,7 @@ 'DeploymentTemplate', 'Index', 'OnlineRequestSettings', + 'PagedDeploymentTemplate', 'PagedIndex', 'ProbeSettings', 'SystemData', diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py index 41ce8779e63a..a2b876606b9b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models.py @@ -447,6 +447,41 @@ def __init__( self.max_concurrent_requests_per_instance = kwargs['max_concurrent_requests_per_instance'] +class PagedDeploymentTemplate(msrest.serialization.Model): + """Paged collection of DeploymentTemplate items. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Required. The list of Deployment Templates. + :vartype value: list[~azure.mgmt.machinelearningservices.models.DeploymentTemplate] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeploymentTemplate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword value: Required. The list of Deployment Templates. + :paramtype value: list[~azure.mgmt.machinelearningservices.models.DeploymentTemplate] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super(PagedDeploymentTemplate, self).__init__(**kwargs) + self.value = kwargs['value'] + self.next_link = kwargs.get('next_link', None) + + class PagedIndex(msrest.serialization.Model): """Paged collection of IndexVersion items. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py index a8f0258aef02..a00139cf0e85 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/models/_models_py3.py @@ -493,6 +493,44 @@ def __init__( self.max_concurrent_requests_per_instance = max_concurrent_requests_per_instance +class PagedDeploymentTemplate(msrest.serialization.Model): + """Paged collection of DeploymentTemplate items. + + All required parameters must be populated in order to send to Azure. + + :ivar value: Required. The list of Deployment Templates. + :vartype value: list[~azure.mgmt.machinelearningservices.models.DeploymentTemplate] + :ivar next_link: The link to the next page of items. + :vartype next_link: str + """ + + _validation = { + 'value': {'required': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DeploymentTemplate]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__( + self, + *, + value: List["DeploymentTemplate"], + next_link: Optional[str] = None, + **kwargs + ): + """ + :keyword value: Required. The list of Deployment Templates. + :paramtype value: list[~azure.mgmt.machinelearningservices.models.DeploymentTemplate] + :keyword next_link: The link to the next page of items. + :paramtype next_link: str + """ + super(PagedDeploymentTemplate, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + class PagedIndex(msrest.serialization.Model): """Paged collection of IndexVersion items. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py index 0fb971981833..aa1ea569d5f8 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_deployment_templates_operations.py @@ -11,6 +11,7 @@ from msrest import Serializer from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged from azure.core.pipeline import PipelineResponse from azure.core.pipeline.transport import HttpResponse from azure.core.rest import HttpRequest @@ -22,7 +23,7 @@ if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports - from typing import Any, Callable, Dict, Optional, TypeVar + from typing import Any, Callable, Dict, Iterable, Optional, TypeVar T = TypeVar('T') ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] @@ -70,6 +71,60 @@ def build_create_request( ) +def build_list_deployment_templates_request( + registry_name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + name = kwargs.pop('name', None) # type: Optional[str] + tags = kwargs.pop('tags', None) # type: Optional[str] + continuation_token_parameter = kwargs.pop('continuation_token_parameter', None) # type: Optional[str] + continuation_token_from_header = kwargs.pop('continuation_token_from_header', None) # type: Optional[str] + count = kwargs.pop('count', None) # type: Optional[int] + stage = kwargs.pop('stage', None) # type: Optional[str] + list_view_type = kwargs.pop('list_view_type', "ActiveOnly") # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/registries/{registryName}/deploymenttemplates") + path_format_arguments = { + "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), + } + + _url = _format_url_section(_url, **path_format_arguments) + + # Construct parameters + _query_parameters = kwargs.pop("params", {}) # type: Dict[str, Any] + _query_parameters['api-version'] = _SERIALIZER.query("api_version", api_version, 'str') + if name is not None: + _query_parameters['name'] = _SERIALIZER.query("name", name, 'str') + if tags is not None: + _query_parameters['tags'] = _SERIALIZER.query("tags", tags, 'str') + if continuation_token_parameter is not None: + _query_parameters['continuationToken'] = _SERIALIZER.query("continuation_token_parameter", continuation_token_parameter, 'str') + if count is not None: + _query_parameters['count'] = _SERIALIZER.query("count", count, 'int') + if stage is not None: + _query_parameters['stage'] = _SERIALIZER.query("stage", stage, 'str') + if list_view_type is not None: + _query_parameters['listViewType'] = _SERIALIZER.query("list_view_type", list_view_type, 'str') + + # Construct headers + _header_parameters = kwargs.pop("headers", {}) # type: Dict[str, Any] + if continuation_token_from_header is not None: + _header_parameters['continuation-token-from-header'] = _SERIALIZER.header("continuation_token_from_header", continuation_token_from_header, 'str') + _header_parameters['Accept'] = _SERIALIZER.header("accept", accept, 'str') + + return HttpRequest( + method="GET", + url=_url, + params=_query_parameters, + headers=_header_parameters, + **kwargs + ) + + def build_get_request( registry_name, # type: str name, # type: str @@ -110,9 +165,8 @@ def build_get_request( ) -def build_delete_generic_asset_request( +def build_delete_deployment_template_request( registry_name, # type: str - type, # type: str name, # type: str version, # type: str **kwargs # type: Any @@ -122,10 +176,9 @@ def build_delete_generic_asset_request( accept = "application/json" # Construct URL - _url = kwargs.pop("template_url", "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}") + _url = kwargs.pop("template_url", "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}") path_format_arguments = { "registryName": _SERIALIZER.url("registry_name", registry_name, 'str'), - "type": _SERIALIZER.url("type", type, 'str'), "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), "version": _SERIALIZER.url("version", version, 'str'), } @@ -177,7 +230,6 @@ def create( # pylint: disable=inconsistent-return-statements endpoint, # type: str subscription_id, # type: str resource_group_name, # type: str - workspace_name, # type: str registry_name, # type: str name, # type: str version, # type: str @@ -193,8 +245,6 @@ def create( # pylint: disable=inconsistent-return-statements :type subscription_id: str :param resource_group_name: The name of the Resource Group. :type resource_group_name: str - :param workspace_name: The name of the AzureML workspace or AI project. - :type workspace_name: str :param registry_name: The name of the AzureML registry. :type registry_name: str :param name: Name of the deployment template. @@ -233,7 +283,6 @@ def create( # pylint: disable=inconsistent-return-statements "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -255,13 +304,151 @@ def create( # pylint: disable=inconsistent-return-statements create.metadata = {'url': "/registries/{registryName}/{name}/versions/{version}"} # type: ignore + @distributed_trace + def list_deployment_templates( + self, + endpoint, # type: str + subscription_id, # type: str + resource_group_name, # type: str + registry_name, # type: str + name=None, # type: Optional[str] + tags=None, # type: Optional[str] + continuation_token_parameter=None, # type: Optional[str] + continuation_token_from_header=None, # type: Optional[str] + count=None, # type: Optional[int] + stage=None, # type: Optional[str] + list_view_type="ActiveOnly", # type: Optional[str] + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.PagedDeploymentTemplate"] + """List deployment templates. + + :param endpoint: Supported Azure-AI asset endpoints. + :type endpoint: str + :param subscription_id: The ID of the target subscription. + :type subscription_id: str + :param resource_group_name: The name of the Resource Group. + :type resource_group_name: str + :param registry_name: The name of the AzureML registry. + :type registry_name: str + :param name: Filter by deployment template name. + :type name: str + :param tags: Comma-separated list of tag names (and optionally values). Example: + tag1,tag2=value2. + :type tags: str + :param continuation_token_parameter: Continuation token for pagination. + :type continuation_token_parameter: str + :param continuation_token_from_header: Continuation token for pagination (from header). + :type continuation_token_from_header: str + :param count: Maximum number of items to return. + :type count: int + :param stage: Filter by deployment template stage. + :type stage: str + :param list_view_type: View type for including/excluding (for example) archived entities. + :type list_view_type: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either PagedDeploymentTemplate or the result of + cls(response) + :rtype: + ~azure.core.paging.ItemPaged[~azure.mgmt.machinelearningservices.models.PagedDeploymentTemplate] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str + + cls = kwargs.pop('cls', None) # type: ClsType["_models.PagedDeploymentTemplate"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + def prepare_request(next_link=None): + if not next_link: + + request = build_list_deployment_templates_request( + registry_name=registry_name, + api_version=api_version, + name=name, + tags=tags, + continuation_token_parameter=continuation_token_parameter, + continuation_token_from_header=continuation_token_from_header, + count=count, + stage=stage, + list_view_type=list_view_type, + template_url=self.list_deployment_templates.metadata['url'], + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + else: + + request = build_list_deployment_templates_request( + registry_name=registry_name, + api_version=api_version, + name=name, + tags=tags, + continuation_token_parameter=continuation_token_parameter, + continuation_token_from_header=continuation_token_from_header, + count=count, + stage=stage, + list_view_type=list_view_type, + template_url=next_link, + ) + request = _convert_request(request) + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + request.url = self._client.format_url(request.url, **path_format_arguments) + + path_format_arguments = { + "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), + "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), + "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), + } + request.method = "GET" + return request + + def extract_data(pipeline_response): + deserialized = self._deserialize("PagedDeploymentTemplate", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) + return deserialized.next_link or None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run( # pylint: disable=protected-access + 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) + error = self._deserialize.failsafe_deserialize(_models.AzureCoreFoundationsErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + return pipeline_response + + + return ItemPaged( + get_next, extract_data + ) + list_deployment_templates.metadata = {'url': "/registries/{registryName}/deploymenttemplates"} # type: ignore + @distributed_trace def get( self, endpoint, # type: str subscription_id, # type: str resource_group_name, # type: str - workspace_name, # type: str registry_name, # type: str name, # type: str version, # type: str @@ -277,8 +464,6 @@ def get( :type subscription_id: str :param resource_group_name: The name of the Resource Group. :type resource_group_name: str - :param workspace_name: The name of the AzureML workspace or AI project. - :type workspace_name: str :param registry_name: The name of the AzureML registry. :type registry_name: str :param name: Name of the deployment template. @@ -314,7 +499,6 @@ def get( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -341,14 +525,12 @@ def get( @distributed_trace - def delete_generic_asset( # pylint: disable=inconsistent-return-statements + def delete_deployment_template( # pylint: disable=inconsistent-return-statements self, endpoint, # type: str subscription_id, # type: str resource_group_name, # type: str - workspace_name, # type: str registry_name, # type: str - type, # type: str name, # type: str version, # type: str **kwargs # type: Any @@ -362,12 +544,8 @@ def delete_generic_asset( # pylint: disable=inconsistent-return-statements :type subscription_id: str :param resource_group_name: The name of the Resource Group. :type resource_group_name: str - :param workspace_name: The name of the AzureML workspace or AI project. - :type workspace_name: str :param registry_name: The name of the AzureML registry. :type registry_name: str - :param type: The type of the deployment template. - :type type: str :param name: Name of the deployment template. :type name: str :param version: Version of the deployment template. @@ -386,20 +564,18 @@ def delete_generic_asset( # pylint: disable=inconsistent-return-statements api_version = kwargs.pop('api_version', "2024-04-01-preview") # type: str - request = build_delete_generic_asset_request( + request = build_delete_deployment_template_request( registry_name=registry_name, - type=type, name=name, version=version, api_version=api_version, - template_url=self.delete_generic_asset.metadata['url'], + template_url=self.delete_deployment_template.metadata['url'], ) request = _convert_request(request) path_format_arguments = { "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -418,5 +594,5 @@ def delete_generic_asset( # pylint: disable=inconsistent-return-statements if cls: return cls(pipeline_response, None, {}) - delete_generic_asset.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}"} # type: ignore + delete_deployment_template.metadata = {'url': "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py index 530c67c48cd6..07517fafe8f6 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024-04-01-dataplanepreview/operations/_indexes_operations.py @@ -32,7 +32,7 @@ # fmt: off def build_list_latest_request( - workspace_name1, # type: str + workspace_name, # type: str **kwargs # type: Any ): # type: (...) -> HttpRequest @@ -45,7 +45,7 @@ def build_list_latest_request( # Construct URL _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes") path_format_arguments = { - "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), } _url = _format_url_section(_url, **path_format_arguments) @@ -74,7 +74,7 @@ def build_list_latest_request( def build_get_latest_request( - workspace_name1, # type: str + workspace_name, # type: str name, # type: str **kwargs # type: Any ): @@ -85,7 +85,7 @@ def build_get_latest_request( # Construct URL _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}") path_format_arguments = { - "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), } @@ -109,7 +109,7 @@ def build_get_latest_request( def build_get_next_version_request( - workspace_name1, # type: str + workspace_name, # type: str name, # type: str **kwargs # type: Any ): @@ -120,7 +120,7 @@ def build_get_next_version_request( # Construct URL _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}:getNextVersion") path_format_arguments = { - "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), } @@ -144,7 +144,7 @@ def build_get_next_version_request( def build_list_request( - workspace_name1, # type: str + workspace_name, # type: str name, # type: str **kwargs # type: Any ): @@ -161,7 +161,7 @@ def build_list_request( # Construct URL _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}/versions") path_format_arguments = { - "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), } @@ -196,7 +196,7 @@ def build_list_request( def build_get_request( - workspace_name1, # type: str + workspace_name, # type: str name, # type: str version, # type: str **kwargs # type: Any @@ -208,7 +208,7 @@ def build_get_request( # Construct URL _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}/versions/{version}") path_format_arguments = { - "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), "version": _SERIALIZER.url("version", version, 'str'), } @@ -233,7 +233,7 @@ def build_get_request( def build_create_or_update_request( - workspace_name1, # type: str + workspace_name, # type: str name, # type: str version, # type: str **kwargs # type: Any @@ -246,7 +246,7 @@ def build_create_or_update_request( # Construct URL _url = kwargs.pop("template_url", "/workspaces/{workspaceName}/indexes/{name}/versions/{version}") path_format_arguments = { - "workspaceName": _SERIALIZER.url("workspace_name1", workspace_name1, 'str'), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str'), "name": _SERIALIZER.url("name", name, 'str', max_length=254, min_length=0, pattern=r'^[a-zA-Z0-9][a-zA-Z0-9-_]*$'), "version": _SERIALIZER.url("version", version, 'str'), } @@ -301,7 +301,6 @@ def list_latest( subscription_id, # type: str resource_group_name, # type: str workspace_name, # type: str - workspace_name1, # type: str top=None, # type: Optional[int] skip=0, # type: Optional[int] maxpagesize=None, # type: Optional[int] @@ -318,8 +317,6 @@ def list_latest( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param top: The number of result items to return. :type top: int :param skip: The number of result items to skip. @@ -342,7 +339,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_latest_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, api_version=api_version, top=top, skip=skip, @@ -354,14 +351,13 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) else: request = build_list_latest_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, api_version=api_version, top=top, skip=skip, @@ -373,7 +369,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -381,7 +376,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.method = "GET" return request @@ -423,7 +417,6 @@ def get_latest( subscription_id, # type: str resource_group_name, # type: str workspace_name, # type: str - workspace_name1, # type: str name, # type: str **kwargs # type: Any ): @@ -438,8 +431,6 @@ def get_latest( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -457,7 +448,7 @@ def get_latest( request = build_get_latest_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, template_url=self.get_latest.metadata['url'], @@ -467,7 +458,6 @@ def get_latest( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -500,7 +490,6 @@ def get_next_version( subscription_id, # type: str resource_group_name, # type: str workspace_name, # type: str - workspace_name1, # type: str name, # type: str **kwargs # type: Any ): @@ -518,8 +507,6 @@ def get_next_version( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :keyword callable cls: A custom type or function that will be passed the direct response @@ -537,7 +524,7 @@ def get_next_version( request = build_get_next_version_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, template_url=self.get_next_version.metadata['url'], @@ -547,7 +534,6 @@ def get_next_version( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -580,7 +566,6 @@ def list( subscription_id, # type: str resource_group_name, # type: str workspace_name, # type: str - workspace_name1, # type: str name, # type: str list_view_type="ActiveOnly", # type: str order_by=None, # type: Optional[str] @@ -601,8 +586,6 @@ def list( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :param list_view_type: View type for including/excluding (for example) archived entities. @@ -635,7 +618,7 @@ def prepare_request(next_link=None): if not next_link: request = build_list_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, list_view_type=list_view_type, @@ -651,14 +634,13 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) else: request = build_list_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, api_version=api_version, list_view_type=list_view_type, @@ -674,7 +656,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -682,7 +663,6 @@ def prepare_request(next_link=None): "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.method = "GET" return request @@ -724,7 +704,6 @@ def get( subscription_id, # type: str resource_group_name, # type: str workspace_name, # type: str - workspace_name1, # type: str name, # type: str version, # type: str **kwargs # type: Any @@ -740,8 +719,6 @@ def get( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :param version: Version of the index. @@ -761,7 +738,7 @@ def get( request = build_get_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, version=version, api_version=api_version, @@ -772,7 +749,6 @@ def get( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) @@ -805,7 +781,6 @@ def create_or_update( subscription_id, # type: str resource_group_name, # type: str workspace_name, # type: str - workspace_name1, # type: str name, # type: str version, # type: str body, # type: "_models.Index" @@ -822,8 +797,6 @@ def create_or_update( :type resource_group_name: str :param workspace_name: The name of the AzureML workspace or AI project. :type workspace_name: str - :param workspace_name1: The name of the AzureML workspace or AI project. - :type workspace_name1: str :param name: Name of the index. :type name: str :param version: Version of the index. @@ -847,7 +820,7 @@ def create_or_update( _json = self._serialize.body(body, 'Index') request = build_create_or_update_request( - workspace_name1=workspace_name1, + workspace_name=workspace_name, name=name, version=version, api_version=api_version, @@ -860,7 +833,6 @@ def create_or_update( "endpoint": self._serialize.url("endpoint", endpoint, 'str', skip_quote=True), "subscriptionId": self._serialize.url("subscription_id", subscription_id, 'str'), "resourceGroupName": self._serialize.url("resource_group_name", resource_group_name, 'str'), - "workspaceName": self._serialize.url("workspace_name", workspace_name, 'str'), } request.url = self._client.format_url(request.url, **path_format_arguments) diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json index 3770d1f60557..6736f024719a 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-04-01-dataplanepreview/azure-ai-assets.json @@ -13,7 +13,7 @@ "https" ], "x-ms-parameterized-host": { - "hostTemplate": "{endpoint}/genericasset/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", + "hostTemplate": "{endpoint}/genericasset/v2.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices", "useSchemePrefix": false, "parameters": [ { @@ -38,13 +38,6 @@ "description": "The name of the Resource Group.", "required": true, "type": "string" - }, - { - "name": "workspaceName", - "in": "path", - "description": "The name of the AzureML workspace or AI project.", - "required": true, - "type": "string" } ] }, @@ -133,6 +126,99 @@ } } }, + "/registries/{registryName}/deploymenttemplates": { + "get": { + "operationId": "DeploymentTemplates_ListDeploymentTemplates", + "description": "List deployment templates.", + "parameters": [ + { + "$ref": "#/parameters/Azure.Core.Foundations.ApiVersionParameter" + }, + { + "name": "registryName", + "in": "path", + "description": "The name of the AzureML registry.", + "required": true, + "type": "string" + }, + { + "name": "name", + "in": "query", + "description": "Filter by deployment template name.", + "required": false, + "type": "string" + }, + { + "name": "tags", + "in": "query", + "description": "Comma-separated list of tag names (and optionally values). Example: tag1,tag2=value2.", + "required": false, + "type": "string" + }, + { + "name": "continuationToken", + "in": "query", + "description": "Continuation token for pagination.", + "required": false, + "type": "string" + }, + { + "name": "continuation-token-from-header", + "in": "header", + "description": "Continuation token for pagination (from header).", + "required": false, + "type": "string", + "x-ms-client-name": "continuationTokenFromHeader" + }, + { + "name": "count", + "in": "query", + "description": "Maximum number of items to return.", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "stage", + "in": "query", + "description": "Filter by deployment template stage.", + "required": false, + "type": "string" + }, + { + "name": "listViewType", + "in": "query", + "description": "View type for including/excluding (for example) archived entities.", + "required": false, + "type": "string", + "default": "ActiveOnly" + } + ], + "responses": { + "200": { + "description": "The request has succeeded.", + "schema": { + "$ref": "#/definitions/PagedDeploymentTemplate" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/Azure.Core.Foundations.ErrorResponse" + }, + "headers": { + "x-ms-error-code": { + "type": "string", + "description": "String error code indicating what went wrong." + } + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}": { "get": { "operationId": "DeploymentTemplates_Get", @@ -192,11 +278,9 @@ } } } - } - }, - "/registries/{registryName}/deploymenttemplates/{name}/versions/{version}/{type}": { + }, "delete": { - "operationId": "DeploymentTemplates_DeleteGenericAsset", + "operationId": "DeploymentTemplates_DeleteDeploymentTemplate", "description": "Delete a specific version of a deployment template.", "parameters": [ { @@ -209,13 +293,6 @@ "required": true, "type": "string" }, - { - "name": "type", - "in": "path", - "description": "The type of the deployment template.", - "required": true, - "type": "string" - }, { "name": "name", "in": "path", @@ -912,6 +989,28 @@ "maxConcurrentRequestsPerInstance" ] }, + "PagedDeploymentTemplate": { + "type": "object", + "description": "Paged collection of DeploymentTemplate items.", + "properties": { + "value": { + "type": "array", + "description": "The list of Deployment Templates.", + "items": { + "$ref": "#/definitions/DeploymentTemplate" + }, + "x-ms-identifiers": [] + }, + "nextLink": { + "type": "string", + "format": "uri", + "description": "The link to the next page of items" + } + }, + "required": [ + "value" + ] + }, "PagedIndex": { "type": "object", "description": "Paged collection of IndexVersion items.",