رفتن به محتوا
cloudhostمستندات
مرجع API

اکتورها

اکتورها با حالت ماندگار، از هر کدام یک نمونه در یک زمان.

توضیح هر مسیر به انگلیسی است، همان متنی که مرجع از کد ساخته می‌شود. مسیرها، نام فیلدها و کدها همان‌اند که در درخواست می‌نویسید.
GET/v1/actors/config

Whether actors are served#

available: whether actor namespaces can be made and their actors reached here; meters: the usage meters.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پاسخ

200object

  • availableboolean
  • metersstring[]

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/actors/config" \
  -H "Authorization: Bearer $KEY"
GET/v1/actors/namespaces

The team's actor namespaces#

Every project's namespaces by name, or one project's with project.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • any
  • any
  • any

پاسخ

200object

  • namespacesActorNamespace[]
  • next_cursorstring | null
  • limitsobject

خطاها

وضعیتتوضیح
400Bad request: bad_param, bad_cursor
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/actors/namespaces" \
  -H "Authorization: Bearer $KEY"
GET/v1/projects/{project}/actors/namespaces

A project's actor namespaces#

The project's namespaces, by name.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • any
  • any
  • any

پاسخ

200object

  • namespacesActorNamespace[]
    • idstring

      ans_…

    • namestring
    • projectobject | null
    • labelstring

      what the namespace is known by inside the platform (from its id)

    • classstring

      the class its actors are instances of

    • functionobject | null

      the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

    • bindingstring

      the binding name the defining function gets it by (env.<binding>)

    • created_atstring (date-time)
  • next_cursorstring | null

خطاها

وضعیتتوضیح
400Bad request: bad_param, bad_cursor
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces" \
  -H "Authorization: Bearer $KEY"
POST/v1/projects/{project}/actors/namespaces

Create an actor namespace#

A namespace of the project: its actors are instances of class, exported by the code of function (a function or app of the project). That function gets the binding without a line; another function binds it with [[actor]].

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • any

بدنهٔ درخواستapplication/json

  • namestringالزامی

    lowercase letters, digits and single hyphens, 1 to 63 characters; unique in the project (any case)

  • classstringالزامی

    the name of the class the function exports

    pattern ^[A-Za-z_$][A-Za-z0-9_$]{0,127}$

  • functionstringالزامی

    a function or app of the project, by name (any case) or id

پاسخ

201ActorNamespace

  • idstring

    ans_…

  • namestring
  • projectobject | null
  • labelstring

    what the namespace is known by inside the platform (from its id)

  • classstring

    the class its actors are instances of

  • functionobject | null

    the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

  • bindingstring

    the binding name the defining function gets it by (env.<binding>)

  • created_atstring (date-time)
  • storage_keptboolean

    true when a namespace of this name was deleted in the project within the grace (before its storage_kept_until); its actors and their storage are this one's

خطاها

وضعیتتوضیح
400Bad request: bad_json, bad_request, bad_name, bad_class, bad_function
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, limit
404Not found: not_found
409Conflict: name_taken
500internal: an unexpected failure
503Unavailable: actors_unavailable

نمونه

curl -X POST "https://api.ibel.ai/v1/projects/my-api/actors/namespaces" \
  -H "Authorization: Bearer $KEY" \
  -d '{"name":"my-api","class":"…","function":"…"}'
GET/v1/projects/{project}/actors/namespaces/{name}

One actor namespace#

The namespace, with the functions and apps whose live version binds it (bound_by).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • any
  • namestringمسیرالزامی

    the namespace's name in the project (any case) or its id (ans_…)

پاسخ

200ActorNamespace

  • idstring

    ans_…

  • namestring
  • projectobject | null
  • labelstring

    what the namespace is known by inside the platform (from its id)

  • classstring

    the class its actors are instances of

  • functionobject | null

    the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

  • bindingstring

    the binding name the defining function gets it by (env.<binding>)

  • created_atstring (date-time)
  • bound_byobject[]
  • availableboolean

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
  -H "Authorization: Bearer $KEY"
DELETE/v1/projects/{project}/actors/namespaces/{name}

Delete an actor namespace#

Its actors stop at once. Their storage is kept until storage_kept_until (about a day): a namespace created by the same name in the project before then gets its actors back with their storage (storage_kept: true); after that it is deleted and a new one starts empty. Refused while a live version binds it (409 bound).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده
تایید دوم
با نشست داشبورد، عامل دوم در ۱۰ دقیقهٔ اخیر لازم است؛ کلید API نیازی ندارد.

پارامترها

  • any
  • namestringمسیرالزامی

    the namespace's name in the project (any case) or its id (ans_…)

پاسخ

200object

  • idstring
  • namestring
  • deletedboolean
  • storage_kept_untilstring (date-time)

    until when a namespace created by the same name in the project gets this one's actors and storage back

خطاها

وضعیتتوضیح
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden, step_up_required
404Not found: not_found
409Conflict: bound
500internal: an unexpected failure

نمونه

curl -X DELETE "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
  -H "Authorization: Bearer $KEY"
PATCH/v1/projects/{project}/actors/namespaces/{name}

Change an actor namespace#

Its class or its function. The actors keep their storage; the next call runs the new class or function.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
مالک، ادمین، توسعه‌دهنده

پارامترها

  • any
  • namestringمسیرالزامی

    the namespace's name in the project (any case) or its id (ans_…)

بدنهٔ درخواستapplication/json

  • classstring

    pattern ^[A-Za-z_$][A-Za-z0-9_$]{0,127}$

  • functionstring

    a function or app of the project, by name (any case) or id

پاسخ

200ActorNamespace

  • idstring

    ans_…

  • namestring
  • projectobject | null
  • labelstring

    what the namespace is known by inside the platform (from its id)

  • classstring

    the class its actors are instances of

  • functionobject | null

    the function or app whose code holds the class (another project's as <project>/<name>); null while it is deleted

  • bindingstring

    the binding name the defining function gets it by (env.<binding>)

  • created_atstring (date-time)

خطاها

وضعیتتوضیح
400Bad request: bad_json, bad_class, bad_function, nothing
401unauthorized: missing, invalid, expired or revoked credential
403Not allowed: forbidden
404Not found: not_found
500internal: an unexpected failure

نمونه

curl -X PATCH "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api" \
  -H "Authorization: Bearer $KEY" \
  -d '{"class":"…","function":"…"}'
GET/v1/projects/{project}/actors/namespaces/{name}/usage

An actor namespace's usage#

Calls, run time, storage reads and writes per day (Tehran), and their cost at list price once the meters have prices (priced).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • any
  • namestringمسیرالزامی

    the namespace's name in the project (any case) or its id (ans_…)

  • daysintegerکوئری

    days back

    1–90 · default 30

پاسخ

200ActorUsage

  • projectobject
  • namespaceobject
  • daysinteger
  • fromstring (date-time)
  • tostring (date-time)
  • requestsinteger
  • cpu_msinteger
  • readsinteger
  • writesinteger
  • per_dayobject[]
  • metersobject[]
  • list_rialsinteger
  • pricedboolean

    false until the meters have prices (to set)

خطاها

وضعیتتوضیح
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api/usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/projects/{project}/actors/namespaces/{name}/audit

Who changed an actor namespace#

Its audit entries, newest first.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • any
  • namestringمسیرالزامی

    the namespace's name in the project (any case) or its id (ans_…)

  • beforestringکوئری

    only entries older than this entry id

  • any
  • any

پاسخ

200ResourceAudit

  • entriesobject[]الزامی
  • nextstring | nullالزامی

    pass as ?before= for the next page

  • next_cursorstring | null

    send as cursor for the next page; null on the last page

خطاها

وضعیتتوضیح
400Bad request: bad_param, bad_cursor
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/projects/my-api/actors/namespaces/my-api/audit" \
  -H "Authorization: Bearer $KEY"
GET/v1/projects/{project}/actors/usage

A project's actor usage#

Every namespace of the project together, per day (Tehran).

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • any
  • daysintegerکوئری

    days back

    1–90 · default 30

پاسخ

200ActorUsage

  • projectobject
  • namespaceobject
  • daysinteger
  • fromstring (date-time)
  • tostring (date-time)
  • requestsinteger
  • cpu_msinteger
  • readsinteger
  • writesinteger
  • per_dayobject[]
  • metersobject[]
  • list_rialsinteger
  • pricedboolean

    false until the meters have prices (to set)

خطاها

وضعیتتوضیح
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/projects/my-api/actors/usage" \
  -H "Authorization: Bearer $KEY"
GET/v1/actors/usage

The team's actor usage#

Every namespace of every project together (the team view), or one project's with project, per day (Tehran). project in the answer is the project asked for, or null.

دسترسی
کلید API یا نشست داشبورد
نقش‌ها
همهٔ نقش‌ها

پارامترها

  • any
  • daysintegerکوئری

    how many days back: 1 to 90 (default 30)

    1–90 · default 30

پاسخ

200ActorUsage

  • projectobject
  • namespaceobject
  • daysinteger
  • fromstring (date-time)
  • tostring (date-time)
  • requestsinteger
  • cpu_msinteger
  • readsinteger
  • writesinteger
  • per_dayobject[]
  • metersobject[]
  • list_rialsinteger
  • pricedboolean

    false until the meters have prices (to set)

خطاها

وضعیتتوضیح
400Bad request: bad_param
401unauthorized: missing, invalid, expired or revoked credential
404Not found: not_found (no such project)
500internal: an unexpected failure

نمونه

curl "https://api.ibel.ai/v1/actors/usage" \
  -H "Authorization: Bearer $KEY"