Highlighted
Super Contributor.
Super Contributor.
175 views

Fetching rest-api data with standard Json parser

Hello,

We're trying to populate data in different tools from our CMDB through the rest-api.
Calling queries or directly with a Json body is working fine, but the output is causing us some problems, due to the relations also being objects in the CMDB datamodel.

Our first objective is to automatically (live or scheduled) populate a technical architecture document listing all servers with their characteristics (cpu, ram, filesystem size, ip addresses...), instead or manually updating all the stuff, we're using Atlassian Confluence in this case.

Some of the tools like Confluence have native Json parsers or through extensions, but they're not adapted to parse this kind of json output, since it's not a "tree" as they would expect, each object being separated.

Is there a way to have a more standard Json output as a tree, directly handled by the api call ? Or is there an external tool or SDK which could help transforming that ?

We're planning to develop our own solution to transform the output to make it usable by external tools, but maybe someone already did this or have a better solution.

Thanks,
Best regards,
Yann Pingot

0 Likes
4 Replies
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Fetching rest-api data with standard Json parser

Hi Yann,

first - you can obtain all this information by configuring reports and export them in several formats  - csv, xml, excel. This will save you a lot of development effort, if the only requirement is to take the data out of the system and process it automatically. The reports can be scheduled and exported in FileSystem or email. 

If you want to process the JSON output, since the information is part of the attributes of different CIs, there is no other way than to develop the processing of the relationship objects.

Regards,

Petko Popadiyski

Freelance Microfocus CMS UCMDB Consulting

 

Likes are appreciated!
0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: Fetching rest-api data with standard Json parser

If I understood well, there is no solution to generate an export (CSV or XML) previously configured thru an API call ?

The only solution is the schedule to send this report to a specific folder ?

0 Likes
Highlighted
Trusted Contributor.. Trusted Contributor..
Trusted Contributor..

Re: Fetching rest-api data with standard Json parser

There is, but you have to code it by yourself (e.g. perl has capabilities of calling the UD rest-api, parse the output and then generate even xlsx files).

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Fetching rest-api data with standard Json parser

Yes, you can do it out of the box. Here is a screenshot:

save_to_local.PNG

 

Apparently I haven't configured the local path, but you can find how to do it.

Regards,

Petko Popadiyski

Freelance Microfocus CMS UCMDB Consulting

 

Likes are appreciated!
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.