コード例 #1
0
def network(request, project):
    createVMform = forms.Create_VM()   
    vms = api.listVMs(api.get_nova(request, project))

    return render(request, 'network.html',
                    {'project': [project] , 'vms': vms,
                    'createVMform': createVMform })
コード例 #2
0
def VM_stop(request, project, VMid):
    print (project, VMid)                   #debugging
    if VMid[len(VMid)-1] == '/':            #strip ending /
        VMid = VMid[:len(VMid)-1]
    nova = api.get_nova(request, project)   #get nova object
    api.stopVM(nova, VMid)                  #stop specified Nova object
    return HttpResponseRedirect('/control/' + project + '/')    #back to control
コード例 #3
0
ファイル: views.py プロジェクト: BU-EC500-SP15/moc-gui
def VM_active_state_toggle (request, project, VMid):
    print (project, VMid)
    if VMid[len(VMid)-1] == '/':
        VMid = VMid[:len(VMid)-1]
    nova = api.get_nova(request, project)
    api.VM_active_state_toggle(nova, VMid)
    return HttpResponseRedirect('/control/' + project + '/')
コード例 #4
0
def control(request, project):
  
    vms = api.listVMs(api.get_nova(request, project))

    return render(request, 'control.html', 
                  {'project': [project], 'vms': vms,
                   'vm_modals': html.vm_modals(request)
                    })
コード例 #5
0
ファイル: forms.py プロジェクト: CCI-MOC/ui
    def save(self, request, force_insert=False, force_update=False, commit=True):
        
        name   = self.cleaned_data['name']
        image  = str(self.cleaned_data['image'])
        flavor = self.cleaned_data['flavor']
        nova   = api.get_nova(request, 'ui') 

        api.createVM(nova, name, image, flavor)
コード例 #6
0
ファイル: views.py プロジェクト: CCI-MOC/ui
def VM_active_state_toggle (request, project, VMid):
    print  (project, VMid)
    print  VMid[len(VMid)-1]
    print  VMid[:len(VMid)-1]
    if VMid[len(VMid)-1] == '/':
        VMid = VMid[:len(VMid)-1]
    nova = api.get_nova(request, project)
    api.VM_active_state_toggle(nova, VMid)
    return HttpResponseRedirect('/control/' + project + '/')
コード例 #7
0
ファイル: views.py プロジェクト: BU-EC500-SP15/moc-gui
def control(request, project):

    createVMform = forms.Create_VM()   
     # UIProject.objects.filter(name = project).__dict__

    vms = api.listVMs(api.get_nova(request, project))

    project = [project]

    return render(request, 'control.html', 
                  {'project': project, 'vms': vms,
                   'createVMform': createVMform })
コード例 #8
0
    def save(self,
             request,
             force_insert=False,
             force_update=False,
             commit=True):

        name = self.cleaned_data['name']
        image = str(self.cleaned_data['image'])
        flavor = self.cleaned_data['flavor']
        nova = api.get_nova(request, 'ui')

        api.createVM(nova, name, image, flavor)
コード例 #9
0
def VM_add(request, project, VMname, imageName, flavorName):
	print (project, VMname, imageName, flavorName)					#debugging

#	if request.method == 'POST':
#		form = forms.Create_VM(request.POST)
#		if form.is_valid():
#			print "form is valid."
#			nameVM = form.cleaned_data['VM_name']
#			nameFlavor 

	nova = api.get_nova(request, project)	#get nova object
	api.createVM(nova, VMname, imageName, flavorName)			#add specified Nova object
	return HttpResponseRedirect('/control/' + project + '/')	#back to control
コード例 #10
0
ファイル: views.py プロジェクト: BU-EC500-SP15/moc-gui
def VM_add(request, project, VMname, imageName, flavorName):
	print (project, VMname, imageName, flavorName)					#debugging

#	if request.method == 'POST':
#		form = forms.Create_VM(request.POST)
#		if form.is_valid():
#			print "form is valid."
#			nameVM = form.cleaned_data['VM_name']
#			nameFlavor 

	nova = api.get_nova(request, project)	#get nova object
	api.createVM(nova, VMname, imageName, flavorName)			#add specified Nova object
	return HttpResponseRedirect('/control/' + project + '/')	#back to control
コード例 #11
0
def VM_add_default(request, project):
    print (project)
    nova = api.get_nova(request, project)   #get nova object
    api.createDefault(nova)
    return HttpResponseRedirect('/control/' + project + '/')    #back to control