分页列出会话当前已挂载的资源。
前提
已完成 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[].urlstringGit 仓库的 HTTPS 地址,不含凭据
data[].mount_pathstring挂载路径。文件带 /mnt/session/uploads 前缀;Git 仓库为实际检出路径,例如 /workspace/project
data[].checkoutobject / nullGit 仓库创建时指定的检出目标,包含 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 错误码。
该文章对您有帮助吗?