api.storage

get()

api.storage.get({ id }) → Promise<ConnectedStorage | null>

一个存储器,准备使用 毫无争议,账户违约

GET /api/storage/:idfreenull, never a throw
Using Python?

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

参数

idstring

哪个储藏室 留到账户违约时再处理

const target = await api.storage.get();            // the default
const one = await api.storage.get({ id });         // a particular one
target = api.storage.get()                # the default
one = api.storage.get(id=storage_id)      # a particular one

空投,而不是扔掉

未知身份、错误身份或属于另一个账户的账户 null。因此,检查是一个价值测试,而不是尝试/catch -和 null 绝不意味着“这是别人的”

const storage = await api.storage.get({ id });

if (!storage) {
  throw new Error("that storage is not on this account");
}
storage = api.storage.get(id=storage_id)

if storage is None:
    raise LookupError("that storage is not on this account")

这个, 或者获得标准()

api.storage.get()api.getStorage()
给给给A 连接系统,使用方法四平原字段
使用它读、写、写、列出文件显示哪个是默认值
取取 ID否 是没有 - 总是默认

回来后你能做什么

const storage = await api.storage.get({ id });

// Any storage: read and write through run()
await storage.run({ action: "collections" });

// A computer only: its own files, on that machine
const pc = await api.storage.get({ id: computerId });
await pc.files.list();
storage = api.storage.get(id=storage_id)

# Any storage: read and write through run()
storage.run(action="collections")

# A computer only: its own files, on that machine
pc = api.storage.get(id=computer_id)
pc.files.list()
仅存在于计算机中的文件和终端文件

或用任何物物去达到他们, storage_not_local,在手机上 storage_is_phone ——其文件在浏览器中。在您到达之前测试类型。

if (storage.type === "filesystem") {
  await storage.files.list();
} else {
  await storage.run({ action: "objects" });
}
if storage.type == "filesystem":
    storage.files.list()
else:
    storage.run(action="objects")

随它携带的

字段是
ID 标签 ID = 标签和显示名称。
类型类型类型· 电话 · 浏览器 · 数据库 · 对象
提供商 管理背后的是什么 是谁在操作它
服务对象在 IaGenify 云储存;否则无效。
是一个“默认”是否在此保存无目标的保存 。
机器 Id · 主机名 · 设备IDd在一个装置上:哪一个。

这里没有带有证书的东西:您在连接时提供的是服务器使用的,没有交还。