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
asked 2 years ago467 views
1 Answer
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.

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions