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!

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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠