{"slug":"cli-storage","title":"CLI: Object Storage","description":"Manage S3-compatible object storage buckets and access keys using the DanubeData CLI.","section":"CLI","url":"https://docs.danubedata.ro/cli-storage","markdown_url":"https://docs.danubedata.ro/cli-storage.md","breadcrumbs":[{"title":"CLI","slug":null},{"title":"Object Storage","slug":"cli-storage"}],"headings":[{"level":1,"title":"CLI: Object Storage","id":"cli-object-storage"},{"level":2,"title":"Prerequisites","id":"prerequisites"},{"level":2,"title":"Quick start","id":"quick-start"},{"level":2,"title":"Bucket management","id":"bucket-management"},{"level":3,"title":"List buckets","id":"list-buckets"},{"level":3,"title":"Create a bucket","id":"create-a-bucket"},{"level":4,"title":"Interactive","id":"interactive"},{"level":4,"title":"With flags","id":"with-flags"},{"level":3,"title":"View bucket details","id":"view-bucket-details"},{"level":3,"title":"Update bucket settings","id":"update-bucket-settings"},{"level":3,"title":"View bucket metrics","id":"view-bucket-metrics"},{"level":4,"title":"Trend (time-series)","id":"trend-time-series"},{"level":4,"title":"Top objects","id":"top-objects"},{"level":4,"title":"Health","id":"health"},{"level":3,"title":"Delete a bucket","id":"delete-a-bucket"},{"level":2,"title":"Access key management","id":"access-key-management"},{"level":3,"title":"List access keys","id":"list-access-keys"},{"level":3,"title":"Create an access key","id":"create-an-access-key"},{"level":3,"title":"View access key details","id":"view-access-key-details"},{"level":3,"title":"Revoke an access key","id":"revoke-an-access-key"},{"level":2,"title":"Using with S3 clients","id":"using-with-s3-clients"},{"level":2,"title":"Complete workflow example","id":"complete-workflow-example"},{"level":2,"title":"Next steps","id":"next-steps"}],"format":"markdown","word_count":621,"content":"# CLI: Object Storage\n\nManage S3-compatible object storage buckets and access keys using the DanubeData CLI.\n\n## Prerequisites\n\n- [DanubeData CLI installed](https://docs.danubedata.ro/cli-overview)\n- Authenticated via `danube auth`, `danube login`, or `DANUBE_TOKEN`\n\n## Quick start\n\nList your buckets:\n\n```bash\ndanube storage buckets ls\n```\n\nCreate a new bucket:\n\n```bash\ndanube storage buckets create --name my-bucket --region fsn1\n```\n\n## Bucket management\n\n### List buckets\n\n```bash\ndanube storage buckets ls\n```\n\nShows all buckets with ID, name, region, status, storage usage, and object count.\n\n### Create a bucket\n\n#### Interactive\n\n```bash\ndanube storage buckets create\n```\n\nThe CLI guides you through naming, region selection, and optional settings.\n\n#### With flags\n\n```bash\ndanube storage buckets create --name my-bucket --region fsn1 --versioning\n```\n\n### View bucket details\n\n```bash\ndanube storage buckets get <id>\n```\n\nDisplays full bucket details including endpoint URL, storage usage, object count, and configuration.\n\n### Update bucket settings\n\n```bash\ndanube storage buckets update <id> --size-limit 10GB --encryption\ndanube storage buckets update <id> --public --display-name \"My Assets\"\n```\n\nAvailable settings:\n\n- `--size-limit` — Maximum storage size\n- `--encryption` — Enable server-side encryption\n- `--public` / `--private` — Toggle public access\n- `--display-name` — Set a display name\n\n### View bucket metrics\n\n```bash\ndanube storage buckets metrics <id>\n```\n\nShows the current snapshot: storage usage, object count, 24h requests, error rate, p50/p95 latency, egress/ingress bytes, and a freshness badge.\n\n#### Trend (time-series)\n\n```bash\ndanube storage buckets metrics trend <id>\ndanube storage buckets metrics trend <id> --window 7d --format table\n```\n\n- `-w, --window` — `24h` (default), `7d`, or `30d`\n- `-r, --resolution` — `1m`, `5m`, `1h`, `1d` (auto by default)\n- `-f, --format` — `sparkline` (default), `table`, `csv`, or `json`\n\n#### Top objects\n\n```bash\ndanube storage buckets metrics top <id> --by size\n```\n\n- `-b, --by` — `size` (default), `egress`, or `requests`\n- `-l, --limit` — number of objects to return (default `10`)\n\n#### Health\n\n```bash\ndanube storage buckets metrics health <id>\n```\n\nShows pending multipart uploads, deleted-version size (reclaimable space), and the last health-check time.\n\n> **Freshness in scripts:** these commands exit with code **3** when the underlying data is stale or not yet available, so automation can branch on data freshness.\n\n### Delete a bucket\n\n```bash\ndanube storage buckets delete <id>\n```\n\nPrompts for confirmation. Deletion may take time for buckets with many objects.\n\n## Access key management\n\nAccess keys provide S3-compatible credentials for connecting to your buckets from applications, backup tools, or S3 clients.\n\n### List access keys\n\n```bash\ndanube storage keys ls\n```\n\nShows all access keys with ID, name, access key ID, and creation date.\n\n### Create an access key\n\n```bash\ndanube storage keys create --name \"deploy-key\"\n```\n\n**Important:** The secret key is displayed only once. Save it immediately.\n\n### View access key details\n\n```bash\ndanube storage keys get <id>\n```\n\nShows key details (the secret key is not shown again after creation).\n\n### Revoke an access key\n\n```bash\ndanube storage keys revoke <id>\n```\n\nImmediately revokes the key. Any applications using this key will lose access.\n\n## Using with S3 clients\n\nAfter creating an access key, use it with any S3-compatible client:\n\n```bash\n# AWS CLI\naws configure\n# Access Key ID: <from danube storage keys create>\n# Secret Access Key: <from danube storage keys create>\n# Region: fsn1\n\naws --endpoint-url https://s3.danubedata.ro s3 ls\n\n# rclone\nrclone config\n# Type: s3\n# Provider: Other\n# Endpoint: https://s3.danubedata.ro\n```\n\n## Complete workflow example\n\n```bash\n# Install the CLI\nnpm install -g @danubedata/cli\n\n# Authenticate\ndanube auth\n\n# Create a bucket with versioning\ndanube storage buckets create --name my-backups --region fsn1 --versioning\n\n# Create an access key for your application\ndanube storage keys create --name \"app-key\"\n# Save the access key ID and secret key!\n\n# Check bucket metrics\ndanube storage buckets metrics <id>\n\n# List all keys\ndanube storage keys ls\n```\n\n## Next steps\n\n- [CLI Overview](https://docs.danubedata.ro/cli-overview) — Installation, auth, and configuration\n- [CLI: VPS Instances](https://docs.danubedata.ro/cli-vps) — Manage VPS instances\n- [Object Storage overview](https://docs.danubedata.ro/object-storage) — Full object storage reference\n- [Object Storage quick start](https://docs.danubedata.ro/object-storage-quickstart) — Dashboard-based guide\n\n---\n\n**Questions?** Contact support at support@danubedata.ro\n","prev":{"title":"VPS Instances","slug":"cli-vps","url":"https://docs.danubedata.ro/cli-vps","markdown_url":"https://docs.danubedata.ro/cli-vps.md","json_url":"https://docs.danubedata.ro/cli-vps.json"},"next":{"title":"Static Sites","slug":"cli-pages","url":"https://docs.danubedata.ro/cli-pages","markdown_url":"https://docs.danubedata.ro/cli-pages.md","json_url":"https://docs.danubedata.ro/cli-pages.json"},"index_url":"https://docs.danubedata.ro/index.json"}