def vm_start(request, vm_id): logging.info("VM %s start by %s", vm_id, request.user_uniq) vm = VirtualMachine.objects.get(pk=vm_id) servers.start_action(vm, 'START') servers_backend.startup_instance(vm) account = vm.userid return HttpResponseRedirect(reverse('helpdesk-details', args=(account,)))
def start(request, vm, args): # Normal Response Code: 202 # Error Response Codes: serviceUnavailable (503), # itemNotFound (404) log.info("Start VM %s", vm) if args: raise faults.BadRequest('Malformed Request.') backend.startup_instance(vm) return HttpResponse(status=202)
def start(server_id, credentials, atomic_context=None): with commands.ServerCommand("START", server_id, credentials, atomic_context) as vm: log.info("Starting VM %s", vm) job_id = backend.startup_instance(vm) vm.record_job(job_id) return vm
def start(server_id, credentials, atomic_context=None): with commands.ServerCommand( "START", server_id, credentials, atomic_context) as vm: log.info("Starting VM %s", vm) job_id = backend.startup_instance(vm) vm.record_job(job_id) return vm
def start(vm): log.info("Starting VM %s", vm) return backend.startup_instance(vm)