Skip to content

Outline a pythonic way to specify fields and type parameters in long poll events #68

@devraj

Description

@devraj

Is your feature request related to a problem? Please describe.
Endpoints like the /api/events accept a field or type as parameter which allow us to narrow the set of results returned by the endpoint.

fields in particular can do something like fields=cardholder.pdf_<pdfId>

An example of this would be

http --cert=.certs/anomaly-gallagher.pem --cert-key=.certs/anomaly-gallagher.key \
get https://commandcentre-api-au.security.gallagher.cloud/api/events\?fields\=cardholder.pdf_6550 \
"Authorization: GGL-API-KEY $GACC_API_KEY"

The fields could have values like defaults, or location.

Describe the solution you'd like
Firstly a constant of the field names that are supported by the API, that way the user is not providing arbitrary string values and then debugging the output.

That way the parameter would look like

fields=[const.DEFAULTS, const.LOCATION]

PDF style parameters could be a special parameter with a format like fields=[const.CARDHOLDER.PDF(Id, Id, Id)] where the Id is the numeric ID of the PDF field.

Since the library caches the PDF fields (see #1) we should be able to validate the IDs ahead of executing the call to the Command Centre.

Describe alternatives you've considered
We could allow the user to provide these as string values and then let the user debug the output, this would not make for a decent developer experience.

Additional context

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions