api.hosts

get()

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

Ein Host mit seinem aktuellen Einsatz, seinen Domains und seinem Zertifikatsstatus – von der Plattform erneut gelesen.

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

So wird ein ausstehendes Zertifikat befolgt

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)

Nichts informiert Sie. Der Zustand wird neu gelesen, wenn ein Host gelesen wird, was eine kurze Umfrage nach einem Einsatz auf einer neuen Adressebene zur richtigen Form macht.

aktuell ist, was online ist

Die Deploy, die jetzt antwortet - was nicht immer die neueste ist, nach einem rollback. deploys() ist die Geschichte.

Die angeschlossenen Domains kommen mit

domains.list() liest das gleiche mit einer eigenen Anfrage, die nach dem Anbringen eines nützlich ist.

Fehler

Ein unbekannter Identifier antwortet 404 — einschließlich eines anderen Kontos, das die gleiche Antwort ist, absichtlich.