This section explains about the web service-related utilities that are part of BMC ProactiveNet Server installation. The following utilities are available when you install BMC ProactiveNet Server:
Note
You need Java Runtime Environment version 1.6 or above to run these utilities. The README.txt file located in the \pw\restclient folder explains the usage of the utilities.
The sample client for web services helps you to run web service requests. The source files for the sample client are available in the \pw\restclient folder.
Run the following command:
java RestClient callMethod "URL" userName password
Entry | Description |
---|---|
callMethod | Indicates the request method the API uses. The supported methods are as follows:
|
URL | URL of the web service API enclosed within double quotation marks |
userName | User name that you want to authenticate |
password | Password for the corresponding user name |
For information about the java RestClient
command, on the command line, change the directory path to the \pw\restclient folder, and run the following command:
java RestClient -h
This utility converts the input parameters to the JSON format. You can use these input parameters in the CI search API (POST method). In the JsonInputForSearch.txt located in the \pw\restclient folder, you must provide the input parameters in the following format:
(identifier1 operator1 "value1") groupingoperator (identifier2 operator2 "value2")
identifier
refers to the slot name. You can retrieve a list of the searchable slots and the supported enumerations by accessing the usage API. See Retrieving searchable slots and supported enumerations for each slot.
value
refers to the value of the slot. It must be provided within double quotation marks.
operator
refers to the condition that relates the identifier and the value. The supported operators are listed in the OperatorsList.properties file located in the \pw\restclient folder. You must add any new operator in the file before using them in the JsonInputForSearch.txt file.
groupingoperator
refers to the boolean operator. The supported values are AND and OR.
For more information about search APIs and their inputs parameters, see Searching CIs.
Note
The source files for the JSON creator utility are available in the \pw\restclient folder.
Run the following command:
java JsonCreator
The inputs are converted to the JSON format and are available in the \pw\restclient\JsonOutputForSearch.json file. The converted output is as follows:
{ "criteria": { "groupingOperator": "AND", "leftExpression": { "groupingOperator": null, "leftExpression": null, "rightExpression": null, "operator": "contains", "value": "CI230", "identifier": "name" }, "rightExpression": { "groupingOperator": null, "leftExpression": null, "rightExpression": null, "operator": "equals", "value": "New configuration item", "identifier": "Description" }, "operator": null, "value": null, "identifier": null } }
For information about the java JsonCreator
command, on the command line, change the directory path to the \pw\restclientfolder, and run the following command:
java JsonCreator -h