Web Services Jobs
The following topics describe job types for web services:
Job:Web Services REST
Web Services REST jobs enable you to design and execute single REST API calls.
To deploy and run a Web Services REST job, ensure that you have installed the Web Services REST plug-in with the provision image command or the provision agent::update command.
The following example shows how to define a Web Services REST job with a defined body:
"Web Services REST_output_parameters":
{
"Type": "Job:Web Services REST",
"ConnectionProfile": "REST_OAUTH2",
"Method": "POST",
"Append Request": "checked",
"Append Response": "checked",
"Endpoint URL": "https://6943019930999707.net",
"URL Request Path": "/api/2.1/jobs/run-now",
"URL parameters" : [
{
"FilterValue" : "Untitled Workflow"
}
],
"HTTP Headers": [
{ "Authorization": "bearer" }
],
"WsRestBody" :
{
"RequestDefinition" : "text",
"BodyRequest" : "{%4E\"Job Identifier\": \"some-unique-id-000x\"%4E}"
},
"OutputHandling": [
{
"HttpCode": "*",
"Parameter": "$.run_id",
"Variable": "file:/home/dbauser/temp.txt"
},
{
"HttpCode": "*",
"Parameter": "$.run_id",
"Variable": "LOCAL_CTM_VAR"
},
{
"HttpCode": "*",
"Parameter": "$.run_id",
"Variable": "\\GLOBAL_CTM_VAR"
} ]
}
The following example shows the same Web Services REST job as above, but the request body is obtained from a local file:
"Web Services REST_output_parameters":
{
"Type": "Job:Web Services REST",
"ConnectionProfile": "REST_OAUTH2",
"Method": "POST",
"Append Request": "checked",
"Append Response": "checked",
"Endpoint URL": "https://6943019930999707.net",
"URL Request Path": "/api/2.1/jobs/run-now",
"URL parameters" : [
{
"FilterValue" : "Untitled Workflow"
}
],
"HTTP Headers": [
{ "Authorization": "bearer" }
],
"WsRestBody" :
{
"RequestDefinition" : "filename",
"FileName" : "/home/jobdefs/request-body.txt"
},
"OutputHandling": [
{
"HttpCode": "*",
"Parameter": "$.run_id",
"Variable": "file:/home/dbauser/temp.txt"
},
{
"HttpCode": "*",
"Parameter": "$.run_id",
"Variable": "LOCAL_CTM_VAR"
},
{
"HttpCode": "*",
"Parameter": "$.run_id",
"Variable": "\\GLOBAL_CTM_VAR"
} ]
}
The following table describes the Web Services REST job parameters.
Parameter |
Description |
---|---|
ConnectionProfile |
Defines the ConnectionProfile:Web Services REST name that connects Control-M to Web Services REST. |
Endpoint URL |
Defines the endpoint base URL, which is the common resource prefix that the API uses to navigate. |
URL Request Path |
Defines the URL request path. |
Method |
Determines one of the following HTTP methods that is used to execute the REST job:
|
URL parameters |
Defines optional URL parameters, as an array of Key:Value pairs. |
HTTP Headers |
Defines optional HTTP headers, as an array of Key:Value pairs. If you created a connection profile that authenticates with OAuth2, as described in Web Services REST Connection Profile Parameters, you must define the following HTTP header key name and value: "Authorization" : "" |
WsRestBody |
Defines the REST request body, using the following parameters on the next level:
|
OutputHandling |
(Optional) Defines output handling. This parameter enables you to extract values from the service response. You can utilize either JSON or XML format. The parameter consists of the following:
Rules:
|
Connection Timeout |
Determines the number of seconds to wait after Control-M initiates a connection request to Web Services before a timeout occurs. Default: 50 |
Append Request |
Determines whether to append the API request to the output Values:
Default: unchecked |
Append Response |
Determines whether to append the API response to the output. Values:
Default: unchecked |
Job:Web Services SOAP
Web Services SOAP jobs enable you to design and execute single SOAP API calls.
The following example shows how to define a Web Services SOAP job, which enables you to design and execute a single SOAP API call.
To deploy and run a Web Services SOAP job, ensure that you have installed the Web Services SOAP plug-in with the provision image command or the provision agent::update command.
The following example shows how to define a Web Services SOAP job:
"Web Services SOAP_Job_2":
{
"Type": "Job:Web Services SOAP",
"ConnectionProfile": "SOAP_BASIC_AUTH",
"Endpoint URL": "http://vw-usr1:8091/ws/register",
"Append Request": "unchecked",
"Append Response": "unchecked",
"SOAP Action": "http://www.bmc.com/ctmem/#register",
"Variables": [
{
"UCM-SOAP_REQUEST_REQ_TYPE": "xml"
},
{
"UCM-SOAP_REQUEST_SOAP_REQUEST": "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:sch=\"http://www.bmc.com/ctmem\">%4E <soapenv:Header/>%4E <soapenv:Body>%4E <sch:request_register>%4E <!--Optional:-->%4E <sch:component>?</sch:component>%4E <sch:user_name>?</sch:user_name>%4E <sch:password>?</sch:password>%4E <sch:timeout>?</sch:timeout>%4E <!--Optional:-->%4E <sch:hostname>?</sch:hostname>%4E </sch:request_register>%4E </soapenv:Body>%4E</soapenv:Envelope>"
} ],
"OutputHandling": [
{
"HttpCode": "200",
"Parameter": "//sch:error_message",
"Variable": "CTM_VAR_RESULT"
},
{
"HttpCode": "200",
"Parameter": "//sch:error_message",
"Variable": "file:/home/dbauser/soap_result.txt"
} ],
}
The following table describes the Web Services SOAP job parameters.
Parameter |
Description |
---|---|
ConnectionProfile |
Defines the ConnectionProfile:Web Services SOAP name that connects Control-M to Web Services SOAP. |
Endpoint URL |
Defines the endpoint base URL, which is the common resource prefix that the API uses to navigate. |
SOAP Action |
Defines a single SOAP action (operation), which you must take from the WSDL file. In this example, in the WSDL file, copy the SOAP action http://tempuri.org/SOAP.Demo.AddInteger from the body of the following operation: Copy
|
Request Definition |
Determines one of the following requests to perform:
|
SOAP Request |
Defines the SOAP request. Copy
|
HTTP Headers |
(Optional) Defines HTTP header key names and values. Key: Content-Type Value: application/json |
OutputHandling |
(Optional) Defines the following output parameters:
Rules:
|
Connection Timeout |
Determines the number of seconds to wait after Control-M initiates a connection request to Web Services before a timeout occurs. Default: 50 |
Append Request |
Determines whether to append the API request to the output Values:
Default: unchecked |
Append Response |
Determines whether to append the API response to the output. Values:
Default: unchecked |