从会话中卸载指定资源,同时清除其内部副本。此操作不可恢复。
前提
已完成 Endpoint 与鉴权配置,详见API 总览与认证。
说明仅文件支持单独卸载;Git 仓库和记忆库不能单独卸载。归档后仍可查询资源信息,删除会话时一并清除。
接口
DELETE
/sessions/{session_id}/resources/{resource_id}路径参数
session_idstring必填会话 ID,格式 sesn_<ULID>
resource_idstring必填资源 ID,格式 sesrsc_<ULID>
请求示例
curl -X DELETE "$AGENTSTUDIO_URL/sessions/sesn_xxx/resources/sesrsc_xxx" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY"
响应字段
idstring被卸载的资源 ID
typestring固定为 session_resource_deleted,标识卸载成功
request_idstring本次请求的唯一标识
响应示例
{
"id": "sesrsc_xxx",
"type": "session_resource_deleted",
"request_id": "xxx"
}
错误码
错误码见 Managed Agent API 错误码。
该文章对您有帮助吗?