Graphon Docs

Renaming buckets

Rename a bucket with the CLI or the JSON API. The bucket ID, objects, and grants stay unchanged.

An Editor or Admin can rename a bucket. The bucket ID, objects, versions, and grants stay unchanged.

With the CLI

The CLI fetches the current revision and sends the rename by stable ID.

CLI

graphon buckets rename support-tickets Support_Archive

With the JSON API

First get the bucket by ID. Set GRAPHON_BUCKET_ID to that ID and GRAPHON_BUCKET_REVISION to its current revision. Send the quoted revision in If-Match on the bare JSON host:

cURL

# Set GRAPHON_BUCKET_ID to the stable ID returned by Get a bucket.
# Set GRAPHON_BUCKET_REVISION to that response's revision.
curl --request PATCH \
  --url "https://storage.beta.graphon.sh/v1/workspaces/$GRAPHON_WORKSPACE_ID/buckets/$GRAPHON_BUCKET_ID" \
  --header "Authorization: Bearer $GRAPHON_API_KEY" \
  --header "Content-Type: application/json" \
  --header "If-Match: \"$GRAPHON_BUCKET_REVISION\"" \
  --data '{"name":"Support_Archive"}'

The response contains the updated bucket and revision. A missing revision returns 428 revision_required. A stale revision returns 412 revision_mismatch. Read the bucket again before retrying. A name already claimed in this workspace returns 409 bucket_name_unavailable.

After you rename

Update name-based links

S3 has no RenameBucket operation. Use JSON or the CLI. Update S3 settings, public links, and presigned URLs after a rename. The old name becomes available without an alias or redirect. If another bucket claims it, an old URL can address that bucket under current access checks.
Was this page helpful?
View as Markdown