API Gateway Boto3 get_usage() - Running Total or just daily?

0

Hi all - writing a quick lambda to get usage per API key so we can run that by billing when the time comes. Stupid question, but just want to make sure...

I know the response from boto3's apigateway client looks like this:

values: {
   'api key id':{ [
         [ usage, remaining ],
         [ usage, remaining ], 
         ...
     ]
   }
}

is the usage for each a running total, or per day? the docs for this word it as though it's just per day, but the example response makes it seem like it's a running total....

{..., "values" : 
    { "{api_key}" : [ 
         [0, 100], 
         [10, 90],
         [100, 0]
         ]
     }

either way is fine, but obviously it'll matter from a billing perspective :)

thanks in advance!

Incyte
preguntada hace 2 años475 visualizaciones
1 Respuesta
0

The responded result is a daily log of used quota and remaining quota for the specified time interval. Also, the first argument of the array is used quota, and the second argument is remaining quota. See the following documents for quota and usage descriptions.

https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-usage-plans-with-console.html#api-gateway-usage-plan-manage-usage

The usage data in the example shows the daily usage data for an API client, as identified by the API key (px1KW6...qBazOJH), between August 1, 2016 and August 3, 2016. Each daily usage data shows used and remaining quotas. In this example, the subscriber hasn't used any allotted quotas yet, and the API owner or administrator has reduced the remaining quota from 5000 to 10 on the third day.

respondido hace 2 años

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas