Skip to main content

Create a cron entry

POST 

/node/:hostname/schedule/cron

Create a new cron drop-in entry on the target node.

Request

Path Parameters

    hostname stringrequired

    Possible values: non-empty

    Target agent hostname, reserved routing value (_any, _all), or label selector (key:value).

Body

required

Cron entry creation parameters.

    name stringrequired

    Name for the cron drop-in entry. Used as the file name under /etc/cron.d/ or /etc/cron.{interval}/.

    object stringrequired

    Name of the uploaded file in the object store to deploy as the cron entry content.

    schedule string

    Cron schedule expression (e.g., "*/5 * * * *"). Mutually exclusive with interval — provide exactly one.

    interval string

    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 string

    User to run the command as. Only applies when using schedule (cron.d entries include a user field).

    content_type string

    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".

    property name* any

    Template variables. Only used when content_type is "template".

Responses

Cron entry created.

Schema

    job_id uuid

    The job ID used to process this request.

    results

    object[]

    required

  • Array [

  • hostname stringrequired

    Hostname of the agent that processed this operation.

    status stringrequired

    Possible values: [ok, failed, skipped]

    The status of the operation for this host.

    name string

    Cron entry name.

    changed boolean

    Whether the operation modified system state.

    error string

    Error message if the agent failed.

  • ]

Loading...