diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/_azure_machine_learning_workspaces.py index 4d57f91a04f2..d8fa7f57c4c7 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/_azure_machine_learning_workspaces.py @@ -15,7 +15,7 @@ from . import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapabilityHostsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -80,6 +80,9 @@ class AzureMachineLearningWorkspaces(object): # pylint: disable=too-many-inst :ivar batch_deployments: BatchDeploymentsOperations operations :vartype batch_deployments: azure.mgmt.machinelearningservices.operations.BatchDeploymentsOperations + :ivar capability_hosts: CapabilityHostsOperations operations + :vartype capability_hosts: + azure.mgmt.machinelearningservices.operations.CapabilityHostsOperations :ivar code_containers: CodeContainersOperations operations :vartype code_containers: azure.mgmt.machinelearningservices.operations.CodeContainersOperations @@ -243,6 +246,7 @@ def __init__( self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.capability_hosts = CapabilityHostsOperations(self._client, self._config, self._serialize, self._deserialize) self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/_azure_machine_learning_workspaces.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/_azure_machine_learning_workspaces.py index 0307dadabeb3..919a8fa64bd5 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/_azure_machine_learning_workspaces.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/_azure_machine_learning_workspaces.py @@ -16,7 +16,7 @@ from .. import models from ._configuration import AzureMachineLearningWorkspacesConfiguration -from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations +from .operations import BatchDeploymentsOperations, BatchEndpointsOperations, CapabilityHostsOperations, CodeContainersOperations, CodeVersionsOperations, ComponentContainersOperations, ComponentVersionsOperations, ComputeOperations, ConnectionOperations, ConnectionRaiBlocklistItemOperations, ConnectionRaiBlocklistItemsOperations, ConnectionRaiBlocklistOperations, ConnectionRaiBlocklistsOperations, ConnectionRaiPoliciesOperations, ConnectionRaiPolicyOperations, DataContainersOperations, DataVersionsOperations, DatastoresOperations, EndpointDeploymentOperations, EndpointOperations, EnvironmentContainersOperations, EnvironmentVersionsOperations, FeaturesOperations, FeaturesetContainersOperations, FeaturesetVersionsOperations, FeaturestoreEntityContainersOperations, FeaturestoreEntityVersionsOperations, InferenceEndpointsOperations, InferenceGroupsOperations, InferencePoolsOperations, JobsOperations, ManagedNetworkProvisionsOperations, ManagedNetworkSettingsRuleOperations, MarketplaceSubscriptionsOperations, ModelContainersOperations, ModelVersionsOperations, OnlineDeploymentsOperations, OnlineEndpointsOperations, Operations, PrivateEndpointConnectionsOperations, PrivateLinkResourcesOperations, QuotasOperations, RaiPoliciesOperations, RaiPolicyOperations, RegistriesOperations, RegistryCodeContainersOperations, RegistryCodeVersionsOperations, RegistryComponentContainersOperations, RegistryComponentVersionsOperations, RegistryDataContainersOperations, RegistryDataReferencesOperations, RegistryDataVersionsOperations, RegistryEnvironmentContainersOperations, RegistryEnvironmentVersionsOperations, RegistryModelContainersOperations, RegistryModelVersionsOperations, SchedulesOperations, ServerlessEndpointsOperations, UsagesOperations, VirtualMachineSizesOperations, WorkspaceConnectionsOperations, WorkspaceFeaturesOperations, WorkspacesOperations if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports @@ -78,6 +78,9 @@ class AzureMachineLearningWorkspaces: # pylint: disable=too-many-instance-att :ivar batch_deployments: BatchDeploymentsOperations operations :vartype batch_deployments: azure.mgmt.machinelearningservices.aio.operations.BatchDeploymentsOperations + :ivar capability_hosts: CapabilityHostsOperations operations + :vartype capability_hosts: + azure.mgmt.machinelearningservices.aio.operations.CapabilityHostsOperations :ivar code_containers: CodeContainersOperations operations :vartype code_containers: azure.mgmt.machinelearningservices.aio.operations.CodeContainersOperations @@ -243,6 +246,7 @@ def __init__( self.registry_model_versions = RegistryModelVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.batch_endpoints = BatchEndpointsOperations(self._client, self._config, self._serialize, self._deserialize) self.batch_deployments = BatchDeploymentsOperations(self._client, self._config, self._serialize, self._deserialize) + self.capability_hosts = CapabilityHostsOperations(self._client, self._config, self._serialize, self._deserialize) self.code_containers = CodeContainersOperations(self._client, self._config, self._serialize, self._deserialize) self.code_versions = CodeVersionsOperations(self._client, self._config, self._serialize, self._deserialize) self.component_containers = ComponentContainersOperations(self._client, self._config, self._serialize, self._deserialize) diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/operations/__init__.py index 72934f488435..c75142ae9e4e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/operations/__init__.py @@ -25,6 +25,7 @@ from ._registry_model_versions_operations import RegistryModelVersionsOperations from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations +from ._capability_hosts_operations import CapabilityHostsOperations from ._code_containers_operations import CodeContainersOperations from ._code_versions_operations import CodeVersionsOperations from ._component_containers_operations import ComponentContainersOperations @@ -89,6 +90,7 @@ 'RegistryModelVersionsOperations', 'BatchEndpointsOperations', 'BatchDeploymentsOperations', + 'CapabilityHostsOperations', 'CodeContainersOperations', 'CodeVersionsOperations', 'ComponentContainersOperations', diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/operations/_capability_hosts_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/operations/_capability_hosts_operations.py new file mode 100644 index 000000000000..854828fead37 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/aio/operations/_capability_hosts_operations.py @@ -0,0 +1,370 @@ +# 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, Union + +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.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator_async import distributed_trace_async +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models +from ..._vendor import _convert_request +from ...operations._capability_hosts_operations import build_create_or_update_request_initial, build_delete_request_initial, build_get_request +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class CapabilityHostsOperations: + """CapabilityHostsOperations 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 + + async def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any + ) -> None: + 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-10-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + + @distributed_trace_async + async def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any + ) -> AsyncLROPoller[None]: + """Delete capabilityHost. + + Delete capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param name: CapabilityHost name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + @distributed_trace_async + async def get( + self, + resource_group_name: str, + workspace_name: str, + name: str, + **kwargs: Any + ) -> "_models.CapabilityHost": + """Get capabilityHost. + + Get capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param name: CapabilityHost name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapabilityHost, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.CapabilityHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CapabilityHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + + async def _create_or_update_initial( + self, + resource_group_name: str, + workspace_name: str, + name: str, + body: "_models.CapabilityHost", + **kwargs: Any + ) -> "_models.CapabilityHost": + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'CapabilityHost') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize('CapabilityHost', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + deserialized = self._deserialize('CapabilityHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + + @distributed_trace_async + async def begin_create_or_update( + self, + resource_group_name: str, + workspace_name: str, + name: str, + body: "_models.CapabilityHost", + **kwargs: Any + ) -> AsyncLROPoller["_models.CapabilityHost"]: + """Create or update capabilityHost. + + Create or update capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param name: CapabilityHost name. + :type name: str + :param body: CapabilityHost definition. + :type body: ~azure.mgmt.machinelearningservices.models.CapabilityHost + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for + this operation to not poll, or pass in your own initialized polling object for a personal + polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CapabilityHost or the result of + cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.machinelearningservices.models.CapabilityHost] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = await self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('CapabilityHost', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/__init__.py index 86be6d6edef0..f8e895b4f916 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/__init__.py @@ -72,6 +72,8 @@ from ._models_py3 import BindOptions from ._models_py3 import BlobReferenceForConsumptionDto from ._models_py3 import BuildContext + from ._models_py3 import CapabilityHost + from ._models_py3 import CapabilityHostProperties from ._models_py3 import CapacityConfig from ._models_py3 import CategoricalDataDriftMetricThreshold from ._models_py3 import CategoricalDataQualityMetricThreshold @@ -684,6 +686,8 @@ from ._models import BindOptions # type: ignore from ._models import BlobReferenceForConsumptionDto # type: ignore from ._models import BuildContext # type: ignore + from ._models import CapabilityHost # type: ignore + from ._models import CapabilityHostProperties # type: ignore from ._models import CapacityConfig # type: ignore from ._models import CategoricalDataDriftMetricThreshold # type: ignore from ._models import CategoricalDataQualityMetricThreshold # type: ignore @@ -1246,6 +1250,8 @@ BillingCurrency, BlockedTransformers, Caching, + CapabilityHostKind, + CapabilityHostProvisioningState, CategoricalDataDriftMetric, CategoricalDataQualityMetric, CategoricalPredictionDriftMetric, @@ -1488,6 +1494,8 @@ 'BindOptions', 'BlobReferenceForConsumptionDto', 'BuildContext', + 'CapabilityHost', + 'CapabilityHostProperties', 'CapacityConfig', 'CategoricalDataDriftMetricThreshold', 'CategoricalDataQualityMetricThreshold', @@ -2048,6 +2056,8 @@ 'BillingCurrency', 'BlockedTransformers', 'Caching', + 'CapabilityHostKind', + 'CapabilityHostProvisioningState', 'CategoricalDataDriftMetric', 'CategoricalDataQualityMetric', 'CategoricalPredictionDriftMetric', diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_azure_machine_learning_workspaces_enums.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_azure_machine_learning_workspaces_enums.py index 5cd596062c6f..d78ccc8e8576 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_azure_machine_learning_workspaces_enums.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_azure_machine_learning_workspaces_enums.py @@ -144,6 +144,21 @@ class Caching(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): READ_ONLY = "ReadOnly" READ_WRITE = "ReadWrite" +class CapabilityHostKind(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + + AGENTS = "Agents" + +class CapabilityHostProvisioningState(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): + """Provisioning state of capability host. + """ + + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + class CategoricalDataDriftMetric(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): #: The Jensen Shannon Distance (JSD) metric. diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py index fd02cab345c2..2f3261e47885 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models.py @@ -2332,6 +2332,8 @@ def __init__( class AssetJobOutput(msrest.serialization.Model): """Asset output type. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -2340,6 +2342,7 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, } @@ -2349,6 +2352,8 @@ def __init__( **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -2356,6 +2361,7 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) + self.asset_name = kwargs.get('asset_name', None) self.mode = kwargs.get('mode', None) self.uri = kwargs.get('uri', None) @@ -3737,7 +3743,7 @@ class FineTuningVertical(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant filled by server. Possible values include: "AzureOpenAI", "Custom". :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider @@ -3760,7 +3766,7 @@ class FineTuningVertical(msrest.serialization.Model): } _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, + 'model': {'key': 'model', 'type': 'JobInput'}, 'model_provider': {'key': 'modelProvider', 'type': 'str'}, 'task_type': {'key': 'taskType', 'type': 'str'}, 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, @@ -3777,7 +3783,7 @@ def __init__( ): """ :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", @@ -3802,7 +3808,7 @@ class AzureOpenAiFineTuning(FineTuningVertical): All required parameters must be populated in order to send to Azure. :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant filled by server. Possible values include: "AzureOpenAI", "Custom". :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider @@ -3828,7 +3834,7 @@ class AzureOpenAiFineTuning(FineTuningVertical): } _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, + 'model': {'key': 'model', 'type': 'JobInput'}, 'model_provider': {'key': 'modelProvider', 'type': 'str'}, 'task_type': {'key': 'taskType', 'type': 'str'}, 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, @@ -3842,7 +3848,7 @@ def __init__( ): """ :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", @@ -5005,6 +5011,173 @@ def __init__( self.dockerfile_path = kwargs.get('dockerfile_path', "Dockerfile") +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class CapabilityHost(ProxyResource): + """Azure Resource Manager resource envelope. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar properties: Required. [Required] Additional attributes of the entity. + :vartype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'CapabilityHostProperties'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword properties: Required. [Required] Additional attributes of the entity. + :paramtype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties + """ + super(CapabilityHost, self).__init__(**kwargs) + self.properties = kwargs['properties'] + + +class CapabilityHostProperties(ResourceBase): + """CapabilityHostProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar ai_services_connections: List of AI services connections. + :vartype ai_services_connections: list[str] + :ivar capability_host_kind: Kind of this capability host. Possible values include: "Agents". + :vartype capability_host_kind: str or + ~azure.mgmt.machinelearningservices.models.CapabilityHostKind + :ivar customer_subnet: Customer subnet info to help set up this capability host. + :vartype customer_subnet: str + :ivar provisioning_state: Provisioning state for the CapabilityHost. Possible values include: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.CapabilityHostProvisioningState + :ivar storage_connections: List of Storage connections. + :vartype storage_connections: list[str] + :ivar vector_store_connections: List of VectorStore connections. + :vartype vector_store_connections: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ai_services_connections': {'key': 'aiServicesConnections', 'type': '[str]'}, + 'capability_host_kind': {'key': 'capabilityHostKind', 'type': 'str'}, + 'customer_subnet': {'key': 'customerSubnet', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'storage_connections': {'key': 'storageConnections', 'type': '[str]'}, + 'vector_store_connections': {'key': 'vectorStoreConnections', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + """ + :keyword description: The asset description text. + :paramtype description: str + :keyword properties: The asset property dictionary. + :paramtype properties: dict[str, str] + :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :paramtype tags: dict[str, str] + :keyword ai_services_connections: List of AI services connections. + :paramtype ai_services_connections: list[str] + :keyword capability_host_kind: Kind of this capability host. Possible values include: "Agents". + :paramtype capability_host_kind: str or + ~azure.mgmt.machinelearningservices.models.CapabilityHostKind + :keyword customer_subnet: Customer subnet info to help set up this capability host. + :paramtype customer_subnet: str + :keyword storage_connections: List of Storage connections. + :paramtype storage_connections: list[str] + :keyword vector_store_connections: List of VectorStore connections. + :paramtype vector_store_connections: list[str] + """ + super(CapabilityHostProperties, self).__init__(**kwargs) + self.ai_services_connections = kwargs.get('ai_services_connections', None) + self.capability_host_kind = kwargs.get('capability_host_kind', None) + self.customer_subnet = kwargs.get('customer_subnet', None) + self.provisioning_state = None + self.storage_connections = kwargs.get('storage_connections', None) + self.vector_store_connections = kwargs.get('vector_store_connections', None) + + class CapacityConfig(msrest.serialization.Model): """The capacity configuration. @@ -5863,47 +6036,6 @@ def __init__( self.scoring_script = kwargs['scoring_script'] -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - class CodeContainer(ProxyResource): """Azure Resource Manager resource envelope. @@ -8889,7 +9021,7 @@ class CustomModelFineTuning(FineTuningVertical): All required parameters must be populated in order to send to Azure. :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant filled by server. Possible values include: "AzureOpenAI", "Custom". :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider @@ -8914,7 +9046,7 @@ class CustomModelFineTuning(FineTuningVertical): } _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, + 'model': {'key': 'model', 'type': 'JobInput'}, 'model_provider': {'key': 'modelProvider', 'type': 'str'}, 'task_type': {'key': 'taskType', 'type': 'str'}, 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, @@ -8928,7 +9060,7 @@ def __init__( ): """ :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", @@ -9085,6 +9217,8 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -9103,6 +9237,7 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -9114,6 +9249,8 @@ def __init__( **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -9123,6 +9260,7 @@ def __init__( :paramtype description: str """ super(CustomModelJobOutput, self).__init__(**kwargs) + self.asset_name = kwargs.get('asset_name', None) self.mode = kwargs.get('mode', None) self.uri = kwargs.get('uri', None) self.job_output_type = 'custom_model' # type: str @@ -20823,6 +20961,8 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -20841,6 +20981,7 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -20852,6 +20993,8 @@ def __init__( **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -20861,6 +21004,7 @@ def __init__( :paramtype description: str """ super(MLFlowModelJobOutput, self).__init__(**kwargs) + self.asset_name = kwargs.get('asset_name', None) self.mode = kwargs.get('mode', None) self.uri = kwargs.get('uri', None) self.job_output_type = 'mlflow_model' # type: str @@ -20989,6 +21133,8 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -21007,6 +21153,7 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -21018,6 +21165,8 @@ def __init__( **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -21027,6 +21176,7 @@ def __init__( :paramtype description: str """ super(MLTableJobOutput, self).__init__(**kwargs) + self.asset_name = kwargs.get('asset_name', None) self.mode = kwargs.get('mode', None) self.uri = kwargs.get('uri', None) self.job_output_type = 'mltable' # type: str @@ -28025,8 +28175,6 @@ def __init__( class ServiceTagDestination(msrest.serialization.Model): """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - Variables are only populated by the server, and will be ignored when sending a request. - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. @@ -28039,10 +28187,6 @@ class ServiceTagDestination(msrest.serialization.Model): :vartype service_tag: str """ - _validation = { - 'address_prefixes': {'readonly': True}, - } - _attribute_map = { 'action': {'key': 'action', 'type': 'str'}, 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, @@ -28058,6 +28202,8 @@ def __init__( """ :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction + :keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored. + :paramtype address_prefixes: list[str] :keyword port_ranges: :paramtype port_ranges: str :keyword protocol: @@ -28067,7 +28213,7 @@ def __init__( """ super(ServiceTagDestination, self).__init__(**kwargs) self.action = kwargs.get('action', None) - self.address_prefixes = None + self.address_prefixes = kwargs.get('address_prefixes', None) self.port_ranges = kwargs.get('port_ranges', None) self.protocol = kwargs.get('protocol', None) self.service_tag = kwargs.get('service_tag', None) @@ -30411,6 +30557,8 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -30429,6 +30577,7 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -30440,6 +30589,8 @@ def __init__( **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -30449,6 +30600,7 @@ def __init__( :paramtype description: str """ super(TritonModelJobOutput, self).__init__(**kwargs) + self.asset_name = kwargs.get('asset_name', None) self.mode = kwargs.get('mode', None) self.uri = kwargs.get('uri', None) self.job_output_type = 'triton_model' # type: str @@ -30704,6 +30856,8 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -30722,6 +30876,7 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -30733,6 +30888,8 @@ def __init__( **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -30742,6 +30899,7 @@ def __init__( :paramtype description: str """ super(UriFileJobOutput, self).__init__(**kwargs) + self.asset_name = kwargs.get('asset_name', None) self.mode = kwargs.get('mode', None) self.uri = kwargs.get('uri', None) self.job_output_type = 'uri_file' # type: str @@ -30864,6 +31022,8 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -30882,6 +31042,7 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -30893,6 +31054,8 @@ def __init__( **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -30902,6 +31065,7 @@ def __init__( :paramtype description: str """ super(UriFolderJobOutput, self).__init__(**kwargs) + self.asset_name = kwargs.get('asset_name', None) self.mode = kwargs.get('mode', None) self.uri = kwargs.get('uri', None) self.job_output_type = 'uri_folder' # type: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py index cd47ba64e002..fcb36586ee8b 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/models/_models_py3.py @@ -2488,6 +2488,8 @@ def __init__( class AssetJobOutput(msrest.serialization.Model): """Asset output type. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -2496,6 +2498,7 @@ class AssetJobOutput(msrest.serialization.Model): """ _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, } @@ -2503,11 +2506,14 @@ class AssetJobOutput(msrest.serialization.Model): def __init__( self, *, + asset_name: Optional[str] = None, mode: Optional[Union[str, "OutputDeliveryMode"]] = None, uri: Optional[str] = None, **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -2515,6 +2521,7 @@ def __init__( :paramtype uri: str """ super(AssetJobOutput, self).__init__(**kwargs) + self.asset_name = asset_name self.mode = mode self.uri = uri @@ -3997,7 +4004,7 @@ class FineTuningVertical(msrest.serialization.Model): All required parameters must be populated in order to send to Azure. :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant filled by server. Possible values include: "AzureOpenAI", "Custom". :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider @@ -4020,7 +4027,7 @@ class FineTuningVertical(msrest.serialization.Model): } _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, + 'model': {'key': 'model', 'type': 'JobInput'}, 'model_provider': {'key': 'modelProvider', 'type': 'str'}, 'task_type': {'key': 'taskType', 'type': 'str'}, 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, @@ -4034,7 +4041,7 @@ class FineTuningVertical(msrest.serialization.Model): def __init__( self, *, - model: "MLFlowModelJobInput", + model: "JobInput", task_type: Union[str, "FineTuningTaskType"], training_data: "JobInput", validation_data: Optional["JobInput"] = None, @@ -4042,7 +4049,7 @@ def __init__( ): """ :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", @@ -4067,7 +4074,7 @@ class AzureOpenAiFineTuning(FineTuningVertical): All required parameters must be populated in order to send to Azure. :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant filled by server. Possible values include: "AzureOpenAI", "Custom". :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider @@ -4093,7 +4100,7 @@ class AzureOpenAiFineTuning(FineTuningVertical): } _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, + 'model': {'key': 'model', 'type': 'JobInput'}, 'model_provider': {'key': 'modelProvider', 'type': 'str'}, 'task_type': {'key': 'taskType', 'type': 'str'}, 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, @@ -4104,7 +4111,7 @@ class AzureOpenAiFineTuning(FineTuningVertical): def __init__( self, *, - model: "MLFlowModelJobInput", + model: "JobInput", task_type: Union[str, "FineTuningTaskType"], training_data: "JobInput", validation_data: Optional["JobInput"] = None, @@ -4113,7 +4120,7 @@ def __init__( ): """ :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", @@ -5366,6 +5373,184 @@ def __init__( self.dockerfile_path = dockerfile_path +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + } + + def __init__( + self, + **kwargs + ): + """ + """ + super(ProxyResource, self).__init__(**kwargs) + + +class CapabilityHost(ProxyResource): + """Azure Resource Manager resource envelope. + + 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: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str + :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy + information. + :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData + :ivar properties: Required. [Required] Additional attributes of the entity. + :vartype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'properties': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'properties': {'key': 'properties', 'type': 'CapabilityHostProperties'}, + } + + def __init__( + self, + *, + properties: "CapabilityHostProperties", + **kwargs + ): + """ + :keyword properties: Required. [Required] Additional attributes of the entity. + :paramtype properties: ~azure.mgmt.machinelearningservices.models.CapabilityHostProperties + """ + super(CapabilityHost, self).__init__(**kwargs) + self.properties = properties + + +class CapabilityHostProperties(ResourceBase): + """CapabilityHostProperties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar description: The asset description text. + :vartype description: str + :ivar properties: The asset property dictionary. + :vartype properties: dict[str, str] + :ivar tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :vartype tags: dict[str, str] + :ivar ai_services_connections: List of AI services connections. + :vartype ai_services_connections: list[str] + :ivar capability_host_kind: Kind of this capability host. Possible values include: "Agents". + :vartype capability_host_kind: str or + ~azure.mgmt.machinelearningservices.models.CapabilityHostKind + :ivar customer_subnet: Customer subnet info to help set up this capability host. + :vartype customer_subnet: str + :ivar provisioning_state: Provisioning state for the CapabilityHost. Possible values include: + "Succeeded", "Failed", "Canceled", "Creating", "Updating", "Deleting". + :vartype provisioning_state: str or + ~azure.mgmt.machinelearningservices.models.CapabilityHostProvisioningState + :ivar storage_connections: List of Storage connections. + :vartype storage_connections: list[str] + :ivar vector_store_connections: List of VectorStore connections. + :vartype vector_store_connections: list[str] + """ + + _validation = { + 'provisioning_state': {'readonly': True}, + } + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': '{str}'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'ai_services_connections': {'key': 'aiServicesConnections', 'type': '[str]'}, + 'capability_host_kind': {'key': 'capabilityHostKind', 'type': 'str'}, + 'customer_subnet': {'key': 'customerSubnet', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'storage_connections': {'key': 'storageConnections', 'type': '[str]'}, + 'vector_store_connections': {'key': 'vectorStoreConnections', 'type': '[str]'}, + } + + def __init__( + self, + *, + description: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + tags: Optional[Dict[str, str]] = None, + ai_services_connections: Optional[List[str]] = None, + capability_host_kind: Optional[Union[str, "CapabilityHostKind"]] = None, + customer_subnet: Optional[str] = None, + storage_connections: Optional[List[str]] = None, + vector_store_connections: Optional[List[str]] = None, + **kwargs + ): + """ + :keyword description: The asset description text. + :paramtype description: str + :keyword properties: The asset property dictionary. + :paramtype properties: dict[str, str] + :keyword tags: A set of tags. Tag dictionary. Tags can be added, removed, and updated. + :paramtype tags: dict[str, str] + :keyword ai_services_connections: List of AI services connections. + :paramtype ai_services_connections: list[str] + :keyword capability_host_kind: Kind of this capability host. Possible values include: "Agents". + :paramtype capability_host_kind: str or + ~azure.mgmt.machinelearningservices.models.CapabilityHostKind + :keyword customer_subnet: Customer subnet info to help set up this capability host. + :paramtype customer_subnet: str + :keyword storage_connections: List of Storage connections. + :paramtype storage_connections: list[str] + :keyword vector_store_connections: List of VectorStore connections. + :paramtype vector_store_connections: list[str] + """ + super(CapabilityHostProperties, self).__init__(description=description, properties=properties, tags=tags, **kwargs) + self.ai_services_connections = ai_services_connections + self.capability_host_kind = capability_host_kind + self.customer_subnet = customer_subnet + self.provisioning_state = None + self.storage_connections = storage_connections + self.vector_store_connections = vector_store_connections + + class CapacityConfig(msrest.serialization.Model): """The capacity configuration. @@ -6303,47 +6488,6 @@ def __init__( self.scoring_script = scoring_script -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. Ex - - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.machinelearningservices.models.SystemData - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, - } - - def __init__( - self, - **kwargs - ): - """ - """ - super(ProxyResource, self).__init__(**kwargs) - - class CodeContainer(ProxyResource): """Azure Resource Manager resource envelope. @@ -9576,7 +9720,7 @@ class CustomModelFineTuning(FineTuningVertical): All required parameters must be populated in order to send to Azure. :ivar model: Required. [Required] Input model for fine tuning. - :vartype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :vartype model: ~azure.mgmt.machinelearningservices.models.JobInput :ivar model_provider: Required. [Required] Enum to determine the type of fine tuning.Constant filled by server. Possible values include: "AzureOpenAI", "Custom". :vartype model_provider: str or ~azure.mgmt.machinelearningservices.models.ModelProvider @@ -9601,7 +9745,7 @@ class CustomModelFineTuning(FineTuningVertical): } _attribute_map = { - 'model': {'key': 'model', 'type': 'MLFlowModelJobInput'}, + 'model': {'key': 'model', 'type': 'JobInput'}, 'model_provider': {'key': 'modelProvider', 'type': 'str'}, 'task_type': {'key': 'taskType', 'type': 'str'}, 'training_data': {'key': 'trainingData', 'type': 'JobInput'}, @@ -9612,7 +9756,7 @@ class CustomModelFineTuning(FineTuningVertical): def __init__( self, *, - model: "MLFlowModelJobInput", + model: "JobInput", task_type: Union[str, "FineTuningTaskType"], training_data: "JobInput", validation_data: Optional["JobInput"] = None, @@ -9621,7 +9765,7 @@ def __init__( ): """ :keyword model: Required. [Required] Input model for fine tuning. - :paramtype model: ~azure.mgmt.machinelearningservices.models.MLFlowModelJobInput + :paramtype model: ~azure.mgmt.machinelearningservices.models.JobInput :keyword task_type: Required. [Required] Fine tuning task type. Possible values include: "ChatCompletion", "TextCompletion", "TextClassification", "QuestionAnswering", "TextSummarization", "TokenClassification", "TextTranslation", "ImageClassification", @@ -9786,6 +9930,8 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -9804,6 +9950,7 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -9813,12 +9960,15 @@ class CustomModelJobOutput(JobOutput, AssetJobOutput): def __init__( self, *, + asset_name: Optional[str] = None, mode: Optional[Union[str, "OutputDeliveryMode"]] = None, uri: Optional[str] = None, description: Optional[str] = None, **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -9827,7 +9977,8 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(CustomModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(CustomModelJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) + self.asset_name = asset_name self.mode = mode self.uri = uri self.job_output_type = 'custom_model' # type: str @@ -22606,6 +22757,8 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -22624,6 +22777,7 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -22633,12 +22787,15 @@ class MLFlowModelJobOutput(JobOutput, AssetJobOutput): def __init__( self, *, + asset_name: Optional[str] = None, mode: Optional[Union[str, "OutputDeliveryMode"]] = None, uri: Optional[str] = None, description: Optional[str] = None, **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -22647,7 +22804,8 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLFlowModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLFlowModelJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) + self.asset_name = asset_name self.mode = mode self.uri = uri self.job_output_type = 'mlflow_model' # type: str @@ -22788,6 +22946,8 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -22806,6 +22966,7 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -22815,12 +22976,15 @@ class MLTableJobOutput(JobOutput, AssetJobOutput): def __init__( self, *, + asset_name: Optional[str] = None, mode: Optional[Union[str, "OutputDeliveryMode"]] = None, uri: Optional[str] = None, description: Optional[str] = None, **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -22829,7 +22993,8 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(MLTableJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(MLTableJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) + self.asset_name = asset_name self.mode = mode self.uri = uri self.job_output_type = 'mltable' # type: str @@ -30415,8 +30580,6 @@ def __init__( class ServiceTagDestination(msrest.serialization.Model): """Service Tag destination for a Service Tag Outbound Rule for the managed network of a machine learning workspace. - Variables are only populated by the server, and will be ignored when sending a request. - :ivar action: The action enum for networking rule. Possible values include: "Allow", "Deny". :vartype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction :ivar address_prefixes: Optional, if provided, the ServiceTag property will be ignored. @@ -30429,10 +30592,6 @@ class ServiceTagDestination(msrest.serialization.Model): :vartype service_tag: str """ - _validation = { - 'address_prefixes': {'readonly': True}, - } - _attribute_map = { 'action': {'key': 'action', 'type': 'str'}, 'address_prefixes': {'key': 'addressPrefixes', 'type': '[str]'}, @@ -30445,6 +30604,7 @@ def __init__( self, *, action: Optional[Union[str, "RuleAction"]] = None, + address_prefixes: Optional[List[str]] = None, port_ranges: Optional[str] = None, protocol: Optional[str] = None, service_tag: Optional[str] = None, @@ -30453,6 +30613,8 @@ def __init__( """ :keyword action: The action enum for networking rule. Possible values include: "Allow", "Deny". :paramtype action: str or ~azure.mgmt.machinelearningservices.models.RuleAction + :keyword address_prefixes: Optional, if provided, the ServiceTag property will be ignored. + :paramtype address_prefixes: list[str] :keyword port_ranges: :paramtype port_ranges: str :keyword protocol: @@ -30462,7 +30624,7 @@ def __init__( """ super(ServiceTagDestination, self).__init__(**kwargs) self.action = action - self.address_prefixes = None + self.address_prefixes = address_prefixes self.port_ranges = port_ranges self.protocol = protocol self.service_tag = service_tag @@ -33033,6 +33195,8 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -33051,6 +33215,7 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -33060,12 +33225,15 @@ class TritonModelJobOutput(JobOutput, AssetJobOutput): def __init__( self, *, + asset_name: Optional[str] = None, mode: Optional[Union[str, "OutputDeliveryMode"]] = None, uri: Optional[str] = None, description: Optional[str] = None, **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -33074,7 +33242,8 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(TritonModelJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(TritonModelJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) + self.asset_name = asset_name self.mode = mode self.uri = uri self.job_output_type = 'triton_model' # type: str @@ -33348,6 +33517,8 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -33366,6 +33537,7 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -33375,12 +33547,15 @@ class UriFileJobOutput(JobOutput, AssetJobOutput): def __init__( self, *, + asset_name: Optional[str] = None, mode: Optional[Union[str, "OutputDeliveryMode"]] = None, uri: Optional[str] = None, description: Optional[str] = None, **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -33389,7 +33564,8 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFileJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFileJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) + self.asset_name = asset_name self.mode = mode self.uri = uri self.job_output_type = 'uri_file' # type: str @@ -33523,6 +33699,8 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): All required parameters must be populated in order to send to Azure. + :ivar asset_name: Output Asset Name. + :vartype asset_name: str :ivar mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :vartype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -33541,6 +33719,7 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): } _attribute_map = { + 'asset_name': {'key': 'assetName', 'type': 'str'}, 'mode': {'key': 'mode', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, @@ -33550,12 +33729,15 @@ class UriFolderJobOutput(JobOutput, AssetJobOutput): def __init__( self, *, + asset_name: Optional[str] = None, mode: Optional[Union[str, "OutputDeliveryMode"]] = None, uri: Optional[str] = None, description: Optional[str] = None, **kwargs ): """ + :keyword asset_name: Output Asset Name. + :paramtype asset_name: str :keyword mode: Output Asset Delivery Mode. Possible values include: "ReadWriteMount", "Upload", "Direct". :paramtype mode: str or ~azure.mgmt.machinelearningservices.models.OutputDeliveryMode @@ -33564,7 +33746,8 @@ def __init__( :keyword description: Description for the output. :paramtype description: str """ - super(UriFolderJobOutput, self).__init__(description=description, mode=mode, uri=uri, **kwargs) + super(UriFolderJobOutput, self).__init__(description=description, asset_name=asset_name, mode=mode, uri=uri, **kwargs) + self.asset_name = asset_name self.mode = mode self.uri = uri self.job_output_type = 'uri_folder' # type: str diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/operations/__init__.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/operations/__init__.py index 72934f488435..c75142ae9e4e 100644 --- a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/operations/__init__.py +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/operations/__init__.py @@ -25,6 +25,7 @@ from ._registry_model_versions_operations import RegistryModelVersionsOperations from ._batch_endpoints_operations import BatchEndpointsOperations from ._batch_deployments_operations import BatchDeploymentsOperations +from ._capability_hosts_operations import CapabilityHostsOperations from ._code_containers_operations import CodeContainersOperations from ._code_versions_operations import CodeVersionsOperations from ._component_containers_operations import ComponentContainersOperations @@ -89,6 +90,7 @@ 'RegistryModelVersionsOperations', 'BatchEndpointsOperations', 'BatchDeploymentsOperations', + 'CapabilityHostsOperations', 'CodeContainersOperations', 'CodeVersionsOperations', 'ComponentContainersOperations', diff --git a/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/operations/_capability_hosts_operations.py b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/operations/_capability_hosts_operations.py new file mode 100644 index 000000000000..88d99b49e5d4 --- /dev/null +++ b/sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/v2024_10_01_preview/operations/_capability_hosts_operations.py @@ -0,0 +1,504 @@ +# 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.polling import LROPoller, NoPolling, PollingMethod +from azure.core.rest import HttpRequest +from azure.core.tracing.decorator import distributed_trace +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +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, Union + 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_delete_request_initial( + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), + "name": _SERIALIZER.url("name", 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') + + # 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 + ) + + +def build_get_request( + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), + "name": _SERIALIZER.url("name", 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') + + # 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_initial( + subscription_id, # type: str + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + **kwargs # type: Any +): + # type: (...) -> HttpRequest + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + content_type = kwargs.pop('content_type', None) # type: Optional[str] + + accept = "application/json" + # Construct URL + _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}") # pylint: disable=line-too-long + path_format_arguments = { + "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, 'str', min_length=1), + "resourceGroupName": _SERIALIZER.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9_-]{2,32}$'), + "name": _SERIALIZER.url("name", name, 'str', pattern=r'^[a-zA-Z0-9][a-zA-Z0-9\-_]{0,254}$'), + } + + _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 CapabilityHostsOperations(object): + """CapabilityHostsOperations 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 + + def _delete_initial( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + 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-10-01-preview") # type: str + + + request = build_delete_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + template_url=self._delete_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) + response_headers['Location']=self._deserialize('str', response.headers.get('Location')) + response_headers['Retry-After']=self._deserialize('int', response.headers.get('Retry-After')) + + + if cls: + return cls(pipeline_response, None, response_headers) + + _delete_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + + @distributed_trace + def begin_delete( # pylint: disable=inconsistent-return-statements + self, + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Delete capabilityHost. + + Delete capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param name: CapabilityHost name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_delete.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + @distributed_trace + def get( + self, + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_models.CapabilityHost" + """Get capabilityHost. + + Get capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param name: CapabilityHost name. + :type name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CapabilityHost, or the result of cls(response) + :rtype: ~azure.mgmt.machinelearningservices.models.CapabilityHost + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + + + request = build_get_request( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + template_url=self.get.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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.ErrorResponse, pipeline_response) + raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) + + deserialized = self._deserialize('CapabilityHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + + get.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + + def _create_or_update_initial( + self, + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + body, # type: "_models.CapabilityHost" + **kwargs # type: Any + ): + # type: (...) -> "_models.CapabilityHost" + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + + _json = self._serialize.body(body, 'CapabilityHost') + + request = build_create_or_update_request_initial( + subscription_id=self._config.subscription_id, + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + api_version=api_version, + content_type=content_type, + json=_json, + template_url=self._create_or_update_initial.metadata['url'], + ) + request = _convert_request(request) + request.url = self._client.format_url(request.url) + + 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) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 200: + deserialized = self._deserialize('CapabilityHost', pipeline_response) + + if response.status_code == 201: + response_headers['x-ms-async-operation-timeout']=self._deserialize('duration', response.headers.get('x-ms-async-operation-timeout')) + response_headers['Azure-AsyncOperation']=self._deserialize('str', response.headers.get('Azure-AsyncOperation')) + + deserialized = self._deserialize('CapabilityHost', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, response_headers) + + return deserialized + + _create_or_update_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore + + + @distributed_trace + def begin_create_or_update( + self, + resource_group_name, # type: str + workspace_name, # type: str + name, # type: str + body, # type: "_models.CapabilityHost" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_models.CapabilityHost"] + """Create or update capabilityHost. + + Create or update capabilityHost. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param workspace_name: Name of Azure Machine Learning workspace. + :type workspace_name: str + :param name: CapabilityHost name. + :type name: str + :param body: CapabilityHost definition. + :type body: ~azure.mgmt.machinelearningservices.models.CapabilityHost + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. Pass in False for this + operation to not poll, or pass in your own initialized polling object for a personal polling + strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no + Retry-After header is present. + :return: An instance of LROPoller that returns either CapabilityHost or the result of + cls(response) + :rtype: + ~azure.core.polling.LROPoller[~azure.mgmt.machinelearningservices.models.CapabilityHost] + :raises: ~azure.core.exceptions.HttpResponseError + """ + api_version = kwargs.pop('api_version', "2024-10-01-preview") # type: str + content_type = kwargs.pop('content_type', "application/json") # type: Optional[str] + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CapabilityHost"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + workspace_name=workspace_name, + name=name, + body=body, + api_version=api_version, + content_type=content_type, + cls=lambda x,y,z: x, + **kwargs + ) + kwargs.pop('error_map', None) + + def get_long_running_output(pipeline_response): + response = pipeline_response.http_response + deserialized = self._deserialize('CapabilityHost', pipeline_response) + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + + if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'original-uri'}, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + + begin_create_or_update.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}"} # type: ignore diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json index 6441dc64c8c1..3f21c8c0b78e 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/mfe.json @@ -4136,6 +4136,214 @@ } } }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/capabilityHosts/{name}": { + "delete": { + "tags": [ + "CapabilityHost" + ], + "summary": "Delete capabilityHost.", + "operationId": "CapabilityHosts_Delete", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "machineLearningServices.json#/parameters/WorkspaceNameParameter" + }, + { + "in": "path", + "name": "name", + "description": "CapabilityHost name.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "202": { + "description": "Accepted", + "headers": { + "x-ms-async-operation-timeout": { + "description": "Timeout for the client to use when polling the asynchronous operation.", + "type": "string", + "format": "duration" + }, + "Location": { + "description": "URI to poll for asynchronous operation result.", + "type": "string" + }, + "Retry-After": { + "description": "Duration the client should wait between requests, in seconds.", + "type": "integer", + "format": "int32", + "maximum": 600, + "minimum": 10 + } + } + }, + "204": { + "description": "No Content" + }, + "default": { + "description": "Error", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Delete CapabilityHost.": { + "$ref": "./examples/CapabilityHost/delete.json" + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "location" + } + }, + "get": { + "tags": [ + "CapabilityHost" + ], + "summary": "Get capabilityHost.", + "operationId": "CapabilityHosts_Get", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "machineLearningServices.json#/parameters/WorkspaceNameParameter" + }, + { + "in": "path", + "name": "name", + "description": "CapabilityHost name.", + "required": true, + "type": "string" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/CapabilityHostResource" + } + }, + "default": { + "description": "Error", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "Get CapabilityHost.": { + "$ref": "./examples/CapabilityHost/get.json" + } + } + }, + "put": { + "tags": [ + "CapabilityHost" + ], + "summary": "Create or update capabilityHost.", + "operationId": "CapabilityHosts_CreateOrUpdate", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "machineLearningServices.json#/parameters/WorkspaceNameParameter" + }, + { + "in": "path", + "name": "name", + "description": "CapabilityHost name.", + "required": true, + "type": "string", + "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,254}$" + }, + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" + }, + { + "in": "body", + "name": "body", + "description": "CapabilityHost definition.", + "required": true, + "schema": { + "$ref": "#/definitions/CapabilityHostResource" + } + } + ], + "responses": { + "200": { + "description": "Create or update request is successful.", + "schema": { + "$ref": "#/definitions/CapabilityHostResource" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/CapabilityHostResource" + }, + "headers": { + "x-ms-async-operation-timeout": { + "description": "Timeout for the client to use when polling the asynchronous operation.", + "type": "string", + "format": "duration" + }, + "Azure-AsyncOperation": { + "description": "URI to poll for asynchronous operation status.", + "type": "string" + } + } + }, + "default": { + "description": "Error", + "schema": { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + } + } + }, + "x-ms-examples": { + "CreateOrUpdate CapabilityHost.": { + "$ref": "./examples/CapabilityHost/createOrUpdate.json" + } + }, + "x-ms-long-running-operation": true, + "x-ms-long-running-operation-options": { + "final-state-via": "original-uri" + } + } + }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/codes": { "get": { "tags": [ @@ -13701,6 +13909,11 @@ "description": "Asset output type.", "type": "object", "properties": { + "assetName": { + "description": "Output Asset Name.", + "type": "string", + "x-nullable": true + }, "mode": { "description": "Output Asset Delivery Mode.", "default": "ReadWriteMount", @@ -14789,6 +15002,134 @@ }, "additionalProperties": false }, + "CapabilityHost": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/ResourceBase" + } + ], + "properties": { + "aiServicesConnections": { + "description": "List of AI services connections.", + "type": "array", + "items": { + "type": "string" + }, + "x-nullable": true + }, + "capabilityHostKind": { + "description": "Kind of this capability host.", + "default": "Agents", + "$ref": "#/definitions/CapabilityHostKind" + }, + "customerSubnet": { + "description": "Customer subnet info to help set up this capability host.", + "type": "string", + "x-nullable": true + }, + "provisioningState": { + "description": "Provisioning state for the CapabilityHost.", + "$ref": "#/definitions/CapabilityHostProvisioningState", + "readOnly": true, + "x-ms-mutability": [ + "read" + ] + }, + "storageConnections": { + "description": "List of Storage connections.", + "type": "array", + "items": { + "type": "string" + }, + "x-nullable": true + }, + "vectorStoreConnections": { + "description": "List of VectorStore connections.", + "type": "array", + "items": { + "type": "string" + }, + "x-nullable": true + } + }, + "x-ms-client-name": "CapabilityHostProperties", + "additionalProperties": false + }, + "CapabilityHostKind": { + "enum": [ + "Agents" + ], + "type": "string", + "x-ms-enum": { + "name": "CapabilityHostKind", + "modelAsString": true, + "values": [ + { + "value": "Agents" + } + ] + }, + "additionalProperties": false + }, + "CapabilityHostProvisioningState": { + "description": "Provisioning state of capability host.", + "enum": [ + "Succeeded", + "Failed", + "Canceled", + "Creating", + "Updating", + "Deleting" + ], + "type": "string", + "readOnly": true, + "x-ms-enum": { + "name": "CapabilityHostProvisioningState", + "modelAsString": true, + "values": [ + { + "value": "Succeeded" + }, + { + "value": "Failed" + }, + { + "value": "Canceled" + }, + { + "value": "Creating" + }, + { + "value": "Updating" + }, + { + "value": "Deleting" + } + ] + }, + "additionalProperties": false + }, + "CapabilityHostResource": { + "description": "Azure Resource Manager resource envelope.", + "required": [ + "properties" + ], + "type": "object", + "allOf": [ + { + "$ref": "../../../../../common-types/resource-management/v3/types.json#/definitions/ProxyResource" + } + ], + "properties": { + "properties": { + "description": "[Required] Additional attributes of the entity.", + "$ref": "#/definitions/CapabilityHost" + } + }, + "x-ms-client-name": "CapabilityHost", + "additionalProperties": false + }, "CategoricalDataDriftMetric": { "enum": [ "JensenShannonDistance", @@ -18485,7 +18826,7 @@ "properties": { "model": { "description": "[Required] Input model for fine tuning.", - "$ref": "#/definitions/MLFlowModelJobInput" + "$ref": "#/definitions/JobInput" }, "modelProvider": { "description": "[Required] Enum to determine the type of fine tuning.", diff --git a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/workspaceRP.json b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/workspaceRP.json index af745eaae9a6..2782370f07eb 100644 --- a/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/workspaceRP.json +++ b/sdk/ml/azure-ai-ml/swagger/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/preview/2024-10-01-preview/workspaceRP.json @@ -6517,8 +6517,7 @@ "type": "array", "items": { "type": "string" - }, - "readOnly": true + } }, "portRanges": { "type": "string"