方法参考 createWorkspace 创建 Docker Workspace。简化调用使用默认镜像、运行时和规格: java CreateWorkspaceResult result client.createWorkspace( apikey, "AIOSsandbox1.0AIUSEv1", true ); 完整调用: java CreateWorkspaceResult result client.createWorkspace( apikey, "AIOSsandbox1.0AIUSEv1", "runc", "4核8G", 18080, Map.of("APPMODE", "production"), "/home/ctyun/workspace", true ); 参数 类型 必填 默认值/限制 说明 apikey String 是 Workspace 管理 API Key,即 AccessKey ID image String 是 简化调用默认 AIOSsandbox1.0AIUSEv1 容器镜像 runtime String 是 runc 仅支持 runc 或 kata specTemplate String 是 简化调用默认 4核8G 规格模板 appPort Integer 否 1025 至 65535 应用端口;8102、9002、9673、18789、49002 为保留端口 env Map 否 空 容器环境变量 workDir String 否 不传 容器工作目录 async boolean 否 true 是否异步创建 plaintext { "image": "AIOSsandbox1.0AIUSEv1", "runtime": "runc", "specTemplate": "4核8G", "appPort": 18080, "env": { "APPMODE": "production" }, "workDir": "/home/ctyun/workspace", "async": true } 成功响应示例: plaintext { "resultCode": 0, "resultMsg": "success", "data": { "workspaceId": "123456789" } } SDK 返回:CreateWorkspaceResult.workspaceId。异步创建返回不代表 Workspace 已就绪;创建后连接并查询 readyDetail()。