Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.0"
".": "0.2.1"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 28
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d5b31b4bbf540f07391766a9217f0dc872e3c9015dc2282b7b346f6594acbe0c.yml
configured_endpoints: 29
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9637e8217fe437592df1d3e503321093cd72be915633e35aada927c3336148da.yml
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.2.1 (2024-10-11)

Full Changelog: [v0.2.0...v0.2.1](https://github.com/runloopai/api-client-python/compare/v0.2.0...v0.2.1)

### Features

* **api:** api update ([#190](https://github.com/runloopai/api-client-python/issues/190)) ([4b40a20](https://github.com/runloopai/api-client-python/commit/4b40a20d3603f8a0dfdb0ecf8884682193e986d9))
* **api:** api update ([#192](https://github.com/runloopai/api-client-python/issues/192)) ([51358a5](https://github.com/runloopai/api-client-python/commit/51358a52a59b31729f05c40a6f84af467313f568))
* **api:** api update ([#193](https://github.com/runloopai/api-client-python/issues/193)) ([d4c04da](https://github.com/runloopai/api-client-python/commit/d4c04da4e1726dd70a638748034e2c86ead63142))
* **api:** api update ([#194](https://github.com/runloopai/api-client-python/issues/194)) ([31fcc6c](https://github.com/runloopai/api-client-python/commit/31fcc6cc52cc1e7cf782b9fd00d75049f455bb98))
* **api:** api update ([#195](https://github.com/runloopai/api-client-python/issues/195)) ([4b3112b](https://github.com/runloopai/api-client-python/commit/4b3112bb3e0620fbce4f37bdd4fe06e3bdbaa0d5))
* **api:** api update ([#196](https://github.com/runloopai/api-client-python/issues/196)) ([f367ac3](https://github.com/runloopai/api-client-python/commit/f367ac3014e94f4be43480fbb8404a8c95b853fe))
* **api:** api update ([#197](https://github.com/runloopai/api-client-python/issues/197)) ([f5d88d9](https://github.com/runloopai/api-client-python/commit/f5d88d970de6e2820449eedbddc424f387a147ff))
* **api:** api update ([#198](https://github.com/runloopai/api-client-python/issues/198)) ([6a8c688](https://github.com/runloopai/api-client-python/commit/6a8c688473c715c6bf82a81084a414ea844bac01))
* **api:** api update ([#199](https://github.com/runloopai/api-client-python/issues/199)) ([e36adf9](https://github.com/runloopai/api-client-python/commit/e36adf900d0c7ee4e25ea1d806c2da2f17cc48eb))
* **api:** api update ([#200](https://github.com/runloopai/api-client-python/issues/200)) ([2b51e56](https://github.com/runloopai/api-client-python/commit/2b51e5641684c23ddaaf23131b3fe8eba0877925))

## 0.2.0 (2024-10-10)

Full Changelog: [v0.1.0-alpha.23...v0.2.0](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.23...v0.2.0)
Expand Down
20 changes: 9 additions & 11 deletions api.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# Shared Types

```python
from runloop_api_client.types import FunctionInvocationExecutionDetailView, ProjectLogsView
```

# Account

Types:

```python
from runloop_api_client.types import ResourceSize
from runloop_api_client.types import (
FunctionInvocationExecutionDetailView,
LaunchParameters,
ProjectLogsView,
)
```

# Blueprints
Expand Down Expand Up @@ -52,9 +48,10 @@ from runloop_api_client.types import (
DevboxAsyncExecutionDetailView,
DevboxExecutionDetailView,
DevboxListView,
DevboxSnapshotListView,
DevboxSnapshotView,
DevboxView,
DevboxCreateSSHKeyResponse,
DevboxDiskSnapshotsResponse,
DevboxReadFileContentsResponse,
DevboxUploadFileResponse,
)
Expand All @@ -66,12 +63,13 @@ Methods:
- <code title="get /v1/devboxes/{id}">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
- <code title="get /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">list</a>(\*\*<a href="src/runloop_api_client/types/devbox_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_list_view.py">DevboxListView</a></code>
- <code title="post /v1/devboxes/{id}/create_ssh_key">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">create_ssh_key</a>(id) -> <a href="./src/runloop_api_client/types/devbox_create_ssh_key_response.py">DevboxCreateSSHKeyResponse</a></code>
- <code title="get /v1/devboxes/disk_snapshots">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">disk_snapshots</a>(\*\*<a href="src/runloop_api_client/types/devbox_disk_snapshots_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_disk_snapshots_response.py">DevboxDiskSnapshotsResponse</a></code>
- <code title="get /v1/devboxes/disk_snapshots">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">disk_snapshots</a>(\*\*<a href="src/runloop_api_client/types/devbox_disk_snapshots_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_snapshot_list_view.py">DevboxSnapshotListView</a></code>
- <code title="post /v1/devboxes/{id}/download_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">download_file</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_download_file_params.py">params</a>) -> BinaryAPIResponse</code>
- <code title="post /v1/devboxes/{id}/execute_async">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_async</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_execute_async_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_async_execution_detail_view.py">DevboxAsyncExecutionDetailView</a></code>
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_sync</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_execute_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
- <code title="post /v1/devboxes/{id}/read_file_contents">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">read_file_contents</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_read_file_contents_params.py">params</a>) -> str</code>
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">shutdown</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
- <code title="post /v1/devboxes/{id}/snapshot_disk">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">snapshot_disk</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_snapshot_disk_params.py">params</a>) -> None</code>
- <code title="post /v1/devboxes/{id}/upload_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">upload_file</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_upload_file_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_upload_file_response.py">object</a></code>
- <code title="post /v1/devboxes/{id}/write_file">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">write_file</a>(id, \*\*<a href="src/runloop_api_client/types/devbox_write_file_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "runloop_api_client"
version = "0.2.0"
version = "0.2.1"
description = "The official Python library for the runloop API"
dynamic = ["readme"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/runloop_api_client/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "runloop_api_client"
__version__ = "0.2.0" # x-release-please-version
__version__ = "0.2.1" # x-release-please-version
9 changes: 5 additions & 4 deletions src/runloop_api_client/resources/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ..types.blueprint_preview_view import BlueprintPreviewView
from ..types.code_mount_parameters_param import CodeMountParametersParam
from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView
from ..types.shared_params.launch_parameters import LaunchParameters

__all__ = ["BlueprintsResource", "AsyncBlueprintsResource"]

Expand Down Expand Up @@ -57,7 +58,7 @@ def create(
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
dockerfile: str | NotGiven = NOT_GIVEN,
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN,
launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN,
system_setup_commands: List[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -237,7 +238,7 @@ def preview(
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
dockerfile: str | NotGiven = NOT_GIVEN,
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN,
launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN,
system_setup_commands: List[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -319,7 +320,7 @@ async def create(
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
dockerfile: str | NotGiven = NOT_GIVEN,
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
launch_parameters: blueprint_create_params.LaunchParameters | NotGiven = NOT_GIVEN,
launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN,
system_setup_commands: List[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down Expand Up @@ -499,7 +500,7 @@ async def preview(
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
dockerfile: str | NotGiven = NOT_GIVEN,
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
launch_parameters: blueprint_preview_params.LaunchParameters | NotGiven = NOT_GIVEN,
launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN,
system_setup_commands: List[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
Expand Down
124 changes: 116 additions & 8 deletions src/runloop_api_client/resources/devboxes/devboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
devbox_execute_sync_params,
devbox_download_file_params,
devbox_execute_async_params,
devbox_snapshot_disk_params,
devbox_disk_snapshots_params,
devbox_read_file_contents_params,
)
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven, FileTypes
from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven, FileTypes
from ..._utils import (
extract_files,
maybe_transform,
Expand Down Expand Up @@ -59,10 +60,11 @@
from ..._base_client import make_request_options
from ...types.devbox_view import DevboxView
from ...types.devbox_list_view import DevboxListView
from ...types.devbox_snapshot_list_view import DevboxSnapshotListView
from ...types.code_mount_parameters_param import CodeMountParametersParam
from ...types.devbox_execution_detail_view import DevboxExecutionDetailView
from ...types.devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse
from ...types.devbox_disk_snapshots_response import DevboxDiskSnapshotsResponse
from ...types.shared_params.launch_parameters import LaunchParameters
from ...types.devbox_async_execution_detail_view import DevboxAsyncExecutionDetailView

__all__ = ["DevboxesResource", "AsyncDevboxesResource"]
Expand Down Expand Up @@ -105,7 +107,7 @@ def create(
entrypoint: str | NotGiven = NOT_GIVEN,
environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN,
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN,
launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
prebuilt: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -317,7 +319,7 @@ def disk_snapshots(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DevboxDiskSnapshotsResponse:
) -> DevboxSnapshotListView:
"""
List all snapshots of a devbox by id.

Expand Down Expand Up @@ -349,7 +351,7 @@ def disk_snapshots(
devbox_disk_snapshots_params.DevboxDiskSnapshotsParams,
),
),
cast_to=DevboxDiskSnapshotsResponse,
cast_to=DevboxSnapshotListView,
)

def download_file(
Expand Down Expand Up @@ -556,6 +558,53 @@ def shutdown(
cast_to=DevboxView,
)

def snapshot_disk(
self,
id: str,
*,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> None:
"""
Create a filesystem snapshot of a devbox with the specified name and metadata.

Args:
metadata: (Optional) Metadata used to describe the snapshot

name: (Optional) A user specified name to give the snapshot

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return self._post(
f"/v1/devboxes/{id}/snapshot_disk",
body=maybe_transform(
{
"metadata": metadata,
"name": name,
},
devbox_snapshot_disk_params.DevboxSnapshotDiskParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)

def upload_file(
self,
id: str,
Expand Down Expand Up @@ -688,7 +737,7 @@ async def create(
entrypoint: str | NotGiven = NOT_GIVEN,
environment_variables: Dict[str, str] | NotGiven = NOT_GIVEN,
file_mounts: Dict[str, str] | NotGiven = NOT_GIVEN,
launch_parameters: devbox_create_params.LaunchParameters | NotGiven = NOT_GIVEN,
launch_parameters: LaunchParameters | NotGiven = NOT_GIVEN,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
prebuilt: str | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -900,7 +949,7 @@ async def disk_snapshots(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> DevboxDiskSnapshotsResponse:
) -> DevboxSnapshotListView:
"""
List all snapshots of a devbox by id.

Expand Down Expand Up @@ -932,7 +981,7 @@ async def disk_snapshots(
devbox_disk_snapshots_params.DevboxDiskSnapshotsParams,
),
),
cast_to=DevboxDiskSnapshotsResponse,
cast_to=DevboxSnapshotListView,
)

async def download_file(
Expand Down Expand Up @@ -1139,6 +1188,53 @@ async def shutdown(
cast_to=DevboxView,
)

async def snapshot_disk(
self,
id: str,
*,
metadata: Dict[str, str] | NotGiven = NOT_GIVEN,
name: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> None:
"""
Create a filesystem snapshot of a devbox with the specified name and metadata.

Args:
metadata: (Optional) Metadata used to describe the snapshot

name: (Optional) A user specified name to give the snapshot

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
if not id:
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
extra_headers = {"Accept": "*/*", **(extra_headers or {})}
return await self._post(
f"/v1/devboxes/{id}/snapshot_disk",
body=await async_maybe_transform(
{
"metadata": metadata,
"name": name,
},
devbox_snapshot_disk_params.DevboxSnapshotDiskParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=NoneType,
)

async def upload_file(
self,
id: str,
Expand Down Expand Up @@ -1269,6 +1365,9 @@ def __init__(self, devboxes: DevboxesResource) -> None:
self.shutdown = to_raw_response_wrapper(
devboxes.shutdown,
)
self.snapshot_disk = to_raw_response_wrapper(
devboxes.snapshot_disk,
)
self.upload_file = to_raw_response_wrapper(
devboxes.upload_file,
)
Expand Down Expand Up @@ -1320,6 +1419,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None:
self.shutdown = async_to_raw_response_wrapper(
devboxes.shutdown,
)
self.snapshot_disk = async_to_raw_response_wrapper(
devboxes.snapshot_disk,
)
self.upload_file = async_to_raw_response_wrapper(
devboxes.upload_file,
)
Expand Down Expand Up @@ -1371,6 +1473,9 @@ def __init__(self, devboxes: DevboxesResource) -> None:
self.shutdown = to_streamed_response_wrapper(
devboxes.shutdown,
)
self.snapshot_disk = to_streamed_response_wrapper(
devboxes.snapshot_disk,
)
self.upload_file = to_streamed_response_wrapper(
devboxes.upload_file,
)
Expand Down Expand Up @@ -1422,6 +1527,9 @@ def __init__(self, devboxes: AsyncDevboxesResource) -> None:
self.shutdown = async_to_streamed_response_wrapper(
devboxes.shutdown,
)
self.snapshot_disk = async_to_streamed_response_wrapper(
devboxes.snapshot_disk,
)
self.upload_file = async_to_streamed_response_wrapper(
devboxes.upload_file,
)
Expand Down
Loading