列出会话资源

更新时间:
复制 MD 格式

分页列出会话当前已挂载的资源。

前提

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

接口

GET/sessions/{session_id}/resources

路径参数

session_idstring必填

会话 ID,格式 sesn_<ULID>

查询参数

limitinteger可选

每页数量,取值 1~1000,默认 100

pagestring可选

分页游标(opaque token)。首次不传,后续传上一次响应返回的游标

请求示例

curl "$AGENTSTUDIO_URL/sessions/sesn_xxx/resources?limit=20" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY"

响应字段

dataarray<object>

资源对象数组

data[].idstring

资源 ID,格式 sesrsc_<ULID>

data[].typestring

资源类型:file / memory_store / git_repository

data[].file_idstring

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

data[].memory_store_id / name / access / instructionsstring

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

data[].urlstring

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

data[].mount_pathstring

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

data[].checkoutobject / null

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

data[].created_atstring

创建时间,ISO 8601

data[].updated_atstring

最近更新时间,ISO 8601

next_pagestring

下一页游标,原样传入 page 参数续翻;末页不返回该字段

request_idstring

本次请求的唯一标识

响应示例

响应包含 data(会话资源对象数组)与 next_page(下一页游标;末页不返回该字段)。

{
  "data": [
    {
      "id": "sesrsc_xxx",
      "type": "file",
      "file_id": "file_xxx",
      "mount_path": "/mnt/session/uploads/data.csv",
      "created_at": "2026-05-28T08:23:11.456000Z",
      "updated_at": "2026-05-28T08:23:11.456000Z"
    },
    {
      "id": "sesrsc_yyy",
      "type": "file",
      "file_id": "file_yyy",
      "mount_path": "/mnt/session/uploads/late.csv",
      "created_at": "2026-05-28T08:25:00.000000Z",
      "updated_at": "2026-05-28T08:25:00.000000Z"
    },
    {
      "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:55.110000Z",
      "updated_at": "2026-11-28T02:00:55.110000Z"
    }
  ],
  "next_page": "page_xxxxxxxxxxxxx",
  "request_id": "xxx"
}

错误码

错误码见 Managed Agent API 错误码。