# uplicazion

Canonical URL: https://developers.iagenify.com/pt/sdk/ref/connected-storage/run/usage/
Language: pt

`storage.run({ action: "usage" })`

Quanta spazio sta prendendo questo stoccaggio. Il numero da lere prima di un scriva fa fail per mancanza di spazio.

Status: any storage · free · a reading

```javascript
await storage.run({ action: "usage" });
```

## Por qua pretere prima de scriver {#why}

Un scrivat passa lo spazio del piano è negat con `quota_exceeded`. Lettura e elimina continua a funzionnèr — que l'assimetria è deliberat, per cui si può sempre ottenere i dati e fare spazio — ma una scrivatura che non fa la mitèria di un lotto lascia che achiesto.

```javascript
const before = await storage.run({ action: "usage" });

// Write in batches, and stop on the first refusal rather than pushing through
for (const batch of batches) {
  try {
    await storage.run({ action: "insert", collection, documents: JSON.stringify(batch) });
  } catch (err) {
    if (err.code === "quota_exceeded") break;
    throw err;
  }
}
```

## Este stoccage, o la conta {#account}

| Question | Ask |
| --- | --- |
| Quan cheio è questo? | run({ azione: "usage" }) |
| Quale è il plan da, inversa di servizi? | api.cloud.usage() |
| Quals dosari prende l'espazio? | api.files.list(), e trie per taglia |

La vista a nivel de contas è quella che dice si comprare un spazio ajudarà, perché è là onde vive la prestazione del plan.

- [api.cloud.usage()](/pt/sdk/ref/cloud/usage): L'espace du compte, service par service.
- [run()](/pt/sdk/ref/connected-storage/run): Tutes les actions, les garde-fous et ce que chaque coute.

```python
storage.run(action="usage")
```

```python
import json
from iagenify import IaGenifyError

before = storage.run(action="usage")

# Write in batches, and stop on the first refusal rather than pushing through
for batch in batches:
    try:
        storage.run(action="insert", collection=collection, documents=json.dumps(batch))
    except IaGenifyError as error:
        if error.code == "quota_exceeded":
            break
        raise
```
