Use the Add Schedule method to add a schedule to run a service.
HTTP method: POST
URI: /scheduler/connection_name/schedule_id
Request payload content type: application/xml
Response payload content type: None
Expected response: HTTP/1.1 201 Created
The method URI contains the following parameters.
| Name | Description | Required |
|---|---|---|
| connection_name | Enter the name that identifies the Optim™ directory connection that is to contain the schedule. | Y |
| schedule_id | Enter the schedule ID that identifies the schedule to be added. | Y |
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:schedule xmlns:ns2="http://www.ibm.com/optim/xsd/scheduler/9.1.0">
<id>fbf1cdd5-bdf7-4682-96ad-722672af0001</id>
<serviceId>783015a5-5ad4-43a8-b3be-a45acaba081a</serviceId>
<startDate>1375378200000</startDate>
<endDate>0</endDate>
<repeatCount>0</repeatCount>
<repeatInterval>0</repeatInterval>
<schedulerTaskType>SOA_SERVICE</schedulerTaskType>
<proxyURL>http://servercomputer:12000/</proxyURL>
<creatorId>jdoe</creatorId>
</ns2:schedule>
The following example shows a request
to schedule the service to run on Thursday, August 1, 2013 at 17:30:00
local time. The cron expression sets the schedule to repeat every
Thursday afterward at 17:30:00 local time.<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:schedule xmlns:ns2="http://www.ibm.com/optim/xsd/scheduler/9.1.0">
<id>fbf1cdd5-bdf7-4682-96ad-722672af0002</id>
<serviceId>783015a5-5ad4-43a8-b3be-a45acaba081a</serviceId>
<startDate>1375378200000</startDate>
<endDate>0</endDate>
<cronExpression>0 30 17 ? * THU</cronExpression>
<schedulerTaskType>SOA_SERVICE</schedulerTaskType>
<proxyURL>http://servercomputer:12000/</proxyURL>
<creatorId>jdoe</creatorId>
</ns2:schedule>
The following response codes can be received when the method is complete.
| Response code | Description |
|---|---|
| 201 | Created. The service schedule was created and scheduled. |
| 400 | Bad Request. A malformed request was submitted. |
| 409 | Conflict. The service ID is already associated with a schedule and the schedule cannot be added, or the schedule ID is already defined in the scheduler. |