-
-
Notifications
You must be signed in to change notification settings - Fork 2
Description
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
- These features are only available in later releases of version
9.x
- Also see Support retrieving partial responses from endpoints (refactor for pydantic
2.10
) #20