> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/sdks/cloud-storage.md).

# Cloud storage

### Configure the provider before automation

![Add Cloud Storage configuration dialog](https://292810646-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGjVLUz4wthGkGlRKM6rM%2Fuploads%2FEceeKlJexxGEUrAINYfa%2Fcloud-storage-add.png?alt=media\&token=7f2c7aff-bb2a-476f-87cb-a8bd3a70540f)

*Workspace Settings › Cloud storage creates the approved provider connection used by SDK and CLI cloud-storage operations. Credentials are never returned by the SDK.*

{% hint style="info" %}
**Outcome:** List safe cloud-storage metadata, browse paginated entries, and import approved paths into a project.
{% endhint %}

```python
storage = next(s for s in client.cloud_storages.list() if s.name == "Production")

for entry in storage.browse(prefix="incoming/", page_size=500):
    print(entry.type, entry.name, entry.size, entry.is_extension_allowed)

batch = project.import_cloud(storage, ["incoming/study-001/"])
batch.wait(timeout=1800)
```

Directory paths end in `/`. Browse results expose safe provider metadata; cloud credentials are never returned by the SDK. `browse()` follows response pagination until no next token remains. An optional project argument applies project-specific validation.

### Operating contract

| Concern           | Required behavior                                                                |
| ----------------- | -------------------------------------------------------------------------------- |
| Execution surface | Pinned `unitlab==3.0.0` application environment on Python 3.10+.                 |
| Identity          | Least-privilege API key supplied through approved configuration.                 |
| Target resolution | Stable resource IDs and an explicitly bounded target set.                        |
| Success evidence  | Typed return fields, server-side state, and downstream acceptance of the result. |

### Failure and recovery boundary

| Condition                                       | Response                                                                                                     |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
| Authentication or authorization fails           | Stop, correct the service identity or access model, rotate exposed credentials, and rerun a read-only check. |
| Validation or entitlement rejects the operation | Correct the input or entitlement; do not retry an unchanged request.                                         |
| A request times out                             | Inspect remote state before repeating a mutation because the server may have accepted it.                    |
| Asynchronous processing exceeds its deadline    | Preserve the Batch Queue or release ID, continue bounded monitoring, and inspect item-level failures.        |
| Only part of a batch succeeds                   | Keep successful identifiers, isolate failed rows, and retry only the corrected subset.                       |

{% hint style="warning" %}
Pin and test the production SDK version. Use stable IDs, keep secrets out of logs and command history, and record the correlation ID, target IDs, counts, final state, and redacted error details for material state changes.
{% endhint %}
