Add/update job schedule


This API call adds a new schedule or updates an existing schedule asynchronously. If the specified schedule does not already exist on the peer, the schedule is added. If the specified schedule exists on the peer, the schedule is updated. 

If updating a schedule, you cannot change the schedule name.

This topic includes the following sections:

Request

HTTP method: POST

Request URL: https://<hostname>:<port>/baocdp/rest/schedule

Header: See HTTP-request-and-response-headers for header information, such as required authentication token.

Request body properties

Property

Type

Required

Description

Values

Default value

name

String

Yes

Schedule name

If updating a schedule, you cannot change the schedule name.

User-provided value

NA

comment

String

No

Schedule description

User-provided value

NA

processName

String

Yes

Name of process associated with the schedule

User-provided value

NA

peerName

String

No

Specify the peer on which the schedule should run: 

  • any: schedule can run on any peer in the grid. The master process processor will distribute the process to the next available peer. 
  • peer: process runs on the peer on you specify using the peerName property.

any, peer

any

startSchedule

String

No

Specify when the schedule starts running.

Specify the EPOCH time.

User-provided value

current time

frequency

Object

No

Specify the frequency at which the schedule runs.

To use frequency, you must provide one of the following attributes:

  • runEvery
  • scheduleFrequency

If you do not provide a frequency value, the default value is scheduleFrequency=Daily.

runEvery, scheduleFrequency

NA

runEvery

String

No

Used with frequency, runEvery specifies the time iteration for schedule runs.

Specify the EPOCH time.

Use this attribute or scheduleFrequency.

User-provided value

NA

scheduleFrequency

String

No

Used with frequency, scheduleFrequency specifies the frequency of schedule runs.

Use this attribute or runEvery.

Daily, Hourly, Weekly, Monthly

Daily

stopSchedule

Object

No

Specify when to stop running the schedule.

To use stopSchedule, you must provide one of the following attributes:

  • runForever
  • stopTime
  • afterRun

If you do not provide a stopSchedule value, the default value is runForever=true.

runForever, stopTime, afterRun

NA

runForever

String

No

Used with stopSchedule, runForever specifies whether the schedule runs forever.

Use this attribute or one of the following:

  • stopTime
  • afterRun

true

true

stopTime

String

No

Used with stopSchedule, stopTime specifies the time to stop running the schedule.

Specify the EPOCH time.

Use this attribute or one of the following: runForever, afterRun.

User-provided value

NA

afterRun

Integer

No

Used with stopSchedule, afterRun specifies the run number after which to stop running the schedule.

Specify the run number as an integer.

Use this attribute or one of the following: runForever, stopTime.

User-provided value

NA

Example request JSON

{"schedules":[{
   "name": "sch2",
   "comment":"nothing",
   "processName": ":AutoPilot-AD-Utilities:HTTP:Get",
   "peerName":"ANY",
   "startSchedule":"<EPOCH time>",
   "frequency": {
           "scheduleFrequency":"Daily",
           "runEvery":"<EPOCH time>"
    },
   "stopSchedule": {
       "runForever":true,
       "stopTime":"<EPOCH time>"
       "afterRun":<count in integer>
    }
},
{
   "name": "sch3",
   "processName":":AutoPilot-AD-Utilities:HTTP:Get"
}
]
}

Response

If successful, the job schedule is added to the peer.

Response body properties

Property

Description

response

Status of the request

Example response JSON

{
 "response":"Success"
}

Status codes and messages

For more details about HTTP response codes, see HTTP response codes.

HTTP code

Message

Description

202

ACCEPTED

Request succeeded

401


Unauthorized

403


Forbidden the client is not permitted to access the resource

500


Internal Server Error


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

TrueSight Orchestration Platform 24.3