Run Service method

Use the Run Service method to run a service. The service can be run without any changes. Alternatively, you can run the service with input values that are different from the values that are saved with the service.

HTTP method: POST

URI: /execute/connection_name/service_id

Request payload content type: application/xml

Response payload content type: application/xml

Expected response: HTTP/1.1 201 Created

Parameters

The method URI contains the following parameters.

Name Description Required
connection_name Enter the name that identifies the Optim™ directory connection that contains the service. Y
service_id Enter the service ID that identifies the service that you want to run. Y

Request payload example

The following example shows a request to run a service.
<?xml version="1.0" encoding="UTF-8"?>
<sem:serviceRequestExecutionInput 
 xmlns:sem="http://www.ibm.com/optim/xsd/sem/9.1.0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://www.ibm.com/optim/xsd/sem/9.1.0 
 resource.xsd ">
   <serviceId>783015a5-5ad4-43a8-b3be-a45acaba081a</serviceId>
   <serviceName>SIDEMO.ERGL23393T</serviceName>
   <servicePath>OPTIMDIR/SMK_V910</servicePath>
   <rsiURL>http://servercomputer:12000/</rsiURL>
   <executedBy>jdoe</executedBy>
</sem:serviceRequestExecutionInput></p>
The following example shows a request to run the service from the first example with two changed input values (override values).
<p><?xml version="1.0" encoding="UTF-8"?>
<sem:serviceRequestExecutionInput 
 xmlns:sem="http://www.ibm.com/optim/xsd/sem/9.1.0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://www.ibm.com/optim/xsd/sem/9.1.0 
 resource.xsd ">
   <serviceId>783015a5-5ad4-43a8-b3be-a45acaba081a</serviceId>
   <serviceName>SIDEMO.ERGL23393T</serviceName>
   <servicePath>OPTIMDIR/SMK_V910</servicePath>
   <rsiURL>http://servercomputer:12000/</rsiURL>
   <executedBy>jdoe</executedBy>
   <overrides>
     <override>
       <id>override-id-000001</id>
       <type>TypeOne</type>
       <value>Value One</value>
     </override>
     <override>
       <id>override-id-000002</id>
       <type>TypeTwo</type>
       <value>Value Two</value>
     </override>
   </overrides>
</sem:serviceRequestExecutionInput></p>

Response payload example

The following example shows the response that confirms that the service was started.
<?xml version="1.0" encoding="UTF-8"?>
<sem:executionResults 
 xmlns:sem="http://www.ibm.com/optim/xsd/sem/9.1.0" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:schemaLocation="http://www.ibm.com/optim/xsd/sem/9.1.0 
 resource.xsd">
   <executionId>fbf1cdd5-bdf7-4682-96ad-722672af0001</executionId>
   <serviceId>783015a5-5ad4-43a8-b3be-a45acaba081a</serviceId>
   <serviceName>SIDEMO.ERGL23393T</serviceName>
   <servicePath>OPTIMDIR/SMK_V910</servicePath>
</sem:executionResults></p>

Response codes

The following response codes can be received when the method is complete.

Response code Description
202 Accepted. The service request was processed and accepted. This response code does not mean that the service request completed successfully.
400 Bad Request. A malformed request was submitted.


Feedback