@@ -53,7 +53,7 @@ def retrieve(
5353 self ,
5454 execution_id : str ,
5555 * ,
56- id : str ,
56+ devbox_id : str ,
5757 last_n : str | NotGiven = NOT_GIVEN ,
5858 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5959 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -63,7 +63,8 @@ def retrieve(
6363 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
6464 ) -> DevboxAsyncExecutionDetailView :
6565 """
66- Get status of an execution on a devbox.
66+ Get the latest status of a previously launched asynchronous execuction including
67+ stdout/error and the exit code if complete.
6768
6869 Args:
6970 last_n: Last n lines of standard error / standard out to return
@@ -76,12 +77,12 @@ def retrieve(
7677
7778 timeout: Override the client-level default timeout for this request, in seconds
7879 """
79- if not id :
80- raise ValueError (f"Expected a non-empty value for `id ` but received { id !r} " )
80+ if not devbox_id :
81+ raise ValueError (f"Expected a non-empty value for `devbox_id ` but received { devbox_id !r} " )
8182 if not execution_id :
8283 raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
8384 return self ._get (
84- f"/v1/devboxes/{ id } /executions/{ execution_id } " ,
85+ f"/v1/devboxes/{ devbox_id } /executions/{ execution_id } " ,
8586 options = make_request_options (
8687 extra_headers = extra_headers ,
8788 extra_query = extra_query ,
@@ -95,7 +96,7 @@ def retrieve(
9596 def await_completed (
9697 self ,
9798 execution_id : str ,
98- id : str ,
99+ devbox_id : str ,
99100 * ,
100101 config : PollingConfig | None = None ,
101102 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -126,7 +127,7 @@ def await_completed(
126127 def retrieve_execution () -> DevboxAsyncExecutionDetailView :
127128 return self .retrieve (
128129 execution_id ,
129- id = id ,
130+ devbox_id = devbox_id ,
130131 extra_headers = extra_headers ,
131132 extra_query = extra_query ,
132133 extra_body = extra_body ,
@@ -256,6 +257,50 @@ def execute_sync(
256257 cast_to = DevboxExecutionDetailView ,
257258 )
258259
260+ def kill (
261+ self ,
262+ execution_id : str ,
263+ * ,
264+ devbox_id : str ,
265+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
266+ # The extra values given here take precedence over values defined on the client or passed to this method.
267+ extra_headers : Headers | None = None ,
268+ extra_query : Query | None = None ,
269+ extra_body : Body | None = None ,
270+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
271+ idempotency_key : str | None = None ,
272+ ) -> DevboxAsyncExecutionDetailView :
273+ """
274+ Kill a previously launched asynchronous execution if it is still running by
275+ killing the launched process.
276+
277+ Args:
278+ extra_headers: Send extra headers
279+
280+ extra_query: Add additional query parameters to the request
281+
282+ extra_body: Add additional JSON properties to the request
283+
284+ timeout: Override the client-level default timeout for this request, in seconds
285+
286+ idempotency_key: Specify a custom idempotency key for this request
287+ """
288+ if not devbox_id :
289+ raise ValueError (f"Expected a non-empty value for `devbox_id` but received { devbox_id !r} " )
290+ if not execution_id :
291+ raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
292+ return self ._post (
293+ f"/v1/devboxes/{ devbox_id } /executions/{ execution_id } /kill" ,
294+ options = make_request_options (
295+ extra_headers = extra_headers ,
296+ extra_query = extra_query ,
297+ extra_body = extra_body ,
298+ timeout = timeout ,
299+ idempotency_key = idempotency_key ,
300+ ),
301+ cast_to = DevboxAsyncExecutionDetailView ,
302+ )
303+
259304
260305class AsyncExecutionsResource (AsyncAPIResource ):
261306 @cached_property
@@ -281,7 +326,7 @@ async def retrieve(
281326 self ,
282327 execution_id : str ,
283328 * ,
284- id : str ,
329+ devbox_id : str ,
285330 last_n : str | NotGiven = NOT_GIVEN ,
286331 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
287332 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -291,7 +336,8 @@ async def retrieve(
291336 timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
292337 ) -> DevboxAsyncExecutionDetailView :
293338 """
294- Get status of an execution on a devbox.
339+ Get the latest status of a previously launched asynchronous execuction including
340+ stdout/error and the exit code if complete.
295341
296342 Args:
297343 last_n: Last n lines of standard error / standard out to return
@@ -304,12 +350,12 @@ async def retrieve(
304350
305351 timeout: Override the client-level default timeout for this request, in seconds
306352 """
307- if not id :
308- raise ValueError (f"Expected a non-empty value for `id ` but received { id !r} " )
353+ if not devbox_id :
354+ raise ValueError (f"Expected a non-empty value for `devbox_id ` but received { devbox_id !r} " )
309355 if not execution_id :
310356 raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
311357 return await self ._get (
312- f"/v1/devboxes/{ id } /executions/{ execution_id } " ,
358+ f"/v1/devboxes/{ devbox_id } /executions/{ execution_id } " ,
313359 options = make_request_options (
314360 extra_headers = extra_headers ,
315361 extra_query = extra_query ,
@@ -326,7 +372,7 @@ async def await_completed(
326372 self ,
327373 execution_id : str ,
328374 * ,
329- id : str ,
375+ devbox_id : str ,
330376 polling_config : PollingConfig | None = None ,
331377 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
332378 # The extra values given here take precedence over values defined on the client or passed to this method.
@@ -356,7 +402,7 @@ async def await_completed(
356402 async def retrieve_execution () -> DevboxAsyncExecutionDetailView :
357403 return await self .retrieve (
358404 execution_id ,
359- id = id ,
405+ devbox_id = devbox_id ,
360406 extra_headers = extra_headers ,
361407 extra_query = extra_query ,
362408 extra_body = extra_body ,
@@ -486,50 +532,118 @@ async def execute_sync(
486532 cast_to = DevboxExecutionDetailView ,
487533 )
488534
535+ async def kill (
536+ self ,
537+ execution_id : str ,
538+ * ,
539+ devbox_id : str ,
540+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
541+ # The extra values given here take precedence over values defined on the client or passed to this method.
542+ extra_headers : Headers | None = None ,
543+ extra_query : Query | None = None ,
544+ extra_body : Body | None = None ,
545+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
546+ idempotency_key : str | None = None ,
547+ ) -> DevboxAsyncExecutionDetailView :
548+ """
549+ Kill a previously launched asynchronous execution if it is still running by
550+ killing the launched process.
551+
552+ Args:
553+ extra_headers: Send extra headers
554+
555+ extra_query: Add additional query parameters to the request
556+
557+ extra_body: Add additional JSON properties to the request
558+
559+ timeout: Override the client-level default timeout for this request, in seconds
560+
561+ idempotency_key: Specify a custom idempotency key for this request
562+ """
563+ if not devbox_id :
564+ raise ValueError (f"Expected a non-empty value for `devbox_id` but received { devbox_id !r} " )
565+ if not execution_id :
566+ raise ValueError (f"Expected a non-empty value for `execution_id` but received { execution_id !r} " )
567+ return await self ._post (
568+ f"/v1/devboxes/{ devbox_id } /executions/{ execution_id } /kill" ,
569+ options = make_request_options (
570+ extra_headers = extra_headers ,
571+ extra_query = extra_query ,
572+ extra_body = extra_body ,
573+ timeout = timeout ,
574+ idempotency_key = idempotency_key ,
575+ ),
576+ cast_to = DevboxAsyncExecutionDetailView ,
577+ )
578+
489579
490580class ExecutionsResourceWithRawResponse :
491581 def __init__ (self , executions : ExecutionsResource ) -> None :
492582 self ._executions = executions
493583
584+ self .retrieve = to_raw_response_wrapper (
585+ executions .retrieve ,
586+ )
494587 self .execute_async = to_raw_response_wrapper (
495588 executions .execute_async ,
496589 )
497590 self .execute_sync = to_raw_response_wrapper (
498591 executions .execute_sync ,
499592 )
593+ self .kill = to_raw_response_wrapper (
594+ executions .kill ,
595+ )
500596
501597
502598class AsyncExecutionsResourceWithRawResponse :
503599 def __init__ (self , executions : AsyncExecutionsResource ) -> None :
504600 self ._executions = executions
505601
602+ self .retrieve = async_to_raw_response_wrapper (
603+ executions .retrieve ,
604+ )
506605 self .execute_async = async_to_raw_response_wrapper (
507606 executions .execute_async ,
508607 )
509608 self .execute_sync = async_to_raw_response_wrapper (
510609 executions .execute_sync ,
511610 )
611+ self .kill = async_to_raw_response_wrapper (
612+ executions .kill ,
613+ )
512614
513615
514616class ExecutionsResourceWithStreamingResponse :
515617 def __init__ (self , executions : ExecutionsResource ) -> None :
516618 self ._executions = executions
517619
620+ self .retrieve = to_streamed_response_wrapper (
621+ executions .retrieve ,
622+ )
518623 self .execute_async = to_streamed_response_wrapper (
519624 executions .execute_async ,
520625 )
521626 self .execute_sync = to_streamed_response_wrapper (
522627 executions .execute_sync ,
523628 )
629+ self .kill = to_streamed_response_wrapper (
630+ executions .kill ,
631+ )
524632
525633
526634class AsyncExecutionsResourceWithStreamingResponse :
527635 def __init__ (self , executions : AsyncExecutionsResource ) -> None :
528636 self ._executions = executions
529637
638+ self .retrieve = async_to_streamed_response_wrapper (
639+ executions .retrieve ,
640+ )
530641 self .execute_async = async_to_streamed_response_wrapper (
531642 executions .execute_async ,
532643 )
533644 self .execute_sync = async_to_streamed_response_wrapper (
534645 executions .execute_sync ,
535646 )
647+ self .kill = async_to_streamed_response_wrapper (
648+ executions .kill ,
649+ )
0 commit comments