RDS:无法获取它在 boto3 中显示为空白的事件 describe_events

RDS: Not able to fetch events it is showing blank in boto3 describe_events

当我尝试获取 rds 实例事件时,它给出了空白。但在 RDS 控制台中显示

但在 Boto3 中我的成绩低于

client.describe_events(SourceIdentifier='xxxxcccc',SourceType='db-instance')
{'Events': [], 'ResponseMetadata': {'RequestId': '-49d7-aa57-940d034bd920', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': '-a045-49d7-aa57-940d034bd920', 'content-type': 'text/xml', 'content-length': '272', 'date': 'Tue, 10 Jul 2018 07:15:48 GMT'}, 'RetryAttempts': 0}}

根据 describe_events() 的文档发现 here "by default, the past hour of events are returned." 因此,如果在过去一小时内没有发生任何事件,那么它 return 是一个空列表。

我用我自己的一个实例测试了这个并用

调用了函数
rds.describe_events(
    SourceIdentifier='db-instance-identifier',
    SourceType='db-instance'
)

returns 与您收到的相同的空响应。

但是,如果我实际上将记录的日期 range/number 指定为 return,就像这样:

rds.describe_events(
    SourceIdentifier='db-instance-identifier',
    SourceType='db-instance',
    StartTime=datetime(2018, 7, 1),
    EndTime=datetime(2018, 7, 10), 
    MaxRecords=20
)

然后我得到一个响应,其中实际包含我期望的事件。