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.
- Hardware Asset :
'http://{server_url}/api/v1/asset/asset_hardware/search/byqual?offset=0&size=50'
- Software Asset :
'http://{server_url}/api/v1/asset/asset_software/search/byqual?offset=0&size=50'
- 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" ] } } } ] }}'