hosting
POST /v1/storage/buckets
Provision Zinn® storage, or attach a bucket of your own.
ការផ្ទៀងផ្ទាត់ភាពត្រឹមត្រូវ
បញ្ជូនសោ API ជា bearer token។ សោនេះត្រូវតែមានសិទ្ធិ storage.manage។ សោដែលគ្មានសិទ្ធិនេះនឹងត្រូវបដិសេធដោយកូដ 403 មិនមែន 404 ទេ។
ចំនុចបញ្ចប់នេះមិនត្រូវការលេខសម្គាល់ស្ថាប័នទេ។ ពស័្ដកូនរបស់អ្នករួចហើយកំណត់អត្តសញ្ញាណស្ថាប័នដែលវាជាកម្មសិទ្ធិ ហើយការឆ្លើយតបគឺត្រូវបានកំណត់វិសាលភាពទៅតាមនោះ។
សាកល្បង
ជំនួសអ្វីមួយនៅក្នុងសញ្ញាពងក្រពើ < > ដោយប្រើតម្លៃផ្ទាល់ខ្លួនរបស់អ្នក ហើយជំនួសកន្លែងរក្សាទុកសោដោយប្រើសោចេញពីផ្ទាំងគ្រប់គ្រងរបស់អ្នក។
curl -X POST https://api.zinndigital.com/v1/storage/buckets \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "name": <string> }'បានចូលគណនីរួចហើយមែនទេ? កុងសូល API ក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នក បំពេញលេខសម្គាល់ស្ថាប័នពិតប្រាកដរបស់អ្នក និងសោផ្ទាល់ខ្លួនរបស់អ្នក ហើយដំណើរការសំណើទល់នឹង API ផ្ទាល់ ដូច្នេះអ្នកអាចមើលឃើញការឆ្លើយតបពិតប្រាកដ។ បើកចំណុចបញ្ចប់នេះក្នុងកុងសូល API
ព័ត៌មានលម្អិត
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`.
សំណើរបស់រាងកាយ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
name | string | បាទ/ចាស | — |
ownership | string<zinn, customer> | ទេ | — |
vendor | string<r2, s3, b2, bunny, gcore, minio> | ទេ | — |
bucket_name | string | ទេ | — |
endpoint | string | ទេ | — |
region | string | ទេ | — |
public_base_url | string | ទេ | — |
access_key_id | string | ទេ | Required for `ownership: customer`. Written to Vault, never to a column. |
secret_access_key | string | ទេ | Required for `ownership: customer`. Written to Vault, never to a column. |
ផ្អាកដំណើរការ
| ឈ្មោះ | ប្រភេទ | តម្រូវការ | តើវាជាអ្វី |
|---|---|---|---|
id | string | បាទ/ចាស | — |
name | string | បាទ/ចាស | The customer's own label, not the bucket's name at the vendor. |
ownership | string<zinn, customer> | បាទ/ចាស | `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> | បាទ/ចាស | — |
status | string<pending, active, suspended, failed> | បាទ/ចាស | — |
bucket_name | string | បាទ/ចាស | — |
endpoint | string | ទេ | — |
region | string | ទេ | — |
public_base_url | string | ទេ | 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 | ទេ | — |
objects_stored | integer | ទេ | — |
usage_measured_at | string | ទេ | 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 | បាទ/ចាស | Whether a stored key exists. The key and the Vault path it lives at are deliberately absent from this payload. |
metered | boolean | បាទ/ចាស | Whether this bucket's bytes count against `object_storage_gb`. |
created_at | string | ទេ | — |
កំហុសដែលចំណុចបញ្ចប់នេះអាចបង្វិលត្រឡប់មកវិញ
401 · 403 · 422 · 429