همهٔ سیستم‌ها عملیاتی‌اند

مرجع API · نسخهٔ v1

API فضای ذخیره‌سازی ابری

ساخت و حذف باکت، مصرف باکت و کلیدهای دسترسی. این گروه با شناسهٔ storage در فایل OpenAPI آمده و ۸ endpoint دارد.

نمونه‌های curl توکن را از متغیر محیطی IRANCLAUD_TOKEN می‌خوانند؛ ساخت توکن و تنظیم این متغیر در راهنمای شروع سریع آمده است.

GET /api/v1/storage/buckets #

List your object-storage buckets

دسترسی لازم: storage:read محدودیت نرخ: خواندن
پاسخ‌ها (۴)
  • 200 All buckets (unpaginated; meta.total = count) data[]: uuidnameregioncreated_at
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:read
  • 429 rate_limited — read limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/storage/buckets"

بازگشت به فهرست این بخش

POST /api/v1/storage/buckets #

Create a bucket (max 10 per account)

دسترسی لازم: storage:write محدودیت نرخ: تغییر
فیلدهای بدنه (JSON) (۱)
name string
الزامی Globally unique. Lowercase letters, digits, dots, dashes; starts/ends with letter or digit; no "..", ".-", "-."; must not look like an IPv4 address — min 3 chars; max 63 chars; pattern ^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$
نمونهٔ بدنهٔ درخواست (JSON)
application/json
{
    "name": "my-app-assets"
}
پاسخ‌ها (۶)
  • 200 Bucket created data: uuidnameregioncreated_at
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:write
  • 422 validation_failed — details.fields.name: required, invalid name, name already taken, or bucket limit (10) reached
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — the storage/database service did not complete the operation; retry later
نمونهٔ curl
curl
curl -X POST \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-app-assets"}' \
  "https://iranclaud.ir/api/v1/storage/buckets"

بازگشت به فهرست این بخش

GET /api/v1/storage/buckets/{name} #

Get a bucket and the access keys bound to it

دسترسی لازم: storage:read محدودیت نرخ: خواندن
پارامترهای مسیر (۱)
name string
الزامی Bucket name, 3-63 chars [a-z0-9.-]
پاسخ‌ها (۵)
  • 200 Bucket + bucket-scoped keys (secrets are never returned) data: bucketkeys
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:read
  • 404 not_found — unknown bucket or not yours
  • 429 rate_limited — read limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/storage/buckets/my-app-assets"

بازگشت به فهرست این بخش

DELETE /api/v1/storage/buckets/{name} #

Delete a bucket (irreversible; also revokes keys bound to it)

دسترسی لازم: storage:write محدودیت نرخ: تغییر
پارامترهای مسیر (۱)
name string
الزامی Bucket name, 3-63 chars [a-z0-9.-]
پاسخ‌ها (۶)
  • 200 Deleted data: deleted
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:write
  • 404 not_found — unknown bucket or not yours
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — the bucket could not be removed; nothing was deleted, retry later
نمونهٔ curl
curl
curl -X DELETE \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/storage/buckets/my-app-assets"

بازگشت به فهرست این بخش

GET /api/v1/storage/buckets/{name}/usage #

Live size and object count of a bucket

دسترسی لازم: storage:read محدودیت نرخ: خواندن
پارامترهای مسیر (۱)
name string
الزامی Bucket name, 3-63 chars [a-z0-9.-]
پاسخ‌ها (۶)
  • 200 Usage data: namesize_bytesobject_count
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:read
  • 404 not_found — unknown bucket or not yours
  • 429 rate_limited — read limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — the storage/database service did not complete the operation; retry later
نمونهٔ curl
curl
curl \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/storage/buckets/my-app-assets/usage"

بازگشت به فهرست این بخش

GET /api/v1/storage/keys #

List your storage access keys (secrets never included)

دسترسی لازم: storage:read محدودیت نرخ: خواندن
پاسخ‌ها (۴)
  • 200 All keys incl. revoked ones (unpaginated) data[]: access_keynamescopebucket_idlast_used_atcreated_atrevoked
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:read
  • 429 rate_limited — read limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/storage/keys"

بازگشت به فهرست این بخش

POST /api/v1/storage/keys #

Create an access key; secret_key is returned only in this response

دسترسی لازم: storage:write محدودیت نرخ: تغییر
فیلدهای بدنه (JSON) (۳)
name string
اختیاری Label; default key-YYYYMMDD-HHMMSS
scope string
اختیاری one of: read | readwrite | admin; default: readwrite
bucket string
اختیاری Optional bucket name to restrict the key to; omitted = all your buckets
نمونهٔ بدنهٔ درخواست (JSON)
application/json
{
    "name": "ci-deploy",
    "scope": "readwrite",
    "bucket": "my-app-assets"
}
پاسخ‌ها (۶)
  • 200 Key created; store secret_key now — it cannot be retrieved again data: access_keynamescopebucket_idlast_used_atcreated_atrevokedsecret_key
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:write
  • 422 validation_failed — details.fields.bucket (unknown bucket) or details.fields.scope (invalid scope)
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — the storage/database service did not complete the operation; retry later
نمونهٔ curl
curl
curl -X POST \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"ci-deploy","scope":"readwrite","bucket":"my-app-assets"}' \
  "https://iranclaud.ir/api/v1/storage/keys"

بازگشت به فهرست این بخش

DELETE /api/v1/storage/keys/{accessKey} #

Revoke an access key

دسترسی لازم: storage:write محدودیت نرخ: تغییر
پارامترهای مسیر (۱)
accessKey string
الزامی Access key ID, 20-40 chars [A-Z0-9]
پاسخ‌ها (۵)
  • 200 Revoked data: revoked
  • 401 unauthenticated / token_invalid — missing or invalid token
  • 403 scope_missing — token lacks storage:write
  • 404 not_found — unknown key or not yours
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
نمونهٔ curl
curl
curl -X DELETE \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/storage/keys/YOUR_ACCESS_KEY_ID"

بازگشت به فهرست این بخش

همهٔ گروه‌های API