Many times, our customers ask us how to call the Workload Automation functionality from their external programs.
Starting from version 9.3 FP2, Workload Automation provides a new set of REST APIs that give you programmatic access to Workload Automation services (we have already discussed this topic in a previous blog post: Driving Workload Scheduler with REST APIs is super simple with Swagger UI!).
Ok, but wouldn’t it be great to have some chunks of code to make developer’s life easier and ensure they’re using the APIs in the best supported manner? That’s what the Client library does.
Today I want to show you how to use the Workload Automation Client libraries to submit an existing Job Stream.
Step 1: Connect your Engine
First, you have to connect your apiClient to your Workload Automation Engine:
Step 2: Retrieve the Jobstream ID
Now, just retrieve the JobstreamID of the Jobstream that you want to submit.
In this example, only the Jobstream name and the workstation are passed, but if you want to include also the Job Stream validFrom, validTo or validInRange, just add them to the JobstreamFilter.
Step 3: Create a new object in the plan
With the JobstreamID just retrieved, you will create a new object in the plan and add all the wanted information. Note that the setInputArrivalTime and the Alias are mandatory!
Step 4: Submit the new object in the plan
We have almost finished! Just submit the new object!
Oops!...I was forgetting…if you prefer to disable the certificate validation, just write a simple method like this and call it in your project!
If you liked my blog or if you would like to have more example of how to use the Workload Automation Client libraries, just leave a comment here or send an e-mail to Vincenzina Leone firstname.lastname@example.org.
Thanks, and see you next blog!