def request_destroy(): vmID = request.args.get('vmID') return jsonify(destroy_vm.destroy(int(vmID)))
def url_parse(server, url): print "details", vm_ki_info print url host_name = url if "?" in url: host_name, args = url.split("?") url_comps = host_name.split("/") print url_comps if "create" in url_comps and "vm" in url_comps: received_args = [] arg_split = args.split("&") for i in xrange(0, 3): received_args.append((arg_split[i].split("="))[1]) print received_args create_vm.create(server, received_args) elif "destroy" in url_comps and "vm" in url_comps: received_args = [] arg_split = args.split("=") received_args.append(arg_split[1]) destroy_vm.destroy(server, received_args) pass elif "query" in url_comps and "vm" in url_comps: received_args = int(args.split("=")[1]) printing.vm_query(server, received_args) elif "query" in url_comps and "volume" in url_comps: received_args = int(args.split("=")[1]) printing.volume_query(server, received_args) elif "types" in url_comps: printing.print_types(server) elif "list" in url_comps: # print "here" printing.print_images(server) elif "create" in url_comps and "volume" in url_comps: received_args = [] arg_split = args.split("&") for i in xrange(0, 2): received_args.append((arg_split[i].split("="))[1]) print received_args print "yayayayaya" create_volume.create(server, received_args) # main_file.create(server,received_args) elif "destroy" in url_comps and "volume" in url_comps: received_args = [] arg_split = args.split("=") received_args.append(arg_split[1]) destroy_volume.destroy(server, received_args) # main_file.destroy(server,received_args) pass elif "attach" in url_comps and "volume" in url_comps: received_args = [] arg_split = args.split("&") for i in xrange(0, 2): received_args.append((arg_split[i].split("="))[1]) print received_args print "yayayayaya" attach_volume.attach(server, received_args) elif "detach" in url_comps and "volume" in url_comps: received_args = [] arg_split = args.split("=") received_args.append(arg_split[1]) detach_vm.detach(server, received_args) pass
def request_destroy(): vmID=request.args.get('vmID') return jsonify(destroy_vm.destroy(int(vmID)))
def destory_vm(): vmid = request.args.get('vmid') vm_dict = {} vm_dict['vmid'] = vmid return jsonify(destroy_vm.destroy(vm_dict))
def destory_vm(): vmid=request.args.get('vmid') vm_dict={} vm_dict['vmid']=vmid return jsonify(destroy_vm.destroy(vm_dict))
def destroy(): vmid = request.args.get('vmid') return jsonify(destroy_vm.destroy(vmid))