@boatdev/sdk 1.9.2 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +28 -0
- package/dist/apis/BoatApi.d.ts +192 -4
- package/dist/apis/BoatApi.js +452 -5
- package/dist/esm/apis/BoatApi.d.ts +192 -4
- package/dist/esm/apis/BoatApi.js +451 -4
- package/dist/esm/models/CommandAttachFrame.d.ts +121 -0
- package/dist/esm/models/CommandAttachFrame.js +83 -0
- package/dist/esm/models/CommandInfoResponse.d.ts +52 -0
- package/dist/esm/models/CommandInfoResponse.js +58 -0
- package/dist/esm/models/CommandListResponse.d.ts +58 -0
- package/dist/esm/models/CommandListResponse.js +62 -0
- package/dist/esm/models/CommandLogsResponse.d.ts +109 -0
- package/dist/esm/models/CommandLogsResponse.js +99 -0
- package/dist/esm/models/CommandRecord.d.ts +132 -0
- package/dist/esm/models/CommandRecord.js +105 -0
- package/dist/esm/models/CommandResponse.d.ts +6 -0
- package/dist/esm/models/CommandResponse.js +2 -0
- package/dist/esm/models/CommandStartedResponse.d.ts +6 -0
- package/dist/esm/models/CommandStartedResponse.js +2 -0
- package/dist/esm/models/CommandStatusResponse.d.ts +32 -2
- package/dist/esm/models/CommandStatusResponse.js +10 -0
- package/dist/esm/models/CommandStopResponse.d.ts +70 -0
- package/dist/esm/models/CommandStopResponse.js +70 -0
- package/dist/esm/models/CommandStreamFrame.d.ts +6 -0
- package/dist/esm/models/CommandStreamFrame.js +2 -0
- package/dist/esm/models/CreateSandboxRequest.d.ts +6 -0
- package/dist/esm/models/CreateSandboxRequest.js +2 -0
- package/dist/esm/models/DataRetentionPolicyResponse.d.ts +12 -0
- package/dist/esm/models/DataRetentionPolicyResponse.js +4 -0
- package/dist/esm/models/DataRetentionUpdateRequest.d.ts +7 -1
- package/dist/esm/models/DataRetentionUpdateRequest.js +2 -0
- package/dist/esm/models/ForkRequest.d.ts +6 -0
- package/dist/esm/models/ForkRequest.js +2 -0
- package/dist/esm/models/ProcessListResponse.d.ts +70 -0
- package/dist/esm/models/ProcessListResponse.js +70 -0
- package/dist/esm/models/Sandbox.d.ts +6 -0
- package/dist/esm/models/Sandbox.js +2 -0
- package/dist/esm/models/SandboxProcess.d.ts +74 -0
- package/dist/esm/models/SandboxProcess.js +59 -0
- package/dist/esm/models/TelemetryConfig.d.ts +57 -0
- package/dist/esm/models/TelemetryConfig.js +60 -0
- package/dist/esm/models/TelemetryConfigLastError.d.ts +44 -0
- package/dist/esm/models/TelemetryConfigLastError.js +51 -0
- package/dist/esm/models/TelemetryResponse.d.ts +45 -0
- package/dist/esm/models/TelemetryResponse.js +52 -0
- package/dist/esm/models/TelemetrySetRequest.d.ts +40 -0
- package/dist/esm/models/TelemetrySetRequest.js +45 -0
- package/dist/esm/models/TelemetrySetResponse.d.ts +52 -0
- package/dist/esm/models/TelemetrySetResponse.js +57 -0
- package/dist/esm/models/TelemetryTestResult.d.ts +44 -0
- package/dist/esm/models/TelemetryTestResult.js +51 -0
- package/dist/esm/models/index.d.ts +14 -0
- package/dist/esm/models/index.js +14 -0
- package/dist/models/CommandAttachFrame.d.ts +121 -0
- package/dist/models/CommandAttachFrame.js +91 -0
- package/dist/models/CommandInfoResponse.d.ts +52 -0
- package/dist/models/CommandInfoResponse.js +66 -0
- package/dist/models/CommandListResponse.d.ts +58 -0
- package/dist/models/CommandListResponse.js +70 -0
- package/dist/models/CommandLogsResponse.d.ts +109 -0
- package/dist/models/CommandLogsResponse.js +107 -0
- package/dist/models/CommandRecord.d.ts +132 -0
- package/dist/models/CommandRecord.js +113 -0
- package/dist/models/CommandResponse.d.ts +6 -0
- package/dist/models/CommandResponse.js +2 -0
- package/dist/models/CommandStartedResponse.d.ts +6 -0
- package/dist/models/CommandStartedResponse.js +2 -0
- package/dist/models/CommandStatusResponse.d.ts +32 -2
- package/dist/models/CommandStatusResponse.js +10 -0
- package/dist/models/CommandStopResponse.d.ts +70 -0
- package/dist/models/CommandStopResponse.js +78 -0
- package/dist/models/CommandStreamFrame.d.ts +6 -0
- package/dist/models/CommandStreamFrame.js +2 -0
- package/dist/models/CreateSandboxRequest.d.ts +6 -0
- package/dist/models/CreateSandboxRequest.js +2 -0
- package/dist/models/DataRetentionPolicyResponse.d.ts +12 -0
- package/dist/models/DataRetentionPolicyResponse.js +4 -0
- package/dist/models/DataRetentionUpdateRequest.d.ts +7 -1
- package/dist/models/DataRetentionUpdateRequest.js +2 -0
- package/dist/models/ForkRequest.d.ts +6 -0
- package/dist/models/ForkRequest.js +2 -0
- package/dist/models/ProcessListResponse.d.ts +70 -0
- package/dist/models/ProcessListResponse.js +78 -0
- package/dist/models/Sandbox.d.ts +6 -0
- package/dist/models/Sandbox.js +2 -0
- package/dist/models/SandboxProcess.d.ts +74 -0
- package/dist/models/SandboxProcess.js +66 -0
- package/dist/models/TelemetryConfig.d.ts +57 -0
- package/dist/models/TelemetryConfig.js +67 -0
- package/dist/models/TelemetryConfigLastError.d.ts +44 -0
- package/dist/models/TelemetryConfigLastError.js +58 -0
- package/dist/models/TelemetryResponse.d.ts +45 -0
- package/dist/models/TelemetryResponse.js +59 -0
- package/dist/models/TelemetrySetRequest.d.ts +40 -0
- package/dist/models/TelemetrySetRequest.js +52 -0
- package/dist/models/TelemetrySetResponse.d.ts +52 -0
- package/dist/models/TelemetrySetResponse.js +64 -0
- package/dist/models/TelemetryTestResult.d.ts +44 -0
- package/dist/models/TelemetryTestResult.js +58 -0
- package/dist/models/index.d.ts +14 -0
- package/dist/models/index.js +14 -0
- package/docs/BoatApi.md +715 -11
- package/docs/Command200Response.md +2 -0
- package/docs/CommandAttachFrame.md +53 -0
- package/docs/CommandInfoResponse.md +36 -0
- package/docs/CommandListResponse.md +38 -0
- package/docs/CommandLogsResponse.md +50 -0
- package/docs/CommandRecord.md +59 -0
- package/docs/CommandResponse.md +2 -0
- package/docs/CommandStartedResponse.md +2 -0
- package/docs/CommandStatusResponse.md +10 -0
- package/docs/CommandStopResponse.md +42 -0
- package/docs/CommandStreamFrame.md +2 -0
- package/docs/CreateSandboxRequest.md +2 -0
- package/docs/DataRetentionPolicyResponse.md +4 -0
- package/docs/DataRetentionUpdateRequest.md +3 -1
- package/docs/ForkRequest.md +2 -0
- package/docs/ProcessListResponse.md +42 -0
- package/docs/Sandbox.md +2 -0
- package/docs/SandboxProcess.md +46 -0
- package/docs/TelemetryConfig.md +40 -0
- package/docs/TelemetryConfigLastError.md +37 -0
- package/docs/TelemetryResponse.md +36 -0
- package/docs/TelemetrySetRequest.md +34 -0
- package/docs/TelemetrySetResponse.md +38 -0
- package/docs/TelemetryTestResult.md +36 -0
- package/package.json +1 -1
- package/src/apis/BoatApi.ts +671 -4
- package/src/models/CommandAttachFrame.ts +179 -0
- package/src/models/CommandInfoResponse.ts +102 -0
- package/src/models/CommandListResponse.ts +111 -0
- package/src/models/CommandLogsResponse.ts +175 -0
- package/src/models/CommandRecord.ts +204 -0
- package/src/models/CommandResponse.ts +8 -0
- package/src/models/CommandStartedResponse.ts +8 -0
- package/src/models/CommandStatusResponse.ts +42 -2
- package/src/models/CommandStopResponse.ts +129 -0
- package/src/models/CommandStreamFrame.ts +8 -0
- package/src/models/CreateSandboxRequest.ts +8 -0
- package/src/models/DataRetentionPolicyResponse.ts +16 -0
- package/src/models/DataRetentionUpdateRequest.ts +9 -1
- package/src/models/ForkRequest.ts +8 -0
- package/src/models/ProcessListResponse.ts +129 -0
- package/src/models/Sandbox.ts +8 -0
- package/src/models/SandboxProcess.ts +123 -0
- package/src/models/TelemetryConfig.ts +110 -0
- package/src/models/TelemetryConfigLastError.ts +84 -0
- package/src/models/TelemetryResponse.ts +92 -0
- package/src/models/TelemetrySetRequest.ts +74 -0
- package/src/models/TelemetrySetResponse.ts +108 -0
- package/src/models/TelemetryTestResult.ts +84 -0
- package/src/models/index.ts +14 -0
package/docs/BoatApi.md
CHANGED
|
@@ -8,7 +8,10 @@ All URIs are relative to *https://boat.dev/api/v1*
|
|
|
8
8
|
| [**apiKeyUsage**](BoatApi.md#apikeyusage) | **GET** /api-keys/{apiKeyId}/usage | Get API key usage |
|
|
9
9
|
| [**apiKeys**](BoatApi.md#apikeys) | **GET** /api-keys | List API keys |
|
|
10
10
|
| [**artifact**](BoatApi.md#artifact) | **GET** /sandboxes/{sandboxId}/artifacts | Download a sandbox artifact |
|
|
11
|
+
| [**attachCommand**](BoatApi.md#attachcommand) | **GET** /sandboxes/{sandboxId}/commands/{processId}/stream | Attach to a detached command |
|
|
11
12
|
| [**command**](BoatApi.md#commandoperation) | **POST** /sandboxes/{sandboxId}/commands | Execute a command in a sandbox |
|
|
13
|
+
| [**commandHistory**](BoatApi.md#commandhistory) | **GET** /sandboxes/{sandboxId}/command-history | List the command and process history |
|
|
14
|
+
| [**commandLogs**](BoatApi.md#commandlogs) | **GET** /sandboxes/{sandboxId}/command-history/{commandId}/logs | Read a command\'s stored output |
|
|
12
15
|
| [**commandStatus**](BoatApi.md#commandstatus) | **GET** /sandboxes/{sandboxId}/commands/{processId} | Get detached command status and logs |
|
|
13
16
|
| [**conversations**](BoatApi.md#conversations) | **GET** /sandboxes/{sandboxId}/conversations | List boat conversations |
|
|
14
17
|
| [**create**](BoatApi.md#create) | **POST** /sandboxes | Create sandbox |
|
|
@@ -24,12 +27,14 @@ All URIs are relative to *https://boat.dev/api/v1*
|
|
|
24
27
|
| [**deleteSandbox**](BoatApi.md#deletesandbox) | **DELETE** /sandboxes/{sandboxId} | Permanently delete sandbox data |
|
|
25
28
|
| [**deleteSandboxSnapshots**](BoatApi.md#deletesandboxsnapshots) | **DELETE** /sandboxes/{sandboxId}/snapshots | Permanently delete all snapshots of a sandbox |
|
|
26
29
|
| [**deleteSnapshot**](BoatApi.md#deletesnapshot) | **DELETE** /snapshots/{snapshotId} | Permanently delete snapshot data |
|
|
30
|
+
| [**deleteTelemetry**](BoatApi.md#deletetelemetry) | **DELETE** /telemetry | Remove OpenTelemetry export |
|
|
27
31
|
| [**deleteWebhook**](BoatApi.md#deletewebhook) | **DELETE** /webhooks/{webhookId} | Delete webhook |
|
|
28
32
|
| [**desktop**](BoatApi.md#desktopoperation) | **POST** /sandboxes/{sandboxId}/desktop | Get desktop streaming URL |
|
|
29
33
|
| [**environments**](BoatApi.md#environments) | **GET** /environments | List Sandbox environments |
|
|
30
34
|
| [**events**](BoatApi.md#events) | **GET** /sandboxes/{sandboxId}/events | List boat events |
|
|
31
35
|
| [**fork**](BoatApi.md#forkoperation) | **POST** /sandboxes/{sandboxId}/fork | Fork sandbox |
|
|
32
36
|
| [**get**](BoatApi.md#get) | **GET** /sandboxes/{sandboxId} | Get sandbox |
|
|
37
|
+
| [**getCommand**](BoatApi.md#getcommand) | **GET** /sandboxes/{sandboxId}/command-history/{commandId} | Get one command from the history |
|
|
33
38
|
| [**getDataRetention**](BoatApi.md#getdataretention) | **GET** /account/data-retention | Get account data-retention policy |
|
|
34
39
|
| [**getDeletionOperation**](BoatApi.md#getdeletionoperation) | **GET** /deletion-operations/{operationId} | Get deletion operation |
|
|
35
40
|
| [**getLatestSandboxSnapshot**](BoatApi.md#getlatestsandboxsnapshot) | **GET** /sandboxes/{sandboxId}/snapshots/latest | Get latest boat snapshot |
|
|
@@ -38,6 +43,7 @@ All URIs are relative to *https://boat.dev/api/v1*
|
|
|
38
43
|
| [**getSnapshotFile**](BoatApi.md#getsnapshotfile) | **GET** /snapshots/{snapshotId}/files | Download a file or folder from a snapshot |
|
|
39
44
|
| [**getSnapshotTree**](BoatApi.md#getsnapshottree) | **GET** /snapshots/{snapshotId}/tree | Get snapshot file tree |
|
|
40
45
|
| [**getStop**](BoatApi.md#getstop) | **GET** /sandboxes/{sandboxId}/stops/{stopId} | Get a stop by id |
|
|
46
|
+
| [**getTelemetry**](BoatApi.md#gettelemetry) | **GET** /telemetry | Get OpenTelemetry export |
|
|
41
47
|
| [**getWebhook**](BoatApi.md#getwebhook) | **GET** /webhooks/{webhookId} | Get webhook |
|
|
42
48
|
| [**hostPort**](BoatApi.md#hostportoperation) | **POST** /sandboxes/{sandboxId}/host | Expose a sandbox port on a public HTTPS URL |
|
|
43
49
|
| [**interrupt**](BoatApi.md#interrupt) | **POST** /sandboxes/{sandboxId}/interrupt | Interrupt running work |
|
|
@@ -49,6 +55,7 @@ All URIs are relative to *https://boat.dev/api/v1*
|
|
|
49
55
|
| [**listSnapshots**](BoatApi.md#listsnapshots) | **GET** /snapshots | List snapshots |
|
|
50
56
|
| [**listWebhooks**](BoatApi.md#listwebhooks) | **GET** /webhooks | List webhooks |
|
|
51
57
|
| [**me**](BoatApi.md#me) | **GET** /me | Get current Boat user |
|
|
58
|
+
| [**processes**](BoatApi.md#processes) | **GET** /sandboxes/{sandboxId}/processes | List the processes in a sandbox |
|
|
52
59
|
| [**prompt**](BoatApi.md#promptoperation) | **POST** /sandboxes/{sandboxId}/prompt | Prompt Sandbox |
|
|
53
60
|
| [**promptRunStatus**](BoatApi.md#promptrunstatus) | **GET** /sandboxes/{sandboxId}/prompts/{promptId} | Get prompt run status |
|
|
54
61
|
| [**readFile**](BoatApi.md#readfile) | **GET** /sandboxes/{sandboxId}/files | Read a file from a sandbox |
|
|
@@ -66,10 +73,12 @@ All URIs are relative to *https://boat.dev/api/v1*
|
|
|
66
73
|
| [**setActiveOrganization**](BoatApi.md#setactiveorganization) | **PATCH** /orgs/active | Set the active organization |
|
|
67
74
|
| [**setEnvironmentSecretFile**](BoatApi.md#setenvironmentsecretfileoperation) | **PUT** /environments/{environmentId}/secret-files | Write one secret file |
|
|
68
75
|
| [**setEnvironmentVar**](BoatApi.md#setenvironmentvaroperation) | **PUT** /environments/{environmentId}/vars/{key} | Set one environment variable |
|
|
76
|
+
| [**setTelemetry**](BoatApi.md#settelemetry) | **PUT** /telemetry | Set OpenTelemetry export |
|
|
69
77
|
| [**share**](BoatApi.md#share) | **POST** /sandboxes/{sandboxId}/share | Share sandbox with the organization |
|
|
70
78
|
| [**sshKey**](BoatApi.md#sshkeyoperation) | **POST** /sandboxes/{sandboxId}/sshkey | Configure sandbox SSH key |
|
|
71
79
|
| [**steer**](BoatApi.md#steeroperation) | **POST** /sandboxes/{sandboxId}/steer | Steer a running turn |
|
|
72
80
|
| [**stop**](BoatApi.md#stopoperation) | **POST** /sandboxes/{sandboxId}/stop | Stop and archive sandbox |
|
|
81
|
+
| [**stopCommand**](BoatApi.md#stopcommand) | **DELETE** /sandboxes/{sandboxId}/commands/{processId} | Stop a detached command |
|
|
73
82
|
| [**update**](BoatApi.md#update) | **PATCH** /sandboxes/{sandboxId} | Update sandbox |
|
|
74
83
|
| [**updateDataRetention**](BoatApi.md#updatedataretention) | **PATCH** /account/data-retention | Update account data-retention policy |
|
|
75
84
|
| [**updateEnvironment**](BoatApi.md#updateenvironment) | **PUT** /environments/{environmentId} | Update a sandbox environment |
|
|
@@ -370,13 +379,97 @@ example().catch(console.error);
|
|
|
370
379
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
371
380
|
|
|
372
381
|
|
|
382
|
+
## attachCommand
|
|
383
|
+
|
|
384
|
+
> CommandAttachFrame attachCommand(sandboxId, processId, stdoutOffset, stderrOffset)
|
|
385
|
+
|
|
386
|
+
Attach to a detached command
|
|
387
|
+
|
|
388
|
+
The output of a detached command as it is written, one JSON object per line, until the command ends. After 10 minutes the stream ends with a `reconnect` line: open it again with its offsets to continue with no gap. One open stream replaces polling. Needs the `exec` key scope.
|
|
389
|
+
|
|
390
|
+
### Example
|
|
391
|
+
|
|
392
|
+
```ts
|
|
393
|
+
import {
|
|
394
|
+
Configuration,
|
|
395
|
+
BoatApi,
|
|
396
|
+
} from '@boatdev/sdk';
|
|
397
|
+
import type { AttachCommandRequest } from '@boatdev/sdk';
|
|
398
|
+
|
|
399
|
+
async function example() {
|
|
400
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
401
|
+
const config = new Configuration({
|
|
402
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
403
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
404
|
+
});
|
|
405
|
+
const api = new BoatApi(config);
|
|
406
|
+
|
|
407
|
+
const body = {
|
|
408
|
+
// string | Public Sandbox id returned by create/list/get sandbox calls.
|
|
409
|
+
sandboxId: sandboxId_example,
|
|
410
|
+
// number | Process id returned by a detached command start.
|
|
411
|
+
processId: 56,
|
|
412
|
+
// number | Start stdout at this byte offset. 0 sends the whole log. (optional)
|
|
413
|
+
stdoutOffset: 56,
|
|
414
|
+
// number | Start stderr at this byte offset. 0 sends the whole log. (optional)
|
|
415
|
+
stderrOffset: 56,
|
|
416
|
+
} satisfies AttachCommandRequest;
|
|
417
|
+
|
|
418
|
+
try {
|
|
419
|
+
const data = await api.attachCommand(body);
|
|
420
|
+
console.log(data);
|
|
421
|
+
} catch (error) {
|
|
422
|
+
console.error(error);
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
// Run the test
|
|
427
|
+
example().catch(console.error);
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### Parameters
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
| Name | Type | Description | Notes |
|
|
434
|
+
|------------- | ------------- | ------------- | -------------|
|
|
435
|
+
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
436
|
+
| **processId** | `number` | Process id returned by a detached command start. | [Defaults to `undefined`] |
|
|
437
|
+
| **stdoutOffset** | `number` | Start stdout at this byte offset. 0 sends the whole log. | [Optional] [Defaults to `0`] |
|
|
438
|
+
| **stderrOffset** | `number` | Start stderr at this byte offset. 0 sends the whole log. | [Optional] [Defaults to `0`] |
|
|
439
|
+
|
|
440
|
+
### Return type
|
|
441
|
+
|
|
442
|
+
[**CommandAttachFrame**](CommandAttachFrame.md)
|
|
443
|
+
|
|
444
|
+
### Authorization
|
|
445
|
+
|
|
446
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
447
|
+
|
|
448
|
+
### HTTP request headers
|
|
449
|
+
|
|
450
|
+
- **Content-Type**: Not defined
|
|
451
|
+
- **Accept**: `application/x-ndjson`, `application/json`
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
### HTTP response details
|
|
455
|
+
| Status code | Description | Response headers |
|
|
456
|
+
|-------------|-------------|------------------|
|
|
457
|
+
| **200** | The output stream. | - |
|
|
458
|
+
| **400** | Invalid request body or parameters. | - |
|
|
459
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
460
|
+
| **404** | Resource not found. | - |
|
|
461
|
+
| **409** | Request conflicts with current account or sandbox state. | - |
|
|
462
|
+
|
|
463
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
464
|
+
|
|
465
|
+
|
|
373
466
|
## command
|
|
374
467
|
|
|
375
468
|
> Command200Response command(sandboxId, commandRequest)
|
|
376
469
|
|
|
377
470
|
Execute a command in a sandbox
|
|
378
471
|
|
|
379
|
-
Runs the command synchronously by default (timeout configurable via `timeoutSeconds`, 600s cap). With `detached: true` the command starts in the background and a process id is returned immediately; poll `/sandboxes/{sandboxId}/commands/{processId}` for status and logs. With `stream: true` the output arrives as the command writes it, as newline-delimited JSON (`application/x-ndjson`): `{\"type\":\"started\"}`, then `{\"type\":\"stdout\"|\"stderr\",\"data\":\"...\"}` per chunk, and last `{\"type\":\"exit\",...}` (the synchronous result without stdout/stderr) or `{\"type\":\"error\",\"error\":\"...\",\"message\":\"...\"}`. Returns 400 invalid_timeout when `timeoutSeconds` is not an integer in 1-600. A command sent while the sandbox is still starting (right after a resume) waits up to 60s for it to be ready instead of failing; 409 boat_starting (retryable) is returned only if it is still not ready by then. A sandbox that is not starting (`error`, `stopped`) returns 409 sandbox_not_ready with `retryable: false` and its `state` at once: resume or recover it first. Command execution is never retried automatically: a 502 boat_direct_failed means the command may already be running on the sandbox.
|
|
472
|
+
Runs the command synchronously by default (timeout configurable via `timeoutSeconds`, 600s cap). With `detached: true` the command starts in the background and a process id is returned immediately; poll `/sandboxes/{sandboxId}/commands/{processId}` for status and logs. With `stream: true` the output arrives as the command writes it, as newline-delimited JSON (`application/x-ndjson`): `{\"type\":\"started\"}`, then `{\"type\":\"stdout\"|\"stderr\",\"data\":\"...\"}` per chunk, and last `{\"type\":\"exit\",...}` (the synchronous result without stdout/stderr) or `{\"type\":\"error\",\"error\":\"...\",\"message\":\"...\"}`. Returns 400 invalid_timeout when `timeoutSeconds` is not an integer in 1-600. A command sent while the sandbox is still starting (right after a resume) waits up to 60s for it to be ready instead of failing; 409 boat_starting (retryable) is returned only if it is still not ready by then. A sandbox that is not starting (`error`, `stopped`) returns 409 sandbox_not_ready with `retryable: false` and its `state` at once: resume or recover it first. Command execution is never retried automatically: a 502 boat_direct_failed means the command may already be running on the sandbox. Every command and its output are kept 90 days in the command history (`/sandboxes/{sandboxId}/command-history`), readable while the sandbox is stopped.
|
|
380
473
|
|
|
381
474
|
### Example
|
|
382
475
|
|
|
@@ -448,12 +541,189 @@ example().catch(console.error);
|
|
|
448
541
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
449
542
|
|
|
450
543
|
|
|
544
|
+
## commandHistory
|
|
545
|
+
|
|
546
|
+
> CommandListResponse commandHistory(sandboxId, mode, q, limit, cursor)
|
|
547
|
+
|
|
548
|
+
List the command and process history
|
|
549
|
+
|
|
550
|
+
Every command run through `POST /sandboxes/{sandboxId}/commands` in the last 90 days, and every other process that wrote to its stdout/stderr in the last 72 hours (mode `process`), newest first. Works while the sandbox is stopped.
|
|
551
|
+
|
|
552
|
+
### Example
|
|
553
|
+
|
|
554
|
+
```ts
|
|
555
|
+
import {
|
|
556
|
+
Configuration,
|
|
557
|
+
BoatApi,
|
|
558
|
+
} from '@boatdev/sdk';
|
|
559
|
+
import type { CommandHistoryRequest } from '@boatdev/sdk';
|
|
560
|
+
|
|
561
|
+
async function example() {
|
|
562
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
563
|
+
const config = new Configuration({
|
|
564
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
565
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
566
|
+
});
|
|
567
|
+
const api = new BoatApi(config);
|
|
568
|
+
|
|
569
|
+
const body = {
|
|
570
|
+
// string | Public Sandbox id returned by create/list/get sandbox calls.
|
|
571
|
+
sandboxId: sandboxId_example,
|
|
572
|
+
// string | Only these modes, comma-separated: sync, stream, detached, process, or `commands` for the first three. Default: all. (optional)
|
|
573
|
+
mode: mode_example,
|
|
574
|
+
// string | Only commands whose command line contains this text, in any case. (optional)
|
|
575
|
+
q: q_example,
|
|
576
|
+
// number (optional)
|
|
577
|
+
limit: 56,
|
|
578
|
+
// string | The `nextCursor` of the previous page. (optional)
|
|
579
|
+
cursor: cursor_example,
|
|
580
|
+
} satisfies CommandHistoryRequest;
|
|
581
|
+
|
|
582
|
+
try {
|
|
583
|
+
const data = await api.commandHistory(body);
|
|
584
|
+
console.log(data);
|
|
585
|
+
} catch (error) {
|
|
586
|
+
console.error(error);
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
// Run the test
|
|
591
|
+
example().catch(console.error);
|
|
592
|
+
```
|
|
593
|
+
|
|
594
|
+
### Parameters
|
|
595
|
+
|
|
596
|
+
|
|
597
|
+
| Name | Type | Description | Notes |
|
|
598
|
+
|------------- | ------------- | ------------- | -------------|
|
|
599
|
+
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
600
|
+
| **mode** | `string` | Only these modes, comma-separated: sync, stream, detached, process, or `commands` for the first three. Default: all. | [Optional] [Defaults to `undefined`] |
|
|
601
|
+
| **q** | `string` | Only commands whose command line contains this text, in any case. | [Optional] [Defaults to `undefined`] |
|
|
602
|
+
| **limit** | `number` | | [Optional] [Defaults to `20`] |
|
|
603
|
+
| **cursor** | `string` | The `nextCursor` of the previous page. | [Optional] [Defaults to `undefined`] |
|
|
604
|
+
|
|
605
|
+
### Return type
|
|
606
|
+
|
|
607
|
+
[**CommandListResponse**](CommandListResponse.md)
|
|
608
|
+
|
|
609
|
+
### Authorization
|
|
610
|
+
|
|
611
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
612
|
+
|
|
613
|
+
### HTTP request headers
|
|
614
|
+
|
|
615
|
+
- **Content-Type**: Not defined
|
|
616
|
+
- **Accept**: `application/json`
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
### HTTP response details
|
|
620
|
+
| Status code | Description | Response headers |
|
|
621
|
+
|-------------|-------------|------------------|
|
|
622
|
+
| **200** | One page of commands. | - |
|
|
623
|
+
| **400** | Invalid request body or parameters. | - |
|
|
624
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
625
|
+
| **404** | Resource not found. | - |
|
|
626
|
+
|
|
627
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
## commandLogs
|
|
631
|
+
|
|
632
|
+
> CommandLogsResponse commandLogs(sandboxId, commandId, stream, offset, limit, encoding)
|
|
633
|
+
|
|
634
|
+
Read a command\'s stored output
|
|
635
|
+
|
|
636
|
+
Reads stdout or stderr from a byte offset, at most 1 MiB per call. Read on with `nextOffset` until `done`. A running detached command gains output every 30 s; a streamed one every 2 s. Works while the sandbox is stopped.
|
|
637
|
+
|
|
638
|
+
### Example
|
|
639
|
+
|
|
640
|
+
```ts
|
|
641
|
+
import {
|
|
642
|
+
Configuration,
|
|
643
|
+
BoatApi,
|
|
644
|
+
} from '@boatdev/sdk';
|
|
645
|
+
import type { CommandLogsRequest } from '@boatdev/sdk';
|
|
646
|
+
|
|
647
|
+
async function example() {
|
|
648
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
649
|
+
const config = new Configuration({
|
|
650
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
651
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
652
|
+
});
|
|
653
|
+
const api = new BoatApi(config);
|
|
654
|
+
|
|
655
|
+
const body = {
|
|
656
|
+
// string | Public Sandbox id returned by create/list/get sandbox calls.
|
|
657
|
+
sandboxId: sandboxId_example,
|
|
658
|
+
// string
|
|
659
|
+
commandId: commandId_example,
|
|
660
|
+
// 'stdout' | 'stderr' (optional)
|
|
661
|
+
stream: stream_example,
|
|
662
|
+
// number (optional)
|
|
663
|
+
offset: 56,
|
|
664
|
+
// number (optional)
|
|
665
|
+
limit: 56,
|
|
666
|
+
// 'utf8' | 'base64' | base64 returns the exact bytes. utf8 can split a character at the edge of a read. (optional)
|
|
667
|
+
encoding: encoding_example,
|
|
668
|
+
} satisfies CommandLogsRequest;
|
|
669
|
+
|
|
670
|
+
try {
|
|
671
|
+
const data = await api.commandLogs(body);
|
|
672
|
+
console.log(data);
|
|
673
|
+
} catch (error) {
|
|
674
|
+
console.error(error);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
// Run the test
|
|
679
|
+
example().catch(console.error);
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
### Parameters
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
| Name | Type | Description | Notes |
|
|
686
|
+
|------------- | ------------- | ------------- | -------------|
|
|
687
|
+
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
688
|
+
| **commandId** | `string` | | [Defaults to `undefined`] |
|
|
689
|
+
| **stream** | `stdout`, `stderr` | | [Optional] [Defaults to `'stdout'`] [Enum: stdout, stderr] |
|
|
690
|
+
| **offset** | `number` | | [Optional] [Defaults to `0`] |
|
|
691
|
+
| **limit** | `number` | | [Optional] [Defaults to `1048576`] |
|
|
692
|
+
| **encoding** | `utf8`, `base64` | base64 returns the exact bytes. utf8 can split a character at the edge of a read. | [Optional] [Defaults to `'utf8'`] [Enum: utf8, base64] |
|
|
693
|
+
|
|
694
|
+
### Return type
|
|
695
|
+
|
|
696
|
+
[**CommandLogsResponse**](CommandLogsResponse.md)
|
|
697
|
+
|
|
698
|
+
### Authorization
|
|
699
|
+
|
|
700
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
701
|
+
|
|
702
|
+
### HTTP request headers
|
|
703
|
+
|
|
704
|
+
- **Content-Type**: Not defined
|
|
705
|
+
- **Accept**: `application/json`
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
### HTTP response details
|
|
709
|
+
| Status code | Description | Response headers |
|
|
710
|
+
|-------------|-------------|------------------|
|
|
711
|
+
| **200** | The bytes from `offset`. | - |
|
|
712
|
+
| **400** | Invalid request body or parameters. | - |
|
|
713
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
714
|
+
| **404** | Resource not found. | - |
|
|
715
|
+
|
|
716
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
717
|
+
|
|
718
|
+
|
|
451
719
|
## commandStatus
|
|
452
720
|
|
|
453
|
-
> CommandStatusResponse commandStatus(sandboxId, processId, tailBytes)
|
|
721
|
+
> CommandStatusResponse commandStatus(sandboxId, processId, tailBytes, stdoutOffset, stderrOffset)
|
|
454
722
|
|
|
455
723
|
Get detached command status and logs
|
|
456
724
|
|
|
725
|
+
Without offsets, the answer holds the end of each log. With `stdoutOffset` or `stderrOffset`, it holds only the output written since those byte offsets, so each poll returns only new output. A sandbox agent too old for offsets answers 409 `agent_outdated`.
|
|
726
|
+
|
|
457
727
|
### Example
|
|
458
728
|
|
|
459
729
|
```ts
|
|
@@ -476,8 +746,12 @@ async function example() {
|
|
|
476
746
|
sandboxId: sandboxId_example,
|
|
477
747
|
// number | Process id returned by a detached command start.
|
|
478
748
|
processId: 56,
|
|
479
|
-
// number | Cap each returned log to its last N bytes. Defaults to 8388608 (8 MiB). (optional)
|
|
749
|
+
// number | Cap each returned log to its last N bytes. Defaults to 8388608 (8 MiB). Ignored with offsets. (optional)
|
|
480
750
|
tailBytes: 56,
|
|
751
|
+
// number | Return only stdout written from this byte offset. Use `stdoutNextOffset` of the previous answer. (optional)
|
|
752
|
+
stdoutOffset: 56,
|
|
753
|
+
// number | Return only stderr written from this byte offset. Use `stderrNextOffset` of the previous answer. (optional)
|
|
754
|
+
stderrOffset: 56,
|
|
481
755
|
} satisfies CommandStatusRequest;
|
|
482
756
|
|
|
483
757
|
try {
|
|
@@ -499,7 +773,9 @@ example().catch(console.error);
|
|
|
499
773
|
|------------- | ------------- | ------------- | -------------|
|
|
500
774
|
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
501
775
|
| **processId** | `number` | Process id returned by a detached command start. | [Defaults to `undefined`] |
|
|
502
|
-
| **tailBytes** | `number` | Cap each returned log to its last N bytes. Defaults to 8388608 (8 MiB). | [Optional] [Defaults to `undefined`] |
|
|
776
|
+
| **tailBytes** | `number` | Cap each returned log to its last N bytes. Defaults to 8388608 (8 MiB). Ignored with offsets. | [Optional] [Defaults to `undefined`] |
|
|
777
|
+
| **stdoutOffset** | `number` | Return only stdout written from this byte offset. Use `stdoutNextOffset` of the previous answer. | [Optional] [Defaults to `undefined`] |
|
|
778
|
+
| **stderrOffset** | `number` | Return only stderr written from this byte offset. Use `stderrNextOffset` of the previous answer. | [Optional] [Defaults to `undefined`] |
|
|
503
779
|
|
|
504
780
|
### Return type
|
|
505
781
|
|
|
@@ -518,10 +794,11 @@ example().catch(console.error);
|
|
|
518
794
|
### HTTP response details
|
|
519
795
|
| Status code | Description | Response headers |
|
|
520
796
|
|-------------|-------------|------------------|
|
|
521
|
-
| **200** | Process status and log tails. | - |
|
|
797
|
+
| **200** | Process status and log tails, or the output since the offsets. | - |
|
|
522
798
|
| **400** | Invalid request body or parameters. | - |
|
|
523
799
|
| **401** | Missing or invalid bearer token. | - |
|
|
524
800
|
| **404** | Resource not found. | - |
|
|
801
|
+
| **409** | Request conflicts with current account or sandbox state. | - |
|
|
525
802
|
|
|
526
803
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
527
804
|
|
|
@@ -1591,6 +1868,71 @@ example().catch(console.error);
|
|
|
1591
1868
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1592
1869
|
|
|
1593
1870
|
|
|
1871
|
+
## deleteTelemetry
|
|
1872
|
+
|
|
1873
|
+
> TelemetryResponse deleteTelemetry()
|
|
1874
|
+
|
|
1875
|
+
Remove OpenTelemetry export
|
|
1876
|
+
|
|
1877
|
+
Removes the export and its queued deliveries. Needs an API key with `account.admin`.
|
|
1878
|
+
|
|
1879
|
+
### Example
|
|
1880
|
+
|
|
1881
|
+
```ts
|
|
1882
|
+
import {
|
|
1883
|
+
Configuration,
|
|
1884
|
+
BoatApi,
|
|
1885
|
+
} from '@boatdev/sdk';
|
|
1886
|
+
import type { DeleteTelemetryRequest } from '@boatdev/sdk';
|
|
1887
|
+
|
|
1888
|
+
async function example() {
|
|
1889
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
1890
|
+
const config = new Configuration({
|
|
1891
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
1892
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
1893
|
+
});
|
|
1894
|
+
const api = new BoatApi(config);
|
|
1895
|
+
|
|
1896
|
+
try {
|
|
1897
|
+
const data = await api.deleteTelemetry();
|
|
1898
|
+
console.log(data);
|
|
1899
|
+
} catch (error) {
|
|
1900
|
+
console.error(error);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
// Run the test
|
|
1905
|
+
example().catch(console.error);
|
|
1906
|
+
```
|
|
1907
|
+
|
|
1908
|
+
### Parameters
|
|
1909
|
+
|
|
1910
|
+
This endpoint does not need any parameter.
|
|
1911
|
+
|
|
1912
|
+
### Return type
|
|
1913
|
+
|
|
1914
|
+
[**TelemetryResponse**](TelemetryResponse.md)
|
|
1915
|
+
|
|
1916
|
+
### Authorization
|
|
1917
|
+
|
|
1918
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
1919
|
+
|
|
1920
|
+
### HTTP request headers
|
|
1921
|
+
|
|
1922
|
+
- **Content-Type**: Not defined
|
|
1923
|
+
- **Accept**: `application/json`
|
|
1924
|
+
|
|
1925
|
+
|
|
1926
|
+
### HTTP response details
|
|
1927
|
+
| Status code | Description | Response headers |
|
|
1928
|
+
|-------------|-------------|------------------|
|
|
1929
|
+
| **200** | Export removed. | - |
|
|
1930
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
1931
|
+
| **404** | Resource not found. | - |
|
|
1932
|
+
|
|
1933
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
1934
|
+
|
|
1935
|
+
|
|
1594
1936
|
## deleteWebhook
|
|
1595
1937
|
|
|
1596
1938
|
> WebhookDeleteResponse deleteWebhook(webhookId)
|
|
@@ -1999,7 +2341,78 @@ import {
|
|
|
1999
2341
|
Configuration,
|
|
2000
2342
|
BoatApi,
|
|
2001
2343
|
} from '@boatdev/sdk';
|
|
2002
|
-
import type { GetRequest } from '@boatdev/sdk';
|
|
2344
|
+
import type { GetRequest } from '@boatdev/sdk';
|
|
2345
|
+
|
|
2346
|
+
async function example() {
|
|
2347
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
2348
|
+
const config = new Configuration({
|
|
2349
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
2350
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
2351
|
+
});
|
|
2352
|
+
const api = new BoatApi(config);
|
|
2353
|
+
|
|
2354
|
+
const body = {
|
|
2355
|
+
// string | Public Sandbox id returned by create/list/get sandbox calls.
|
|
2356
|
+
sandboxId: sandboxId_example,
|
|
2357
|
+
} satisfies GetRequest;
|
|
2358
|
+
|
|
2359
|
+
try {
|
|
2360
|
+
const data = await api.get(body);
|
|
2361
|
+
console.log(data);
|
|
2362
|
+
} catch (error) {
|
|
2363
|
+
console.error(error);
|
|
2364
|
+
}
|
|
2365
|
+
}
|
|
2366
|
+
|
|
2367
|
+
// Run the test
|
|
2368
|
+
example().catch(console.error);
|
|
2369
|
+
```
|
|
2370
|
+
|
|
2371
|
+
### Parameters
|
|
2372
|
+
|
|
2373
|
+
|
|
2374
|
+
| Name | Type | Description | Notes |
|
|
2375
|
+
|------------- | ------------- | ------------- | -------------|
|
|
2376
|
+
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
2377
|
+
|
|
2378
|
+
### Return type
|
|
2379
|
+
|
|
2380
|
+
[**SandboxInfoResponse**](SandboxInfoResponse.md)
|
|
2381
|
+
|
|
2382
|
+
### Authorization
|
|
2383
|
+
|
|
2384
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
2385
|
+
|
|
2386
|
+
### HTTP request headers
|
|
2387
|
+
|
|
2388
|
+
- **Content-Type**: Not defined
|
|
2389
|
+
- **Accept**: `application/json`
|
|
2390
|
+
|
|
2391
|
+
|
|
2392
|
+
### HTTP response details
|
|
2393
|
+
| Status code | Description | Response headers |
|
|
2394
|
+
|-------------|-------------|------------------|
|
|
2395
|
+
| **200** | Boat details. | - |
|
|
2396
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
2397
|
+
| **404** | Resource not found. | - |
|
|
2398
|
+
|
|
2399
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
2400
|
+
|
|
2401
|
+
|
|
2402
|
+
## getCommand
|
|
2403
|
+
|
|
2404
|
+
> CommandInfoResponse getCommand(sandboxId, commandId)
|
|
2405
|
+
|
|
2406
|
+
Get one command from the history
|
|
2407
|
+
|
|
2408
|
+
### Example
|
|
2409
|
+
|
|
2410
|
+
```ts
|
|
2411
|
+
import {
|
|
2412
|
+
Configuration,
|
|
2413
|
+
BoatApi,
|
|
2414
|
+
} from '@boatdev/sdk';
|
|
2415
|
+
import type { GetCommandRequest } from '@boatdev/sdk';
|
|
2003
2416
|
|
|
2004
2417
|
async function example() {
|
|
2005
2418
|
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
@@ -2012,10 +2425,12 @@ async function example() {
|
|
|
2012
2425
|
const body = {
|
|
2013
2426
|
// string | Public Sandbox id returned by create/list/get sandbox calls.
|
|
2014
2427
|
sandboxId: sandboxId_example,
|
|
2015
|
-
|
|
2428
|
+
// string
|
|
2429
|
+
commandId: commandId_example,
|
|
2430
|
+
} satisfies GetCommandRequest;
|
|
2016
2431
|
|
|
2017
2432
|
try {
|
|
2018
|
-
const data = await api.
|
|
2433
|
+
const data = await api.getCommand(body);
|
|
2019
2434
|
console.log(data);
|
|
2020
2435
|
} catch (error) {
|
|
2021
2436
|
console.error(error);
|
|
@@ -2032,10 +2447,11 @@ example().catch(console.error);
|
|
|
2032
2447
|
| Name | Type | Description | Notes |
|
|
2033
2448
|
|------------- | ------------- | ------------- | -------------|
|
|
2034
2449
|
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
2450
|
+
| **commandId** | `string` | | [Defaults to `undefined`] |
|
|
2035
2451
|
|
|
2036
2452
|
### Return type
|
|
2037
2453
|
|
|
2038
|
-
[**
|
|
2454
|
+
[**CommandInfoResponse**](CommandInfoResponse.md)
|
|
2039
2455
|
|
|
2040
2456
|
### Authorization
|
|
2041
2457
|
|
|
@@ -2050,7 +2466,7 @@ example().catch(console.error);
|
|
|
2050
2466
|
### HTTP response details
|
|
2051
2467
|
| Status code | Description | Response headers |
|
|
2052
2468
|
|-------------|-------------|------------------|
|
|
2053
|
-
| **200** |
|
|
2469
|
+
| **200** | The command. | - |
|
|
2054
2470
|
| **401** | Missing or invalid bearer token. | - |
|
|
2055
2471
|
| **404** | Resource not found. | - |
|
|
2056
2472
|
|
|
@@ -2418,7 +2834,7 @@ example().catch(console.error);
|
|
|
2418
2834
|
|
|
2419
2835
|
Download a file or folder from a snapshot
|
|
2420
2836
|
|
|
2421
|
-
Stream a single file\'s bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use `GET /snapshots/{snapshotId}/tree` to list paths, then pass one here. Paths are relative to the snapshot root (same space as `tree` entries; docker volumes under `__dockervol__/`). An empty or `/` path downloads the whole snapshot as a tar. Folder responses set `X-Snapshot-File-Count`, `X-Snapshot-Total-Size-Bytes` and `X-Snapshot-Skipped-Base-Image-Files` headers; both response shapes set `X-Snapshot-Entry-Kind` (`file` or `dir`).
|
|
2837
|
+
Stream a single file\'s bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use `GET /snapshots/{snapshotId}/tree` to list paths, then pass one here. Paths are relative to the snapshot root (same space as `tree` entries; docker volumes under `__dockervol__/`). An empty or `/` path downloads the whole snapshot as a tar. Folder responses set `X-Snapshot-File-Count`, `X-Snapshot-Total-Size-Bytes` and `X-Snapshot-Skipped-Base-Image-Files` headers; both response shapes set `X-Snapshot-Entry-Kind` (`file` or `dir`). File responses accept a single `Range: bytes=` header and answer 206 with `Content-Range`, so large files can be downloaded in parts and resumed.
|
|
2422
2838
|
|
|
2423
2839
|
### Example
|
|
2424
2840
|
|
|
@@ -2638,6 +3054,70 @@ example().catch(console.error);
|
|
|
2638
3054
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
2639
3055
|
|
|
2640
3056
|
|
|
3057
|
+
## getTelemetry
|
|
3058
|
+
|
|
3059
|
+
> TelemetryResponse getTelemetry()
|
|
3060
|
+
|
|
3061
|
+
Get OpenTelemetry export
|
|
3062
|
+
|
|
3063
|
+
Returns the account\'s OpenTelemetry export, or `telemetry` null when none is set. Header values are never included. Needs an API key with `account.admin`.
|
|
3064
|
+
|
|
3065
|
+
### Example
|
|
3066
|
+
|
|
3067
|
+
```ts
|
|
3068
|
+
import {
|
|
3069
|
+
Configuration,
|
|
3070
|
+
BoatApi,
|
|
3071
|
+
} from '@boatdev/sdk';
|
|
3072
|
+
import type { GetTelemetryRequest } from '@boatdev/sdk';
|
|
3073
|
+
|
|
3074
|
+
async function example() {
|
|
3075
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
3076
|
+
const config = new Configuration({
|
|
3077
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
3078
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
3079
|
+
});
|
|
3080
|
+
const api = new BoatApi(config);
|
|
3081
|
+
|
|
3082
|
+
try {
|
|
3083
|
+
const data = await api.getTelemetry();
|
|
3084
|
+
console.log(data);
|
|
3085
|
+
} catch (error) {
|
|
3086
|
+
console.error(error);
|
|
3087
|
+
}
|
|
3088
|
+
}
|
|
3089
|
+
|
|
3090
|
+
// Run the test
|
|
3091
|
+
example().catch(console.error);
|
|
3092
|
+
```
|
|
3093
|
+
|
|
3094
|
+
### Parameters
|
|
3095
|
+
|
|
3096
|
+
This endpoint does not need any parameter.
|
|
3097
|
+
|
|
3098
|
+
### Return type
|
|
3099
|
+
|
|
3100
|
+
[**TelemetryResponse**](TelemetryResponse.md)
|
|
3101
|
+
|
|
3102
|
+
### Authorization
|
|
3103
|
+
|
|
3104
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
3105
|
+
|
|
3106
|
+
### HTTP request headers
|
|
3107
|
+
|
|
3108
|
+
- **Content-Type**: Not defined
|
|
3109
|
+
- **Accept**: `application/json`
|
|
3110
|
+
|
|
3111
|
+
|
|
3112
|
+
### HTTP response details
|
|
3113
|
+
| Status code | Description | Response headers |
|
|
3114
|
+
|-------------|-------------|------------------|
|
|
3115
|
+
| **200** | The export and its last result. | - |
|
|
3116
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
3117
|
+
|
|
3118
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
3119
|
+
|
|
3120
|
+
|
|
2641
3121
|
## getWebhook
|
|
2642
3122
|
|
|
2643
3123
|
> WebhookResponse getWebhook(webhookId)
|
|
@@ -3436,6 +3916,79 @@ This endpoint does not need any parameter.
|
|
|
3436
3916
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
3437
3917
|
|
|
3438
3918
|
|
|
3919
|
+
## processes
|
|
3920
|
+
|
|
3921
|
+
> ProcessListResponse processes(sandboxId)
|
|
3922
|
+
|
|
3923
|
+
List the processes in a sandbox
|
|
3924
|
+
|
|
3925
|
+
A running sandbox: every user-space process, read now, busiest first. A stopped sandbox: the last sample kept (`live: false`).
|
|
3926
|
+
|
|
3927
|
+
### Example
|
|
3928
|
+
|
|
3929
|
+
```ts
|
|
3930
|
+
import {
|
|
3931
|
+
Configuration,
|
|
3932
|
+
BoatApi,
|
|
3933
|
+
} from '@boatdev/sdk';
|
|
3934
|
+
import type { ProcessesRequest } from '@boatdev/sdk';
|
|
3935
|
+
|
|
3936
|
+
async function example() {
|
|
3937
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
3938
|
+
const config = new Configuration({
|
|
3939
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
3940
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
3941
|
+
});
|
|
3942
|
+
const api = new BoatApi(config);
|
|
3943
|
+
|
|
3944
|
+
const body = {
|
|
3945
|
+
// string | Public Sandbox id returned by create/list/get sandbox calls.
|
|
3946
|
+
sandboxId: sandboxId_example,
|
|
3947
|
+
} satisfies ProcessesRequest;
|
|
3948
|
+
|
|
3949
|
+
try {
|
|
3950
|
+
const data = await api.processes(body);
|
|
3951
|
+
console.log(data);
|
|
3952
|
+
} catch (error) {
|
|
3953
|
+
console.error(error);
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3957
|
+
// Run the test
|
|
3958
|
+
example().catch(console.error);
|
|
3959
|
+
```
|
|
3960
|
+
|
|
3961
|
+
### Parameters
|
|
3962
|
+
|
|
3963
|
+
|
|
3964
|
+
| Name | Type | Description | Notes |
|
|
3965
|
+
|------------- | ------------- | ------------- | -------------|
|
|
3966
|
+
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
3967
|
+
|
|
3968
|
+
### Return type
|
|
3969
|
+
|
|
3970
|
+
[**ProcessListResponse**](ProcessListResponse.md)
|
|
3971
|
+
|
|
3972
|
+
### Authorization
|
|
3973
|
+
|
|
3974
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
3975
|
+
|
|
3976
|
+
### HTTP request headers
|
|
3977
|
+
|
|
3978
|
+
- **Content-Type**: Not defined
|
|
3979
|
+
- **Accept**: `application/json`
|
|
3980
|
+
|
|
3981
|
+
|
|
3982
|
+
### HTTP response details
|
|
3983
|
+
| Status code | Description | Response headers |
|
|
3984
|
+
|-------------|-------------|------------------|
|
|
3985
|
+
| **200** | The processes. | - |
|
|
3986
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
3987
|
+
| **404** | Resource not found. | - |
|
|
3988
|
+
|
|
3989
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
3990
|
+
|
|
3991
|
+
|
|
3439
3992
|
## prompt
|
|
3440
3993
|
|
|
3441
3994
|
> PromptResponse prompt(sandboxId, promptRequest)
|
|
@@ -4740,6 +5293,79 @@ example().catch(console.error);
|
|
|
4740
5293
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
4741
5294
|
|
|
4742
5295
|
|
|
5296
|
+
## setTelemetry
|
|
5297
|
+
|
|
5298
|
+
> TelemetrySetResponse setTelemetry(telemetrySetRequest)
|
|
5299
|
+
|
|
5300
|
+
Set OpenTelemetry export
|
|
5301
|
+
|
|
5302
|
+
Sets the account\'s one OTLP/HTTP destination, or replaces it. Boat then sends one metrics export at once and returns the collector\'s answer in `test`. Every 60 seconds Boat sends the sandbox and account gauges to `<endpoint>/v1/metrics`. Each sandbox lifecycle event goes to `<endpoint>/v1/logs`. The endpoint must use HTTPS on port 443 or 4318 and resolve only to public addresses. Needs an API key with `account.admin`.
|
|
5303
|
+
|
|
5304
|
+
### Example
|
|
5305
|
+
|
|
5306
|
+
```ts
|
|
5307
|
+
import {
|
|
5308
|
+
Configuration,
|
|
5309
|
+
BoatApi,
|
|
5310
|
+
} from '@boatdev/sdk';
|
|
5311
|
+
import type { SetTelemetryRequest } from '@boatdev/sdk';
|
|
5312
|
+
|
|
5313
|
+
async function example() {
|
|
5314
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
5315
|
+
const config = new Configuration({
|
|
5316
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
5317
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
5318
|
+
});
|
|
5319
|
+
const api = new BoatApi(config);
|
|
5320
|
+
|
|
5321
|
+
const body = {
|
|
5322
|
+
// TelemetrySetRequest
|
|
5323
|
+
telemetrySetRequest: {"endpoint":"https://otlp.datadoghq.com","headers":{"dd-api-key":"<DATADOG_API_KEY>"}},
|
|
5324
|
+
} satisfies SetTelemetryRequest;
|
|
5325
|
+
|
|
5326
|
+
try {
|
|
5327
|
+
const data = await api.setTelemetry(body);
|
|
5328
|
+
console.log(data);
|
|
5329
|
+
} catch (error) {
|
|
5330
|
+
console.error(error);
|
|
5331
|
+
}
|
|
5332
|
+
}
|
|
5333
|
+
|
|
5334
|
+
// Run the test
|
|
5335
|
+
example().catch(console.error);
|
|
5336
|
+
```
|
|
5337
|
+
|
|
5338
|
+
### Parameters
|
|
5339
|
+
|
|
5340
|
+
|
|
5341
|
+
| Name | Type | Description | Notes |
|
|
5342
|
+
|------------- | ------------- | ------------- | -------------|
|
|
5343
|
+
| **telemetrySetRequest** | [TelemetrySetRequest](TelemetrySetRequest.md) | | |
|
|
5344
|
+
|
|
5345
|
+
### Return type
|
|
5346
|
+
|
|
5347
|
+
[**TelemetrySetResponse**](TelemetrySetResponse.md)
|
|
5348
|
+
|
|
5349
|
+
### Authorization
|
|
5350
|
+
|
|
5351
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
5352
|
+
|
|
5353
|
+
### HTTP request headers
|
|
5354
|
+
|
|
5355
|
+
- **Content-Type**: `application/json`
|
|
5356
|
+
- **Accept**: `application/json`
|
|
5357
|
+
|
|
5358
|
+
|
|
5359
|
+
### HTTP response details
|
|
5360
|
+
| Status code | Description | Response headers |
|
|
5361
|
+
|-------------|-------------|------------------|
|
|
5362
|
+
| **200** | Export saved. `test` holds the result of the first export. | - |
|
|
5363
|
+
| **400** | Invalid request body or parameters. | - |
|
|
5364
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
5365
|
+
|
|
5366
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
5367
|
+
|
|
5368
|
+
|
|
4743
5369
|
## share
|
|
4744
5370
|
|
|
4745
5371
|
> Share200Response share(sandboxId)
|
|
@@ -5052,6 +5678,84 @@ example().catch(console.error);
|
|
|
5052
5678
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
5053
5679
|
|
|
5054
5680
|
|
|
5681
|
+
## stopCommand
|
|
5682
|
+
|
|
5683
|
+
> CommandStopResponse stopCommand(sandboxId, processId)
|
|
5684
|
+
|
|
5685
|
+
Stop a detached command
|
|
5686
|
+
|
|
5687
|
+
Sends SIGTERM to the command and every process it started, then SIGKILL to what is left after 5 s. Only a process started with `detached` can be stopped. The response carries the command\'s history record with its final state and output.
|
|
5688
|
+
|
|
5689
|
+
### Example
|
|
5690
|
+
|
|
5691
|
+
```ts
|
|
5692
|
+
import {
|
|
5693
|
+
Configuration,
|
|
5694
|
+
BoatApi,
|
|
5695
|
+
} from '@boatdev/sdk';
|
|
5696
|
+
import type { StopCommandRequest } from '@boatdev/sdk';
|
|
5697
|
+
|
|
5698
|
+
async function example() {
|
|
5699
|
+
console.log("🚀 Testing @boatdev/sdk SDK...");
|
|
5700
|
+
const config = new Configuration({
|
|
5701
|
+
// Configure HTTP bearer authorization: BoatBearerAuth
|
|
5702
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
5703
|
+
});
|
|
5704
|
+
const api = new BoatApi(config);
|
|
5705
|
+
|
|
5706
|
+
const body = {
|
|
5707
|
+
// string | Public Sandbox id returned by create/list/get sandbox calls.
|
|
5708
|
+
sandboxId: sandboxId_example,
|
|
5709
|
+
// number | Process id returned by a detached command start.
|
|
5710
|
+
processId: 56,
|
|
5711
|
+
} satisfies StopCommandRequest;
|
|
5712
|
+
|
|
5713
|
+
try {
|
|
5714
|
+
const data = await api.stopCommand(body);
|
|
5715
|
+
console.log(data);
|
|
5716
|
+
} catch (error) {
|
|
5717
|
+
console.error(error);
|
|
5718
|
+
}
|
|
5719
|
+
}
|
|
5720
|
+
|
|
5721
|
+
// Run the test
|
|
5722
|
+
example().catch(console.error);
|
|
5723
|
+
```
|
|
5724
|
+
|
|
5725
|
+
### Parameters
|
|
5726
|
+
|
|
5727
|
+
|
|
5728
|
+
| Name | Type | Description | Notes |
|
|
5729
|
+
|------------- | ------------- | ------------- | -------------|
|
|
5730
|
+
| **sandboxId** | `string` | Public Sandbox id returned by create/list/get sandbox calls. | [Defaults to `undefined`] |
|
|
5731
|
+
| **processId** | `number` | Process id returned by a detached command start. | [Defaults to `undefined`] |
|
|
5732
|
+
|
|
5733
|
+
### Return type
|
|
5734
|
+
|
|
5735
|
+
[**CommandStopResponse**](CommandStopResponse.md)
|
|
5736
|
+
|
|
5737
|
+
### Authorization
|
|
5738
|
+
|
|
5739
|
+
[BoatBearerAuth](../README.md#BoatBearerAuth)
|
|
5740
|
+
|
|
5741
|
+
### HTTP request headers
|
|
5742
|
+
|
|
5743
|
+
- **Content-Type**: Not defined
|
|
5744
|
+
- **Accept**: `application/json`
|
|
5745
|
+
|
|
5746
|
+
|
|
5747
|
+
### HTTP response details
|
|
5748
|
+
| Status code | Description | Response headers |
|
|
5749
|
+
|-------------|-------------|------------------|
|
|
5750
|
+
| **200** | The command is stopped. | - |
|
|
5751
|
+
| **400** | Invalid request body or parameters. | - |
|
|
5752
|
+
| **401** | Missing or invalid bearer token. | - |
|
|
5753
|
+
| **404** | Resource not found. | - |
|
|
5754
|
+
| **409** | Request conflicts with current account or sandbox state. | - |
|
|
5755
|
+
|
|
5756
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
5757
|
+
|
|
5758
|
+
|
|
5055
5759
|
## update
|
|
5056
5760
|
|
|
5057
5761
|
> SandboxInfoResponse update(sandboxId, updateSandboxRequest)
|