PaloAltoNetworks / prismacloud-api-python

Prisma Cloud utility scripts, and a Python SDK for Prisma Cloud APIs.
ISC License
60 stars 54 forks source link

Request to add wrapper of api/v1/registry/names #125

Closed diogoraposo closed 1 year ago

diogoraposo commented 1 year ago

Is your feature request related to a problem?

No

Describe the solution you'd like

Add the following snippet to prismacloud/api/compute/_registry.py: def registry_list_names(self, body_params=None): result = self.execute_compute('GET', 'api/v1/registry/names', body_params=body_params) return result

Describe alternatives you've considered

Have to implement this locally, but I use it in lambdas which have an automated deployment. It would make it easier to deploy and reduce complexity of my deployment to have it in the package installed via requirements.txt

welcome-to-palo-alto-networks[bot] commented 1 year ago

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

tkishel commented 1 year ago

Thanks! That endpoint is a GET, so should use query params rather than body params:

https://prisma.pan.dev/api/cloud/cwpp/registry#operation/get-registry-names

So I'll add this:

    def registry_list_image_names(self, query_params=None):
        result = self.execute_compute('GET', 'api/v1/registry/names?', query_params=query_params)
        return result
tkishel commented 1 year ago

Resolved via https://github.com/PaloAltoNetworks/prismacloud-api-python/pull/126