与大多数列名不同,这些并非简单记录:每个记录都是 连接连接的系统 您可以拨打 run() 直线前进
const all = await api.storage.list();
for (const s of all) {
console.log(`${s.label} · ${s.type}${s.service ? ` (${s.service})` : ""}${s.isDefault ? " · default" : ""}`);
}
// And use one immediately
const base = all.find((s) => s.service === "nosql");
await base.run({ action: "collections" });storages = api.storage.list()
for s in storages:
service = f" ({s.service})" if s.service else ""
print(f"{s.label} · {s.type}{service}{' · default' if s.is_default else ''}")
# And use one immediately
base = next(s for s in storages if s.service == "nosql")
base.run(action="collections")回到什么
活动存储仅是活动存储, 被删除的存储不在列表中。 最新列表先是, 并且没有限制: 账户有少数这些, 不是数千个 。
找到一个你指的
const all = await api.storage.list();
const byLabel = all.find((s) => s.label === "Archive");
const computers = all.filter((s) => s.type === "filesystem");
const phones = all.filter((s) => s.type === "phone");
const ours = all.filter((s) => s.provider === "iagenify");
const fallback = all.find((s) => s.isDefault);storages = api.storage.list()
by_label = next((s for s in storages if s.label == "Archive"), None)
computers = [s for s in storages if s.type == "filesystem"]
phones = [s for s in storages if s.type == "phone"]
ours = [s for s in storages if s.provider == "iagenify"]
fallback = next((s for s in storages if s.is_default), None)以标签方式决定一次, 然后保留id
标签并非独一无二, 账户持有人可以重命名一个。 在每个运行中查找一个以名称命名的存储处, 取决于显示名称 。
几个电脑是正常的
每台机器 SDK 运行中运行成为自己的存储器。 每次重新启动登记时,会话缓存会丢失的部署每次都会有新的部署,因此,清单上的一堆接近同义电脑是一个值得读取的信号。
const machines = (await api.storage.list()).filter((s) => s.type === "filesystem");
if (machines.length > expected) {
for (const m of machines) console.log(m.label, m.hostname, m.createdAt);
// Near-identical entries usually mean the session cache is not persisting.
}machines = [s for s in api.storage.list() if s.type == "filesystem"]
if len(machines) > expected:
for m in machines:
print(m.label, m.machine_id, m.created_at)
# Near-identical entries usually mean the session cache is not persisting.持有违约者
完全一匹 isDefault。在删除了持有该存储器的存储器之后,该列表将显示您是如何看待哪个存储器接管了该存储器的。