Skip to content

Commit 71da505

Browse files
feat: Add pagination to list active axons (#8359)
1 parent f835622 commit 71da505

File tree

12 files changed

+154
-10
lines changed

12 files changed

+154
-10
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 124
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-11588dad716c3ded3699f14d5e1c5f847d6d099ce0595430f608386b2d1d7c46.yml
3-
openapi_spec_hash: 60c33284c8248c346994db8b2b399758
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-9d88cbc5027ae905a7fcc174467a306592c9a01af2a335a4c20994e3a9e51a13.yml
3+
openapi_spec_hash: 92901e300d9cd9b4209833ec445cccca
44
config_hash: a759c23a5a04ad26f8740acc7e094c01

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Methods:
107107

108108
- <code title="post /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">create</a>(\*\*<a href="src/runloop_api_client/types/axon_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
109109
- <code title="get /v1/axons/{id}">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/axon_view.py">AxonView</a></code>
110-
- <code title="get /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">list</a>() -> <a href="./src/runloop_api_client/types/axon_list_view.py">AxonListView</a></code>
110+
- <code title="get /v1/axons">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">list</a>(\*\*<a href="src/runloop_api_client/types/axon_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/axon_list_view.py">AxonListView</a></code>
111111
- <code title="post /v1/axons/{id}/publish">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">publish</a>(id, \*\*<a href="src/runloop_api_client/types/axon_publish_params.py">params</a>) -> <a href="./src/runloop_api_client/types/publish_result_view.py">PublishResultView</a></code>
112112
- <code title="get /v1/axons/{id}/subscribe/sse">client.axons.<a href="./src/runloop_api_client/resources/axons/axons.py">subscribe_sse</a>(id) -> <a href="./src/runloop_api_client/types/axon_event_view.py">AxonEventView</a></code>
113113

src/runloop_api_client/resources/axons/axons.py

Lines changed: 69 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
SqlResourceWithStreamingResponse,
1616
AsyncSqlResourceWithStreamingResponse,
1717
)
18-
from ...types import axon_create_params, axon_publish_params
18+
from ...types import axon_list_params, axon_create_params, axon_publish_params
1919
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
2020
from ..._utils import path_template, maybe_transform, async_maybe_transform
2121
from ..._compat import cached_property
@@ -137,18 +137,50 @@ def retrieve(
137137
def list(
138138
self,
139139
*,
140+
include_total_count: bool | Omit = omit,
141+
limit: int | Omit = omit,
142+
starting_after: str | Omit = omit,
140143
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
141144
# The extra values given here take precedence over values defined on the client or passed to this method.
142145
extra_headers: Headers | None = None,
143146
extra_query: Query | None = None,
144147
extra_body: Body | None = None,
145148
timeout: float | httpx.Timeout | None | NotGiven = not_given,
146149
) -> AxonListView:
147-
"""[Beta] List all active axons."""
150+
"""
151+
[Beta] List all active axons.
152+
153+
Args:
154+
include_total_count: If true (default), includes total_count in the response. Set to false to skip
155+
the count query for better performance on large datasets.
156+
157+
limit: The limit of items to return. Default is 20. Max is 5000.
158+
159+
starting_after: Load the next page of data starting after the item with the given ID.
160+
161+
extra_headers: Send extra headers
162+
163+
extra_query: Add additional query parameters to the request
164+
165+
extra_body: Add additional JSON properties to the request
166+
167+
timeout: Override the client-level default timeout for this request, in seconds
168+
"""
148169
return self._get(
149170
"/v1/axons",
150171
options=make_request_options(
151-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
172+
extra_headers=extra_headers,
173+
extra_query=extra_query,
174+
extra_body=extra_body,
175+
timeout=timeout,
176+
query=maybe_transform(
177+
{
178+
"include_total_count": include_total_count,
179+
"limit": limit,
180+
"starting_after": starting_after,
181+
},
182+
axon_list_params.AxonListParams,
183+
),
152184
),
153185
cast_to=AxonListView,
154186
)
@@ -353,18 +385,50 @@ async def retrieve(
353385
async def list(
354386
self,
355387
*,
388+
include_total_count: bool | Omit = omit,
389+
limit: int | Omit = omit,
390+
starting_after: str | Omit = omit,
356391
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
357392
# The extra values given here take precedence over values defined on the client or passed to this method.
358393
extra_headers: Headers | None = None,
359394
extra_query: Query | None = None,
360395
extra_body: Body | None = None,
361396
timeout: float | httpx.Timeout | None | NotGiven = not_given,
362397
) -> AxonListView:
363-
"""[Beta] List all active axons."""
398+
"""
399+
[Beta] List all active axons.
400+
401+
Args:
402+
include_total_count: If true (default), includes total_count in the response. Set to false to skip
403+
the count query for better performance on large datasets.
404+
405+
limit: The limit of items to return. Default is 20. Max is 5000.
406+
407+
starting_after: Load the next page of data starting after the item with the given ID.
408+
409+
extra_headers: Send extra headers
410+
411+
extra_query: Add additional query parameters to the request
412+
413+
extra_body: Add additional JSON properties to the request
414+
415+
timeout: Override the client-level default timeout for this request, in seconds
416+
"""
364417
return await self._get(
365418
"/v1/axons",
366419
options=make_request_options(
367-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
420+
extra_headers=extra_headers,
421+
extra_query=extra_query,
422+
extra_body=extra_body,
423+
timeout=timeout,
424+
query=await async_maybe_transform(
425+
{
426+
"include_total_count": include_total_count,
427+
"limit": limit,
428+
"starting_after": starting_after,
429+
},
430+
axon_list_params.AxonListParams,
431+
),
368432
),
369433
cast_to=AxonListView,
370434
)

src/runloop_api_client/resources/devboxes/devboxes.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,7 @@ def enable_tunnel(
761761
*,
762762
auth_mode: Optional[Literal["open", "authenticated"]] | Omit = omit,
763763
http_keep_alive: Optional[bool] | Omit = omit,
764+
wake_on_http: Optional[bool] | Omit = omit,
764765
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
765766
# The extra values given here take precedence over values defined on the client or passed to this method.
766767
extra_headers: Headers | None = None,
@@ -783,6 +784,9 @@ def enable_tunnel(
783784
http_keep_alive: When true, HTTP traffic through the tunnel counts as activity for idle lifecycle
784785
policies, resetting the idle timer. Defaults to true if not specified.
785786
787+
wake_on_http: When true, HTTP traffic to a suspended devbox will automatically trigger a
788+
resume. Defaults to false if not specified.
789+
786790
extra_headers: Send extra headers
787791
788792
extra_query: Add additional query parameters to the request
@@ -801,6 +805,7 @@ def enable_tunnel(
801805
{
802806
"auth_mode": auth_mode,
803807
"http_keep_alive": http_keep_alive,
808+
"wake_on_http": wake_on_http,
804809
},
805810
devbox_enable_tunnel_params.DevboxEnableTunnelParams,
806811
),
@@ -2397,6 +2402,7 @@ async def enable_tunnel(
23972402
*,
23982403
auth_mode: Optional[Literal["open", "authenticated"]] | Omit = omit,
23992404
http_keep_alive: Optional[bool] | Omit = omit,
2405+
wake_on_http: Optional[bool] | Omit = omit,
24002406
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
24012407
# The extra values given here take precedence over values defined on the client or passed to this method.
24022408
extra_headers: Headers | None = None,
@@ -2419,6 +2425,9 @@ async def enable_tunnel(
24192425
http_keep_alive: When true, HTTP traffic through the tunnel counts as activity for idle lifecycle
24202426
policies, resetting the idle timer. Defaults to true if not specified.
24212427
2428+
wake_on_http: When true, HTTP traffic to a suspended devbox will automatically trigger a
2429+
resume. Defaults to false if not specified.
2430+
24222431
extra_headers: Send extra headers
24232432
24242433
extra_query: Add additional query parameters to the request
@@ -2437,6 +2446,7 @@ async def enable_tunnel(
24372446
{
24382447
"auth_mode": auth_mode,
24392448
"http_keep_alive": http_keep_alive,
2449+
"wake_on_http": wake_on_http,
24402450
},
24412451
devbox_enable_tunnel_params.DevboxEnableTunnelParams,
24422452
),

src/runloop_api_client/types/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from .agent_list_view import AgentListView as AgentListView
2828
from .axon_event_view import AxonEventView as AxonEventView
2929
from .mcp_config_view import McpConfigView as McpConfigView
30+
from .axon_list_params import AxonListParams as AxonListParams
3031
from .devbox_list_view import DevboxListView as DevboxListView
3132
from .object_list_view import ObjectListView as ObjectListView
3233
from .scoring_contract import ScoringContract as ScoringContract
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import TypedDict
6+
7+
__all__ = ["AxonListParams"]
8+
9+
10+
class AxonListParams(TypedDict, total=False):
11+
include_total_count: bool
12+
"""If true (default), includes total_count in the response.
13+
14+
Set to false to skip the count query for better performance on large datasets.
15+
"""
16+
17+
limit: int
18+
"""The limit of items to return. Default is 20. Max is 5000."""
19+
20+
starting_after: str
21+
"""Load the next page of data starting after the item with the given ID."""

src/runloop_api_client/types/axon_list_view.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List
3+
from typing import List, Optional
44

55
from .._models import BaseModel
66
from .axon_view import AxonView
@@ -11,3 +11,7 @@
1111
class AxonListView(BaseModel):
1212
axons: List[AxonView]
1313
"""List of active axons."""
14+
15+
has_more: bool
16+
17+
total_count: Optional[int] = None

src/runloop_api_client/types/devbox_create_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,9 @@ class Tunnel(TypedDict, total=False):
149149
When true, HTTP traffic through the tunnel counts as activity for idle lifecycle
150150
policies, resetting the idle timer. Defaults to true if not specified.
151151
"""
152+
153+
wake_on_http: Optional[bool]
154+
"""
155+
When true, HTTP traffic to a suspended devbox will automatically trigger a
156+
resume. Defaults to false if not specified.
157+
"""

src/runloop_api_client/types/devbox_enable_tunnel_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ class DevboxEnableTunnelParams(TypedDict, total=False):
1717
When true, HTTP traffic through the tunnel counts as activity for idle lifecycle
1818
policies, resetting the idle timer. Defaults to true if not specified.
1919
"""
20+
21+
wake_on_http: Optional[bool]
22+
"""
23+
When true, HTTP traffic to a suspended devbox will automatically trigger a
24+
resume. Defaults to false if not specified.
25+
"""

src/runloop_api_client/types/tunnel_view.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ class TunnelView(BaseModel):
3333
URL format: https://{port}-{tunnel_key}.tunnel.runloop.{domain}
3434
"""
3535

36+
wake_on_http: bool
37+
"""
38+
When true, HTTP traffic to a suspended devbox will automatically trigger a
39+
resume.
40+
"""
41+
3642
auth_token: Optional[str] = None
3743
"""Bearer token for tunnel authentication.
3844

0 commit comments

Comments
 (0)