查询私有逻辑缓存控制操作结果
const url = 'https://api.tansr.com/t1/cache/v1/operations?protocol=sdk2-cache-v1&operation=open&operationEpoch=example&requestId=example';const options = {method: 'GET', headers: {'x-tansr-app-token': '<x-tansr-app-token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.tansr.com/t1/cache/v1/operations?protocol=sdk2-cache-v1&operation=open&operationEpoch=example&requestId=example' \ --header 'x-tansr-app-token: <x-tansr-app-token>'仅接受当前 app_user 短期令牌,并按当前应用、末端用户和原会话验证权限。此扩展默认关闭;未启用时不提供控制接口。GET 不接受请求体,所有查询参数只能出现一次;拒绝未知参数。POST 不接受查询串或 Content-Encoding。
查询已受理的控制操作结果,不创建操作或续期。open 省略 bindingId,其他操作必须提供。已保存结果仍可读取;活跃 epoch 下结果缺席返回 503 未知,epoch 已退休或过期且结果缺席才返回 receipt_expired。此端点不查询 TWP 模型请求。
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Open 操作不得提供;其他操作必须提供。
Responses
Section titled “Responses”成功;相同操作身份按原结果重放。
object
object
object
Canonical unsigned decimal 0..2^63-1. Never parse through IEEE754 Number.
Canonical unsigned decimal 0..2^63-1. Never parse through IEEE754 Number.
object
object
object
object
Canonical unsigned decimal 0..2^63-1. Never parse through IEEE754 Number.
Canonical unsigned decimal 0..2^63-1. Never parse through IEEE754 Number.
Example
{ "protocol": "sdk2-cache-v1", "binding": { "protocol": "sdk2-cache-v1", "audience": "gateway-cache", "state": "active", "mode": "private-logical-v1", "projection": { "status": "current", "reason": "unchanged" }, "availability": "legacy-complete" }, "relation": "new"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Invalid_request 或 protocol_version_mismatch
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Unauthorized
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Forbidden
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Stale_revision、stale_generation、request_id_conflict 或 projection_stale
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Ticket_expired、mapping_expired 或 receipt_expired
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Payload_too_large
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Unsupported_capability
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Capacity_exceeded
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
Epoch_unavailable、mapping_unavailable 或 result_unknown;未知结果不得自动重新执行或回退旧接口。
object
Example
{ "protocol": "sdk2-cache-v1", "code": "invalid_request", "retryAction": "none", "fallback": "none"}Headers
Section titled “Headers”禁止缓存绑定、票据、状态及模型响应。
本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。