重新连接当前私有逻辑缓存绑定
const url = 'https://api.tansr.com/t1/cache/v1/bindings/example/rebind';const options = { method: 'POST', headers: {'x-tansr-app-token': '<x-tansr-app-token>', 'Content-Type': 'application/json'}, body: '{"protocol":"sdk2-cache-v1","request":{"operationEpoch":"example","requestId":"example"},"bindingId":"example","expectedRevision":"example","sessionId":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tansr.com/t1/cache/v1/bindings/example/rebind \ --header 'Content-Type: application/json' \ --header 'x-tansr-app-token: <x-tansr-app-token>' \ --data '{ "protocol": "sdk2-cache-v1", "request": { "operationEpoch": "example", "requestId": "example" }, "bindingId": "example", "expectedRevision": "example", "sessionId": "example" }'仅接受当前 app_user 短期令牌,并按当前应用、末端用户和原会话验证权限。此扩展默认关闭;未启用时不提供控制接口。GET 不接受请求体,所有查询参数只能出现一次;拒绝未知参数。POST 不接受查询串或 Content-Encoding。
控制 JSON 最多 65536 字节;拒绝重复键、未知字段、无效 UTF-8、未配对代理项和非整数数字词法(含小数、指数、负零)。序号必须是 0..9223372036854775807 的规范十进制字符串,不能经 Number 转换。
请求体 bindingId 必须与路径一致;当前仅允许绑定原有的同 runtime sessionId,不支持跨 runtime 迁移,不复活已关闭、撤销或过期的绑定。
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
object
Canonical unsigned decimal 0..2^63-1. Never parse through IEEE754 Number.
Existing opaque ID; no trimming, case folding or Unicode normalization. Do not mint authority from this string.
Responses
Section titled “Responses”成功;相同操作身份按原结果重放。
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", "operation": "open", "semanticDigest": { "algorithm": "hmac-sha256" }, "state": "completed", "binding": { "protocol": "sdk2-cache-v1", "audience": "gateway-cache", "state": "active", "mode": "private-logical-v1", "projection": { "status": "current", "reason": "unchanged" }, "availability": "legacy-complete" }}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”禁止缓存绑定、票据、状态及模型响应。
本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。