Skip to content

Commit c4e0693

Browse files
feat(api): api update (#221)
1 parent d435de8 commit c4e0693

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 29
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c40cea26561cc5976de1fb8e31ea7236db81c0cc8dd6bbaedb9044531f053291.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c5f29b6d5424246c8c6d585c697032f4b4b6c49e316c9d28706cc0d0683609a3.yml

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse:
102102
def create(
103103
self,
104104
*,
105+
available_ports: Iterable[int] | NotGiven = NOT_GIVEN,
105106
blueprint_id: str | NotGiven = NOT_GIVEN,
106107
blueprint_name: str | NotGiven = NOT_GIVEN,
107108
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
@@ -127,6 +128,9 @@ def create(
127128
the 'pending' state and will transition to 'running' once it is ready.
128129
129130
Args:
131+
available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a
132+
tunnel to the port.
133+
130134
blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be
131135
created with the default Runloop Devbox image.
132136
@@ -169,6 +173,7 @@ def create(
169173
"/v1/devboxes",
170174
body=maybe_transform(
171175
{
176+
"available_ports": available_ports,
172177
"blueprint_id": blueprint_id,
173178
"blueprint_name": blueprint_name,
174179
"code_mounts": code_mounts,
@@ -731,6 +736,7 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse:
731736
async def create(
732737
self,
733738
*,
739+
available_ports: Iterable[int] | NotGiven = NOT_GIVEN,
734740
blueprint_id: str | NotGiven = NOT_GIVEN,
735741
blueprint_name: str | NotGiven = NOT_GIVEN,
736742
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
@@ -756,6 +762,9 @@ async def create(
756762
the 'pending' state and will transition to 'running' once it is ready.
757763
758764
Args:
765+
available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a
766+
tunnel to the port.
767+
759768
blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be
760769
created with the default Runloop Devbox image.
761770
@@ -798,6 +807,7 @@ async def create(
798807
"/v1/devboxes",
799808
body=await async_maybe_transform(
800809
{
810+
"available_ports": available_ports,
801811
"blueprint_id": blueprint_id,
802812
"blueprint_name": blueprint_name,
803813
"code_mounts": code_mounts,

src/runloop_api_client/types/devbox_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212

1313

1414
class DevboxCreateParams(TypedDict, total=False):
15+
available_ports: Iterable[int]
16+
"""A list of ports to make available on the Devbox.
17+
18+
Call createTunnel to open a tunnel to the port.
19+
"""
20+
1521
blueprint_id: str
1622
"""(Optional) Blueprint to use for the Devbox.
1723

tests/api_resources/test_devboxes.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def test_method_create(self, client: Runloop) -> None:
4141
@parametrize
4242
def test_method_create_with_all_params(self, client: Runloop) -> None:
4343
devbox = client.devboxes.create(
44+
available_ports=[0, 0, 0],
4445
blueprint_id="blueprint_id",
4546
blueprint_name="blueprint_name",
4647
code_mounts=[
@@ -634,6 +635,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None:
634635
@parametrize
635636
async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None:
636637
devbox = await async_client.devboxes.create(
638+
available_ports=[0, 0, 0],
637639
blueprint_id="blueprint_id",
638640
blueprint_name="blueprint_name",
639641
code_mounts=[

0 commit comments

Comments
 (0)