本文整理汇总了Python中botocore.waiter.create_waiter_with_client方法的典型用法代码示例。如果您正苦于以下问题:Python waiter.create_waiter_with_client方法的具体用法?Python waiter.create_waiter_with_client怎么用?Python waiter.create_waiter_with_client使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类botocore.waiter
的用法示例。
在下文中一共展示了waiter.create_waiter_with_client方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_waiter
# 需要导入模块: from botocore import waiter [as 别名]
# 或者: from botocore.waiter import create_waiter_with_client [as 别名]
def get_waiter(self, waiter_name):
"""Returns an object that can wait for some condition.
:type waiter_name: str
:param waiter_name: The name of the waiter to get. See the waiters
section of the service docs for a list of available waiters.
:returns: The specified waiter object.
:rtype: botocore.waiter.Waiter
"""
config = self._get_waiter_config()
if not config:
raise ValueError("Waiter does not exist: %s" % waiter_name)
model = waiter.WaiterModel(config)
mapping = {}
for name in model.waiter_names:
mapping[xform_name(name)] = name
if waiter_name not in mapping:
raise ValueError("Waiter does not exist: %s" % waiter_name)
return waiter.create_waiter_with_client(
mapping[waiter_name], model, self)
示例2: get_waiter
# 需要导入模块: from botocore import waiter [as 别名]
# 或者: from botocore.waiter import create_waiter_with_client [as 别名]
def get_waiter(self, waiter_name):
config = self._get_waiter_config()
if not config:
raise ValueError("Waiter does not exist: %s" % waiter_name)
model = waiter.WaiterModel(config)
mapping = {}
for name in model.waiter_names:
mapping[xform_name(name)] = name
if waiter_name not in mapping:
raise ValueError("Waiter does not exist: %s" % waiter_name)
return waiter.create_waiter_with_client(
mapping[waiter_name], model, self)
示例3: fargate_delete_waiter
# 需要导入模块: from botocore import waiter [as 别名]
# 或者: from botocore.waiter import create_waiter_with_client [as 别名]
def fargate_delete_waiter(self, client):
# Fargate profiles seem to delete faster @ roughly 2 minutes each so keeping defaults
config = {
'version': 2,
'waiters': {
"FargateProfileDeleted": {
'operation': 'DescribeFargateProfile',
'delay': 30,
'maxAttempts': 40,
'acceptors': [
{
"expected": "DELETE_FAILED",
"matcher": "path",
"state": "failure",
"argument": "fargateprofile.status"
},
{
"expected": "ResourceNotFoundException",
"matcher": "error",
"state": "success"
}
]
}
}
}
return create_waiter_with_client("FargateProfileDeleted", WaiterModel(config), client)
示例4: __init__
# 需要导入模块: from botocore import waiter [as 别名]
# 或者: from botocore.waiter import create_waiter_with_client [as 别名]
def __init__(self, client):
waiter_json_filename = os.path.join(utils.__path__[0], 'cfn-waiters-2.json')
with open(waiter_json_filename, 'r') as waiter_json_file:
self.waiter_json_model = json.load(waiter_json_file)
self.waiter_model = WaiterModel(self.waiter_json_model)
self.waiter = create_waiter_with_client('StackAvailable', self.waiter_model, client.meta.client)