diff --git a/docs/api/index.rst b/docs/api/index.rst deleted file mode 100644 index f746a47d8..000000000 --- a/docs/api/index.rst +++ /dev/null @@ -1,135 +0,0 @@ -API Reference -============= - -This section contains detailed API documentation for the Runloop SDK. - -.. toctree:: - :maxdepth: 2 - - typedicts - -SDK Classes ------------ - -Synchronous SDK -~~~~~~~~~~~~~~~ - -.. autoclass:: runloop_api_client.RunloopSDK - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.sync.DevboxOps - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.sync.BlueprintOps - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.sync.SnapshotOps - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.sync.StorageObjectOps - :members: - :undoc-members: - :show-inheritance: - -Resource Classes -~~~~~~~~~~~~~~~~ - -.. autoclass:: runloop_api_client.sdk.devbox.Devbox - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.blueprint.Blueprint - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.snapshot.Snapshot - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.storage_object.StorageObject - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.execution.Execution - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.execution_result.ExecutionResult - :members: - :undoc-members: - :show-inheritance: - -Asynchronous SDK -~~~~~~~~~~~~~~~~ - -.. autoclass:: runloop_api_client.AsyncRunloopSDK - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_.AsyncDevboxOps - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_.AsyncBlueprintOps - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_.AsyncSnapshotOps - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_.AsyncStorageObjectOps - :members: - :undoc-members: - :show-inheritance: - -Asynchronous Resource Classes -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. autoclass:: runloop_api_client.sdk.async_devbox.AsyncDevbox - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_blueprint.AsyncBlueprint - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_snapshot.AsyncSnapshot - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_storage_object.AsyncStorageObject - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_execution.AsyncExecution - :members: - :undoc-members: - :show-inheritance: - -.. autoclass:: runloop_api_client.sdk.async_execution_result.AsyncExecutionResult - :members: - :undoc-members: - :show-inheritance: - diff --git a/docs/conf.py b/docs/conf.py index 8b685cd7a..80794e562 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,7 +15,6 @@ project = "Runloop Python SDK" copyright = "2025, Runloop" author = "Runloop" -release = "0.68.0" # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -40,18 +39,9 @@ # -- Extension configuration ------------------------------------------------- -# Napoleon settings -napoleon_google_docstring = False -napoleon_numpy_docstring = False -napoleon_use_param = True -napoleon_use_rtype = True -napoleon_use_ivar = True - # Autodoc settings autodoc_default_options = { "members": None, - "undoc-members": None, - "show-inheritance": None, } autodoc_typehints = "description" @@ -60,5 +50,4 @@ # Intersphinx mapping intersphinx_mapping = { "python": ("https://docs.python.org/3", None), - "httpx": ("https://www.python-httpx.org", None), } diff --git a/docs/index.rst b/docs/index.rst index d082e4e74..30e7043bb 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,7 +9,7 @@ and asynchronous variants to match your runtime requirements. :maxdepth: 2 :caption: Contents: - api/index + sdk/index Installation ------------ @@ -42,16 +42,16 @@ Asynchronous Example .. code-block:: python + import asyncio from runloop_api_client import AsyncRunloopSDK async def main(): runloop = AsyncRunloopSDK() - async with runloop.devbox.create(name="my-devbox") as devbox: + async with await runloop.devbox.create(name="my-devbox") as devbox: result = await devbox.cmd.exec(command="echo 'Hello from Runloop!'") print(await result.stdout()) - import asyncio asyncio.run(main()) Indices and tables diff --git a/docs/sdk/async/blueprint.rst b/docs/sdk/async/blueprint.rst new file mode 100644 index 000000000..c28afd382 --- /dev/null +++ b/docs/sdk/async/blueprint.rst @@ -0,0 +1,8 @@ +Blueprint +========= + +The ``AsyncBlueprint`` class provides asynchronous methods for managing devbox blueprints. + +.. automodule:: runloop_api_client.sdk.async_blueprint + :members: + diff --git a/docs/sdk/async/devbox.rst b/docs/sdk/async/devbox.rst new file mode 100644 index 000000000..ef04443d7 --- /dev/null +++ b/docs/sdk/async/devbox.rst @@ -0,0 +1,8 @@ +Devbox +====== + +The ``AsyncDevbox`` class provides asynchronous methods for managing and interacting with a devbox instance. + +.. automodule:: runloop_api_client.sdk.async_devbox + :members: + diff --git a/docs/sdk/async/execution.rst b/docs/sdk/async/execution.rst new file mode 100644 index 000000000..988688094 --- /dev/null +++ b/docs/sdk/async/execution.rst @@ -0,0 +1,8 @@ +Execution +========= + +The ``AsyncExecution`` class represents an asynchronous command execution in progress. + +.. automodule:: runloop_api_client.sdk.async_execution + :members: + diff --git a/docs/sdk/async/execution_result.rst b/docs/sdk/async/execution_result.rst new file mode 100644 index 000000000..e2f6f3ad1 --- /dev/null +++ b/docs/sdk/async/execution_result.rst @@ -0,0 +1,8 @@ +Execution Result +================ + +The ``AsyncExecutionResult`` class represents the result of a completed command execution. + +.. automodule:: runloop_api_client.sdk.async_execution_result + :members: + diff --git a/docs/sdk/async/index.rst b/docs/sdk/async/index.rst new file mode 100644 index 000000000..1d92ea76f --- /dev/null +++ b/docs/sdk/async/index.rst @@ -0,0 +1,29 @@ +Asynchronous SDK +================ + +The asynchronous SDK provides a non-blocking interface for managing devboxes, blueprints, snapshots, and storage objects. Use this variant when working with async/await Python code. + +Core Module +----------- + +The core asynchronous SDK module provides async operation classes. + +.. autoclass:: runloop_api_client.sdk.async_.AsyncRunloopSDK + +.. automodule:: runloop_api_client.sdk.async_ + +Resource Modules +---------------- + +Asynchronous resource classes for working with devboxes, blueprints, snapshots, and more. + +.. toctree:: + :maxdepth: 1 + + devbox + execution + execution_result + blueprint + snapshot + storage_object + diff --git a/docs/sdk/async/snapshot.rst b/docs/sdk/async/snapshot.rst new file mode 100644 index 000000000..75826695a --- /dev/null +++ b/docs/sdk/async/snapshot.rst @@ -0,0 +1,8 @@ +Snapshot +======== + +The ``AsyncSnapshot`` class provides asynchronous methods for managing devbox snapshots. + +.. automodule:: runloop_api_client.sdk.async_snapshot + :members: + diff --git a/docs/sdk/async/storage_object.rst b/docs/sdk/async/storage_object.rst new file mode 100644 index 000000000..bc7f79b35 --- /dev/null +++ b/docs/sdk/async/storage_object.rst @@ -0,0 +1,8 @@ +Storage Object +============== + +The ``AsyncStorageObject`` class provides asynchronous methods for managing storage objects. + +.. automodule:: runloop_api_client.sdk.async_storage_object + :members: + diff --git a/docs/sdk/index.rst b/docs/sdk/index.rst new file mode 100644 index 000000000..0151a89d3 --- /dev/null +++ b/docs/sdk/index.rst @@ -0,0 +1,14 @@ +SDK Reference +============= + +This section contains detailed documentation for the Runloop SDK. + +The Runloop SDK provides both synchronous and asynchronous interfaces for managing devboxes, blueprints, snapshots, and storage objects. Choose the variant that matches your application's runtime requirements. + +.. toctree:: + :maxdepth: 2 + :caption: SDK Documentation + + sync/index + async/index + types diff --git a/docs/sdk/sync/blueprint.rst b/docs/sdk/sync/blueprint.rst new file mode 100644 index 000000000..c7e250285 --- /dev/null +++ b/docs/sdk/sync/blueprint.rst @@ -0,0 +1,8 @@ +Blueprint +========= + +The ``Blueprint`` class provides synchronous methods for managing devbox blueprints. + +.. automodule:: runloop_api_client.sdk.blueprint + :members: + diff --git a/docs/sdk/sync/devbox.rst b/docs/sdk/sync/devbox.rst new file mode 100644 index 000000000..ca60c6993 --- /dev/null +++ b/docs/sdk/sync/devbox.rst @@ -0,0 +1,8 @@ +Devbox +====== + +The ``Devbox`` class provides synchronous methods for managing and interacting with a devbox instance. + +.. automodule:: runloop_api_client.sdk.devbox + :members: + diff --git a/docs/sdk/sync/execution.rst b/docs/sdk/sync/execution.rst new file mode 100644 index 000000000..8159eae1e --- /dev/null +++ b/docs/sdk/sync/execution.rst @@ -0,0 +1,8 @@ +Execution +========= + +The ``Execution`` class represents an asynchronous command execution in progress. + +.. automodule:: runloop_api_client.sdk.execution + :members: + diff --git a/docs/sdk/sync/execution_result.rst b/docs/sdk/sync/execution_result.rst new file mode 100644 index 000000000..92496683a --- /dev/null +++ b/docs/sdk/sync/execution_result.rst @@ -0,0 +1,8 @@ +Execution Result +================ + +The ``ExecutionResult`` class represents the result of a completed command execution. + +.. automodule:: runloop_api_client.sdk.execution_result + :members: + diff --git a/docs/sdk/sync/index.rst b/docs/sdk/sync/index.rst new file mode 100644 index 000000000..c77646f2a --- /dev/null +++ b/docs/sdk/sync/index.rst @@ -0,0 +1,29 @@ +Synchronous SDK +=============== + +The synchronous SDK provides a blocking interface for managing devboxes, blueprints, snapshots, and storage objects. Use this variant when working in synchronous Python code. + +Core Module +----------- + +The core synchronous SDK module provides the main entry point and operation classes. + +.. autoclass:: runloop_api_client.sdk.sync.RunloopSDK + +.. automodule:: runloop_api_client.sdk.sync + +Resource Modules +---------------- + +Synchronous resource classes for working with devboxes, blueprints, snapshots, and more. + +.. toctree:: + :maxdepth: 1 + + devbox + execution + execution_result + blueprint + snapshot + storage_object + diff --git a/docs/sdk/sync/snapshot.rst b/docs/sdk/sync/snapshot.rst new file mode 100644 index 000000000..6b0bb358d --- /dev/null +++ b/docs/sdk/sync/snapshot.rst @@ -0,0 +1,8 @@ +Snapshot +======== + +The ``Snapshot`` class provides synchronous methods for managing devbox snapshots. + +.. automodule:: runloop_api_client.sdk.snapshot + :members: + diff --git a/docs/sdk/sync/storage_object.rst b/docs/sdk/sync/storage_object.rst new file mode 100644 index 000000000..97b4bb77d --- /dev/null +++ b/docs/sdk/sync/storage_object.rst @@ -0,0 +1,8 @@ +Storage Object +============== + +The ``StorageObject`` class provides synchronous methods for managing storage objects. + +.. automodule:: runloop_api_client.sdk.storage_object + :members: + diff --git a/docs/api/typedicts.rst b/docs/sdk/types.rst similarity index 71% rename from docs/api/typedicts.rst rename to docs/sdk/types.rst index 8a15d4304..ba46d7ef2 100644 --- a/docs/api/typedicts.rst +++ b/docs/sdk/types.rst @@ -1,17 +1,12 @@ -TypedDict Reference -=================== +Type Reference +============== -This page documents all TypedDict parameter types used throughout the SDK. -These typed dictionaries define the structure of parameters passed to SDK methods. - -SDK TypedDicts --------------- - -These are the primary TypedDict classes used in SDK methods, combining multiple -parameter types and options. +This page documents all TypeDict parameter types used throughout the SDK. Core Request Options -~~~~~~~~~~~~~~~~~~~~ +-------------------- + +These TypeDicts define options for streaming, timeouts, polling, and other request configuration. .. autotypeddict:: runloop_api_client.sdk._types.ExecuteStreamingCallbacks @@ -24,16 +19,27 @@ Core Request Options .. autotypeddict:: runloop_api_client.sdk._types.LongPollingRequestOptions Devbox Parameters -~~~~~~~~~~~~~~~~~ +----------------- + +These TypeDicts define parameters for devbox creation, execution, file operations, network tunnels, and snapshots. + +Creation Parameters +~~~~~~~~~~~~~~~~~~~ .. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxCreateParams -.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxExtraCreateParams +.. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams + +Execution Parameters +~~~~~~~~~~~~~~~~~~~~ .. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxExecuteParams .. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxExecuteAsyncParams +Listing Parameters +~~~~~~~~~~~~~~~~~~ + .. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxListParams File Operation Parameters @@ -47,8 +53,8 @@ File Operation Parameters .. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxUploadFileParams -Network Operation Parameters -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Network Tunnel Parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~ .. autotypeddict:: runloop_api_client.sdk._types.SDKDevboxCreateTunnelParams @@ -66,14 +72,18 @@ Snapshot Parameters .. autotypeddict:: runloop_api_client.sdk._types.SDKDiskSnapshotUpdateParams Blueprint Parameters -~~~~~~~~~~~~~~~~~~~~ +-------------------- + +These TypeDicts define parameters for blueprint creation and listing. .. autotypeddict:: runloop_api_client.sdk._types.SDKBlueprintCreateParams .. autotypeddict:: runloop_api_client.sdk._types.SDKBlueprintListParams Storage Object Parameters -~~~~~~~~~~~~~~~~~~~~~~~~~ +------------------------- + +These TypeDicts define parameters for storage object creation, listing, and downloading. .. autotypeddict:: runloop_api_client.sdk._types.SDKObjectCreateParams diff --git a/src/runloop_api_client/sdk/_types.py b/src/runloop_api_client/sdk/_types.py index 72ede0da1..7ac404055 100644 --- a/src/runloop_api_client/sdk/_types.py +++ b/src/runloop_api_client/sdk/_types.py @@ -68,7 +68,7 @@ class SDKDevboxCreateParams(DevboxCreateParams, LongPollingRequestOptions): pass -class SDKDevboxExtraCreateParams(DevboxBaseCreateParams, LongPollingRequestOptions): +class SDKDevboxCreateFromImageParams(DevboxBaseCreateParams, LongPollingRequestOptions): pass diff --git a/src/runloop_api_client/sdk/async_.py b/src/runloop_api_client/sdk/async_.py index 6f62c278b..ef3191791 100644 --- a/src/runloop_api_client/sdk/async_.py +++ b/src/runloop_api_client/sdk/async_.py @@ -17,7 +17,7 @@ SDKBlueprintListParams, SDKBlueprintCreateParams, SDKDiskSnapshotListParams, - SDKDevboxExtraCreateParams, + SDKDevboxCreateFromImageParams, ) from .._types import Timeout, NotGiven, not_given from .._client import DEFAULT_MAX_RETRIES, AsyncRunloop @@ -68,13 +68,13 @@ async def create( async def create_from_blueprint_id( self, blueprint_id: str, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> AsyncDevbox: """Create a devbox from an existing blueprint by identifier. :param blueprint_id: Blueprint ID to create from :type blueprint_id: str - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the newly created devbox :rtype: AsyncDevbox """ @@ -87,13 +87,13 @@ async def create_from_blueprint_id( async def create_from_blueprint_name( self, blueprint_name: str, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> AsyncDevbox: """Create a devbox from the latest blueprint with the given name. :param blueprint_name: Blueprint name to create from :type blueprint_name: str - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the newly created devbox :rtype: AsyncDevbox """ @@ -106,13 +106,13 @@ async def create_from_blueprint_name( async def create_from_snapshot( self, snapshot_id: str, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> AsyncDevbox: """Create a devbox initialized from a snapshot. :param snapshot_id: Snapshot ID to create from :type snapshot_id: str - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the newly created devbox :rtype: AsyncDevbox """ @@ -422,12 +422,16 @@ class AsyncRunloopSDK: blueprints, snapshots, and storage objects. Exposes the generated async REST client via the ``api`` attribute for advanced use cases. - Attributes: - api: Direct access to the generated async REST API client. - devbox: High-level async interface for devbox management. - blueprint: High-level async interface for blueprint management. - snapshot: High-level async interface for snapshot management. - storage_object: High-level async interface for storage object management. + :ivar api: Direct access to the generated async REST API client + :vartype api: AsyncRunloop + :ivar devbox: High-level async interface for devbox management + :vartype devbox: AsyncDevboxOps + :ivar blueprint: High-level async interface for blueprint management + :vartype blueprint: AsyncBlueprintOps + :ivar snapshot: High-level async interface for snapshot management + :vartype snapshot: AsyncSnapshotOps + :ivar storage_object: High-level async interface for storage object management + :vartype storage_object: AsyncStorageObjectOps Example: >>> runloop = AsyncRunloopSDK() # Uses RUNLOOP_API_KEY env var diff --git a/src/runloop_api_client/sdk/async_blueprint.py b/src/runloop_api_client/sdk/async_blueprint.py index 77207e758..ab070cb89 100644 --- a/src/runloop_api_client/sdk/async_blueprint.py +++ b/src/runloop_api_client/sdk/async_blueprint.py @@ -5,7 +5,7 @@ from typing_extensions import Unpack, override from ..types import BlueprintView -from ._types import RequestOptions, LongRequestOptions, SDKDevboxExtraCreateParams +from ._types import RequestOptions, LongRequestOptions, SDKDevboxCreateFromImageParams from .._client import AsyncRunloop from .async_devbox import AsyncDevbox from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView @@ -89,11 +89,11 @@ async def delete( async def create_devbox( self, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> "AsyncDevbox": """Create a devbox derived from the blueprint. - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the running devbox :rtype: AsyncDevbox """ diff --git a/src/runloop_api_client/sdk/async_devbox.py b/src/runloop_api_client/sdk/async_devbox.py index 82f61e6d4..cf553b021 100644 --- a/src/runloop_api_client/sdk/async_devbox.py +++ b/src/runloop_api_client/sdk/async_devbox.py @@ -60,12 +60,6 @@ class AsyncDevbox: ... result = await devbox.cmd.exec(command="echo 'hello'") ... print(await result.stdout()) # Devbox is automatically shut down on exit - - Attributes: - id: The devbox identifier. - cmd: Command execution interface (exec, exec_async). - file: File operations interface (read, write, upload, download). - net: Network operations interface (SSH keys, tunnels). """ def __init__(self, client: AsyncRunloop, devbox_id: str) -> None: diff --git a/src/runloop_api_client/sdk/async_execution.py b/src/runloop_api_client/sdk/async_execution.py index 7158ba03d..cef1b29d9 100644 --- a/src/runloop_api_client/sdk/async_execution.py +++ b/src/runloop_api_client/sdk/async_execution.py @@ -42,10 +42,6 @@ class AsyncExecution: Provides coroutines to poll execution state, wait for completion, and terminate the running process. Created by ``await devbox.cmd.exec_async()``. - Attributes: - execution_id: The unique execution identifier. - devbox_id: The devbox where the command is executing. - Example: >>> execution = await devbox.cmd.exec_async(command="python train.py") >>> state = await execution.get_state() diff --git a/src/runloop_api_client/sdk/async_snapshot.py b/src/runloop_api_client/sdk/async_snapshot.py index 93139ebd8..f08ee31bc 100644 --- a/src/runloop_api_client/sdk/async_snapshot.py +++ b/src/runloop_api_client/sdk/async_snapshot.py @@ -8,8 +8,8 @@ RequestOptions, LongRequestOptions, PollingRequestOptions, - SDKDevboxExtraCreateParams, SDKDiskSnapshotUpdateParams, + SDKDevboxCreateFromImageParams, ) from .._client import AsyncRunloop from .async_devbox import AsyncDevbox @@ -110,11 +110,11 @@ async def await_completed( async def create_devbox( self, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> "AsyncDevbox": """Create a devbox restored from this snapshot. - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the running devbox :rtype: AsyncDevbox """ diff --git a/src/runloop_api_client/sdk/blueprint.py b/src/runloop_api_client/sdk/blueprint.py index e2c00826d..bc06b0601 100644 --- a/src/runloop_api_client/sdk/blueprint.py +++ b/src/runloop_api_client/sdk/blueprint.py @@ -5,7 +5,7 @@ from typing_extensions import Unpack, override from ..types import BlueprintView -from ._types import RequestOptions, LongRequestOptions, SDKDevboxExtraCreateParams +from ._types import RequestOptions, LongRequestOptions, SDKDevboxCreateFromImageParams from .devbox import Devbox from .._client import Runloop from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView @@ -89,11 +89,11 @@ def delete( def create_devbox( self, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> "Devbox": """Create a devbox derived from the blueprint. - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the running devbox :rtype: Devbox """ diff --git a/src/runloop_api_client/sdk/devbox.py b/src/runloop_api_client/sdk/devbox.py index eda2274fb..7f1f2fa63 100644 --- a/src/runloop_api_client/sdk/devbox.py +++ b/src/runloop_api_client/sdk/devbox.py @@ -52,17 +52,13 @@ class Devbox: This class provides a Pythonic, object-oriented API for interacting with devboxes, including command execution, file operations, networking, and lifecycle management. - The Devbox class supports context manager protocol for automatic cleanup: + The Devbox class supports context manager protocol for automatic cleanup. + + Example: >>> with sdk.devbox.create(name="my-devbox") as devbox: ... result = devbox.cmd.exec("echo 'hello'") ... print(result.stdout()) # Devbox is automatically shutdown on exit - - Attributes: - id: The devbox identifier. - cmd: Command execution interface (exec, exec_async). - file: File operations interface (read, write, upload, download). - net: Network operations interface (SSH keys, tunnels). """ def __init__(self, client: Runloop, devbox_id: str) -> None: diff --git a/src/runloop_api_client/sdk/execution.py b/src/runloop_api_client/sdk/execution.py index 55eb73c67..3b59fd309 100644 --- a/src/runloop_api_client/sdk/execution.py +++ b/src/runloop_api_client/sdk/execution.py @@ -41,10 +41,6 @@ class Execution: Provides methods to poll execution state, wait for completion, and terminate the running process. Created by ``devbox.cmd.exec_async()``. - Attributes: - execution_id: The unique execution identifier. - devbox_id: The devbox where the command is executing. - Example: >>> execution = devbox.cmd.exec_async(command="python train.py") >>> state = execution.get_state() diff --git a/src/runloop_api_client/sdk/snapshot.py b/src/runloop_api_client/sdk/snapshot.py index 4a973a68f..81c654385 100644 --- a/src/runloop_api_client/sdk/snapshot.py +++ b/src/runloop_api_client/sdk/snapshot.py @@ -8,8 +8,8 @@ RequestOptions, LongRequestOptions, PollingRequestOptions, - SDKDevboxExtraCreateParams, SDKDiskSnapshotUpdateParams, + SDKDevboxCreateFromImageParams, ) from .devbox import Devbox from .._client import Runloop @@ -110,11 +110,11 @@ def await_completed( def create_devbox( self, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> "Devbox": """Create a devbox restored from this snapshot. - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the running devbox :rtype: Devbox """ diff --git a/src/runloop_api_client/sdk/sync.py b/src/runloop_api_client/sdk/sync.py index 5d82b5022..04d9b67cf 100644 --- a/src/runloop_api_client/sdk/sync.py +++ b/src/runloop_api_client/sdk/sync.py @@ -17,7 +17,7 @@ SDKBlueprintListParams, SDKBlueprintCreateParams, SDKDiskSnapshotListParams, - SDKDevboxExtraCreateParams, + SDKDevboxCreateFromImageParams, ) from .devbox import Devbox from .._types import Timeout, NotGiven, not_given @@ -68,13 +68,13 @@ def create( def create_from_blueprint_id( self, blueprint_id: str, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> Devbox: """Create a devbox from an existing blueprint by identifier. :param blueprint_id: Blueprint ID to create from :type blueprint_id: str - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :type params: :return: Wrapper bound to the newly created devbox :rtype: Devbox @@ -88,13 +88,13 @@ def create_from_blueprint_id( def create_from_blueprint_name( self, blueprint_name: str, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> Devbox: """Create a devbox from the latest blueprint with the given name. :param blueprint_name: Blueprint name to create from :type blueprint_name: str - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the newly created devbox :rtype: Devbox """ @@ -107,13 +107,13 @@ def create_from_blueprint_name( def create_from_snapshot( self, snapshot_id: str, - **params: Unpack[SDKDevboxExtraCreateParams], + **params: Unpack[SDKDevboxCreateFromImageParams], ) -> Devbox: """Create a devbox initialized from a snapshot. :param snapshot_id: Snapshot ID to create from :type snapshot_id: str - :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxExtraCreateParams` for available parameters + :param params: See :typeddict:`~runloop_api_client.sdk._types.SDKDevboxCreateFromImageParams` for available parameters :return: Wrapper bound to the newly created devbox :rtype: Devbox """ @@ -422,12 +422,16 @@ class RunloopSDK: snapshots, and storage objects. Exposes the generated REST client via the ``api`` attribute for advanced use cases. - Attributes: - api: Direct access to the generated REST API client. - devbox: High-level interface for devbox management. - blueprint: High-level interface for blueprint management. - snapshot: High-level interface for snapshot management. - storage_object: High-level interface for storage object management. + :ivar api: Direct access to the generated REST API client + :vartype api: Runloop + :ivar devbox: High-level interface for devbox management + :vartype devbox: DevboxOps + :ivar blueprint: High-level interface for blueprint management + :vartype blueprint: BlueprintOps + :ivar snapshot: High-level interface for snapshot management + :vartype snapshot: SnapshotOps + :ivar storage_object: High-level interface for storage object management + :vartype storage_object: StorageObjectOps Example: >>> runloop = RunloopSDK() # Uses RUNLOOP_API_KEY env var