Parâmetros
idstringQuale stoccatura. Esclude-lo per il predefinit del cont.
const target = await api.storage.get(); // the default
const one = await api.storage.get({ id }); // a particular onetarget = api.storage.get() # the default
one = api.storage.get(id=storage_id) # a particular oneResponde null e non lance
Un id sconosciut, un malformat, o un identificat di un altro conto, da null. Quindi il check è un test de valore, non un test/catch — e null non significa mai «è di qualcun altro».
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")Isto, o getStorage()
| api.storage.get() | api.getStorage() | |
|---|---|---|
| Dà | Un archivament connesso, con metodi | Quattro campis simples |
| Usar-lo a | leg, scrivi, list files | Mostra qual è la predefinit |
| Prende un id | si | no — sempre il predefinit |
Ce pots fare con ce che torna
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()Fichier e terminales existen solo in un computer
Assegnîs per loro su ningun altro get storage_not_local, e su un telefono storage_is_phone — i suoi files sono in suo browser. Teste tipo prima di arrivi.
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")Ce porta
| Campo | Is |
|---|---|
| id · étiquette | Identità, e nome di mostra. |
| tipo | sistema de fiches · telefono · navegador · base de datos · objeto |
| provider · gestitBy | Cenès isquit e chi lo opera. |
| servizio | Nosql · sql · objete su un IaGenify Storage cloud; null other. |
| isdefault | Se un salvatèn senza alza va aquí. |
| idmachine · nomede l'host · dispositivo | Su un dispositivo: qual. |
Nada qui porta un credential: quello che tu providenzis in connezion e usat dal servèr e non restituit.