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
已提问 2 年前475 查看次数
1 回答
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.

已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则