User Tools

Site Tools


api:tools:scheduledjobs:create

API : Tools: Scheduled jobs : Create

Introduction

Creates a scheduled job. The target is free-form: any hostname, path, method, query parameters and body may be given. Every create, update and delete writes a ChangeLog entry.

Request

URL https://api.telecomx.dk/tools/scheduledjobs
Method POST
Access level Admin

Body

Field Type Required Description
name String Yes Human readable label, 1-200 characters.
hostname String Yes Hostname to call, with or without a scheme.
path String No Path appended to the hostname. Defaults to empty.
method String Yes GET, POST, PATCH or DELETE.
params Object No Key-value pairs, all values strings. Defaults to empty.
body Object or Array No Request body. Defaults to empty.
timeoutMs Number No Request timeout, 1000-600000 ms. Defaults to 120000.
when Date Conditional When to run. Required when there is no recurrence; ignored when there is, because the first run is derived from the recurrence.
recurrence Object No Recurrence settings, see Recurrence. Omit for a one-shot job.
runAs String No ME to run as the calling admin, SYSTEM to run as the TelecomX system employee. Defaults to ME. Recurring jobs should use SYSTEM, so the schedule survives the creating admin leaving.
customerId Id No Customer the job relates to. Defaults to the TelecomX customer.
accountId Id No Account the job relates to. Jobs sharing an account are never run concurrently.

Query example

https://api.telecomx.dk/tools/scheduledjobs

Response

The created job, with the same fields as List.

Example

{
	"name": "IPTV device state cleanup",
	"hostname": "api.telecomx.dk",
	"path": "/iptv/devicestate/clean",
	"method": "POST",
	"runAs": "SYSTEM",
	"recurrence": { "interval": "MINUTE", "enabled": true }
}

Errors

Error code Message Description
400 invalid_data A field is missing or out of range
403 access_denied Insufficient access level
500 internal_error <Unspecified>
api/tools/scheduledjobs/create.txt · Last modified: by Per Møller

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki