client_traffic - bruno-beloff/scs_analysis GitHub Wiki

docs > software repositories > scs_analysis > commands > estate management


DESCRIPTION

Usage statistics are continuously collected for each web API by endpoint, date and user. The client_traffic utility is used to query these statistics. Compulsory query fields are:

  • --period=PERIOD - should be in the form YYYY, YYYY-MM, or YYYY-MM-DD
  • --users or -organisations CLIENT_1 [.. CLIENT_N] - specifies one or more email addresses, or one or more organisation labels

Optional query fields are:

  • --endpoint=ENDPOINT - if specified, statistics for the given endpoint are reported, otherwise, all endpoints are reported

Other parameters are:

  • --separate - (only permitted when specifying a single organisation) the organisation is broken down by individual user members
  • --aggregate - (only relevant when specifying a year or month period) statistics are aggregated to totals for the period

Statistics are available only for the clients(s) that are visible to the user. Only organisation admins may view statistics for whole organisations.

The --credentials flag is only required where the user wishes to store multiple identities. Setting the credentials is done interactively using the command line interface.

SYNOPSIS

client_traffic.py [-c CREDENTIALS] [-e ENDPOINT] { -u | -o [-s] } -p PERIOD [-a] [-i INDENT] [-v] CLIENT_1 [..CLIENT_N]

Options
-h, --help show this help message and exit
-c CREDENTIALS_NAME, --credentials=CREDENTIALS_NAME the stored credentials to be presented
-e ENDPOINT, --endpoint=ENDPOINT a specific endpoint
-u, --users a specific user
-o, --organisations a specific organisation
-s, --separate report on each member individually
-p PERIOD, --period=PERIOD reporting period
-a, --aggregate aggregate data for the period
-i INDENT, --indent=INDENT pretty-print the output with INDENT
-v, --verbose report narrative to stderr

EXAMPLES

client_traffic.py -vi4 -c super -e TopicHistory -u -p 2024-05 [email protected]
client_traffic.py -c super -o MyOrg -e test1 -p 2023-08-22

DOCUMENT EXAMPLE

[{"endpoint": "test1", "client": "MyOrg", "period": "2023-08-22", "queries": 99, "invocations": 99, "documents": 495}]

SEE ALSO

scs_analysis/cognito_user_credentials