예제 #1
0
def vm_shutdown(request, vm_id):
    logging.info("VM %s shutdown by %s", vm_id, request.user_uniq)
    vm = VirtualMachine.objects.get(pk=vm_id)
    servers.start_action(vm, 'STOP')
    servers_backend.shutdown_instance(vm)
    account = vm.userid
    return HttpResponseRedirect(reverse('helpdesk-details', args=(account,)))
예제 #2
0
파일: views.py 프로젝트: cstavr/synnefo
def vm_shutdown(request, vm_id):
    logging.info("VM %s shutdown by %s", vm_id, request.user_uniq)
    vm = VirtualMachine.objects.get(pk=vm_id)
    servers.start_action(vm, 'STOP')
    servers_backend.shutdown_instance(vm)
    account = vm.userid
    return HttpResponseRedirect(reverse('helpdesk-details', args=(account,)))
예제 #3
0
def shutdown(request, vm, args):
    # Normal Response Code: 202
    # Error Response Codes: serviceUnavailable (503),
    #                       itemNotFound (404)

    log.info("Shutdown VM %s", vm)
    if args:
        raise faults.BadRequest('Malformed Request.')
    backend.shutdown_instance(vm)
    return HttpResponse(status=202)
예제 #4
0
def shutdown(request, vm, args):
    # Normal Response Code: 202
    # Error Response Codes: serviceUnavailable (503),
    #                       itemNotFound (404)

    log.info("Shutdown VM %s", vm)
    if args:
        raise faults.BadRequest('Malformed Request.')
    backend.shutdown_instance(vm)
    return HttpResponse(status=202)
예제 #5
0
파일: servers.py 프로젝트: grnet/synnefo
def stop(server_id, shutdown_timeout=None, credentials=None,
         atomic_context=None):
    with commands.ServerCommand(
            "STOP", server_id, credentials, atomic_context) as vm:
        log.info("Stopping VM %s", vm)
        job_id = backend.shutdown_instance(
            vm, shutdown_timeout=shutdown_timeout)
        vm.record_job(job_id)
        return vm
예제 #6
0
파일: servers.py 프로젝트: vgerak/synnefo
def stop(server_id,
         shutdown_timeout=None,
         credentials=None,
         atomic_context=None):
    with commands.ServerCommand("STOP", server_id, credentials,
                                atomic_context) as vm:
        log.info("Stopping VM %s", vm)
        job_id = backend.shutdown_instance(vm,
                                           shutdown_timeout=shutdown_timeout)
        vm.record_job(job_id)
        return vm
예제 #7
0
def stop(vm, shutdown_timeout=None):
    log.info("Stopping VM %s", vm)
    return backend.shutdown_instance(vm, shutdown_timeout=shutdown_timeout)
예제 #8
0
def stop(vm, shutdown_timeout=None):
    log.info("Stopping VM %s", vm)
    return backend.shutdown_instance(vm, shutdown_timeout=shutdown_timeout)