@cloudbase/manager-node 5.1.1 → 5.2.0-beta.0

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.
@@ -0,0 +1,98 @@
1
+ import { Environment } from '../environment';
2
+ import { UpdateSandboxToolOptions, UpdateSandboxToolResp, DescribeSandboxToolListOptions, DescribeSandboxToolListResp, CreateSandboxToolOptions, CreateSandboxToolResp, DeleteSandboxToolOptions, DeleteSandboxToolResp, ResumeSandboxInstanceOptions, ResumeSandboxInstanceResp, PauseSandboxInstanceOptions, PauseSandboxInstanceResp, UpdateSandboxInstanceOptions, UpdateSandboxInstanceResp, StopSandboxInstanceOptions, StopSandboxInstanceResp, StartSandboxInstanceOptions, StartSandboxInstanceResp, DescribeSandboxInstanceListOptions, DescribeSandboxInstanceListResp, AcquireSandboxInstanceTokenOptions, AcquireSandboxInstanceTokenResp, DescribeAPIKeyListResp, CreateAPIKeyOptions, CreateAPIKeyResp, DeleteAPIKeyOptions, DeleteAPIKeyResp } from './types';
3
+ export declare class SandboxService {
4
+ private environment;
5
+ private agsService;
6
+ constructor(environment: Environment);
7
+ /**
8
+ * 更新沙箱工具
9
+ * 更新指定沙箱工具的描述、网络配置、标签和自定义配置等信息。
10
+ * @param {UpdateSandboxToolOptions} options 更新参数
11
+ * @returns {Promise<UpdateSandboxToolResp>}
12
+ */
13
+ updateSandboxTool(options: UpdateSandboxToolOptions): Promise<UpdateSandboxToolResp>;
14
+ /**
15
+ * 查询沙箱工具列表
16
+ * @param {DescribeSandboxToolListOptions} options 查询参数
17
+ * @returns {Promise<DescribeSandboxToolListResp>}
18
+ */
19
+ describeSandboxToolList(options?: DescribeSandboxToolListOptions): Promise<DescribeSandboxToolListResp>;
20
+ /**
21
+ * 创建沙箱工具
22
+ * @param {CreateSandboxToolOptions} options 创建参数
23
+ * @returns {Promise<CreateSandboxToolResp>}
24
+ */
25
+ createSandboxTool(options: CreateSandboxToolOptions): Promise<CreateSandboxToolResp>;
26
+ /**
27
+ * 删除沙箱工具
28
+ * @param {DeleteSandboxToolOptions} options 删除参数
29
+ * @returns {Promise<DeleteSandboxToolResp>}
30
+ */
31
+ deleteSandboxTool(options: DeleteSandboxToolOptions): Promise<DeleteSandboxToolResp>;
32
+ /**
33
+ * 恢复沙箱实例
34
+ * @param {ResumeSandboxInstanceOptions} options 恢复参数
35
+ * @returns {Promise<ResumeSandboxInstanceResp>}
36
+ */
37
+ resumeSandboxInstance(options: ResumeSandboxInstanceOptions): Promise<ResumeSandboxInstanceResp>;
38
+ /**
39
+ * 暂停沙箱实例
40
+ * @param {PauseSandboxInstanceOptions} options 暂停参数
41
+ * @returns {Promise<PauseSandboxInstanceResp>}
42
+ */
43
+ pauseSandboxInstance(options: PauseSandboxInstanceOptions): Promise<PauseSandboxInstanceResp>;
44
+ /**
45
+ * 更新沙箱实例
46
+ * 更新指定沙箱实例的超时时间和元数据等信息。
47
+ * @param {UpdateSandboxInstanceOptions} options 更新参数
48
+ * @returns {Promise<UpdateSandboxInstanceResp>}
49
+ */
50
+ updateSandboxInstance(options: UpdateSandboxInstanceOptions): Promise<UpdateSandboxInstanceResp>;
51
+ /**
52
+ * 停止沙箱实例
53
+ * @param {StopSandboxInstanceOptions} options 停止参数
54
+ * @returns {Promise<StopSandboxInstanceResp>}
55
+ */
56
+ stopSandboxInstance(options: StopSandboxInstanceOptions): Promise<StopSandboxInstanceResp>;
57
+ /**
58
+ * 启动沙箱实例
59
+ * @param {StartSandboxInstanceOptions} options 启动参数
60
+ * @returns {Promise<StartSandboxInstanceResp>}
61
+ */
62
+ startSandboxInstance(options: StartSandboxInstanceOptions): Promise<StartSandboxInstanceResp>;
63
+ /**
64
+ * 查询沙箱实例列表
65
+ * @param {DescribeSandboxInstanceListOptions} options 查询参数
66
+ * @returns {Promise<DescribeSandboxInstanceListResp>}
67
+ */
68
+ describeSandboxInstanceList(options?: DescribeSandboxInstanceListOptions): Promise<DescribeSandboxInstanceListResp>;
69
+ /**
70
+ * 获取沙箱实例访问 Token
71
+ * 获取访问沙箱工具时所需要使用的访问 Token,创建沙箱实例后需调用此接口获取沙箱实例访问 Token。
72
+ * 此 Token 可用于调用代码沙箱实例执行代码,或浏览器沙箱实例进行浏览器操作等。
73
+ * @param {AcquireSandboxInstanceTokenOptions} options 请求参数
74
+ * @returns {Promise<AcquireSandboxInstanceTokenResp>}
75
+ */
76
+ acquireSandboxInstanceToken(options: AcquireSandboxInstanceTokenOptions): Promise<AcquireSandboxInstanceTokenResp>;
77
+ /**
78
+ * 获取 API 密钥列表
79
+ * 获取 API 密钥简略信息列表,包含名称、创建时间等。
80
+ * @returns {Promise<DescribeAPIKeyListResp>}
81
+ */
82
+ describeAPIKeyList(): Promise<DescribeAPIKeyListResp>;
83
+ /**
84
+ * 创建 API 密钥
85
+ * 创建新的 API 密钥,用于调用 Agent Sandbox 接口。
86
+ * 注意:生成的 APIKey 仅在此次响应中返回,后续无法再次获取,请妥善保管。
87
+ * @param {CreateAPIKeyOptions} options 创建参数
88
+ * @returns {Promise<CreateAPIKeyResp>}
89
+ */
90
+ createAPIKey(options?: CreateAPIKeyOptions): Promise<CreateAPIKeyResp>;
91
+ /**
92
+ * 删除 API 密钥
93
+ * 注意:本接口删除的是 Agent Sandbox 专用 API Key,区别于腾讯云 Secret ID / Secret Key。
94
+ * @param {DeleteAPIKeyOptions} options 删除参数
95
+ * @returns {Promise<DeleteAPIKeyResp>}
96
+ */
97
+ deleteAPIKey(options: DeleteAPIKeyOptions): Promise<DeleteAPIKeyResp>;
98
+ }
@@ -0,0 +1,618 @@
1
+ /**
2
+ * 标签
3
+ */
4
+ export interface Tag {
5
+ /** 标签键 */
6
+ Key?: string;
7
+ /** 标签值 */
8
+ Value?: string;
9
+ }
10
+ /**
11
+ * 沙箱实例元数据项
12
+ * 被如下接口引用:DescribeSandboxInstanceList, StartSandboxInstance, UpdateSandboxInstance
13
+ */
14
+ export interface MetadataVar {
15
+ /** 沙箱元数据名 */
16
+ Name?: string;
17
+ /** 沙箱元数据值 */
18
+ Value?: string;
19
+ }
20
+ /**
21
+ * VPC 网络相关配置
22
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList, UpdateSandboxTool
23
+ */
24
+ export interface VPCConfig {
25
+ /** VPC 子网 ID 列表 */
26
+ SubnetIds?: string[];
27
+ /** 安全组 ID 列表 */
28
+ SecurityGroupIds?: string[];
29
+ }
30
+ /**
31
+ * 沙箱网络配置
32
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList, UpdateSandboxTool
33
+ */
34
+ export interface NetworkConfiguration {
35
+ /** 网络模式(当前支持 PUBLIC, VPC, SANDBOX) */
36
+ NetworkMode: string;
37
+ /** VPC 网络相关配置 */
38
+ VpcConfig?: VPCConfig;
39
+ }
40
+ /**
41
+ * 环境变量
42
+ */
43
+ export interface EnvVar {
44
+ /** 环境变量名称 */
45
+ Name: string;
46
+ /** 环境变量值 */
47
+ Value: string;
48
+ }
49
+ /**
50
+ * 端口配置
51
+ */
52
+ export interface PortConfiguration {
53
+ /** 端口名 */
54
+ Name?: string;
55
+ /** 端口 */
56
+ Port?: number;
57
+ /** 协议 */
58
+ Protocol?: string;
59
+ }
60
+ /**
61
+ * 资源配置
62
+ */
63
+ export interface ResourceConfiguration {
64
+ /** CPU 资源量,示例值: 500m */
65
+ CPU?: number;
66
+ /** 内存规格,示例值: 1Gi */
67
+ Memory?: string;
68
+ }
69
+ /**
70
+ * HTTP GET 探测动作配置
71
+ */
72
+ export interface HttpGetAction {
73
+ /** 路径 */
74
+ Path?: string;
75
+ /** 端口 */
76
+ Port?: number;
77
+ /** 协议 */
78
+ Scheme?: string;
79
+ }
80
+ /**
81
+ * 健康检查探针配置
82
+ */
83
+ export interface ProbeConfiguration {
84
+ /** HTTP GET 探测配置 */
85
+ HttpGet?: HttpGetAction;
86
+ /** 健康检查就绪超时(毫秒) */
87
+ ReadyTimeoutMs?: number;
88
+ /** 健康检查单次探测超时(毫秒) */
89
+ ProbeTimeoutMs?: number;
90
+ /** 健康检查间隔(毫秒) */
91
+ ProbePeriodMs?: number;
92
+ /** 健康检查成功阈值 */
93
+ SuccessThreshold?: number;
94
+ /** 健康检查失败阈值 */
95
+ FailureThreshold?: number;
96
+ }
97
+ /**
98
+ * 沙箱自定义 DNS 配置
99
+ */
100
+ export interface DNSConfig {
101
+ /** DNS 服务器地址,需要有效 IP 地址,默认值:10.0.0.1 */
102
+ Servers: string[];
103
+ /** 搜索域(对应 resolv.conf 的 search 指令) */
104
+ Searches?: string[];
105
+ /** 配置项(对应 resolv.conf 选项) */
106
+ Options?: string[];
107
+ }
108
+ /**
109
+ * 沙箱自定义配置
110
+ * 被如下接口引用:CreateSandboxTool, StartSandboxInstance, UpdateSandboxTool
111
+ */
112
+ export interface CustomConfiguration {
113
+ /** 镜像地址 */
114
+ Image?: string;
115
+ /** 镜像仓库类型:enterprise、personal */
116
+ ImageRegistryType?: string;
117
+ /** 启动命令 */
118
+ Command?: string[];
119
+ /** 启动参数 */
120
+ Args?: string[];
121
+ /** 环境变量 */
122
+ Env?: EnvVar[];
123
+ /** 端口配置 */
124
+ Ports?: PortConfiguration[];
125
+ /** 资源配置 */
126
+ Resources?: ResourceConfiguration;
127
+ /** 探针配置 */
128
+ Probe?: ProbeConfiguration;
129
+ /** 沙箱 DNS 配置 */
130
+ DNSConfig?: DNSConfig;
131
+ }
132
+ /**
133
+ * UpdateSandboxTool 请求参数
134
+ */
135
+ export interface UpdateSandboxToolOptions {
136
+ /** 沙箱工具 ID,如 sdt-dibk4rra */
137
+ toolId: string;
138
+ /** 沙箱工具描述,最大长度 200 字符 */
139
+ description?: string;
140
+ /** 网络配置 */
141
+ networkConfiguration?: NetworkConfiguration;
142
+ /** 标签 */
143
+ tags?: Tag[];
144
+ /** 沙箱工具自定义配置 */
145
+ customConfiguration?: CustomConfiguration;
146
+ }
147
+ /**
148
+ * UpdateSandboxTool 返回结果
149
+ */
150
+ export interface UpdateSandboxToolResp {
151
+ /** 唯一请求 ID */
152
+ RequestId: string;
153
+ }
154
+ /**
155
+ * 过滤列表规则
156
+ * 被如下接口引用:DescribeSandboxInstanceList, DescribeSandboxToolList
157
+ */
158
+ export interface Filter {
159
+ /** 属性名称,若存在多个 Filter 时,Filter 间的关系为逻辑与(AND) */
160
+ Name?: string;
161
+ /** 属性值,若同一个 Filter 存在多个 Values,同一 Filter 下 Values 间的关系为逻辑或(OR) */
162
+ Values?: string[];
163
+ }
164
+ /**
165
+ * 对象存储桶挂载配置
166
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList
167
+ */
168
+ export interface CosStorageSource {
169
+ /** 对象存储访问域名 */
170
+ Endpoint?: string;
171
+ /** 对象存储桶名称 */
172
+ BucketName?: string;
173
+ /** 对象存储桶路径,必须为以 / 起始的绝对路径 */
174
+ BucketPath?: string;
175
+ }
176
+ /**
177
+ * 镜像卷挂载源配置
178
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList
179
+ */
180
+ export interface ImageStorageSource {
181
+ /** 镜像地址 */
182
+ Reference?: string;
183
+ /** 镜像仓库类型:enterprise、personal */
184
+ ImageRegistryType?: string;
185
+ /** 镜像内部的路径 */
186
+ SubPath?: string;
187
+ /** 镜像 Digest,请求时无需传入 */
188
+ Digest?: string;
189
+ }
190
+ /**
191
+ * 文件存储配置
192
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList
193
+ */
194
+ export interface CfsStorageSource {
195
+ /** CFS 资源 ID */
196
+ FileSystemId?: string;
197
+ /** CFS 挂载路径 */
198
+ Path?: string;
199
+ }
200
+ /**
201
+ * 挂载存储配置
202
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList
203
+ */
204
+ export interface StorageSource {
205
+ /** 对象存储桶配置 */
206
+ Cos?: CosStorageSource;
207
+ /** 镜像卷配置 */
208
+ Image?: ImageStorageSource;
209
+ /** 文件存储配置 */
210
+ Cfs?: CfsStorageSource;
211
+ }
212
+ /**
213
+ * 沙箱工具中实例存储挂载配置
214
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList
215
+ */
216
+ export interface StorageMount {
217
+ /** 存储挂载配置名称 */
218
+ Name?: string;
219
+ /** 存储配置 */
220
+ StorageSource?: StorageSource;
221
+ /** 沙箱实例本地挂载路径 */
222
+ MountPath?: string;
223
+ /** 存储挂载读写权限配置,默认为 false */
224
+ ReadOnly?: boolean;
225
+ }
226
+ /**
227
+ * 沙箱自定义配置详细信息(响应用,与写入用的 CustomConfiguration 区分)
228
+ * 被如下接口引用:DescribeSandboxInstanceList, DescribeSandboxToolList, StartSandboxInstance
229
+ */
230
+ export interface CustomConfigurationDetail {
231
+ /** 镜像地址 */
232
+ Image?: string;
233
+ /** 镜像仓库类型:TCR、CCR */
234
+ ImageRegistryType?: string;
235
+ /** 镜像 Digest */
236
+ ImageDigest?: string;
237
+ /** 启动命令 */
238
+ Command?: string[];
239
+ /** 启动参数 */
240
+ Args?: string[];
241
+ /** 环境变量 */
242
+ Env?: EnvVar[];
243
+ /** 端口配置 */
244
+ Ports?: PortConfiguration[];
245
+ /** 资源配置 */
246
+ Resources?: ResourceConfiguration;
247
+ /** 探针配置 */
248
+ Probe?: ProbeConfiguration;
249
+ /** 沙箱 DNS 配置 */
250
+ DNSConfig?: DNSConfig;
251
+ }
252
+ /**
253
+ * CLS 日志推送配置
254
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList
255
+ */
256
+ export interface CLSConfig {
257
+ /** 沙箱工具日志推送所使用的 CLS 日志主题 ID */
258
+ TopicId?: string;
259
+ }
260
+ /**
261
+ * 沙箱工具日志采集相关配置
262
+ * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList
263
+ */
264
+ export interface LogConfiguration {
265
+ /** 日志推送 CLS 的配置 */
266
+ CLSConfig?: CLSConfig;
267
+ }
268
+ /**
269
+ * 沙箱工具结构体
270
+ * 被如下接口引用:DescribeSandboxToolList
271
+ */
272
+ export interface SandboxTool {
273
+ /** 沙箱工具唯一标识符 */
274
+ ToolId: string;
275
+ /** 沙箱工具名称,长度 1-50 字符 */
276
+ ToolName?: string;
277
+ /** 沙箱工具类型:browser、code-interpreter、computer、mobile */
278
+ ToolType?: string;
279
+ /** 沙箱工具状态:CREATING、ACTIVE、DELETING、FAILED */
280
+ Status?: string;
281
+ /** 沙箱工具描述信息,最大长度 200 字符 */
282
+ Description?: string;
283
+ /** 默认超时时间(秒) */
284
+ DefaultTimeoutSeconds?: number;
285
+ /** 网络配置 */
286
+ NetworkConfiguration?: NetworkConfiguration;
287
+ /** 标签 */
288
+ Tags?: Tag[];
289
+ /** 创建时间,格式:ISO8601 */
290
+ CreateTime?: string;
291
+ /** 更新时间,格式:ISO8601 */
292
+ UpdateTime?: string;
293
+ /** 沙箱工具绑定角色 ARN */
294
+ RoleArn?: string;
295
+ /** 实例存储挂载配置 */
296
+ StorageMounts?: StorageMount[];
297
+ /** 沙箱工具自定义配置 */
298
+ CustomConfiguration?: CustomConfigurationDetail;
299
+ /** 日志推送相关配置 */
300
+ LogConfiguration?: LogConfiguration;
301
+ /** 用于说明沙箱工具处于该状态的原因 */
302
+ StatusReason?: string;
303
+ }
304
+ /**
305
+ * DescribeSandboxToolList 请求参数
306
+ */
307
+ export interface DescribeSandboxToolListOptions {
308
+ /** 沙箱工具 ID 列表,为空则查询所有,最大支持 100 个 */
309
+ toolIds?: string[];
310
+ /** 偏移量,默认为 0 */
311
+ offset?: number;
312
+ /** 返回数量,默认为 20,最大值为 100 */
313
+ limit?: number;
314
+ /** 过滤条件 */
315
+ filters?: Filter[];
316
+ }
317
+ /**
318
+ * DescribeSandboxToolList 返回结果
319
+ */
320
+ export interface DescribeSandboxToolListResp {
321
+ /** 沙箱工具列表 */
322
+ SandboxToolSet: SandboxTool[];
323
+ /** 符合条件的沙箱工具总数 */
324
+ TotalCount: number;
325
+ /** 唯一请求 ID */
326
+ RequestId: string;
327
+ }
328
+ /**
329
+ * CreateSandboxTool 请求参数
330
+ */
331
+ export interface CreateSandboxToolOptions {
332
+ /** 沙箱工具名称,长度 1-50 字符,支持英文、数字、下划线和连接线。同一 AppId 下名称必须唯一 */
333
+ toolName: string;
334
+ /** 沙箱工具类型:browser、code-interpreter、custom */
335
+ toolType: string;
336
+ /** 网络配置 */
337
+ networkConfiguration: NetworkConfiguration;
338
+ /** 沙箱工具描述,最大长度 200 字符 */
339
+ description?: string;
340
+ /** 默认超时时间,支持格式:5m、300s、1h 等,不指定则使用系统默认值(5 分钟),最大 24 小时 */
341
+ defaultTimeout?: string;
342
+ /** 标签 */
343
+ tags?: Tag[];
344
+ /** 幂等性 Token,长度不超过 64 字符 */
345
+ clientToken?: string;
346
+ /** 角色 ARN */
347
+ roleArn?: string;
348
+ /** 沙箱工具存储配置 */
349
+ storageMounts?: StorageMount[];
350
+ /** 沙箱工具自定义配置 */
351
+ customConfiguration?: CustomConfiguration;
352
+ /** 沙箱工具日志推送相关配置 */
353
+ logConfiguration?: LogConfiguration;
354
+ }
355
+ /**
356
+ * CreateSandboxTool 返回结果
357
+ */
358
+ export interface CreateSandboxToolResp {
359
+ /** 创建的沙箱工具 ID */
360
+ ToolId: string;
361
+ /** 唯一请求 ID */
362
+ RequestId: string;
363
+ }
364
+ /**
365
+ * DeleteSandboxTool 请求参数
366
+ */
367
+ export interface DeleteSandboxToolOptions {
368
+ /** 沙箱工具 ID,如 sdt-dibk4rra */
369
+ toolId: string;
370
+ }
371
+ /**
372
+ * DeleteSandboxTool 返回结果
373
+ */
374
+ export interface DeleteSandboxToolResp {
375
+ /** 唯一请求 ID */
376
+ RequestId: string;
377
+ }
378
+ /**
379
+ * ResumeSandboxInstance 请求参数
380
+ */
381
+ export interface ResumeSandboxInstanceOptions {
382
+ /** 沙箱实例 ID,如 4729e19d67fb4ba38854dbbfc63c72e9 */
383
+ instanceId: string;
384
+ }
385
+ /**
386
+ * ResumeSandboxInstance 返回结果
387
+ */
388
+ export interface ResumeSandboxInstanceResp {
389
+ /** 唯一请求 ID */
390
+ RequestId: string;
391
+ }
392
+ /**
393
+ * PauseSandboxInstance 请求参数
394
+ */
395
+ export interface PauseSandboxInstanceOptions {
396
+ /** 沙箱实例 ID,如 4729e19d67fb4ba38854dbbfc63c72e9 */
397
+ instanceId: string;
398
+ }
399
+ /**
400
+ * PauseSandboxInstance 返回结果
401
+ */
402
+ export interface PauseSandboxInstanceResp {
403
+ /** 唯一请求 ID */
404
+ RequestId: string;
405
+ }
406
+ /**
407
+ * UpdateSandboxInstance 请求参数
408
+ */
409
+ export interface UpdateSandboxInstanceOptions {
410
+ /** 沙箱实例 ID,如 953e15d3655e4daab120b885c908edf7 */
411
+ instanceId: string;
412
+ /** 新的超时时间(从设置时重新计算),支持格式:5m、300s、1h 等。最小 30s,最大 24h。不指定则保持原有设置 */
413
+ timeout?: string;
414
+ /** 沙箱实例元数据 */
415
+ metadata?: MetadataVar[];
416
+ }
417
+ /**
418
+ * UpdateSandboxInstance 返回结果
419
+ */
420
+ export interface UpdateSandboxInstanceResp {
421
+ /** 唯一请求 ID */
422
+ RequestId: string;
423
+ }
424
+ /**
425
+ * StopSandboxInstance 请求参数
426
+ */
427
+ export interface StopSandboxInstanceOptions {
428
+ /** 沙箱实例 ID,如 12345678123412341234123456789abc */
429
+ instanceId: string;
430
+ }
431
+ /**
432
+ * StopSandboxInstance 返回结果
433
+ */
434
+ export interface StopSandboxInstanceResp {
435
+ /** 唯一请求 ID */
436
+ RequestId: string;
437
+ }
438
+ /**
439
+ * 沙箱实例存储挂载配置可选项,用于覆盖沙箱工具的存储配置的部分选项
440
+ * 被如下接口引用:DescribeSandboxInstanceList, StartSandboxInstance
441
+ */
442
+ export interface MountOption {
443
+ /** 指定沙箱工具中的存储配置名称 */
444
+ Name?: string;
445
+ /** 沙箱实例本地挂载路径(可选),默认继承工具中的存储配置 */
446
+ MountPath?: string;
447
+ /** 沙箱实例存储挂载子路径(可选) */
448
+ SubPath?: string;
449
+ /** 沙箱实例存储挂载读写权限(可选),默认继承工具存储配置 */
450
+ ReadOnly?: boolean;
451
+ }
452
+ /**
453
+ * 沙箱实例结构体
454
+ * 被如下接口引用:DescribeSandboxInstanceList, StartSandboxInstance
455
+ */
456
+ export interface SandboxInstance {
457
+ /** 沙箱实例唯一标识符 */
458
+ InstanceId: string;
459
+ /** 所属沙箱工具 ID */
460
+ ToolId: string;
461
+ /** 所属沙箱工具名称 */
462
+ ToolName: string;
463
+ /** 实例状态:STARTING、RUNNING、STOPPING、STOPPED、STOP_FAILED、FAILED */
464
+ Status: string;
465
+ /** 超时时间(秒),null 表示无超时设置 */
466
+ TimeoutSeconds?: number;
467
+ /** 过期时间(ISO 8601 格式),null 表示无过期时间 */
468
+ ExpiresAt?: string;
469
+ /** 停止原因:manual、timeout、error、system,仅在 STOPPED/STOP_FAILED/FAILED 时有值 */
470
+ StopReason?: string;
471
+ /** 创建时间(ISO 8601 格式) */
472
+ CreateTime?: string;
473
+ /** 更新时间(ISO 8601 格式) */
474
+ UpdateTime?: string;
475
+ /** 存储挂载选项 */
476
+ MountOptions?: MountOption[];
477
+ /** 沙箱实例自定义配置 */
478
+ CustomConfiguration?: CustomConfigurationDetail;
479
+ /** 网络模式:PUBLIC、SANDBOX、INTERNAL_SERVICE 等 */
480
+ NetworkMode?: string;
481
+ /** 沙箱实例元数据 */
482
+ Metadata?: MetadataVar[];
483
+ }
484
+ /**
485
+ * StartSandboxInstance 请求参数
486
+ */
487
+ export interface StartSandboxInstanceOptions {
488
+ /** 沙箱工具 ID,与 toolName 至少有一个要填 */
489
+ toolId?: string;
490
+ /** 沙箱工具名称,与 toolId 至少有一个要填 */
491
+ toolName?: string;
492
+ /** 超时时间,支持格式:5m、300s、1h 等,默认 5m。最小 30s,最大 24h */
493
+ timeout?: string;
494
+ /** 幂等性 Token,长度不超过 64 字符 */
495
+ clientToken?: string;
496
+ /** 沙箱实例存储挂载配置 */
497
+ mountOptions?: MountOption[];
498
+ /** 沙箱实例自定义配置 */
499
+ customConfiguration?: CustomConfiguration;
500
+ /** 沙箱访问认证模式:DEFAULT(跟随系统策略)、TOKEN(Token认证)、NONE(免认证),默认 DEFAULT */
501
+ authMode?: string;
502
+ /** 沙箱元数据 */
503
+ metadata?: MetadataVar[];
504
+ }
505
+ /**
506
+ * StartSandboxInstance 返回结果
507
+ */
508
+ export interface StartSandboxInstanceResp {
509
+ /** 创建的沙箱实例完整信息 */
510
+ Instance: SandboxInstance;
511
+ /** 唯一请求 ID */
512
+ RequestId: string;
513
+ }
514
+ /**
515
+ * DescribeSandboxInstanceList 请求参数
516
+ */
517
+ export interface DescribeSandboxInstanceListOptions {
518
+ /** 沙箱实例 ID 列表,为空则查询所有,最大支持 100 个 */
519
+ instanceIds?: string[];
520
+ /** 沙箱工具 ID,指定时查询该工具下的实例,为空则查询所有 */
521
+ toolId?: string;
522
+ /** 偏移量,默认为 0 */
523
+ offset?: number;
524
+ /** 返回数量,默认为 20,最大值为 100 */
525
+ limit?: number;
526
+ /** 过滤条件 */
527
+ filters?: Filter[];
528
+ }
529
+ /**
530
+ * DescribeSandboxInstanceList 返回结果
531
+ */
532
+ export interface DescribeSandboxInstanceListResp {
533
+ /** 沙箱实例列表 */
534
+ InstanceSet: SandboxInstance[];
535
+ /** 符合条件的实例总数 */
536
+ TotalCount: number;
537
+ /** 唯一请求 ID */
538
+ RequestId: string;
539
+ }
540
+ /**
541
+ * AcquireSandboxInstanceToken 请求参数
542
+ */
543
+ export interface AcquireSandboxInstanceTokenOptions {
544
+ /** 沙箱实例 ID,生成的访问 Token 将仅可用于访问此沙箱实例 */
545
+ instanceId: string;
546
+ }
547
+ /**
548
+ * AcquireSandboxInstanceToken 返回结果
549
+ */
550
+ export interface AcquireSandboxInstanceTokenResp {
551
+ /** 访问 Token */
552
+ Token: string;
553
+ /** 过期时间(ISO 8601 格式) */
554
+ ExpiresAt: string;
555
+ /** 唯一请求 ID */
556
+ RequestId: string;
557
+ }
558
+ /**
559
+ * API 密钥简略信息
560
+ * 被如下接口引用:DescribeAPIKeyList
561
+ */
562
+ export interface APIKeyInfo {
563
+ /** API 密钥名称 */
564
+ Name?: string;
565
+ /** API 密钥 ID */
566
+ KeyId?: string;
567
+ /** 密钥状态:API_KEY_STATUS_ACTIVE、API_KEY_STATUS_INACTIVE */
568
+ Status?: string;
569
+ /** 隐藏部分字符的 API 密钥,方便用户辨认 */
570
+ MaskedKey?: string;
571
+ /** API 密钥创建时间(ISO 8601 格式) */
572
+ CreatedAt?: string;
573
+ }
574
+ /**
575
+ * DescribeAPIKeyList 返回结果
576
+ */
577
+ export interface DescribeAPIKeyListResp {
578
+ /** API 密钥简略信息列表 */
579
+ APIKeySet: APIKeyInfo[];
580
+ /** 列表中 API 密钥数量 */
581
+ TotalCount: number;
582
+ /** 唯一请求 ID */
583
+ RequestId: string;
584
+ }
585
+ /**
586
+ * CreateAPIKey 请求参数
587
+ */
588
+ export interface CreateAPIKeyOptions {
589
+ /** API 密钥名称,方便用户记忆 */
590
+ name?: string;
591
+ }
592
+ /**
593
+ * CreateAPIKey 返回结果
594
+ */
595
+ export interface CreateAPIKeyResp {
596
+ /** 用户传入的 API 密钥名称 */
597
+ Name: string;
598
+ /** 生成的 API 密钥,仅返回此一次,后续无法获取 */
599
+ APIKey: string;
600
+ /** API 密钥 ID */
601
+ KeyId: string;
602
+ /** 唯一请求 ID */
603
+ RequestId: string;
604
+ }
605
+ /**
606
+ * DeleteAPIKey 请求参数
607
+ */
608
+ export interface DeleteAPIKeyOptions {
609
+ /** 需要删除的 API 密钥 ID,如 ark-2wsxdr5t */
610
+ keyId: string;
611
+ }
612
+ /**
613
+ * DeleteAPIKey 返回结果
614
+ */
615
+ export interface DeleteAPIKeyResp {
616
+ /** 唯一请求 ID */
617
+ RequestId: string;
618
+ }