hosting
POST /v1/storage/buckets
Provision Zinn® storage, or attach a bucket of your own.
Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền storage.manage; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Endpoint này không nhận ID tổ chức. Khóa của bạn đã xác định tổ chức mà nó thuộc về và phản hồi được giới hạn trong phạm vi đó.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
curl -X POST https://api.zinndigital.com/v1/storage/buckets \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string> }'Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
With ownership: zinn this provisions storage on our own backend and needs nothing else. With ownership: customer it attaches an existing S3-compatible bucket and requires bucket_name, endpoint, access_key_id and secret_access_key. The key pair is written to Vault and never to a column; the bucket is created pending and only becomes active once the write has returned, so a failure part way leaves a visibly unfinished bucket rather than one that reads as configured and cannot sign. Requires storage.manage.
Nội dung yêu cầu
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
name | string | Có | — |
ownership | string<zinn, customer> | Không | — |
vendor | string<r2, s3, b2, bunny, gcore, minio> | Không | — |
bucket_name | string | Không | — |
endpoint | string | Không | — |
region | string | Không | — |
public_base_url | string | Không | — |
access_key_id | string | Không | Required for ownership: customer. Written to Vault, never to a column. |
secret_access_key | string | Không | Required for ownership: customer. Written to Vault, never to a column. |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
id | string | Có | — |
name | string | Có | The customer's own label, not the bucket's name at the vendor. |
ownership | string<zinn, customer> | Có | zinn is storage we operate and bill for; customer is the organisation's own bucket, which costs us nothing and is not metered against their allowance. |
vendor | string<r2, s3, b2, bunny, gcore, minio> | Có | — |
status | string<pending, active, suspended, failed> | Có | — |
bucket_name | string | Có | — |
endpoint | string | Không | — |
region | string | Không | — |
public_base_url | string | Không | Where a public object is readable. Empty means the bucket is private and its objects are reachable only through a presigned URL. |
bytes_stored | integer | Không | — |
objects_stored | integer | Không | — |
usage_measured_at | string | Không | When the size above was last measured against the vendor. null means it has not been measured yet — which is not the same as empty. |
has_credential | boolean | Có | Whether a stored key exists. The key and the Vault path it lives at are deliberately absent from this payload. |
metered | boolean | Có | Whether this bucket's bytes count against object_storage_gb. |
created_at | string | Không | — |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 422 · 429