Service task (svctask)

Description

Deferred job to run a service script once or periodically.

Limitations

  • The collection is not available in the master domain.

Fields

Entity structure
{
  "id": uuid,
  "name": str,
  "isenabled": intbool,
  "svcscriptcode": str,
  "sitemode": str,
  "sites": array<str>,
  "isregular": intbool,
  "overlap": intbool,
  "intervalsec": int,
  "dtstart": date,
  "dtstop": date,
  "schedule": str,
  "periods": array<object>,
  "opts": {
    "title": str,
    "comment": str
  },
  "ext": {
    "ct": date,
    "lwt": date
  }
}
Table 1. Fields
Specification Description

Field: id
Mode: inout
Type: uuid
Default: generated

Identifier. Can be specified at creation, otherwise generated by the system.

Field: name
Mode: in
Type: str
Default: requried

Title

Field: isenabled
Mode: in
Type: intbool
Default: 0

Task switch

Field: svcscriptcode
Mode: in
Type: str
Default: empty

Service script code

Field: sitemode
Mode: in
Type: str
Default: "all"

Field: sites
Mode: in
Type: array<str>
Default: empty

List of sites where the task can be run.
Parameter for sitemode field in some modes

Field: isregular
Mode: in
Type: intbool
Default: 0

Run mode. 0 - single run, 1 - regular run.

Field: overlap
Mode: in
Type: intbool
Default: 1

Multiple instances of the task can be executed simultaneously.
Used for regular tasks whose script execution time may exceed the startup period.

Field: intervalsec
Mode: in
Type: int
Default: 0

Timer task start interval in seconds.
Used for regular tasks.

Field: dtstart
Mode: in
Type: date
Default: empty

The date and time of the start of the activity period of a regular task, or the start of a single-executable task.
RFC3339 format in UTC.

Field: dtstop
Mode: in
Type: date
Default: empty

The date and time when the activity period of a regular task ends, or when a once-executed task goes out of relevance.
RFC3339 format in UTC.

Field: schedule
Mode: in
Type: str
Default: `"all"`","Work Schedule.
Outside of the schedule, the script will not run.
In case the launch time is up but the schedule is not suitable, the launch is postponed until it hits the schedule.

Field: periods
Mode: in
Type: array<object>
Default: empty

Activity interval during the week.
Applies in mode schedule = custom.
Each item in the list covers a specific segment within the week: from time on a particular day of the week to time on another particular day of the week.
Based on the aggregate of these segments, an overall schedule is generated.
Weekly schedule list item.

Field: opts
Mode: in
Type: object
Composite field

Field: opts.title
Mode: in
Type: str
Default: empty

Arbitrary header

Field: opts.comment
Mode: in
Type: str
Default: empty

Arbitrary comment

Field: ext
Mode: inout
Type: object
Compound field

Allows you to extend the compound with arbitrary keys and values

Field: ext.ct
Mode: out
Type: date
Default: generated

Object creation time

Field: ext.lwt
Mode: out
Type: date
Default: generated

Time of last modification of the object

Field: ext.lasterror
Mode: out
Type: str
Default: generated

Mode of service at the sites

Table 2. Mode of service at the sites
Value Description

"all"

Performing the task on all sites where the domain is served

"any"

Performing the task on any site where the domain is served

"selected"

Performing the task on all sites listed in the sites field if the domain is served there

"selectedany"

Executing the task on one of the sites listed in the sites field if the domain is served there

"firstsite"

Performing the task on the first site where the domain is served

Work schedule

Table 3. Work schedule
Value Description

"all"

A service task can always be started

"work"

A service task can only be started during working hours

"non-work"

A service task can only be started after hours

"custom"

The service task defines the individual availability schedule in the field periods

Weekly schedule list item

Table 4. Weekly schedule list item
Field Value Description

daystart

17

Day of the week of the start of the segment (1 - Mon, 7 - Sun)

daystop

17

Day of the week of the end of the segment (1 - Mon, 7 - Sun)

timestart

01440

Intraday segment start time in minutes

timestop

01440

Intraday segment end time in minutes

See also

Logical roles

  • svc runs and maintains service scripts.