amazon-web-services - 未在 AWS boto3 costExplorer get_cost_and_usage() 函数中获取总成本
问题描述
我正在使用以下请求调用 boto3 get_cost_and_usage 函数来获取按服务和“名称”标签分组的每日成本:
result = client.get_cost_and_usage(
TimePeriod = {
'Start': '2020-10-31',
'End': '2020-11-02'
},
Granularity = 'DAILY',
Metrics = ["BlendedCost"],
GroupBy = [
{
'Type': 'DIMENSION',
'Key': 'SERVICE'
},
{
'Type': 'TAG',
'Key': 'Name'
}
]
)
在响应中,我得到了每天每项服务和名称标签的所有费用,但是每天的总费用为空 [ "Total": {} ]:
"ResultsByTime": [
{
"Estimated": true,
"Groups": [
{
...
}
"TimePeriod": {
"End": "2020-11-01",
"Start": "2020-10-31"
},
"Total": {}
},
...
]
请告诉我这里有什么问题吗?我还尝试在 Metrics 中使用“UnblendedCost”、“AmortizedCost”并仅按服务分组,但这是同样的问题,即总成本不会到来。
请在这里帮助我。
解决方案
推荐阅读
- r - 如何创建 R 字典
- reactjs - React Bootstrap Popover:初始化时的 Pre-Open Popover
- java - Spring LDAP - 错误代码 32 - 问题 2001 (NO_OBJECT)
- vue.js - 动态改变 vuetify v-alert prop
- node.js - Docusign API 收件人速率限制
- javascript - 使用 SVG 图像和 JS 创建动态页面
- java - 如何从文件系统中读取 Java ObjectOutputStream 生成的文件?
- keras - model.predict 尽管模型给出了错误的答案。准确率为 99%
- snowflake-cloud-data-platform - 本地 CSV 文件加载到雪花表
- python - 如何使用yolo格式图像坐标裁剪图像