diff options
| author | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
|---|---|---|
| committer | S. Solomon Darnell | 2025-03-28 21:52:21 -0500 |
| commit | 4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch) | |
| tree | ee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/service_instance.py | |
| parent | cc961e04ba734dd72309fb548a2f97d67d578813 (diff) | |
| download | gn-ai-master.tar.gz | |
Diffstat (limited to '.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/service_instance.py')
| -rw-r--r-- | .venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/service_instance.py | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/service_instance.py b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/service_instance.py new file mode 100644 index 00000000..0e5ba6c6 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/azure/ai/ml/entities/_job/service_instance.py @@ -0,0 +1,59 @@ +# --------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# --------------------------------------------------------- + +import logging +from typing import Any, Dict, Optional + +from azure.ai.ml._restclient.runhistory.models import ServiceInstanceResult +from azure.ai.ml.entities._mixins import DictMixin, RestTranslatableMixin + +module_logger = logging.getLogger(__name__) + + +class ServiceInstance(RestTranslatableMixin, DictMixin): + """Service Instance Result. + + :keyword type: The type of service. + :paramtype type: Optional[str] + :keyword port: The port used by the service. + :paramtype port: Optional[int] + :keyword status: The status of the service. + :paramtype status: Optional[str] + :keyword error: The error message. + :paramtype error: Optional[str] + :keyword endpoint: The service endpoint. + :paramtype endpoint: Optional[str] + :keyword properties: The service instance's properties. + :paramtype properties: Optional[dict[str, str]] + """ + + def __init__( + self, # pylint: disable=unused-argument + *, + type: Optional[str] = None, # pylint: disable=redefined-builtin + port: Optional[int] = None, + status: Optional[str] = None, + error: Optional[str] = None, + endpoint: Optional[str] = None, + properties: Optional[Dict[str, str]] = None, + **kwargs: Any + ) -> None: + self.type = type + self.port = port + self.status = status + self.error = error + self.endpoint = endpoint + self.properties = properties + + @classmethod + # pylint: disable=arguments-differ + def _from_rest_object(cls, obj: ServiceInstanceResult, node_index: int) -> "ServiceInstance": # type: ignore + return cls( + type=obj.type, + port=obj.port, + status=obj.status, + error=obj.error.error.message if obj.error and obj.error.error else None, + endpoint=obj.endpoint.replace("<nodeIndex>", str(node_index)) if obj.endpoint else obj.endpoint, + properties=obj.properties, + ) |
