本文整理汇总了Python中infrastructure_manager.InfrastructureManager.deregister_instances方法的典型用法代码示例。如果您正苦于以下问题:Python InfrastructureManager.deregister_instances方法的具体用法?Python InfrastructureManager.deregister_instances怎么用?Python InfrastructureManager.deregister_instances使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类infrastructure_manager.InfrastructureManager
的用法示例。
在下文中一共展示了InfrastructureManager.deregister_instances方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: deregister_flex_cloud
# 需要导入模块: from infrastructure_manager import InfrastructureManager [as 别名]
# 或者: from infrastructure_manager.InfrastructureManager import deregister_instances [as 别名]
def deregister_flex_cloud(self, parameters, blocking=True):
try:
i = InfrastructureManager(blocking=blocking)
res = i.deregister_instances(parameters=parameters, terminate=False)
ret = True
except Exception, e:
logging.error("deregister_flex_cloud() failed with error : %s", str(e))
ret = False
示例2: stop_ec2_vms
# 需要导入模块: from infrastructure_manager import InfrastructureManager [as 别名]
# 或者: from infrastructure_manager.InfrastructureManager import deregister_instances [as 别名]
def stop_ec2_vms(self, params, blocking=False):
'''
This method would terminate all the EC2 instances associated with the account
that have a keyname prefixed with stochss (all instances created by the backend service)
params must contain credentials key/value
'''
key_prefix = AgentConfig.get_agent_key_prefix(agent_type=AgentTypes.EC2,
key_prefix=params.get('key_prefix', ''))
try:
logging.debug("Stopping compute nodes with key_prefix: {0}".format(key_prefix))
i = InfrastructureManager(blocking=blocking)
res = i.deregister_instances(parameters=params, terminate=True)
ret = True
except Exception, e:
logging.error("Terminate machine failed with error : %s", str(e))
ret = False