本文整理匯總了Python中boto.ec2.autoscale.AutoScaleConnection.close方法的典型用法代碼示例。如果您正苦於以下問題:Python AutoScaleConnection.close方法的具體用法?Python AutoScaleConnection.close怎麽用?Python AutoScaleConnection.close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類boto.ec2.autoscale.AutoScaleConnection
的用法示例。
在下文中一共展示了AutoScaleConnection.close方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: delete_autoscaling
# 需要導入模塊: from boto.ec2.autoscale import AutoScaleConnection [as 別名]
# 或者: from boto.ec2.autoscale.AutoScaleConnection import close [as 別名]
def delete_autoscaling():
con = AutoScaleConnection(aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
aws_access_key_id=AWS_ACCESS_KEY,
region=RegionInfo(name=REGION,
endpoint='autoscaling.%s.amazonaws.com' % REGION))
print "Deleting autoscaling group.."
group = con.get_all_groups(names=[AUTOSCALING_GROUP_NAME])[0]
print "shutting down instances"
group.shutdown_instances()
time.sleep(LONG_SLEEP_PERIOD)
print "Deleting autoscaling group itself"
con.delete_auto_scaling_group(AUTOSCALING_GROUP_NAME, force_delete=True)
print "Deleting launch configuration"
con.delete_launch_configuration(AUTOSCALING_GROUP_NAME)
con.close()