我是否可以假设“描述\实例\状态响应”永远不会是局部的?更具体地说,关于“InstanceStatus”属性

2024-09-19 23:35:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我在这个documentation或任何其他地方都找不到关于我是否可以假设boto3 ec2客户端describe_instance_status查询响应永远不会是部分的问题的答案

更具体地说,这里是实例状态检查失败时InstanceStatus属性的典型describe_instance_status响应的一个片段:

"InstanceStatus": {
    "Details": [
        {
            "ImpairedSince": datetime(2015, 1, 1),
            "Name": "reachability",
            "Status": "failed",
        }
    ],
    "Status": "impaired",
}

实例状态状态为impaired,因此问题是,我是否可以假设在这种情况下总是给出ImpairedSince,或者有时,尽管状态为impaired,但响应中会缺少此数据。 如果它可能丢失,原因是什么


Tags: 实例instance答案客户端状态documentationstatus地方
1条回答
网友
1楼 · 发布于 2024-09-19 23:35:08

以下是doc所说的:

Status checks are performed every minute, returning a pass or a fail status. If all checks pass, the overall status of the instance is OK. If one or more checks fail, the overall status is impaired. Status checks are built into Amazon EC2, so they cannot be disabled or deleted.

和另一个doc

impairedSince: The time when a status check failed. For an instance that was launched and impaired, this is the time when the instance was launched.

结论:ImpairedSince键将仅在InstanceStatusDetails对象中给出,其中Statusfailed。如果至少有一个状态检查失败,则整个InstanceStatusSummary对象的Status将是impaired

相关问题 更多 >