cancel
Showing results for 
Search instead for 
Did you mean: 

Increasing Flexibility for InfoScale Environments with the VIOM API

Jayant_Chopade
Level 1
Employee

Veritas InfoScale Operations Manager provides an API that can be accessed over the HTTPS protocol using any standard HTTPS clients. These APIs can be accessed using HTTP clients like Curl, XPRTLC and other REST clients. VIOM APIs can be used to fetch data discovered by VIOM (stored in VIOM DB) as to perform InfoScale operations.

The base URL to access the web services API is: https://ManagementServer_hostname:14161/vom/api, where ManagementServer_hostname is the hostname, fully qualified hostname, or IP address of Management Server.

Use Cases

You can use VIOM API to create customized reports by fetching data from VIOM as required. These APIs can also be integrated with third-party reporting tools that will directly fetch data from the VIOM database and create reports based on the available data.

For example, you can create a report that shows the free storage space available in your data center and this can be categorized based on hardware type (since VIOM also has this information).

You can also use the operations API to automate certain InfoScale operations using scripting. For example, you can create a script that will fetch all input data required to bring an InfoScale service group online by using the query API. Then, you can execute the service group online operation using that input data.

Types of API in VIOM

Veritas InfoScale Operations Manager APIs are categorized into four main types according to their function. This is shown in figure 1.Figure 1. API OverviewFigure 1. API Overview

When you access the base URL for the VIOM API, you will see these four APIs:

  1. https://ManagementServer_hostname:14161/vom/api/meta

This API will provide details about the schema of attributes related to different InfoScale objects. This API will use the HTTP GET method to fetch the data.

  1. https://ManagementServer_hostname:14161/vom/api/query

This API is used to fetch different attributes related to different InfoScale Objects. It will provide the actual values of attributes for objects discovered by VIOM  that are stored in the VIOM database. This API uses the HTTP GET method to fetch the data.

  1. https://ManagementServer_hostname:14161/vom/api/update

This API can be used to update extended attributes for InfoScale objects in the VIOM database. This API will use the HTTP POST method to update the database.

  1. https://ManagementServer_hostname:14161/vom/api/op

This API can be used to perform different InfoScale operations. For example, online and offline operations for a service group. Currently, there are only a few InfoScale operations that are supported using APIs. This API uses the HTTP POST method to perform operations.

As far as overall API usage goes, the query and operations API’s are most commonly used. Let’s take a more detailed look at how to use the query and operations API.

Fetching data using API

For fetching details about different attributes for different InfoScale objects, we can use the query API.

https://ManagementServer_hostname:14161/vom/api/query

Once accessed, this API will provide the URLs for all query API’s currently available in VIOM.

You can check how to get cluster information for clusters present in a VIOM environment. To do this, you can use the Curl client.

Before using the query API to access cluster details, we must get the JSESSIONID for secure API login as follows:

curl -g -k -d user=user -d password=password -d domain=ManagementServer_hostnamehttps://ManagementServer_hostname:14161/vom/api/login

This command will require the username and password of the CMS to get the JSESSIONID. If you want to use a certificate instead of a username and password, you can use this command:

curl -g -k -F certfile=@/root/cert.txt https://ManagementServer_hostname:14161/vom/api/login

After logging in, a session ID is created with which you can access the Web services API. The session ID is valid for 30 minutes. After the session expires, you need to log in again to obtain a new session ID.

Sample session ID:

{"cookie":"JSESSIONID=38B752A5DCF210717F5C99D867A17379;","current_server_time":"Mon Jan 28 03:48:03 PST 2013","max_active_interval":30,"expires_at":"Mon Jan 28 04:18:03 PST 2013"}

More details about this can be found in this link:

https://sort.veritas.com/public/documents/vom/7.3/windowsandunix/productguides/html/viom_user/ch38s0...

Once we get a session ID, we can fetch the cluster details using this command:

curl -g -k -X POST -b "session id"

https://veritasdomain.example.com:14161/vom/api/query/hadr/cluster 

This API will provide attribute details for all clusters present in the VIOM environment. You can also use this API to get ID’s to be used as input for the operations API.  You can access this API by entering the URL directly in a browser.

Operations using the API

Let’s look at how you can use the VIOM operations API to perform operations.

https://ManagementServer_hostname:14161/vom/api/op

Once accessed, this API will provide the URLs for all query API’s currently available in VIOM.

You can check how to perform a service group online operation.

You can use the same SessionID that was obtained earlier since it’s valid for 30 minutes.  If the SessionID has expired, follow the steps mentioned in the previous section to get a new SessionID.

Once you get a session ID, you can perform the online service group operation by using the API available for this operation:

curl -g -k -X POST -b "session id" https://veritasdomain.example.com:14161/vom/api/op/hadr/servicegroup/{sgid}/host/{hostname}/{force}/...

This operation will require some input such as sgid, hostname, force, and propagate.

The sgid and hostname for a specific service group can be obtained using the query API. The value for force and propagate will be true or false depending on the option you want.

When this API is accessed using a GET request or directly from a browser, it will provide usage information for this specific API.

For additional information, please take a look at the VIOM User’s Guide (chapter 40).

Summary

The VIOM API provides several options to help manage your InfoScale environment.  Whether you’re interested in simplifying and automating operational tasks, creating customized reports, or integrating with third-party platforms, the VIOM API provides the functionality to help you manage your InfoScale environments as efficiently as possible.