Obter uma chave de API
Conceitos

Máquinas são armazenamentos

La macchina che esegue il SDK registra se in tuo conto la prima volta che scambia una chiave. Itè che dè un agent in un luogo da lavoro, e è il motivo per cui i suoi files non lasce la macchina.

registered on first callfiles stay local
Using Python?

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

Ideia

Un storage è in ogni parte di vita dei dati, e la lista è deliberament miscelada: un computer, un dispositivo de browser, cloud managed storage, e bases de dabdas o baldes connet con le vostre proprie credenciali. Differiscent in cui i bytes sono — non in come li raggiunge.

GentileQuando i suoi dati sonoAtinse con
computersu quella macchina, sotto ~/.iagenify/filesstorage.files
telefonoin quel browserun ponte de files che tu providenzi
IaGenify Cloudgestit per testorage.run()
Base de datos o cubo conectadocon il provider, i suoi credencialistorage.run()

Como arriva una machina

Non lo registra. Nel primo scambio di tasche il SDK informa id la macchina, l'ambiente e i recursos detectati, e la macchina appare in la lista. Mantiene la stessa identitât poi perché l'identit de stoccaj è memorizat con la sessione.

const pc = await api.storage.get();   // this machine

pc.id;
pc.type;        // "filesystem"
pc.hostname;
pc.isDefault;

await api.storage.list();             // every storage on the account
pc = api.storage.get()   # this machine

pc.id
pc.type          # "filesystem"
pc.machine_id
pc.is_default

api.storage.list()       # every storage on the account

Por què un computer mantiene is seus files

Un archivio del computer non tiene octes sul server, e che è implementat in lugar de meramente intenzione: un upload mirat a uno è negat con storage_is_local. Un agent che lavora li lee e scrie a travers la macchina stessa.

// Refused — a computer is not a destination for an upload
await api.files.create({ name: "notes.md", content }).save({ localOnly: false });
// IaGenifyError: storage_is_local

// This is the way: the file is written on the machine
await pc.files.write("notes.md", content);
# Refused — a computer is not a destination for an upload
api.files.create(name="notes.md", content=content).save(local_only=False)
# IaGenifyError: storage_is_local

# This is the way: the file is written on the machine
pc.files.write("notes.md", content)

Il stoccaggio predefinit

Ogni conto ha un, e è dove va un salva senza destino. Un computer è un default deficiente per tal motivo — non può ricever un — así que il default normalmente indica a storage cloud gestit.

await api.getStorage();              // the default
await api.storage.remove(id);        // allowed even for the default
                                     // another storage inherits the flag
api.get_storage()             # the default
api.storage.remove(storage_id)  # allowed even for the default:
                                # another storage inherits the flag