Administer > Policies > REST Web Service Listener Policies > REST Web Service Listener Policy User Interface > Configuring the Data Source in REST Web Service Listener Policies

Configuring the Data Source in REST Web Service Listener Policies

The source page of the REST Web service listener policy editor enables you to set up the path as part of URL where the REST Web Service Listener will listen for the XML data. In event and metric integrations, you can additionally upload the sample data to Operations Connector, and to specify one or more XML tags that create the shortcuts to the XML elements that you want to process. When integrating the topology data, you can specify the age to deletion and to decide whether delta detection should be done.

To access

  • In the Operations Connector user interface, click Create in the toolbar. Then click Event > REST Web service listener REST Web Service Listener.

  • In the Operations Connector user interface, click Create in the toolbar. Then click Metrics > REST Web service listener REST Web Service Listener.

  • In the Operations Connector user interface, click Create in the toolbar. Then click Topology > REST Web service listener REST Web Service Listener.

  • In the Operations Connector user interface, click Create in the toolbar. Then click Generic output > REST Web service listener REST Web Service Listener.

Alternatively, double-click an existing policy to edit it.

Click Source to open the policy Source page.

Customizing REST Web Service Listener

REST Web Service Listener listens for the XML data at the predefined URL. For example, for the event integration this URL should look as follows:

http(s)://<bsmc_FQDN>:<configured_port>/bsmc/rest/events/<PATH>

In this instance, <PATH> is the string, entered in the policy. The REST Web Service Listener for the metric, topology, and generic output data integrations should look as follows:

  • /bsmc/rest/metrics/<PATH>

  • /bsmc/rest/topology/<PATH>

  • /bsmc/rest/genericdata/<PATH>

You can customize the OpsCx REST Web Service Listener by using the bsmc-wsconf.[bat|sh] utility, located at:

 $OvDataDir/installation/HPOprBSMC/

For example, to enable basic authentication, set the listener port to 12345 and set the credentials any client needs to provide to post data, type the following:

bsmc-wsconf.bat -enable_auth -port 12345 -username integrator -password bsmcRESTd8a

For the bsmc-wsconf.[bat|sh] utility usage details, type:

bsmc-wsconf.[bat|sh] -help

The following table lists the available XPL configuration parameters that apply to each activated web service policy:

Attribute Name Default Description
RESTWS_PORT 30005 Operations Connector will spawn an HTTP(s) server on the specified port.
RESTWS_USE_BASIC_AUTH false If set to TRUE, the REST Web Service Listener requires credentials. The basic HTTP authentication mechanism is used.
RESTWS_AUTH_USER   Encrypted user name, used for the basic HTTP authentication. Encryption is done by using the OvSecCore crypt mechanism.
RESTWS_AUTH_PASSWORD   Encrypted password, used for the basic HTTP authentication. Encryption is done by using the OvSecCore crypt mechanism.
RESTWS_REGISTER_CB false If set to TRUE, the REST Web Service Listener is registered at the BBC communication broker. This enables accessing the Web Service Listener through the port 383.

You can view the XPL configuration parameters by using the ovconfget command.

Creating the XML data

REST Web Service accepts the regular XML data without an XML header structure ("<?xml version=.....") and all-embracing XML root tag. Additionally, you can collect the data for multiple events and send them consolidated to the REST Web Service.

A successful Web Service call should result in HTTP status code 200. Otherwise status codes like 501 or 401 are returned.

The following is an example of the XML event:

<BSMCEvent>
    <title>Detected neglectable impact on system hydrogen.elementary.com caused by monitored aspect workers_restart_rate [1/s]: 0.0000 at Tue Aug 5 13:41:32 2014</title>
     <timeStamp>12/13/14 08:59:57 AM</timeStamp>
     <impact>neglectable</impact>
     <category>Monitor Alert</category>
     <relatedCounter>workers_restart_rate [1/s]</relatedCounter>
     <relatedEntity>hydrogen.elementary.com</relatedEntity>
</BSMCEvent>

Tasks

How to configure the REST Web service listener source (events and metrics)

This task describes how configure the REST Web service listener source and how the policy reads it.

  1. Enter the Path parameter string, which is a part of the actual URL where the REST Web Service Listener listens for the XML data from the Web service client.

  2. Click to load a sample XML file. You can load a sample file from the Operations Connector system or from the system where the Web browser runs.

    When you load sample data, Operations Connector replaces already loaded data with the new data. This does not affect any mappings that are defined based on previously available sample data.

  3. Click Create a new XML event tag to create one or more XML event or metric tags. You can create a tag manually by typing the XML element. If you are working with sample data, you can create a tag by double-clicking the XML element in the list.

    The XML tag creates a shortcut to the XML element that you want the policy to process. An event tag typically identifies an event record in an XML log file, while a metric tag identifies a metric record in an XML log file. You can define more than one XML tag. For example, an XML file may contain two types of events: <PerformanceAlert> and <AvailabilityAlert>. To process both types, define both elements as event tags.

How to configure the REST Web service listener source (topology)

This task describes how configure the XML source file and how the policy reads it.

  1. Enter the Path parameter string, which is a part of the actual URL where the REST Web Service Listener listens for the XML data from the Web service client.

  2. Enter the age to deletion - the number of times for the policy to be run for a host that is not part of the topology data. After this number of policy executions, this host is deleted from the server.

  3. Optionally, enable delta detection, so that only the difference between the received XML file and the repository is sent to the topology server.

Events and Metrics only: How to load sample data into the policy

  1. Create a file that contains the XML data, and then send it to the REST Web Service listener.
  2. Click to upload the XML file to the Operations Connector user interface policy editor. The results are displayed in the Sample Data tabs of the policy.

Related tasks

UI Descriptions

REST Web Service Listener Source Page

UI Element

Description

Path

A string entered in the policy. This string is a part of the actual URL where the REST Web Service Listener listens for the XML data. For example, for events the URL must conform to one of the following (depending on the protocol):

http://<BSMC_FQDN><ConnectedServerHostFQDN>:<ConfiguredPort>/bsmc/rest/events/<Path>

https://<BSMC_FQDN><ConnectedServerHostFQDN>:<ConfiguredPort>/bsmc/rest/events/<Path>

Only the following characters are allowed in a path: [a-zA-Z0-9()-=*.?;,+/:&_]

Character Set

Name of the character set used by the XML data that the policy reads.

It is important to choose the correct character set. If the character set that the policy is expecting does not match the character set in the XML data, pattern matching may not work, and the event details can have incorrect characters or be truncated in OMi. If you are unsure of which character set is used by the XML data that the policy reads, consult the documentation of the program that writes the file.

Default value: UTF-8

Sample Data
(events and metrics only)

Uploads the XML file to the Operations Connector.

Operations Connector The policy editor can only load a maximum of 50 MB of sample data.

Opens the REST Web Service Sample Data dialog box. This dialog box displays the XML elements and values contained in the uploaded XML sample data.

XML Generic Data Tag

Enables you to specify one or more XML generic data tags. The XML generic data tag creates a shortcut to the XML element that you want to process. An event tag typically identifies an event record in an XML data. A metric tag typically identifies a metric record in an XML data. You can define more than one tag.

Create a new XML generic data tag manually. Enables you to type an XML element in the provided box.

Create a new XML generic data tag from XML sample data. Opens the XML Sample Data Outline dialog box. This dialog box displays the XML elements and attributes contained in the uploaded XML sample data.

Deletes the selected XML tag.

Deleting a tag that is referenced in a policy corrupts the policy and renders it unusable.

Detect deltas
(topology only)

A delta is the difference between the received XML file and the repository. The delta is the bare minimum of information about the changes. It discovers all changes without regards to the RTSM model.

If an instance or relation is not discovered for a certain amount of time (Age to deletion), it is deleted. The counter goes up each time when the algorithm is running (this depends on the interval and the last time the file was written / sent via web service).

If not selected, no delta detection is done and the incoming topology file is directly sent to the topology server.

Default value: selected.

Age to deletion
(topology only)

A number of times for the policy to be run for a host that is not part of the topology data. After this number of policy executions, this host is deleted from the server.