:py:mod:`rhino_health.lib.endpoints.code_object.code_object_endpoints` ====================================================================== .. py:module:: rhino_health.lib.endpoints.code_object.code_object_endpoints Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: rhino_health.lib.endpoints.code_object.code_object_endpoints.CodeObjectEndpoints .. py:class:: CodeObjectEndpoints(session) Bases: :py:obj:`LTSCodeObjectEndpoints` Endpoints for interacting with CodeObjects .. !! processed by numpydoc !! .. py:method:: run_code_object(code_object: rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObjectRunInput) -> Union[rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObjectRunSyncResponse, rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObjectRunAsyncResponse] Returns the result of starting a CodeRun .. warning:: This feature is under development and the return response may change :Parameters: **code_object: CodeObjectRunInput** CodeObjectRunInput data class :Returns: run_response: Union[CodeObjectRunSyncResponse, CodeObjectRunAsyncResponse] Response dataclass depending on if the request was run synchronously .. seealso:: :obj:`rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObjectRunSyncResponse` CodeObjectRunSyncResponse Dataclass :obj:`rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObjectRunAsyncResponse` CodeObjectRunAsyncResponse Dataclass .. rubric:: Examples >>> run_response = session.code_object.code_object(run_code_object_input) CodeObjectRunSyncResponse() >>> run_response.code_run CodeRun() .. !! processed by numpydoc !! .. py:method:: train_model(model: rhino_health.lib.endpoints.code_object.code_object_dataclass.ModelTrainInput) Starts training a NVFlare Model .. warning:: This feature is under development and the return response may change :Parameters: **model: ModelTrainInput** ModelTrainInput data class :Returns: run_response: ModelTrainAsyncResponse Response dataclass .. seealso:: :obj:`rhino_health.lib.endpoints.code_object.code_object_dataclass.ModelTrainAsyncResponse` ModelTrainAsyncResponse Dataclass .. rubric:: Examples >>> session.code_object.train_model(model_train_input) ModelTrainAsyncResponse() .. !! processed by numpydoc !! .. py:method:: create_code_object(code_object: rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObjectCreateInput, return_existing=True, add_version_if_exists=False) Starts the creation of a new CodeObject on the platform. .. warning:: This feature is under development and the interface may change :Parameters: **code_object: CodeObjectCreateInput** CodeObjectCreateInput data class **return_existing: bool** If a CodeObject with the name already exists, return it instead of creating one. Takes precedence over add_version_if_exists **add_version_if_exists** If a CodeObject with the name already exists, create a new version. :Returns: code_object: CodeObject CodeObject dataclass .. rubric:: Examples >>> session.code_object.create_code_object(create_code_object_input) CodeObject() .. !! processed by numpydoc !! .. py:method:: get_code_object(code_object_uid: str) Returns a CodeObject dataclass :Parameters: **code_object_uid: str** UID for the CodeObject :Returns: code_object: CodeObject CodeObject dataclass .. rubric:: Examples >>> session.code_object.get_code_object(my_code_object_uid) CodeObject() .. !! processed by numpydoc !! .. py:method:: get_code_object_by_name(name, version=VersionMode.LATEST, project_uid=None) -> Optional[rhino_health.lib.endpoints.code_object.code_object_dataclass.CodeObject] Returns the latest or a specific CodeObject dataclass .. warning:: VersionMode.ALL will return the same as VersionMode.LATEST :Parameters: **name: str** Full name for the CodeObject **version: Optional[Union[int, VersionMode]]** Version of the CodeObject, latest by default, for an earlier version pass in an integer **project_uid: Optional[str]** Project UID to search under :Returns: code_object: Optional[CodeObject] CodeObject with the name or None if not found .. rubric:: Examples >>> session.code_object.get_code_object_by_name("My CodeObject") CodeObject(name="My CodeObject") .. !! processed by numpydoc !! .. py:method:: search_for_code_objects_by_name(name, version: Optional[Union[int, rhino_health.lib.endpoints.endpoint.VersionMode]] = VersionMode.LATEST, project_uid: Optional[str] = None, name_filter_mode: Optional[rhino_health.lib.endpoints.endpoint.NameFilterMode] = NameFilterMode.CONTAINS) Returns CodeObject dataclasses :Parameters: **name: str** Full or partial name for the CodeObject **version: Optional[Union[int, VersionMode]]** Version of the CodeObject, latest by default **project_uid: Optional[str]** Project UID to search under **name_filter_mode: Optional[NameFilterMode]** Only return results with the specified filter mode. By default uses CONTAINS :Returns: code_objects: List[CodeObject] CodeObject dataclasses that match the name .. seealso:: :obj:`rhino_health.lib.endpoints.endpoint.FilterMode` Different modes to filter by :obj:`rhino_health.lib.endpoints.endpoint.VersionMode` Which version to return .. rubric:: Examples >>> session.code_object.search_for_code_objects_by_name("My CodeObject") [CodeObject(name="My CodeObject)] .. !! processed by numpydoc !! .. py:method:: get_build_logs(code_object_uid: str) Returns logs for building the CodeObject :Parameters: **code_object_uid: str** UID for the CodeObject :Returns: build_logs: str .. .. rubric:: Examples >>> session.code_object.get_build_logs(my_code_object_uid) "Starting to build..." .. !! processed by numpydoc !!