本文整理匯總了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": []}