本文整理汇总了Python中bioblend.cloudman.launch.CloudManLauncher._find_placements方法的典型用法代码示例。如果您正苦于以下问题:Python CloudManLauncher._find_placements方法的具体用法?Python CloudManLauncher._find_placements怎么用?Python CloudManLauncher._find_placements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bioblend.cloudman.launch.CloudManLauncher
的用法示例。
在下文中一共展示了CloudManLauncher._find_placements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _get_placement_inner
# 需要导入模块: from bioblend.cloudman.launch import CloudManLauncher [as 别名]
# 或者: from bioblend.cloudman.launch.CloudManLauncher import _find_placements [as 别名]
def _get_placement_inner(request):
if request.is_ajax():
if request.method == 'POST':
cloud_id = request.POST.get('cloud_id', '')
a_key = request.POST.get('a_key', '')
s_key = request.POST.get('s_key', '')
inst_type = request.POST.get('instance_type', '')
placements = []
if cloud_id != '' and a_key != '' and s_key != '':
# Needed to get the cloud connection
cloud = models.Cloud.objects.get(pk=cloud_id)
cml = CloudManLauncher(a_key, s_key, cloud)
placements = cml._find_placements(cml.ec2_conn, inst_type, cloud.cloud_type)
return {'placements': placements}
else:
log.error("Not a POST request")
else:
log.error("No XHR")
return {"error": "Please specify access and secret keys", "placements": []}