Searching the Help
To search for information in the Help, type a word or phrase in the Search box. When you enter a group of words, OR is inferred. You can use Boolean operators to refine your search.
Results returned are case insensitive. However, results ranking takes case into account and assigns higher scores to case matches. Therefore, a search for "cats" followed by a search for "Cats" would return the same number of Help topics, but the order in which the topics are listed would be different.
Search for | Example | Results |
---|---|---|
A single word | cat
|
Topics that contain the word "cat". You will also find its grammatical variations, such as "cats". |
A phrase. You can specify that the search results contain a specific phrase. |
"cat food" (quotation marks) |
Topics that contain the literal phrase "cat food" and all its grammatical variations. Without the quotation marks, the query is equivalent to specifying an OR operator, which finds topics with one of the individual words instead of the phrase. |
Search for | Operator | Example |
---|---|---|
Two or more words in the same topic |
|
|
Either word in a topic |
|
|
Topics that do not contain a specific word or phrase |
|
|
Topics that contain one string and do not contain another | ^ (caret) |
cat ^ mouse
|
A combination of search types | ( ) parentheses |
|
RestWsUtil Command-Line Interface
The RestWsUtil command-line interface enables you to:
-
Carry out simple testing of the Event Web Service.
-
Perform the four basic operations: create, read, update and delete.
Create and update require an input file with the payload to send to the REST web service. Read and delete do not set the payload.
Location
<OMi_HOME>/opr/bin/RestWsUtil[.bat|.sh]
Synopsis
RestWsUtil -help | -version | -verbose| <CONNECTION_INFO> | <operation>
Options
-rc_file <file> &| -username <login name> [ -password <password> | -smartcard | -winCrypto | -jks <keystore path> -jksPassword <keystore password> ] [[-port <port>] [-server <gatewayserver>] [-ssl] | [-u <URL>]]
Note If <CONNECTION_INFO>
is omitted, the command is executed on the server to which you are logged on.
Option | Description |
---|---|
{-rc_file | -rcf }<file>
|
Location of your credential store. Values for your username, password, java keystore location, and java keystore password can be defined here, enabling you to run commands without having to specify the values individually each time. Use the options -list_rc , -set_rc , and -delete_rc to work with the file. The default file is <OMi_HOME>/.opr-cli-rc . If this option is not specified, then commands automatically check the default file location for credentials. You must specify this option if your credential store file is in a non-default location. If this file does not exist or does not contain the correct settings, you must manually specify the credentials using the other command options. |
{-list_rc| -lrc} [-rc_file <file>]
|
Display the content of the file from which credentials are read. The file contains fields for java keystore, keystore password, username and password, and is encrypted by a hardcoded key. |
{-set_rc | -src} <key>=<value> [-rc_file <file>]
|
Configure one setting in the file from which credentials are read. Specify the setting and the new value by using a key=value pair. For example, -set_rc password=<password string> . |
{-delete_rc | -drc} <setting> [-rc_file <file> }
|
Delete setting from file from which credentials are read. Possible settings are username, password, jks, and jksPassword. |
{-username|-user} <login name>
|
Sets the login name of the user required to execute CLI operations on the target gateway server. |
{-password|-pw} <password>
|
Sets the password for the specified user. If using SSH on Cygwin, either enter the password in free text or use other communication methods, for example Java keystore, Windows keystore, or smart card authentication. Default value: empty string |
{-smartcard|-sc}
|
Use certificate stored on smart card or security token for authentication. When OMi is configured to use CAC authentication, the CLI tools under For more information, see Using command-line tools when client certificate enforcement is used. |
{-winCrypto|-wc}
|
If OMi is configured for TLS mutual authentication, this option specifies to use the Windows certificate store for authentication. The certificate store must hold exactly one client certificate, which OMi will use to authenticate the user. This option is only available on Windows systems. For details, see Configure Client Certificate or Smart Card Authentication. |
{-jks|-j} <keystore path>
|
If OMi is configured for TLS mutual authentication, this option can be used to specify the Java keystore to be used for authentication. The keystore must hold exactly one client certificate, which OMi will use to authenticate the user. Note It is not necessary that the client certificate contains the flag "Smart Card Logon (1.3.6.1.4.1.311.20.2.2)" in the "Enhanced Key Usage" field. For details, see Configure Client Certificate or Smart Card Authentication. |
{-jksPassword|-jp} <keystore password>
|
Password for accessing the Java keystore. |
{-port|-p} <port>
|
Uses port Default: |
-server <GatewayServer>
|
Sets the target gateway server, using Default: FQDN of the OMi gateway server |
-ssl |
When this option is specified, the HTTPS protocol is used to connect to the target gateway server. If omitted, the HTTP protocol is used. Cannot be used in conjunction with the |
{-url|-u} <url> |
Sets the target gateway server, using Default: |
(-h | -version | (-read | -delete | ((-create | -update) <filename> [-content_type <type>][-output <filename>] | -version)
Option | Description |
---|---|
|
Create the resource in the specified XML document. HTTP POST operation. |
|
HTTP header content-type value to set for create and update operations. Default: |
|
Delete the specified resource. The URL directly addresses the resource to delete. HTTP DELETE operation. |
|
Print this message and exit. |
|
Name of output file for text returned from the web service request. Default: |
|
Read the specified resource. HTTP GET operation. |
|
Update the resource with the specified XML document changes. HTTP PUT operation. |
|
Print verbose output. |
|
Print the version information and exit. |
Exit Status
Exit Status |
Description |
Output |
---|---|---|
0
|
Successful completion of the requested operation |
No output. |
1
|
Failure of the requested operation |
An error message stating why the operation failed, followed by the tool's help text. |
300‑399
|
HTTP Redirection (300-399) |
An error message stating the HTTP error number and description. For more information about HTTP error status values, see publicly available HTTP documentation. |
400‑499
|
HTTP Client Error (400-499) |
|
500‑599
|
HTTP Internal Server Error (500-599) |
Restrictions
The utility uses basic authentication and has parameters to specify a username and password.
Note The appropriate identity assurance software, such as ActivIdentity, must be installed to be able to authenticate using a smart card when executing the RestWsUtil CLI.
When connecting to OMi servers using Remote Desktop Connections, the client system must also have the appropriate identity assurance software, such as ActivIdentity, installed to be able to authenticate using a smart card attached to the client system when executing the RestWsUtil CLI remotely.
In addition, in the Remote Desktop Connections dialog box, select More Show Options > Local Resources > More to open the Local devices and resources dialog box. Ensure that the Smart Cards check box is selected.
Non-admin users also need the following file permissions to operate this command-line tool:
File | Windows Permissions | Linux Permissions |
---|---|---|
<OMi_HOME>/conf/TopazInfra.ini |
read | r |
<OMi_HOME>/log/opr-clis.log |
full control | rw |
Note: This file is not available on gateway server systems.
|
full control | rw |
<OMi_HOME>/conf/encryption.properties |
read | r |
<OMi_HOME>/conf/seed.properties |
read | r |
Examples
Some examples of usage of the RestWsUtil
CLI follow.
Here is an example of using the RestWsUtil
command-line utility to read events and to send the results to an output file called test.xml
.
RestWsUtil -r -username admin -o test.xml -verbose
Password: ******
INFO: Read the resource located at: http://server.example.com/opr-web/rest/9.10/event_list
INFO: Operation successful.
To read the custom attributes of an event, you must specify the complete URL, including the ID of the event you want to read the attributes for.
The following example sends the output to stdout
, which is the default.
RestWsUtil -r
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0fc9b4ea07a4ec/custom_attribute_list"
-username admin -verbose
Password: ******
INFO: Read the resource located at: http://localhost/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0f-c9b4ea07a4ec/custom_attribute_list
<?xml version="1.0"encoding="UTF-8"standalone="yes"?>
<custom_attribute_list xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://localhost:80/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0f-c9b4ea07a4ec/custom_attribute_list"
type="urn:x-hp:2009:software:data_model:opr:type:event:custom_attribute_list"version="1.0">
<custom_attribute
self="http://localhost:80/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0fc9b4ea07a4ec/custom_attribute_list/CiResolverSimilarityMetric"
type="urn:x-hp:2009:software:data_model:opr:type:event:custom_attribute"version="1.0">
<name>CiResolverSimilarityMetric</name>
<value>100</value>
</custom_attribute>
</custom_attribute_list>
INFO: Operation successful.
To read annotations of an event, you must specify the complete URL, including the ID of the event you want to read the annotations for.
The following example sends the output to stdout
, which is the default.
-username admin -verbose
Password: ******
INFO: Read the resource located at:
http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list
<?xml version="1.0" encoding="UTF-8"?>
<annotation_list xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list"
type="urn:x-hp:2009:software:data_model:opr:type:event:annotation_list" version="1.0">
<annotation
self="http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list/74b869a8-399c-42cb-854c-03b9ced975c3"
type="urn:x-hp:2009:software:data_model:opr:type:event:annotation" version="1.0">
<id>74b869a8-399c-42cb-854c-03b9ced975c3</id>
<event_ref
target_role="urn:x-hp:2009:software:data_model:opr:relationship:event:is_related_to:event"
type="urn:x-hp:2009:software:data_model:opr:type:reference:event:event_ref" version="1.0">
<target_id>10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_id>
<target_type>urn:x-hp:2009:software:data_model:opr:type:event</target_type>
<target_href>http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_href>
</event_ref>
<author>admin</author>
<time_created>2010-07-13T14:18:14.860+02:00</time_created>
<text>Some annotation text</text>
</annotation>
</annotation_list>
INFO: Operation successful.
Here is an example showing how to create a new custom attribute called MyNewCA
for a specified event.
RestWsUtil -c newca.xml
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0fc9b4ea07a4ec/custom_attribute_list"
-username admin -verbose
Password: *******
INFO: Create the resource located at: newca.xml
<?xml version="1.0"encoding="UTF-8"standalone="yes"?>
<custom_attribute xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://localhost:80/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0f-c9b4ea07a4ec/custom_attribute_list/MyNewCA"
type="urn:xhp:2009:software:data_model:opr:type:event:custom_attribute"version="1.0">
<name>MyNewCA</name>
<value>100</value>
</custom_attribute>
INFO: Operation successful.
The new custom attribute and its value is written to stdout
.
The contents of the newca.xml
file look like this:
<custom_attribute xmlns="http://www.hp.com/2009/software/opr/data_model"> <name>MyNewCA</name> <value>100</value> </custom_attribute>
Here is an example showing how to create an annotation. The new annotation is written to the newanno.xml
file.
RestWsUtil -c newanno.xml
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list"
-username admin -verbose
Password: ******
INFO: Create the resource located at: newanno.xml
<?xml version="1.0" encoding="UTF-8"?>
<annotation
xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list/62f86310-38ce-4793-ab3f-23ecfb3f2a67"
type="urn:x-hp:2009:software:data_model:opr:type:event:annotation" version="1.0">
<id>62f86310-38ce-4793-ab3f-23ecfb3f2a67</id>
<event_ref target_role="urn:x-hp:2009:software:data_model:opr:relationship:event:is_related_to:event"
type="urn:x-hp:2009:software:data_model:opr:type:reference:event:event_ref" version="1.0">
<target_id>10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_id>
<target_type>urn:x-hp:2009:software:data_model:opr:type:event</target_type>
<target_href>http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_href>
</event_ref>
<author>admin</author>
<time_created>2010-07-13T14:56:56.642+02:00</time_created>
<text>Some new annotation text</text>
</annotation>
INFO: Operation successful.
The contents of the newanno.xml
file look like this:
<annotation xmlns="http://www.hp.com/2009/software/opr/data_model" > <author>admin</author> <text>Some new annotation text</text> </annotation>
Here is an example showing how to update a custom attribute called MyNewCA
with a new value for a specified event.
RestWsUtil -update updateca.xml
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0fc9b4ea07a4ec/custom_attribute_list/MyNewCa"
-username admin -verbose
Password: ******
INFO: Update the resource with changes located at: updateca.xml
<?xml version="1.0"encoding="UTF-8"standalone="yes"?>
<custom_attribute xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://localhost:80/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0f-c9b4ea07a4ec/custom_attribute_list/MyNewCA"
type="urn:x-hp:2009:software:data_model:opr:type:event:custom_attribute"version="1.0">
<name>MyNewCA</name>
<value>999</value>
</custom_attribute>
INFO: Operation successful.
The updated value for the custom attribute is written to stdout
.
The contents of the updateca.xml
file look like this:
<custom_attribute xmlns="http://www.hp.com/2009/software/opr/data_model"> <value>999</value> </custom_attribute>
Here is an example showing how to update an annotation. The updated annotation is written to the updateanno.xml
file.
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list/582f0488-15ad-40ac-907f-fec21041b5c0"
-username admin -verbose
Password: ******
INFO: Update the resource with changes located at: updateanno.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<annotation xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list/582f0488-15ad-40ac-907f-fec21041b5c0"
type="urn:x-hp:2009:software:data_model:opr:type:event:annotation" version="1.0">
<id>582f0488-15ad-40ac-907f-fec21041b5c0</id>
<event_ref
target_role="urn:x-hp:2009:software:data_model:opr:relationship:event:is_related_to:event"
type="urn:x-hp:2009:software:data_model:opr:type:reference:event:event_ref" version="1.0">
<target_id>10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_id>
<target_type>urn:x-hp:2009:software:data_model:opr:type:event</target_type>
<target_href>http://example.example.com:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_href>
</event_ref>
<author>admin</author>
<time_created>2010-07-13T15:56:31.220+02:00</time_created>
<text>Updated annotation text</text>
</annotation>
INFO: Operation successful.
The contents of the updateanno.xml
file look like this:
<annotation xmlns="http://www.hp.com/2009/software/opr/data_model"> <text>Updated annotation text</text> </annotation>
Here is an example showing how to modify the title of an event. The modified title is written to the update.xml
file.
RestWsUtil -update update.xml -username admin
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/d36a157e-7312-4302-a2da-e5b7230b0e21"
Password: *******
INFO: Operation successful.
The contents of the update.xml
file look like this:
<event xmlns="http://www.hp.com/2009/software/opr/data_model"> <title>New title goes here</title> </event>
Here is an example showing how to modify the lifecycle state of an event. This works in the same way as modifying the title of an event. The modified lifecycle state is written to the update.xml
file.
RestWsUtil -update update.xml -username admin
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/d36a157e-7312-4302-a2da-e5b7230b0e21"
Password: *******
INFO: Operation successful.
The contents of the update.xml
file look like this:
<event xmlns="http://www.hp.com/2009/software/opr/data_model"> <state>in_progress</state> </event>
Here is an example showing how to modify both the lifecycle state and the severity of an event. This works in the same way as any other updates to an event. The modified lifecycle state and severity is written to the update.xml
file.
RestWsUtil -update update.xml -username admin
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/d36a157e-7312-4302-a2da-e5b7230b0e21"
Password: *******
INFO: Operation successful.
The contents of the update.xml
file look like this:
<event xmlns="http://www.hp.com/2009/software/opr/data_model"> <state>in_progress</state> <severity>critical</severity> </event>
Here is an example showing how to update an event with the information that control of the event has been transferred to a connected server. This information is written to the update.xml
file.
RestWsUtil -update update.xml -username admin
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/d36a157e-7312-4302-a2da-e5b7230b0e21"
Password: *******
INFO: Operation successful.
The contents of the update.xml
file look like this:
<event xmlns="http://www.hp.com/2009/software/opr/data_model"> <control_transferred_to> <name>logger</name> </control_transferred_to> </event>
Here is an example where all events with the title set to “DB down” have their severity set to critical
and their state set to in_progress
. A list of the updated events is returned to the caller.
RestWsUtil -update update.xml -username admin
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list?query=title='DB down'"
Password: *******
INFO: Operation successful.
The contents of the update.xml
file look like this:
<event xmlns="http://www.hp.com/2009/software/opr/data_model"> <state>in_progress</state> <severity>critical</severity> </event>
Note that failures can occur when performing bulk event updates, for example because of concurrent modifications or other conflicts. The update request returns the number of succeeded event updates. The REST web service API has a total_error
attribute that indicates the number of failed updates.
Here is an example of how to delete a custom attribute called MyNewCA
from the list of custom attributes for a selected event.
RestWsUtil -d
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/0695624b-93fa-40b18b0fc9b4ea07a4ec/custom_attribute_list/MyNewCa" -username admin -verbose
Password: ******
INFO: Deleting resource located at: http://localhost/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0f-c9b4ea07a4ec/custom_attribute_list/MyNewCa
<?xml version="1.0"encoding="UTF-8"standalone="yes"?>
<custom_attribute xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://localhost:80/opr-web/rest/9.10/event_list/0695624b-93fa-40b1-8b0f-c9b4ea07a4ec/custom_attribute_list/MyNewCa"
type="urn:x-hp:2009:software:data_model:opr:type:event:custom_attribute"version="1.0">
<name>MyNewCa</name>
<value>999</value>
</custom_attribute>
INFO: Operation successful.
Here is an example of how to delete an annotation from the list of annotations for a selected event.
RestWsUtil -d
-url "http://<fully qualified domain name of OMi gateway server>/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list/582f0488-15ad-40ac-907f-fec21041b5c0"
-username admin -verbose
Password: ******
INFO: Deleting resource located at: http://example.example.net/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list/582f0488-15ad-40ac-907f-fec21041b5c0
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<annotation xmlns="http://www.hp.com/2009/software/opr/data_model"
self="http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e/annotation_list/582f0488-15ad-40ac-907f-fec21041b5c0"
type="urn:x-hp:2009:software:data_model:opr:type:event:annotation" version="1.0">
<id>582f0488-15ad-40ac-907f-fec21041b5c0</id>
<event_ref
target_role="urn:x-hp:2009:software:data_model:opr:relationship:event:is_related_to:event"
type="urn:x-hp:2009:software:data_model:opr:type:reference:event:event_ref" version="1.0">
<target_id>10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_id>
<target_type>urn:x-hp:2009:software:data_model:opr:type:event</target_type>
<target_href>http://example.example.net:80/opr-web/rest/9.10/event_list/10d9a54f-54b9-41d6-b933-ed84b4f5e43e</target_href>
</event_ref>
<author>admin</author>
<time_created>2010-07-13T15:56:31.220+02:00</time_created>
<text>Updated annotation text</text>
</annotation>
INFO: Operation successful.
Here is an example of how to create a new event.
RestWsUtil -create create.xml -username admin -password ***** -url "http://<server.example.com>/opr-web/rest/9.10/event_list"
The contents of the create.xml
file look like this:
<event xmlns="http://www.hp.com/2009/software/opr/data_model">
<title>New event title</title>
<severity>normal</severity>
<priority>low</priority>
<state>open</state>
</event>
Here is an example of how to create a list of events.
RestWsUtil -create createlist.xml -content_type "application/xml; type=collection" -username admin -password ***** -url "http://<server.example.com>/opr-web/rest/9.10/event_list"
The contents of the createlist.xml
file look like this:
<event_list xmlns="http://www.hp.com/2009/software/opr/data_model">
<event>
<title>Major Event</title>
<severity>major</severity>
</event>
<event>
<title>Minor Event</title>
<severity>minor</severity>
</event>
</event_list>
Note The HTTP response code from this call will be 202 Accepted
. This means that the POST operation looks OK and the request will be submitted, but the resource has not yet been created. New events must be submitted through the event pipeline, and may or may not be eventually stored in the event database. For example, the submitted event may be de-duplicated in the event pipeline. Submission of events through this interface is subject to all the standard restrictions and must be processed through the event pipeline.
We welcome your comments!
To open the configured email client on this computer, open an email window.
Otherwise, copy the information below to a web mail client, and send this email to ovdoc-asm@hpe.com.
Help Topic ID:
Product:
Topic Title:
Feedback: