Skip to main content
Version: 8.4

POST Search an Asset

For Asset search there are basically 3 types of API divided for Hardware, Software and Non It Asset where, you can call the below endpoints to search any asset in the ServiceOps Solution.

  1. Hardware Asset : 'http://{server_url}/api/v1/asset/asset_hardware/search/byqual?offset=0&size=50'
  2. Software Asset : 'http://{server_url}/api/v1/asset/asset_software/search/byqual?offset=0&size=50'
  3. Non IT Asset : 'http://{serverurl}/api/v1/asset/asset_non_it/search/byqual?offset=0&size=50'

Here is an example of Search with IP Address on the Hardware asset:

Request

curl --request POST
--url 'http://127.0.0.1/api/v1/asset/asset\_hardware/search/byqual?offset=0&size=50'
-H 'Accept: application/json'
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1ODg3Njg5ODIsInVzZXJfbmFtZSI6Im5pcmF2LnBhdGVsQG1vdGFkYXRhLmNvbSIsImp0aSI6IjI5MWUxN2RjLWIzNzktNDZjMy1iZmM2LTllZDMwZWM5YTFkNyIsImNsaWVudF9pZCI6ImZsb3RvLXdlYi1hcHAiLCJzY29wZSI6WyJOTy1TQ09QRSJdLCJ0ZW5hbnRJZGVudGlmaWVyIjoiYXBvbG8ifQ.kAdJ1hDK0bN3DDmI6mKyfQpqKfcnZELgatriHWTpQ'
-H 'Content-Type: application/json'
--data-binary '{ "qualDetails": { "type": "FlatQualificationRest", "quals": [ { "type": "RelationalQualificationRest", "leftOperand": { "type": "DbOperandRest", "key": "ipAddress" }, "operator": "in\_case\_insensitive", "rightOperand": { "type": "ValueOperandRest", "value": { "type": "ListStringValueRest", "value": [ "172.16.10.1" ] } } } ] }}'

Response

{
"objectList": [
{
"type": "HardwareAssetRest",
"id": 1,
"updatedById": 1,
"updatedTime": 1588600717681,
"createdById": 1,
"createdTime": 1588598464114,
"assetTypeId": 1,
"displayName": "asdasdasd",
"origin": "manual",
"model": "asset\_hardware",
"inReview": false,
"ipAddress": "1.1.1.1",
"name": "AST-1"
}
],
"totalCount": 1
}