/** * 标签 */ export interface Tag { /** 标签键 */ Key?: string; /** 标签值 */ Value?: string; } /** * 沙箱实例元数据项 * 被如下接口引用:DescribeSandboxInstanceList, StartSandboxInstance, UpdateSandboxInstance */ export interface MetadataVar { /** 沙箱元数据名 */ Name?: string; /** 沙箱元数据值 */ Value?: string; } /** * VPC 网络相关配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList, UpdateSandboxTool */ export interface VPCConfig { /** VPC 子网 ID 列表 */ SubnetIds?: string[]; /** 安全组 ID 列表 */ SecurityGroupIds?: string[]; } /** * 沙箱网络配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList, UpdateSandboxTool */ export interface NetworkConfiguration { /** 网络模式(当前支持 PUBLIC, VPC, SANDBOX) */ NetworkMode: string; /** VPC 网络相关配置 */ VpcConfig?: VPCConfig; } /** * 环境变量 */ export interface EnvVar { /** 环境变量名称 */ Name: string; /** 环境变量值 */ Value: string; } /** * 端口配置 */ export interface PortConfiguration { /** 端口名 */ Name?: string; /** 端口 */ Port?: number; /** 协议 */ Protocol?: string; } /** * 资源配置 */ export interface ResourceConfiguration { /** CPU 资源量,示例值:500m */ CPU?: string; /** 内存资源量,示例值:1Gi */ Memory?: string; } /** * HTTP GET 探测动作配置 */ export interface HttpGetAction { /** 路径 */ Path?: string; /** 端口 */ Port?: number; /** 协议 */ Scheme?: string; } /** * 健康检查探针配置 */ export interface ProbeConfiguration { /** HTTP GET 探测配置 */ HttpGet?: HttpGetAction; /** 健康检查就绪超时(毫秒) */ ReadyTimeoutMs?: number; /** 健康检查单次探测超时(毫秒) */ ProbeTimeoutMs?: number; /** 健康检查间隔(毫秒) */ ProbePeriodMs?: number; /** 健康检查成功阈值 */ SuccessThreshold?: number; /** 健康检查失败阈值 */ FailureThreshold?: number; } /** * 沙箱自定义 DNS 配置 */ export interface DNSConfig { /** DNS 服务器地址,需要有效 IP 地址,默认值:10.0.0.1 */ Servers: string[]; /** 搜索域(对应 resolv.conf 的 search 指令) */ Searches?: string[]; /** 配置项(对应 resolv.conf 选项) */ Options?: string[]; } /** * 沙箱自定义配置 * 被如下接口引用:CreateSandboxTool, StartSandboxInstance, UpdateSandboxTool */ export interface CustomConfiguration { /** 镜像地址 */ Image?: string; /** 镜像仓库类型:enterprise、personal */ ImageRegistryType?: string; /** 启动命令 */ Command?: string[]; /** 启动参数 */ Args?: string[]; /** 环境变量 */ Env?: EnvVar[]; /** 端口配置 */ Ports?: PortConfiguration[]; /** 资源配置 */ Resources?: ResourceConfiguration; /** 探针配置 */ Probe?: ProbeConfiguration; /** 沙箱 DNS 配置 */ DNSConfig?: DNSConfig; } /** * UpdateSandboxTool 请求参数 */ export interface UpdateSandboxToolOptions { /** 沙箱工具 ID,如 sdt-dibk4rra */ toolId: string; /** 沙箱工具描述,最大长度 200 字符 */ description?: string; /** 网络配置 */ networkConfiguration?: NetworkConfiguration; /** 标签 */ tags?: Tag[]; /** 沙箱工具自定义配置 */ customConfiguration?: CustomConfiguration; } /** * UpdateSandboxTool 返回结果 */ export interface UpdateSandboxToolResp { /** 唯一请求 ID */ RequestId: string; } /** * 过滤列表规则 * 被如下接口引用:DescribeSandboxInstanceList, DescribeSandboxToolList */ export interface Filter { /** 属性名称,若存在多个 Filter 时,Filter 间的关系为逻辑与(AND) */ Name?: string; /** 属性值,若同一个 Filter 存在多个 Values,同一 Filter 下 Values 间的关系为逻辑或(OR) */ Values?: string[]; } /** * 对象存储桶挂载配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList */ export interface CosStorageSource { /** 对象存储访问域名 */ Endpoint?: string; /** 对象存储桶名称 */ BucketName?: string; /** 对象存储桶路径,必须为以 / 起始的绝对路径 */ BucketPath?: string; } /** * 镜像卷挂载源配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList */ export interface ImageStorageSource { /** 镜像地址 */ Reference?: string; /** 镜像仓库类型:enterprise、personal */ ImageRegistryType?: string; /** 镜像内部的路径 */ SubPath?: string; /** 镜像 Digest,请求时无需传入 */ Digest?: string; } /** * 文件存储配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList */ export interface CfsStorageSource { /** CFS 资源 ID */ FileSystemId?: string; /** CFS 挂载路径 */ Path?: string; } /** * 挂载存储配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList */ export interface StorageSource { /** 对象存储桶配置 */ Cos?: CosStorageSource; /** 镜像卷配置 */ Image?: ImageStorageSource; /** 文件存储配置 */ Cfs?: CfsStorageSource; } /** * 沙箱工具中实例存储挂载配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList */ export interface StorageMount { /** 存储挂载配置名称 */ Name?: string; /** 存储配置 */ StorageSource?: StorageSource; /** 沙箱实例本地挂载路径 */ MountPath?: string; /** 存储挂载读写权限配置,默认为 false */ ReadOnly?: boolean; } /** * 沙箱自定义配置详细信息(响应用,与写入用的 CustomConfiguration 区分) * 被如下接口引用:DescribeSandboxInstanceList, DescribeSandboxToolList, StartSandboxInstance */ export interface CustomConfigurationDetail { /** 镜像地址 */ Image?: string; /** 镜像仓库类型:TCR、CCR */ ImageRegistryType?: string; /** 镜像 Digest */ ImageDigest?: string; /** 启动命令 */ Command?: string[]; /** 启动参数 */ Args?: string[]; /** 环境变量 */ Env?: EnvVar[]; /** 端口配置 */ Ports?: PortConfiguration[]; /** 资源配置 */ Resources?: ResourceConfiguration; /** 探针配置 */ Probe?: ProbeConfiguration; /** 沙箱 DNS 配置 */ DNSConfig?: DNSConfig; } /** * CLS 日志推送配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList */ export interface CLSConfig { /** 沙箱工具日志推送所使用的 CLS 日志主题 ID */ TopicId?: string; } /** * 沙箱工具日志采集相关配置 * 被如下接口引用:CreateSandboxTool, DescribeSandboxToolList */ export interface LogConfiguration { /** 日志推送 CLS 的配置 */ CLSConfig?: CLSConfig; } /** * 沙箱工具结构体 * 被如下接口引用:DescribeSandboxToolList */ export interface SandboxTool { /** 沙箱工具唯一标识符 */ ToolId: string; /** 沙箱工具名称,长度 1-50 字符 */ ToolName?: string; /** 沙箱工具类型:browser、code-interpreter、computer、mobile */ ToolType?: string; /** 沙箱工具状态:CREATING、ACTIVE、DELETING、FAILED */ Status?: string; /** 沙箱工具描述信息,最大长度 200 字符 */ Description?: string; /** 默认超时时间(秒) */ DefaultTimeoutSeconds?: number; /** 网络配置 */ NetworkConfiguration?: NetworkConfiguration; /** 标签 */ Tags?: Tag[]; /** 创建时间,格式:ISO8601 */ CreateTime?: string; /** 更新时间,格式:ISO8601 */ UpdateTime?: string; /** 沙箱工具绑定角色 ARN */ RoleArn?: string; /** 实例存储挂载配置 */ StorageMounts?: StorageMount[]; /** 沙箱工具自定义配置 */ CustomConfiguration?: CustomConfigurationDetail; /** 日志推送相关配置 */ LogConfiguration?: LogConfiguration; /** 用于说明沙箱工具处于该状态的原因 */ StatusReason?: string; } /** * DescribeSandboxToolList 请求参数 */ export interface DescribeSandboxToolListOptions { /** 沙箱工具 ID 列表,为空则查询所有,最大支持 100 个 */ toolIds?: string[]; /** 偏移量,默认为 0 */ offset?: number; /** 返回数量,默认为 20,最大值为 100 */ limit?: number; /** 过滤条件 */ filters?: Filter[]; } /** * DescribeSandboxToolList 返回结果 */ export interface DescribeSandboxToolListResp { /** 沙箱工具列表 */ SandboxToolSet: SandboxTool[]; /** 符合条件的沙箱工具总数 */ TotalCount: number; /** 唯一请求 ID */ RequestId: string; } /** * CreateSandboxTool 请求参数 */ export interface CreateSandboxToolOptions { /** 沙箱工具名称,长度 1-50 字符,支持英文、数字、下划线和连接线。同一 AppId 下名称必须唯一 */ toolName: string; /** 沙箱工具类型:browser、code-interpreter、custom */ toolType: string; /** 网络配置 */ networkConfiguration: NetworkConfiguration; /** 沙箱工具描述,最大长度 200 字符 */ description?: string; /** 默认超时时间,支持格式:5m、300s、1h 等,不指定则使用系统默认值(5 分钟),最大 24 小时 */ defaultTimeout?: string; /** 标签 */ tags?: Tag[]; /** 幂等性 Token,长度不超过 64 字符 */ clientToken?: string; /** 角色 ARN */ roleArn?: string; /** 沙箱工具存储配置 */ storageMounts?: StorageMount[]; /** 沙箱工具自定义配置 */ customConfiguration?: CustomConfiguration; /** 沙箱工具日志推送相关配置 */ logConfiguration?: LogConfiguration; } /** * CreateSandboxTool 返回结果 */ export interface CreateSandboxToolResp { /** 创建的沙箱工具 ID */ ToolId: string; /** 唯一请求 ID */ RequestId: string; } /** * DeleteSandboxTool 请求参数 */ export interface DeleteSandboxToolOptions { /** 沙箱工具 ID,如 sdt-dibk4rra */ toolId: string; } /** * DeleteSandboxTool 返回结果 */ export interface DeleteSandboxToolResp { /** 唯一请求 ID */ RequestId: string; } /** * ResumeSandboxInstance 请求参数 */ export interface ResumeSandboxInstanceOptions { /** 沙箱实例 ID,如 4729e19d67fb4ba38854dbbfc63c72e9 */ instanceId: string; } /** * ResumeSandboxInstance 返回结果 */ export interface ResumeSandboxInstanceResp { /** 唯一请求 ID */ RequestId: string; } /** * PauseSandboxInstance 请求参数 */ export interface PauseSandboxInstanceOptions { /** 沙箱实例 ID,如 4729e19d67fb4ba38854dbbfc63c72e9 */ instanceId: string; } /** * PauseSandboxInstance 返回结果 */ export interface PauseSandboxInstanceResp { /** 唯一请求 ID */ RequestId: string; } /** * UpdateSandboxInstance 请求参数 */ export interface UpdateSandboxInstanceOptions { /** 沙箱实例 ID,如 953e15d3655e4daab120b885c908edf7 */ instanceId: string; /** 新的超时时间(从设置时重新计算),支持格式:5m、300s、1h 等。最小 30s,最大 24h。不指定则保持原有设置 */ timeout?: string; /** 沙箱实例元数据 */ metadata?: MetadataVar[]; } /** * UpdateSandboxInstance 返回结果 */ export interface UpdateSandboxInstanceResp { /** 唯一请求 ID */ RequestId: string; } /** * StopSandboxInstance 请求参数 */ export interface StopSandboxInstanceOptions { /** 沙箱实例 ID,如 12345678123412341234123456789abc */ instanceId: string; } /** * StopSandboxInstance 返回结果 */ export interface StopSandboxInstanceResp { /** 唯一请求 ID */ RequestId: string; } /** * 沙箱实例存储挂载配置可选项,用于覆盖沙箱工具的存储配置的部分选项 * 被如下接口引用:DescribeSandboxInstanceList, StartSandboxInstance */ export interface MountOption { /** 指定沙箱工具中的存储配置名称 */ Name?: string; /** 沙箱实例本地挂载路径(可选),默认继承工具中的存储配置 */ MountPath?: string; /** 沙箱实例存储挂载子路径(可选) */ SubPath?: string; /** 沙箱实例存储挂载读写权限(可选),默认继承工具存储配置 */ ReadOnly?: boolean; } /** * 沙箱实例结构体 * 被如下接口引用:DescribeSandboxInstanceList, StartSandboxInstance */ export interface SandboxInstance { /** 沙箱实例唯一标识符 */ InstanceId: string; /** 所属沙箱工具 ID */ ToolId: string; /** 所属沙箱工具名称 */ ToolName: string; /** 实例状态:STARTING、RUNNING、STOPPING、STOPPED、STOP_FAILED、FAILED */ Status: string; /** 超时时间(秒),null 表示无超时设置 */ TimeoutSeconds?: number; /** 过期时间(ISO 8601 格式),null 表示无过期时间 */ ExpiresAt?: string; /** 停止原因:manual、timeout、error、system,仅在 STOPPED/STOP_FAILED/FAILED 时有值 */ StopReason?: string; /** 创建时间(ISO 8601 格式) */ CreateTime?: string; /** 更新时间(ISO 8601 格式) */ UpdateTime?: string; /** 存储挂载选项 */ MountOptions?: MountOption[]; /** 沙箱实例自定义配置 */ CustomConfiguration?: CustomConfigurationDetail; /** 网络模式:PUBLIC、SANDBOX、INTERNAL_SERVICE 等 */ NetworkMode?: string; /** 沙箱实例元数据 */ Metadata?: MetadataVar[]; } /** * StartSandboxInstance 请求参数 */ export interface StartSandboxInstanceOptions { /** 沙箱工具 ID,与 toolName 至少有一个要填 */ toolId?: string; /** 沙箱工具名称,与 toolId 至少有一个要填 */ toolName?: string; /** 超时时间,支持格式:5m、300s、1h 等,默认 5m。最小 30s,最大 24h */ timeout?: string; /** 幂等性 Token,长度不超过 64 字符 */ clientToken?: string; /** 沙箱实例存储挂载配置 */ mountOptions?: MountOption[]; /** 沙箱实例自定义配置 */ customConfiguration?: CustomConfiguration; /** 沙箱访问认证模式:DEFAULT(跟随系统策略)、TOKEN(Token认证)、NONE(免认证),默认 DEFAULT */ authMode?: string; /** 沙箱元数据 */ metadata?: MetadataVar[]; } /** * StartSandboxInstance 返回结果 */ export interface StartSandboxInstanceResp { /** 创建的沙箱实例完整信息 */ Instance: SandboxInstance; /** 唯一请求 ID */ RequestId: string; } /** * DescribeSandboxInstanceList 请求参数 */ export interface DescribeSandboxInstanceListOptions { /** 沙箱实例 ID 列表,为空则查询所有,最大支持 100 个 */ instanceIds?: string[]; /** 沙箱工具 ID,指定时查询该工具下的实例,为空则查询所有 */ toolId?: string; /** 偏移量,默认为 0 */ offset?: number; /** 返回数量,默认为 20,最大值为 100 */ limit?: number; /** 过滤条件 */ filters?: Filter[]; } /** * DescribeSandboxInstanceList 返回结果 */ export interface DescribeSandboxInstanceListResp { /** 沙箱实例列表 */ InstanceSet: SandboxInstance[]; /** 符合条件的实例总数 */ TotalCount: number; /** 唯一请求 ID */ RequestId: string; } /** * AcquireSandboxInstanceToken 请求参数 */ export interface AcquireSandboxInstanceTokenOptions { /** 沙箱实例 ID,生成的访问 Token 将仅可用于访问此沙箱实例 */ instanceId: string; } /** * AcquireSandboxInstanceToken 返回结果 */ export interface AcquireSandboxInstanceTokenResp { /** 访问 Token */ Token: string; /** 过期时间(ISO 8601 格式) */ ExpiresAt: string; /** 唯一请求 ID */ RequestId: string; } /** * API 密钥简略信息 * 被如下接口引用:DescribeAPIKeyList */ export interface APIKeyInfo { /** API 密钥名称 */ Name?: string; /** API 密钥 ID */ KeyId?: string; /** 密钥状态:API_KEY_STATUS_ACTIVE、API_KEY_STATUS_INACTIVE */ Status?: string; /** 隐藏部分字符的 API 密钥,方便用户辨认 */ MaskedKey?: string; /** API 密钥创建时间(ISO 8601 格式) */ CreatedAt?: string; } /** * DescribeAPIKeyList 返回结果 */ export interface DescribeAPIKeyListResp { /** API 密钥简略信息列表 */ APIKeySet: APIKeyInfo[]; /** 列表中 API 密钥数量 */ TotalCount: number; /** 唯一请求 ID */ RequestId: string; } /** * CreateAPIKey 请求参数 */ export interface CreateAPIKeyOptions { /** API 密钥名称,方便用户记忆 */ name?: string; } /** * CreateAPIKey 返回结果 */ export interface CreateAPIKeyResp { /** 用户传入的 API 密钥名称 */ Name: string; /** 生成的 API 密钥,仅返回此一次,后续无法获取 */ APIKey: string; /** API 密钥 ID */ KeyId: string; /** 唯一请求 ID */ RequestId: string; } /** * DeleteAPIKey 请求参数 */ export interface DeleteAPIKeyOptions { /** 需要删除的 API 密钥 ID,如 ark-2wsxdr5t */ keyId: string; } /** * DeleteAPIKey 返回结果 */ export interface DeleteAPIKeyResp { /** 唯一请求 ID */ RequestId: string; }