Python 在负载平衡器中打印实例的状态
我想打印连接到负载平衡器的实例的状态。(服务内/服务外)。 我怎样才能用Boto3做到这一点。我附上了屏幕截图,以指定我需要打印的内容。 提前感谢。-p>描述指定实例相对于指定负载平衡器的状态Python 在负载平衡器中打印实例的状态,python,amazon-web-services,boto3,amazon-elb,Python,Amazon Web Services,Boto3,Amazon Elb,我想打印连接到负载平衡器的实例的状态。(服务内/服务外)。 我怎样才能用Boto3做到这一点。我附上了屏幕截图,以指定我需要打印的内容。 提前感谢。-p>描述指定实例相对于指定负载平衡器的状态 import boto3 client = boto3.client("elb") response = client.describe_instance_health(LoadBalancerName='testname') for instance in response['InstanceState
import boto3
client = boto3.client("elb")
response = client.describe_instance_health(LoadBalancerName='testname')
for instance in response['InstanceStates']:
print(instance['InstanceId'],instance['State'])