查询会话资源详情

更新时间:
复制 MD 格式

查询会话中单个已挂载资源的详情。

前提

已完成 Endpoint 与鉴权配置,详见API 总览与认证。

接口

GET/sessions/{session_id}/resources/{resource_id}

路径参数

session_idstring必填

会话 ID,格式 sesn_<ULID>

resource_idstring必填

资源 ID,格式 sesrsc_<ULID>

请求示例

curl "$AGENTSTUDIO_URL/sessions/sesn_xxx/resources/sesrsc_xxx" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

响应字段

idstring

资源 ID,格式 sesrsc_<ULID>

typestring

资源类型:file / memory_store / git_repository

file_idstring

文件资源返回内部副本 ID;记忆库资源为 null

memory_store_id / name / access / instructionsstring

记忆库资源的元数据与挂载配置

urlstring

Git 仓库的 HTTPS 地址,不含凭据

mount_pathstring

挂载路径。文件带 /mnt/session/uploads 前缀;Git 仓库为实际检出路径,例如 /workspace/project

checkoutobject / null

Git 仓库创建时指定的检出目标,包含 type 与 name(分支)或 sha(提交);省略时为 null

created_atstring

创建时间,ISO 8601

updated_atstring

最近更新时间,ISO 8601

request_idstring

本次请求的唯一标识

响应示例

{
  "id": "sesrsc_xxx",
  "type": "file",
  "file_id": "file_xxx",
  "mount_path": "/mnt/session/uploads/data.csv",
  "created_at": "2026-05-28T08:23:11Z",
  "updated_at": "2026-05-28T08:23:11Z",
  "request_id": "xxx"
}

Git 仓库资源:

{
  "id": "sesrsc_zzz",
  "type": "git_repository",
  "url": "https://gitlab.com/group/project",
  "mount_path": "/workspace/project",
  "checkout": {"type": "branch", "name": "main"},
  "created_at": "2026-11-28T02:00:55Z",
  "updated_at": "2026-11-28T02:00:55Z",
  "request_id": "xxx"
}

错误码

错误码见 Managed Agent API 错误码。