Video
Demonstration on how to use the REST API in dSeries Workload Automation
See how to install and use dSeries REST webservices.
Video Transcript
Note: Transcript created with the assistance of generative AI |
Hello everyone, I'm Ravi Kiran, and today I'm going to talk about how to use REST APIs in dSeries Work Automation. As part of this video, you'll be getting the introduction to REST APIs, you'll see the installation procedure, you'll see the demo, and some useful information.
The dSeries REST API comes bundled with the web client. Once you install the web client, the REST API component will also get installed. You can use any REST client to talk to the REST APIs and invoke the functionalities that are exposed as part of the APIs.
Installation
As you know, the web client installation — currently, I'm using the Windows web client installation — this is the 12.4 installation. You can provide the server details here and provide the location where the web client will get installed. These are the HTTPS ports, and I'm using the self-signed certificate. This is the service that gets created, and this is the pre-installation summary that you can talk about. Let me click on the install button.
Using the REST APIs
Let us see how to use the REST APIs. For that, you can use the Swagger documentation that is there in the web client documentation. Under the web client documentation, you can see the REST API. Currently, we support basic authentication, and these are the list of APIs that we support. It will give you, at a high level, what is the schema of this API, what are the input and the output response for it.
Let me use an example Postman client here to talk to the REST API. As you can see, I want to use a Get Jobs API that will return the list of active generations or computed generations on the particular server. As you can see, it returns the output in the JSON format. Similarly, you can use the POST method and other things using Postman or cURL or any other HTTP REST client.
If you are using the HTTP V2 job types that we have introduced, these HTTP V2 jobs can also be used to invoke any REST API. For this demo, I'm going to use the HTTP V2 job type. Basically, there is a login API that you can use to connect to the particular server from the REST API. This is the location type, this is the URL, and this is the payload content. Also, if you have to provide any headers, you can use them.
Once the login happens, the API token that gets generated can be captured and used in subsequent jobs. For that, you can use the response variables concept that is there in the HTTP V2 and SOAP V2 job types. As part of this, we are looking at the HTTP V2. This is going to capture a header value and place it in the variable called AU value. This AU value can be used in subsequent jobs.
Next, we'll try to subscribe to a REST API call, which will use the AU value from the previous job, and it will be replaced. Then, we will do the Get Jobs and Get Application Definitions calls, and ultimately, we'll log off from the REST API.
Demo
Let me run this application. As you can see, the login API and other jobs have successfully completed. The login completed and generated an AU token, and this AU token will be used in the subsequent jobs automatically. All the REST API calls can be done through this. This is how easily you can use the HTTP V2 job types to connect to the dSeries REST APIs or any other REST APIs and use them.
Useful information
Some useful information: you'll have to install the Application Services plugin to the agent to use the HTTP V2 job type. If you're using a self-signed certificate, you should use this parameter. As I was showing previously, this is the Swagger documentation for the REST API. There are very good examples provided in the documentation about how you can use the REST APIs. This gives a very good idea of what a request should look like and what the response will be for each request.
I hope this information is helpful. Thank you for your time today!