api.hosts

get()

api.hosts.get(id) → Promise<Host>

一个主机,目前部署、域名和证书状态,从平台上重新阅读。

GETfreere-reads the certificate
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const host = await api.hosts.get(id);

host.current;      // the deploy currently online
host.certificate;  // "none" | "pending" | "active"
host.domains_;     // the customer domains attached
host = api.hosts.get(host_id)

host.current       # the deploy currently online
host.certificate   # "none" | "pending" | "active"
host.domains_      # the customer domains attached

使用这种方式才能执行未结证书

let host = await api.hosts.get(id);

while (host.certificate === "pending") {
  await new Promise((r) => setTimeout(r, 10_000));
  host = await api.hosts.get(id);
}
import time

host = api.hosts.get(host_id)

while host.certificate == "pending":
    time.sleep(10)
    host = api.hosts.get(host_id)

无法通知您。 当读取主机时, 状态会重新读取, 也就是在新地址级别上进行部署后, 短时间的民意测验会成为正确的形状 。

当前的是在线的

答案现在的部署——这不是最新的部署,在经过 滚回. 部署() 历史就是历史。

附加域域与它相连

domains.list() 也附有同样内容,

错误

未知识别信息回答404,包括属于另一个账户的账户,这是目的相同的答案。