本文整理匯總了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)