Skip to content

Instantly share code, notes, and snippets.

@filipeandre
Last active May 27, 2024 13:06
Show Gist options
  • Save filipeandre/22d8d15c2ecc015f2872fac27d5197cc to your computer and use it in GitHub Desktop.
Save filipeandre/22d8d15c2ecc015f2872fac27d5197cc to your computer and use it in GitHub Desktop.
Implementation of get command incocations boto3 waiter
import botocore.waiter
import botocore.session
get_command_invocations_model = botocore.waiter.WaiterModel({
"version": 2,
"waiters": {
"CommandSuccess": {
"delay": 2,
"operation": "GetCommandInvocation",
"maxAttempts": 3,
"description": "Wait until command is completed",
"acceptors": [
{
"state": "retry",
"matcher": "error",
"expected": "InvocationDoesNotExist"
},
{
"state": "retry",
"matcher": "path",
"argument": "Status",
"expected": "Pending"
},
{
"state": "failure",
"matcher": "path",
"argument": "length(StandardErrorContent) == `0`",
"expected": False
},
{
"state": "success",
"matcher": "path",
"argument": "Status",
"expected": "Success"
}
]
},
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment