Is this content useful for you? Support this site by donating any amount....(takes you to Paypal website)
Other Amount

Categories

IT Infrastructure Systems, Programming

Invoking HPOOv10 via REST API

Read Time:3 Minute, 3 Second

Last Updated on August 17, 2021 by Hammad Rauf

If you use Micro-Focus (formerly Hewlett Packard) Operations Orchestration version 10 (HPOOv10) tool to automate system operations, than it may be required to invoke the HPOOv10 Flows from outside of the tool. HPOOv10 supports this functionality with its REST Application Programming Interface (API).

I will mention a few useful calls here. These can be used to couple an external system with HPOOv10 server. For a detailed reference please read the manual (Further Reading section). The code snippets are written in Python programming language. But these REST calls are quite self explanatory. They can be made in any tool that can make HTTP GET, POST and PUT requests.

What is HPOO?

HPOO is a software system for creating flows (Structured sequences of actions). These flows are usually targeted for maintaining, troubleshooting, repairing and providing various information technology resources and services.

One can interact with HPOO by utilizing:

  1. A dedicated client
  2. The HPOO Web Interface
  3. Custom Applications using REST API Calls

For more detail into what is HPOO please refer to the reading list at the bottom of this post.

What is REST?

REST or ReST is an acronym for Representational State Transfer. It refers to a way of interacting with cloud (or intranet HTTP) exposed software systems (Web Services). Using HTTP protocol to interact with remote software systems has the benefit that different systems can be coupled using simple to program techniques.

From a system security stand-point all the same security principles that make online financial transactions safe, can also be applied to it.

Further reading list points to some more reading on REST.

Useful API Calls

The following list is not complete. But it lists some of the more commonly used API calls. The code is written in Python, but it replaced by any other programming language. When using Python the “requests” library will need to be installed.

List of All Flows

import requests
r = requests.get('https://hpoov10.com/oo/rest/v2/flows/tree/level',auth=('username','password'))

print (r.status_code) # HTTP 200 is ok

Start a Flow Execution

import requests

r = requests.post('https://hpoov10.com/oo/rest/v2/executions', auth=('username','password'), json={'flowUuid':'ffffff', 'inputs':{'someKey':'someValue'}})

print(r.status_code) # HTTP 201 is ok

print(r.json()) # Prints the Run-ID

After this call you should get the Run-id or execution-id for your instance of the executing flow.

Flow Execution Summary (Status)

import requests

r = requests.get('https://hpoov10.com/oo/rest/v2/executions/{run-id}/summary', auth=('username','password'))

print(r.status_code) # HTTP 200 is ok

print(r.text) # Prints the json data structure, scan for 'status' or 'resultStatusName'

Flow Execution Log (Output)

import requests
r = requests.get('https://hpoov10.com/oo/rest/v2/executions/{run-id}/execution-log', auth=('username','password'))

print(r.status_code) # HTTP 200 is ok

print(r.text) # Prints the json data structure, scan for 'flowOutput'

Changing Flow Status

Cancel Flow
import requests
r = requests.put('https://hpoov10.com/oo/rest/v2/executions/{run-id}/status', auth=('username','password'), json={"action":"CANCEL"})

print(r.status_code) # HTTP 200 is ok

print(r.text) # Prints 'Change Flow Status' request's status, Do a 'GET Flow Execution Summary (Status)' request to confirm new status.

Other useful Changing Flow Status requests are “PAUSE” and “RESUME”.

Further Reading

  1. HP Operations Orchestration (Software Version 10.20) – Application Program Interface (API) Guide, November 2014, Online link, Date Accessed October 30, 2016
  2. HP Operations Orchestration – User Guide, Online link, Date Accessed October 30, 2016
  3. Learn REST: A Tutorial, http://rest.elkstein.org Date Accessed October 30, 2016
  4. Python Requests Library, http://docs.python-requests.org/en/master Date Accessed October 30, 2016

Leave a Reply

Your email address will not be published. Required fields are marked *