Skip to content

Commit a1dd9fe

Browse files
feat(api): api update (#233)
1 parent b81a685 commit a1dd9fe

7 files changed

Lines changed: 20 additions & 20 deletions

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: 32
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-56beb98c6aa0c8bb041c5bb832d3c2a67812be83e1ff1099768e6c9b01f25e48.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d1c9bf36f07cc070f3bf4c0065d35b6e310907810b819b66539be4a950536496.yml

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ def with_streaming_response(self) -> DevboxesResourceWithStreamingResponse:
103103
def create(
104104
self,
105105
*,
106+
available_ports: Iterable[int] | NotGiven = NOT_GIVEN,
106107
blueprint_id: str | NotGiven = NOT_GIVEN,
107108
blueprint_name: str | NotGiven = NOT_GIVEN,
108109
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
@@ -128,6 +129,9 @@ def create(
128129
the 'pending' state and will transition to 'running' once it is ready.
129130
130131
Args:
132+
available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a
133+
tunnel to the port.
134+
131135
blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be
132136
created with the default Runloop Devbox image.
133137
@@ -170,6 +174,7 @@ def create(
170174
"/v1/devboxes",
171175
body=maybe_transform(
172176
{
177+
"available_ports": available_ports,
173178
"blueprint_id": blueprint_id,
174179
"blueprint_name": blueprint_name,
175180
"code_mounts": code_mounts,
@@ -832,6 +837,7 @@ def with_streaming_response(self) -> AsyncDevboxesResourceWithStreamingResponse:
832837
async def create(
833838
self,
834839
*,
840+
available_ports: Iterable[int] | NotGiven = NOT_GIVEN,
835841
blueprint_id: str | NotGiven = NOT_GIVEN,
836842
blueprint_name: str | NotGiven = NOT_GIVEN,
837843
code_mounts: Iterable[CodeMountParametersParam] | NotGiven = NOT_GIVEN,
@@ -857,6 +863,9 @@ async def create(
857863
the 'pending' state and will transition to 'running' once it is ready.
858864
859865
Args:
866+
available_ports: A list of ports to make available on the Devbox. Call createTunnel to open a
867+
tunnel to the port.
868+
860869
blueprint_id: (Optional) Blueprint to use for the Devbox. If none set, the Devbox will be
861870
created with the default Runloop Devbox image.
862871
@@ -899,6 +908,7 @@ async def create(
899908
"/v1/devboxes",
900909
body=await async_maybe_transform(
901910
{
911+
"available_ports": available_ports,
902912
"blueprint_id": blueprint_id,
903913
"blueprint_name": blueprint_name,
904914
"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

src/runloop_api_client/types/shared/launch_parameters.py

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

1010

1111
class LaunchParameters(BaseModel):
12-
available_ports: Optional[List[int]] = None
13-
"""A list of ports to make available on the Devbox.
14-
15-
Call createTunnel to open a tunnel to the port.
16-
"""
17-
1812
keep_alive_time_seconds: Optional[int] = None
1913
"""Time in seconds after which Devbox will automatically shutdown.
2014

src/runloop_api_client/types/shared_params/launch_parameters.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,13 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Iterable
5+
from typing import List
66
from typing_extensions import Literal, TypedDict
77

88
__all__ = ["LaunchParameters"]
99

1010

1111
class LaunchParameters(TypedDict, total=False):
12-
available_ports: Iterable[int]
13-
"""A list of ports to make available on the Devbox.
14-
15-
Call createTunnel to open a tunnel to the port.
16-
"""
17-
1812
keep_alive_time_seconds: int
1913
"""Time in seconds after which Devbox will automatically shutdown.
2014

tests/api_resources/test_blueprints.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
5656
dockerfile="dockerfile",
5757
file_mounts={"foo": "string"},
5858
launch_parameters={
59-
"available_ports": [0, 0, 0],
6059
"keep_alive_time_seconds": 0,
6160
"launch_commands": ["string", "string", "string"],
6261
"resource_size_request": "SMALL",
@@ -233,7 +232,6 @@ def test_method_preview_with_all_params(self, client: Runloop) -> None:
233232
dockerfile="dockerfile",
234233
file_mounts={"foo": "string"},
235234
launch_parameters={
236-
"available_ports": [0, 0, 0],
237235
"keep_alive_time_seconds": 0,
238236
"launch_commands": ["string", "string", "string"],
239237
"resource_size_request": "SMALL",
@@ -304,7 +302,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
304302
dockerfile="dockerfile",
305303
file_mounts={"foo": "string"},
306304
launch_parameters={
307-
"available_ports": [0, 0, 0],
308305
"keep_alive_time_seconds": 0,
309306
"launch_commands": ["string", "string", "string"],
310307
"resource_size_request": "SMALL",
@@ -481,7 +478,6 @@ async def test_method_preview_with_all_params(self, async_client: AsyncRunloop)
481478
dockerfile="dockerfile",
482479
file_mounts={"foo": "string"},
483480
launch_parameters={
484-
"available_ports": [0, 0, 0],
485481
"keep_alive_time_seconds": 0,
486482
"launch_commands": ["string", "string", "string"],
487483
"resource_size_request": "SMALL",

tests/api_resources/test_devboxes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def test_method_create(self, client: Runloop) -> None:
4242
@parametrize
4343
def test_method_create_with_all_params(self, client: Runloop) -> None:
4444
devbox = client.devboxes.create(
45+
available_ports=[0, 0, 0],
4546
blueprint_id="blueprint_id",
4647
blueprint_name="blueprint_name",
4748
code_mounts=[
@@ -68,7 +69,6 @@ def test_method_create_with_all_params(self, client: Runloop) -> None:
6869
environment_variables={"foo": "string"},
6970
file_mounts={"foo": "string"},
7071
launch_parameters={
71-
"available_ports": [0, 0, 0],
7272
"keep_alive_time_seconds": 0,
7373
"launch_commands": ["string", "string", "string"],
7474
"resource_size_request": "SMALL",
@@ -750,6 +750,7 @@ async def test_method_create(self, async_client: AsyncRunloop) -> None:
750750
@parametrize
751751
async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -> None:
752752
devbox = await async_client.devboxes.create(
753+
available_ports=[0, 0, 0],
753754
blueprint_id="blueprint_id",
754755
blueprint_name="blueprint_name",
755756
code_mounts=[
@@ -776,7 +777,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) -
776777
environment_variables={"foo": "string"},
777778
file_mounts={"foo": "string"},
778779
launch_parameters={
779-
"available_ports": [0, 0, 0],
780780
"keep_alive_time_seconds": 0,
781781
"launch_commands": ["string", "string", "string"],
782782
"resource_size_request": "SMALL",

0 commit comments

Comments
 (0)