hosting
POST /v1/sites/{siteId}/scheduled-tasks
Schedule a command on a site.
စစ်မှန်ကြောင်း အတည်ပြုခြင်း
API သော့တစ်ခုကို bearer token အဖြစ် ပို့ပါ။ သော့တွင် sites.view ခွင့်ပြုချက် ပါရှိရမည်ဖြစ်ပြီး၊ ၎င်းမပါရှိသော သော့ကို 404 အစား 403 ဖြင့် ငြင်းပယ်ပါမည်။
ဤ အမှတ်ဆက် (endpoint) သည် အဖွဲ့အစည်း အိုင်ဒီ (organisation id) ကို မယူပါ။ သင်၏ သော့ချက် (key) သည် ၎င်းပိုင်ဆိုင်သည့် အဖွဲ့အစည်းကို အလိုအလျောက် ဖော်ထုတ်ပြီးဖြစ်ကာ တုံ့ပြန်ချက်ကိုလည်း ၎င်းနှင့်သာ ကန့်သတ်ထားမည် ဖြစ်သည်။
စမ်းကြည့်ရန်
ထောင့်ချိတ်များအတွင်းရှိ မည်သည့်အရာကိုမဆို သင်၏ကိုယ်ပိုင်တန်ဖိုးများဖြင့် အစားထိုးပြီး သင့်ဒက်ရှ်ဘုတ်မှ သော့ချက်တစ်ခုဖြင့် key ကို အစားထိုးပါ။
curl -X POST https://api.zinndigital.com/v1/sites/{siteId}/scheduled-tasks \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "schedule": <string>, "command": <string> }'ဝင်ရောက်ပြီးပြီလား။ သင့်ဒက်ရှ်ဘုတ်ရှိ API ကွန်ဆိုးလ်တွင် သင့်၏ တကယ့်အဖွဲ့အစည်း ID နှင့် သင့်ကိုယ်ပိုင်သော့ချက်တို့ဖြင့် ဖြည့်သွင်းပေးပြီး တကယ့်တုံ့ပြန်ချက်ကို သင်မြင်နိုင်ရန် တိုက်ရိုက် API (live API) ကို အသုံးပြု၍ တောင်းဆိုမှုကို လုပ်ဆောင်ပေးပါသည်။ ဤအဆုံးသတ်အမှတ် (endpoint) ကို API ကွန်ဆိုးလ်တွင် ဖွင့်ပါ
အသေးစိတ်အချက်အလက်များ
Adds one cron job. The schedule and the command are validated **before** the vendor is called: a five- or six-field crontab expression, no newline anywhere (a crontab is lines, so one embedded newline is a second job the customer never wrote), and a command within the length the vendor's crond accepts. Each refusal is a `422` carrying our sentence and naming the fix. ⛔ `enabled` is accepted for symmetry with `updateSiteScheduledTask` and **ignored here** — a newly created task is always active. Pause it with a subsequent `updateSiteScheduledTask` carrying the whole row. `404` for a site with no managed hosting package. Requires `sites.view` and `sites.panel_access`.
ကန့်သတ်ဘောင်များ
| နာမည် | အမျိုးအစား | လိုအပ်သည် | ဘာလဲဆိုတာ |
|---|---|---|---|
siteId (path) | Uuid | ဟုတ်ကဲ့ | Site ID (UUIDv7). |
တောင်းဆိုချက် ကိုယ်ထည်
| နာမည် | အမျိုးအစား | လိုအပ်သည် | ဘာလဲဆိုတာ |
|---|---|---|---|
schedule | string | ဟုတ်ကဲ့ | A five- or six-field crontab expression. Validated before the vendor is called; ⛔ a newline anywhere in it is refused, because a crontab is lines and one embedded newline is a s… |
command | string | ဟုတ်ကဲ့ | The command to run. Capped at the length the vendor's crond accepts — anything longer belongs in a script file the task then schedules. |
email_output | string | မဟုတ်ပါ | Where to mail the task's output. An email address, or empty to mail it nowhere — which is why this carries no `format: email`: the empty string is a valid value here and a forma… |
enabled | boolean | မဟုတ်ပါ | Whether the task runs. ⛔ Honoured by `updateSiteScheduledTask` and **ignored by `createSiteScheduledTask`** — a newly created task is always active, and pausing one is a subsequ… |
တုံ့ပြန်ချက်
| နာမည် | အမျိုးအစား | လိုအပ်သည် | ဘာလဲဆိုတာ |
|---|---|---|---|
id | string | ဟုတ်ကဲ့ | The task's identifier at the vendor, used to update or delete it. |
schedule | string | ဟုတ်ကဲ့ | The crontab expression, carried **verbatim**. A customer who typed `*/15 * * * *` sees exactly that back, never a normalised rewriting of it. |
command | string | ဟုတ်ကဲ့ | The command the vendor runs, as the site's own user. |
enabled | boolean | ဟုတ်ကဲ့ | Whether the task currently runs. ⛔ An absent vendor flag reads as `false`, never `true` — reporting a paused job as running is how a customer stops investigating the thing that… |
email_output | string | ဟုတ်ကဲ့ | Where the task's output is mailed, or `""` when the vendor mails it nowhere. |
ဤအမှတ်ဆက်မှ ပြန်ပေးနိုင်သော အမှားများ
401 · 403 · 404 · 409 · 422 · 429 · 503