PaloAltoNetworks/prisma.pan.dev

Enhance docs for reporting endpoint query params

ion9 opened this issue · 6 comments

ion9 commented

Describe the problem

Is this a request for improvement.
In the LIVEcommunity we have questions on how some of the options work for the API,

https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-cloud-compute-api-filtering/td-p/321159

Suggested fix

Enumerate, provide examples for the api options.

E.G. sort=entityInfo.scanTime ... short of seeing it in a call to the api, where would we know entityInfo from?

🎉 Thanks for opening your first issue here! Welcome to the community!

Is there any news on this? I would really like to slim down responses by only retrieving relevant data. I always get
{ "err": "unknown filtering field <fieldName>" }

where <fieldName> is whatever I pass as query param (e.g. hostname). Interestingly, it seems to split by "," because if I pass ?fields=hostname,type it still says "err": "unknown filtering field hostname".

ion9 commented

I'm not sure what endpoint you are trying to use. but on the registry I have see a "compact=true" https://prisma.pan.dev/api/cloud/cwpp/registry#operation/get-registry it can help to cut down on some of the size.

That option looks to be missing from the serverless endpoint.
https://prisma.pan.dev/api/cloud/cwpp/serverless#operation/get-serverless

I tried it on images and hosts endpoints. The problem with compact=true is that it does not return vulnerabilities, but that's the information I'm after (among some other data).

Not the answer that any of us are looking for or want, but apparently the fields parameter is not exposed through the API and is supposed to be removed from the documentation.

twistlock/docs#232

from customer case, the 'field' from the query string is internal and should be removed from API docs

Does the extend to other API calls that have a fields query parameter? For example, /hosts/info also has fields. Is this issue saying that the field is not exposed to the API anywhere or only this specific call?

Yes, this extends to the other api calls that expect a fields input

Feature request posted here - https://prismacloud.ideas.aha.io/ideas/PANW-I-3140

iansk commented

Partially resolved with doc updates. See here PaloAltoNetworks/prisma-cloud-docs#365

The Aha issue PANW-I-3140 will continue to stay open, with the request to enhance the API and the corresponding OpenAPI spec.