api.hosts

get()

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

Un host, con il suo actual deploy, i suoi dominis e il suo stato certificat — re-lee da la plataforma.

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

Issí come un certificate pendente è seguit

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)

Nada t'avunta. Lo stato è re-lettura quando un host è let, che è ciò che rende un sondaje breve la forma giusta dopo un deployment a un livello di adrese fresca.

Attual è ciò che è on line

La diplomazion che risponde ora — che non è sempre la più recente, dopo un rollback. deploys() è la cronologia.

I dominis annessats a lui convien

domains.list() legge la stessa cosa con una richiesta propria, che è utile dopo l'applicare.

Erros

Un identificatore sconosciut risponde 404 — incluso uno appartenente a un altro conto, che è la stessa risposta intenzionalmente.