I was trying to monitor my AWS account using cloud watch api. When i tried to extract estimated charges data as given below.
cn = boto.ec2.cloudwatch.connect_to_region('us-east-1',aws_access_key_id='*******************',
aws_secret_access_key='***************************',debug=2)
and
cn.get_metric_statistics(
1800,
datetime.datetime.utcnow() - datetime.timedelta(hours=24*12),
datetime.datetime.utcnow(),
'EstimatedCharges',
'AWS/Billing',
['Sum'],
dimensions={
'Currency':'USD',
'ServiceName': 'AmazoneEC2'
}
)
But the data i got from this api doesn't match with the values shown in the aws console. What am i doing wrong here? Or if i want the billing reports of each day last month how should i modify the query?
Aucun commentaire:
Enregistrer un commentaire