简体   繁体   English

如何使用AWS CLI知道RDS免费存储?

[英]How to know RDS free storage with using AWS CLI?

I tried with below command but no luck(if I did anything wrong please let me know). 我尝试使用下面的命令,但是没有运气(如果做错了,请告诉我)。

aws cloudwatch get-metric-statistics --metric-name FreeStorageSpace --start-time 2018-12-15T23:18:00Z --end-time 2018-12-16T23:18:00Z --period 60 --namespace AWS/RDS --statistics Average --dimensions Name=Instance name, value=dev

I get below output:- 我得到以下输出:-

{ "Datapoints": [], "Label": "FreeStorageSpace" }

Input was this : 输入是这样的:

aws cloudwatch get-metric-statistics
--region us-east-1
--metric-name FreeStorageSpace
--start-time 2018-12-15T20:05:00
--end-time 2017-12-16T20:05:00
--period 3600
--namespace AWS/RDS
--statistics Maximum
--dimensions="Name=MyDB,Value=cc-mysql-prod-db"

Output : 输出:

{
"Datapoints": [
    {
        "Timestamp": "2018-12-15T20:05:00Z",
        "Maximum": 2196401152.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-15T21:05:00Z",
        "Maximum": 2196433920.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-15T22:05:00Z",
        "Maximum": 2196401152.0,
        "Unit": "Bytes"
    },


    ...


    {
        "Timestamp": "2018-12-16T18:05:00Z",
        "Maximum": 2196405248.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-16T19:05:00Z",
        "Maximum": 2196405248.0,
        "Unit": "Bytes"
    },
    {
        "Timestamp": "2018-12-16T20:05:00Z",
        "Maximum": 2196433920.0,
        "Unit": "Bytes"
    }
],
"Label": "FreeStorageSpace"
    }

Can you also make sure that you are using your default region same as where the DB instance reside in aws cli and try with period maybe 300 or something ? 您是否还可以确保使用与数据库实例驻留在aws cli中相同的默认区域,并尝试使用句号(可能为300左右)?

Yes, I did. 是的,我做到了。 here is my out put:- 这是我的输出:-

..... ...... ..... "Timestamp": "2018-12-18T11:18:00Z", "Average": 103001828556.8, "Unit": "Bytes" }, { "Timestamp": "2018-12-17T20:18:00Z", "Average": 103001801386.66667, "Unit": "Bytes" }, { "Timestamp": "2018-12-18T01:18:00Z", "Average": 103001622664.53334, "Unit": "Bytes" } ], "Label": "FreeStorageSpace"

but here it showing 103.00162266453334 GB(My Rds instance size is only 100GB) and On AWS console, it showing 98.3456775GB 但这里显示103.00162266453334 GB(我的Rds实例大小仅为100GB),在AWS控制台上,它显示98.3456775GB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM