API for getting KPIs about assets - counting assets with criterias - reporting
Hello,
i would like to know what is the best practice for getting KPIs about assets with Collibra’s APIs ?
The goal is to count assets with filtering or selection on community, domain, validation result, responsability, creation or modification date, …
The only method i see in REST API is ‘HTTP GET’ with ‘/rest/2.0/assets’.
There is only parameters on domain, community, type and status.
The REST request will fetch and transfer a lot of datas from Collibra server (repository) to HTTP REST client.
I only want to have a count of assets corresponding to criterias.
Have you got any advice please ?
Thank you very much, Regards
francoisabraham
Posted 4 years ago · Edited 1 year ago·Last reply 3 years ago
9 comments
arthurburkhardt
·3 years ago · EditedThe pdf documentation is available with all the other PDF downloads: PDF downloads (collibra.com)
and the html documentation is on the dev portal: https://developer.collibra.com/rest/output-module/Content/OutputModule/ref_whats-new.htm
By the way, I don’t know who’s responsible for the output module documentation, but GOOD JOB on the html version. It’s much easier to use than the previous PDF version.
joseparada
·3 years ago · EditedI found out the Output Module is now an endpoint into the Core APIs, can’t find the PDF as reference though. Would anybody mind to share it?
Thanks in advance.
francoisabraham
OP4 years ago · EditedHi, thanks a lot for the advices : OutpoutModule API works fine, very quick, very usefull.
Regards, François
francoisabraham
OP4 years ago · EditedHi, thanks for answer : i get “access denied error” when i try to get the PDF …
AccessDeniedAccess Denied
A7KSV2DX9S0BDWTR
…
arthurburkhardt
·4 years ago · EditedYes, you should just left click on it, not right click and open in new tab.
francoisabraham
OP4 years ago · EditedHello, thank you for your answer : i d’ont know what is ‘outputModuleApi’. Is it from the marketPlace ?
Where can i found documentation about this API ?
Regards
arthurburkhardt
·4 years ago · EditedNo, it’s in the standard documentation, but they haven’t migrated it to the documentation center yet. You can find it here: https://productresources.collibra.com/documentation/, under:
arthurburkhardt
·4 years ago · EditedAlso, here’s an updated example, because I just discovered YAML is also supported and MUCH nicer to code. But hey, I guess I could have figured it out a while ago and just convert YAML to json anyways.
query = """--- TableViewConfig: Resources: Term: Id: {name: id} Signifier: {name: name} ConceptType: {Id: {name: assetTypeId}, Name: {name: assetType}} Vocabulary: {Id: {name: domainId}, Community: {Id: {name: communityId}}} Status: {Signifier: {name: status}} DateAttribute: - {labelId: c0e00000-0000-0000-0001-000500000193, Date: {name: dueDate}} Filter: AND: - OR: - Field: {name: assetTypeId, operator: EQUALS, value: daaf28e9-a73b-4d83-bd7f-db110512c632} - Field: {name: assetTypeId, operator: EQUALS, value: 548585f7-ac1b-4483-8ced-08d570c0d9b0} - Field: {name: communityId, operator: EQUALS, value: 4f4670ba-eaf9-428d-97f7-d350b879b668} - Field: {name: dueDate, operator: GREATER, value: %(threshold)s} Columns: - Column: {fieldName: id} - Column: {fieldName: dueDate} - Column: {fieldName: status} """ % {'threshold': 123,} r = c.post('outputModule/export/json', data=query, headers={'Content-Type': 'application/x-yaml'}) df = pd.json_normalize(r.json()['aaData'])arthurburkhardt
·4 years ago · EditedI would recommend to use the outputModule for that. It’s essentially a graph query engine that allows to be very specific about what data you want to extract. Here’s an example I posted here: https://datacitizens.collibra.com/forum/t/view-filtered-by-current-date/1024/12?u=arthur.burkhardt