Unsupported content This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Search API (GET method)


Search API (GET method) uses the GET method to search the CIs. It searches the CIs based on the identifier that you provide. The identifier can be partial or complete. For example, if you want to search the CIs identified by sim in their names, the details of the CIs that have sim in their names are retrieved. The supported identifiers are as follows:

  • Name of the CI
  • Uniform Resource Identifier of the CI
  • Identifier of the CI (CI_ID or RECON_ID)

You must provide authentication credentials by using the login API before accessing the data. For information about authentication, see Web-services-authentication.

URL to access the search API (GET method)

The generic format of a URL for the search API (GET method) is as follows:

http|https://<serverHost>:<port>/bppmws/api/CI/<stringToSearch>/search?<queryParam1>&<queryParam2>&...<queryParamn>

Example

http://bppmwsserver:80/bppmws/api/CI/p/search?idType=Name&slot=CLASS:BMC_ComputerSystem;PriorityWatchdog:NO&resultSize=default

Entry

Description

http|https

Type of protocol to send the request. Infrastructure Management support both HTTP and HTTPS protocols.

serverHost

Host name of the BMC TrueSight Infrastructure Management Server

port

Port number through which communication is established. The default port number is 80 if you use the HTTP protocol and 443 if you use the HTTPS protocol.

stringToSearch

String to be searched to identify the CIs

If you do not provide any value, the query returns all the CIs that match the given condition.

For example, the query fetches all the CIs that belong to the BMC_ComputerSystem class.

queryParam1, queryParam2, queryParamn

Additional parameters that you want to provide in the request

Available query parameters (optional)

idType

Type of identifier based on which the search must be run. All the specified identifier type values are searched for the string that is provided in the stringToSearch parameter, and the search is case insensitive. The supported identifier types are as follows:

  • Name
  • RECON_ID
  • URI

The default value is RECON_ID.

For CIs that belong to the BMC_ComputerSystem class, the value of URI is same as the TokenID of the CI. For CIs that belong to any class other than the BMC_ComputerSystem class, the value of URI is same as the ComponentAliases value.

Example:


where, test is the search string, and idType=Name indicates that the search is based on the name of the CIs.

You must provide this parameter because it is mandatory.

Subtype

Subtype of the specified resource. The supported subtypes are as follows:

  • Cluster
  • Host
  • VMs
  • Storage
  • VDC
  • vCenter

The default value is vCenter.

slot=slotName:slotValue

Based on the slot name and its value, the CIs that match the search string are filtered. You can filter the search results based on the following slot names:

  • CLASS
  • PriorityWatchdog

The CLASS option retrieves the CIs that belong to the subclasses of the specified class. You can use the usage API to get a list of supported classes. The PriorityWatchdog option retrieves CIs based on its value. The supported values are YES and NO.

Example:
slot=CLASS:BMC_ComputerSystem;PriorityWatchdog:NO

page

Page number of the paginated data from which you want to retrieve the data. When your request generates a huge volume of data, the response data is paginated with page numbers. This parameter helps to retrieve data from any particular page by using the page number. This parameter is applicable only when you send the web service request from a Central Server.

Example:
page=2

In this example, the data from page number 2 is retrieved. To set a page size, using a text editor, open the pw\pronto\conf\pronet.conf file, set the pronet.max.ci.count property, and save the file. By default, the value is 500, and you can view 500 search results in a page. To set the maximum result count per search, using a text editor, open the pw\pronto\conf\bppmws.properties file, set the max.total.ci.count property, and save the file. By default, the value is 10,000, and you can view a maximum of 10,000 search results per search.

You must restart the server after updating the pronet.conf file.

resultSize

Indicates whether you want to retrieve the details of the CIs or partial details of the CIs. The supported values are as follows:

  • default — Retrieves partial details of the CIs that are set by default. If you want to customize the default list, open the pw\pronto\conf\pronet.conf file, and update the pronet.ws.ci.short.version.list parameter.
  • full — Retrieves complete details of the CIs

The default value for this parameter is default.

Response information of the search API (GET method)

The response to the search API (GET method) depends on the search string and the query parameters that you pass.

A sample JSON response is as follows:

{
    "cis": {
        "count": 1,
        "status": "OK",
        "ciList": [
            {
                "id": "OI-43ab1727d1344f22958e60c12890c824",
                "className": "BMC_ResourcePool",
                "hasProviders": true,
                "hasConsumers": true,
                "attributeMap": {
                    "Name": "ATUL-VRP-POOL",
                    "status": "OK",
                    "mc_udid": "OI-43ab1727d1344f229c12890c824",
                    "CLASS": "BMC_ResourcePool",
                    "sub_status": "NONE",
                    "sla_rollup_status": "NO_SLAS",
                    "computed_priority": "PRIORITY_5",
                    "direct_events_count": "0",
                    "pn_predict_to_occur_time": "0",
                    "highest_pn_predicted_severity": "",
                    "any_open_event_max_sev": "OK",
                    "any_event_max_sev": "OK",
                    "impacting_open_event_max_sev": "OK",
                    "maintenance_mode": "NO",
                    "OwnerName": "",
                    "OwnerContact": "",
                    "ShortDescription": "n/a",
                    "manual_status": "NONE",
                    "schedule_status": "IN"
                },
                "hostUri": "HTTPS://vl-pun-ngp-qa07.bmc.com:443"
            }
        ]
    },
    "statusCodes": [
        "200"
    ],
    "statusCode": "200",
    "statusMsg": "OK",
    "responseTimeStamp": "2012-02-20T12:19:11",
    "statusMessages": [
        "OK"
    ]
}

Note

If there are no matching CIs, the web service request returns the 404 HTTP error code in the HTTP header.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*