Last active
June 17, 2024 07:40
-
-
Save filipeandre/c1f86c9d3b178b52383bd783088aaf48 to your computer and use it in GitHub Desktop.
Implementation of batch get builds boto3 waiter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import botocore.waiter | |
import botocore.session | |
batch_get_builds_model = botocore.waiter.WaiterModel({ | |
"version": 2, | |
"waiters": { | |
"BuildSuccess": { | |
"delay": 5, | |
"operation": "BatchGetBuilds", | |
"maxAttempts": 60, | |
"description": "Wait until build is finished", | |
"acceptors": [ | |
{ | |
"state": "failure", | |
"matcher": "path", | |
"argument": "length(builds) != `1`", | |
"expected": True | |
}, | |
{ | |
"state": "retry", | |
"matcher": "path", | |
"argument": "Status", | |
"expected": "IN_PROGRESS" | |
}, | |
{ | |
"state": "failure", | |
"matcher": "path", | |
"argument": "builds[0].buildStatus", | |
"expected": "FAILED" | |
}, | |
{ | |
"state": "failure", | |
"matcher": "path", | |
"argument": "builds[0].buildStatus", | |
"expected": "FAULT" | |
}, | |
{ | |
"state": "failure", | |
"matcher": "path", | |
"argument": "builds[0].buildStatus", | |
"expected": "STOPPED" | |
}, | |
{ | |
"state": "failure", | |
"matcher": "path", | |
"argument": "builds[0].buildStatus", | |
"expected": "TIMED_OUT" | |
}, | |
{ | |
"state": "success", | |
"matcher": "path", | |
"argument": "builds[0].buildStatus", | |
"expected": "SUCCEEDED" | |
} | |
] | |
}, | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment