hosting
POST /v1/sites/{siteId}/scheduled-tasks
Schedule a command on a site.
සත්යාපනය
බෙරර් ටෝකනයක් ලෙස API යතුරක් යවන්න. යතුරෙහි sites.view අවසරය තිබිය යුතුය; එය නොමැති යතුරක් 404 ලෙස නොව 403 ලෙස ප්රතික්ෂේප කෙරේ.
මෙම අවසාන ලක්ෂ්යය සඳහා සංවිධාන හැඳුනුම්පතක් (organisation id) අවශ්ය නොවේ. ඔබගේ යතුර මඟින් එය අයත් වන සංවිධානය දැනටමත් හඳුනා ගන්නා අතර, ප්රතිචාරය ඒ වෙත සීමා වේ.
උත්සාහ කරන්න
<අගයන්> සමඟ කෝණික වරහන් තුළ ඇති ඕනෑම දෙයක් සහ ඔබේ උපකරණ පුවරුවෙන් ලබාගත් යතුරක් සමඟ 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 කොන්සෝලය මඟින් ඔබේ සැබෑ ආයතනික හැඳුනුම්පත සහ ඔබේම යතුර පුරවා, සජීවී API වෙත ඉල්ලීම ක්රියාත්මක කරන බැවින් ඔබට සැබෑ ප්රතිචාරය දැකගත හැක. මෙම අග්රලක්ෂ්යය 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… |
පsspil
| නම | වර්ගය | අත්යවශ්යයි | එය කුමක්ද |
|---|---|---|---|
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