REST API for custom computer property inside dbo.computer_properties view of BFI database

I am aware that there are predefined REST API samples in the following links below where I could extract computer information.

https://www.ibm.com/support/knowledgecenter/SS8JFY_9.2.0/com.ibm.lmt.doc/Inventory/integration/r_get_computer_systems.html

https://www.ibm.com/support/knowledgecenter/SS8JFY_9.2.0/com.ibm.lmt.doc/Inventory/integration/r_get_computers_v2.html

https://www.ibm.com/support/knowledgecenter/SS8JFY_9.2.0/com.ibm.lmt.doc/Inventory/integration/r_api_associantion_computer_hardware.html#reference_itl_vzf_vz

==============

There are also a lot of tables and views inside the ILMT or BFI database with different schema such as dbo, sam, adm, etc…

Questions:

  1. Can I run REST API against every table or view inside the ILMT or BFI database or there are ONLY certain views or tables that can be used REST API?

For example,

Is this REST API below extracting data directly from sam.computer_system table?

https://hostname:port/api/sam/computer_systems?token=token

Is this REST API below extracting data directly from adm.computer_hw table or dbo.computers view?

https://hostname:port/api/sam/v2/computers?token=token

  1. It seems that REST API can only access a subset of tables or views inside the ILMT or BFI database? If so, how do I identify which table or view from the database?

  2. I have a custom computer property named “serial_number” created from BFI portal. It is created inside dbo.computer_properties view.

I have no problem selecting this serial_number column from Computers and Hardware Inventory reports.

Using ServiceNow integration with BFI, how do I run REST API against this dbo.computer_properities view to get the information from my custom computer property called “serial_number”? This custom serial_number property contains a specific format for the serial number. Customer wants to extract this custom serial_number property into ServiceNow. Please advise.

You would use the computer_details association to pull back custom computer properties. See documentation here.

Any custom computer property added to the Computer Properties panel in BFI is available via this association. Use the following to retrieve the computer properties identifiers:

https://bfiserver:9081/api/sam/schemas/associations/computer_details.json?token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623

It will return something like this snippet:

"computer_property_61": { "type": ["string", "array", "null"], "items": "string", "title": "Device Type", "mappings": { "type": "array", "association": true, "description": "Mappings into datasource properties", "item": [{ "datasource_site_remote_id": -1995304751, "datasource_analysis_remote_id": 25, "datasource_property_remote_id": 1, "datasource_id": 1 }] } }

Then to retrieve the Name and Device Type from BFI:

https://bfiserver:9081/api/sam/v2/computerscolums[]=name&columns[]=computer_details.computer_property_61&token=7adc3efb175e2bc0f4484bdd2efca54a8fa04623

which returns:

{"name":"BFISERVER","computer_details":{"computer_property_61":"Server"}}

2 Likes

Thank you itsmpro92. I will have a look. Can someone modify or customize the REST API *.json files (computer_details.json) provided by BFI to add additional table or field information?

I don’t think so, aside from than adding fields (properties) as described previously.