api.hosts

kinds()

api.hosts.kinds() → Promise<Kind[]>

存在哪种类型, 哪些是可用的, 以及为什么其他的不是。 阅读它, 而不是将列表写入页面 。

freeavailability per kindsuffixes come from here
Using Python?

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

const kinds = await api.hosts.kinds();
// [{ kind: "site", hostSuffix: "…", deploy: "files", available: true, reason: null }, …]

const usable = kinds.filter((k) => k.available);
kinds = api.hosts.kinds()
# [{"kind": "site", "hostSuffix": "…", "deploy": "files", "available": True, "reason": None}, …]

usable = [k for k in kinds if k["available"]]
kindstring

要传递到的识别标识符 create().

hostSuffixstring

地址级别为此等。

deploystring

部署需要什么——文件或代码。

availableboolean

能否创建它 。

reasonstring|null

为什么,当它不能。

为什么可用性是一个字段

无法服务的那种在创建时被拒绝

从未创建过“现在 ” : 不回答的地址读作断线。 这个列表让界面只显示什么有效, 并解释为什么其余部分, 而不是在改变页面时更改。

不要硬编码后缀

一种水平是蓄意的,它阻止顾客使用平台本身所回答的名字。 后缀被退回到这里,所以没有页次重复。

建造拾拾器

for (const k of await api.hosts.kinds()) {
  render({ value: k.kind, label: k.kind, hint: k.hostSuffix, disabled: !k.available, why: k.reason });
}
for k in api.hosts.kinds():
    render(value=k["kind"], label=k["kind"], hint=k.get("hostSuffix"), disabled=not k["available"], why=k.get("reason"))