看起来服务员不存在,但您可以像这样创建自己的客户服务员:
import boto3
from botocore.waiter import WaiterModel
from botocore.waiter import create_waiter_with_client
client = boto3.client('backup')
waiter_name = "BackupCompleted"
waiter_config = {
"version": 2,
"waiters": {
"BackupCompleted": {
"operation": "DescribeRestoreJob",
"delay": 60, # Number of seconds to delay
"maxAttempts": 5, # Max attempts before failure
"acceptors": [
{
"matcher": "path",
"expected": "COMPLETED",
"argument": "Status",
"state": "success"
},
{
"matcher": "path",
"expected": "ABORTED",
"argument": "Status",
"state": "failure"
},
{
"matcher": "path",
"expected": "FAILED",
"argument": "Status",
"state": "failure"
}
]
}
}
}
waiter_model = WaiterModel(waiter_config)
backup_waiter = create_waiter_with_client(waiter_name, waiter_model, client)
backup_waiter.wait(RestoreJobId='MyRestoreJobId')