Example #1
0
def get_status(job_id):
    """
    Poll the status of an active job
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    job_status = session.get_task_status(job_id)
    session.kill()
    return job_status
Example #2
0
def get_status(job_id):
    """
    Poll the status of an active job
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    job_status = session.get_task_status(job_id)
    session.kill()
    return job_status
Example #3
0
def boost_vm_cores(vm_id, cores):
    """
    Boost or deboost the VM cores
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.set_system_cpu_config(vm_id, cores)
    session.kill()
    return session.last_status, session.last_job_id
Example #4
0
def boost_vm_memory(vm_id, ram):
    """
    Boost or deboost the VM memory
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.set_system_memory_config(vm_id, ram)
    session.kill()
    return session.last_status, session.last_job_id
Example #5
0
def poweroff_vm(vm_id):
    """
    Attempt to hard-stop a VM. Returns HTTP status from attempt and job_id in
    order to obtain future progress updates
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.poweroff_vm(vm_id)
    session.kill()
    return session.last_status, session.last_job_id
Example #6
0
def shutdown_vm(vm_id):
    """
    Attempt to cleanly shutdown a VM. Returns HTTP status from attempt and job_id in
    order to obtain future progress updates
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.shutdown_vm(vm_id)
    session.kill()
    return session.last_status, session.last_job_id
Example #7
0
def restart_vm(vm_id):
    """
    Attempt to reboot a VM (soft reboot). Returns HTTP status from attempt and
    job id in order to obtain future progress updates.
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.restart_vm(vm_id)
    session.kill()
    return session.last_status, session.last_job_id
Example #8
0
def boost_vm_cores(vm_id, cores):
    """
    Boost or deboost the VM cores
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.set_system_cpu_config(vm_id, cores)
    session.kill()
    return session.last_status, session.last_job_id
Example #9
0
def boost_vm_memory(vm_id, ram):
    """
    Boost or deboost the VM memory
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.set_system_memory_config(vm_id, ram)
    session.kill()
    return session.last_status, session.last_job_id
Example #10
0
def poweroff_vm(vm_id):
    """
    Attempt to hard-stop a VM. Returns HTTP status from attempt and job_id in
    order to obtain future progress updates
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.poweroff_vm(vm_id)
    session.kill()
    return session.last_status, session.last_job_id
Example #11
0
def shutdown_vm(vm_id):
    """
    Attempt to cleanly shutdown a VM. Returns HTTP status from attempt and job_id in
    order to obtain future progress updates
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.shutdown_vm(vm_id)
    session.kill()
    return session.last_status, session.last_job_id
Example #12
0
def restart_vm(vm_id):
    """
    Attempt to reboot a VM (soft reboot). Returns HTTP status from attempt and
    job id in order to obtain future progress updates.
    """
    session = VCSession(VCD.username, VCD.password, VCD.org, VCD.endpoint)
    session.restart_vm(vm_id)
    session.kill()
    return session.last_status, session.last_job_id