Create a cron entry
POST/node/:hostname/schedule/cron
Create a new cron drop-in entry on the target node.
Request
Path Parameters
Possible values: non-empty
Target agent hostname, reserved routing value (_any, _all), or label selector (key:value).
- application/json
Body
required
Cron entry creation parameters.
Name for the cron drop-in entry. Used as the file name under /etc/cron.d/ or /etc/cron.{interval}/.
Name of the uploaded file in the object store to deploy as the cron entry content.
Cron schedule expression (e.g., "*/5 * * * *"). Mutually exclusive with interval — provide exactly one.
Possible values: [hourly, daily, weekly, monthly]
Periodic interval (hourly, daily, weekly, monthly). Places the script in /etc/cron.{interval}/. Mutually exclusive with schedule — provide exactly one.
User to run the command as. Only applies when using schedule (cron.d entries include a user field).
Possible values: [raw, template]
Content type: "raw" or "template". When "template", the file content is rendered through Go text/template with agent facts and user-supplied vars.
vars
object
Template variables. Only used when content_type is "template".
Template variables. Only used when content_type is "template".
Responses
- 200
- 400
- 401
- 403
- 500
Cron entry created.
- application/json
- Schema
- Example (from schema)
Schema
Array [
]
The job ID used to process this request.
results
object[]
required
Hostname of the agent that processed this operation.
Possible values: [ok, failed, skipped]
The status of the operation for this host.
Cron entry name.
Whether the operation modified system state.
Error message if the agent failed.
{
"job_id": "550e8400-e29b-41d4-a716-446655440000",
"results": [
{
"hostname": "string",
"status": "ok",
"name": "string",
"changed": true,
"error": "string"
}
]
}
Invalid request payload.
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Unauthorized - API key required
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Forbidden - Insufficient permissions
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}
Error creating cron entry.
- application/json
- Schema
- Example (from schema)
Schema
A description of the error that occurred.
Additional details about the error.
The error code.
{
"error": "Failed to retrieve status.",
"details": "Failed due to network timeout.",
"code": 500
}