4.1 Using a Web Browser to Access Operations Center Data

Using the REST protocol, it is possible to access Operations Center data using a Web browser alone. Data is returned in XML format and all modern Web browsers simply render the XML as a viewable document.

4.1.1 Creating a Session

To access data from Operations Center, a session must be initiated first with a user name and password. The user name must be a valid account in Operations Center.

To create a session using the REST API, go to:

http://OperationsCenterServer:port/moweb2cn/rest/session/?username=name&password=password

where OperationsCenterServer:port is the server host where the dashboard and Web 2.0 Connect are hosted and name and password is a valid credential for logging into the Operations Center application.

For example, where our server is named manor-as08-v:

http://manor-as08-v:8080/moweb2cn/rest/session/?username=admin&password=formula

The response is an XML document. If the session creation is successful the <value/> element contains the string OK, as shown:

If the session was not created, a HTTP Status 500 is returned:

After a session is created, subsequent attempts to create a session before the session expires, result in an error.

4.1.2 Reading an Element

After a session is successfully created other REST APIs can be used.

To read an element using the element/value mount point, go to:

http://OperationsCenterServer:port/moweb2cn/rest/element/value/DName

where OperationsCenterServer:port is the server host where the dashboard and Web 2.0 Connect are hosted and DName is an element’s distinguished name (DName).

For example, where our server is named manor-as08-v:

http://manor-as08-v:8080/moweb2cn/rest/element/value/root=Administration

The response is an XML document similar to the following:

HINT:The element XML metadata contains an <identity> tag, which can be useful to use as a unique key when building user interfaces.

4.1.3 Encoding DNames in REST Calls

As a best practice, and to avoid technical issues with REST calls when some characters are present in DNames, use a base 64 encoded hash to encode the DName.

When encoding the DName, be sure to precede the encoded DName with identity:dname:

For example, if the URL is:

http://manor-as08-v:8080/moweb2cn/rest/element/alarms/GENERAL/realtime/Node=10.99.104.45/Nodes=Nodes/ncool=Adapter%3A+IBM+Micromuse+Netcool%2 FOMNIbus%28r%29/root=Elements

Then, the same URL with the base 64 encoded DName is-:

http://manor-as08-v:8080/moweb2cn/rest/element/alarms/GENERAL/realtime/identity:dname:Tm9kZT0xMC45OS4xMDQuNDUvTm9kZXM9Tm9kZXMvbmNvb2w9QWRhcHRlciUzQStJQk0rTWljcm9tdXNlK05ldGNvb2wlMiBGT01OSWJ1cyUyOHIlMjkvcm9vdD1FbGVtZW50cw==

4.1.4 Understanding Session Retention

The Web 2.0 Connect session remains active for the duration specified by the Tomcat configuration. After session expiration, subsequent calls to REST APIs fails. Web 2.0 Connect provides a simple ping capability for maintaining a session.

To perform a session ping using the REST ping mount point, go to:

http://OperationsCenterServer:port/moweb2cn/rest/ping

where OperationsCenterServer:port is the server host where the dashboard and Web 2.0 Connect are hosted. The ping mount point does not require any parameters.

For example, where our server is named manor-as08-v:

http://manor-as08-v:8080/moweb2cn/rest/ping

The response is an XML document similar to the following:

If the ping is successful the <value/> element contains the string OK.