PaloAltoNetworks / prisma.pan.dev

The home of Developer docs for Prisma by Palo Alto Networks
https://prisma.pan.dev
MIT License
21 stars 38 forks source link

Enhance docs for reporting endpoint query params #150

Closed ion9 closed 2 years ago

ion9 commented 3 years ago

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?

welcome-to-palo-alto-networks[bot] commented 3 years ago

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

Kagemusha-san commented 3 years ago

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 3 years ago

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

Kagemusha-san commented 3 years ago

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).

jeremyp-synopsys commented 2 years ago

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.

https://github.com/twistlock/docs/issues/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 2 years ago

Partially resolved with doc updates. See here https://github.com/PaloAltoNetworks/prisma-cloud-docs/pull/365

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