api.hosts

usage()

api.hosts.usage() → Promise<Usage>

计划允许托管什么,以及网上什么能占用多少空间——相对于账户的存储对象而言。

freeread the zeroquota is the object storage
Using Python?

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

const usage = await api.hosts.usage();

if (!usage.maxHosts) {
  // This plan has no hosting. Show the limit, with a link to the plans.
}
usage = api.hosts.usage()

if not usage["maxHosts"]:
    pass  # This plan has no hosting. Show the limit, with a link to the plans.
packstring

计划

hosts · maxHostsinteger

有多少存在,以及有多少计划允许。

usedBytesinteger

主持人在网上都保留了什么

quotaBytesinteger

该账户的实物储存配额。

读取零

最大最大目标: 0 表示计划没有主机

与最大邮件框相同形状: 0 份邮件。 读取数字而不是匹配计划的名称—— 计划变更的当日, 匹配的页面是谎言的页面 。

配额Bytete 不是一个主机津贴

这是账户的物品储存——与文件、信箱和为账户保存的其他一切共享。 cloud.usage() 显示从另一侧的相同数字, object.hostingBytes 说有多少人正在接待它。

展示

const u = await api.hosts.usage();

if (!u.maxHosts)             return showPlanLimit();
if (u.hosts >= u.maxHosts)   return showAtLimit();
return showCreateButton();
def hosting_screen():
    u = api.hosts.usage()
    if not u["maxHosts"]:
        return show_plan_limit()
    if u["hosts"] >= u["maxHosts"]:
        return show_at_limit()
    return show_create_button()