跳转到内容

停止云端运行环境

Request

停止浏览器所在的云端运行实例。

  • 前置条件:该浏览器必须有一个由你启动的进行中运行实例。若实例已停止或正在释放,调用成功但不做任何事。
  • 副作用:停止计费、结算用量、释放浏览器占用锁,并在释放实例前让客户端把 profile 和 Cookie 归档回云端。
  • 完成信号:已受理,未完成。 请轮询 /cloudbrowser/page 直到 cloudBrowserStatus 为 CLOSED 且 cloudBrowserArchiveStatus 到达 COMPLETED 或 FAILED。
  • 归档失败时:该运行实例仍在计费,且仍显示为 RUNNING。force 仅在这种状态下生效:它跳过归档直接释放实例,代价是本次会话的 profile 变更会丢失。
  • 并发:同一运行实例的并发停止会被串行化,重复调用是安全的。

已记录的业务错误码:40002, 40006, 40008, 40020。 各错误码的含义见 Error Codes。任何接口还可能返回通用错误码。

Bodyapplication/jsonrequired
envIdstring(EnvironmentId)^[1-9]\d*$required

Browser profile (environment) ID. Serialized as a decimal string to avoid JavaScript precision loss on 64-bit integers.

Example:"1800000000000001"
forceboolean

Whether to forcibly release the cloud runtime. Only takes effect when the current run has an archive status of FAILED; in that case the archive step is skipped and runtime resources are reclaimed. Ignored in all other cases.

Default:false
Example:false
curl -i -X POST \
  http://127.0.0.1:40000/api/cloudbrowser/stop \
  -H 'Content-Type: application/json' \
  -d '{
    "envId": "1800000000000001",
    "force": false
  }'

Responses

Success

Bodyapplication/json
codeintegerrequired

Return result code. 0 means success; other codes indicate exceptions.

Example:0
msgstring or nullrequired

Error message. Usually null on success.

Example:null
requestIdstring

Operation request ID. This field may be present when the request passes through the API gateway.

Example:"1d4f3ea968664593860b94b35d4ebf5e"
datanull
Example:null
Response
{ "code": 0, "msg": null, "requestId": "1d4f3ea968664593860b94b35d4ebf5e", "data": null }