Я хочу присвоить json результаты, если он получился успешным - 0, а неудача - 1.
Результат - успех, как показано ниже:
[root@jenkins qemu-server]# aws elb describe-instance-health --profile test --load-balancer-name classic-balance-test
{
"InstanceStates": [
{
"InstanceId": "i-05414ddade7f312ff",
"ReasonCode": "Instance",
"State": "OutOfService",
"Description": "Instance is in stopped state."
},
{
"InstanceId": "i-0ccf638d2cd59bc73",
"ReasonCode": "Instance",
"State": "OutOfService",
"Description": "Instance is in stopped state."
}
]
}
Результаты не пройдены, как показано ниже:
[root@jenkins qemu-server]# aws elb describe-instance-health --profile test --load-balancer-name classic-balance-test1
An error occurred (LoadBalancerNotFound) when calling the DescribeInstanceHealth operation: There is no ACTIVE Load Balancer named 'classic-balance-test1'