@put('/:hypervisor/:host/guests/:guest_id/power')
def power_guest(hypervisor, host, guest_id):
    response.content_type = "application/json"
    manager = create_manager(hypervisor, host)
    data = request.body.readline()
    if not data:
        abort(400, 'No data received')
    data = json.loads(data)
    state = data['state']
    if state == "force_stop":
        manager.guest_shutdown(guest_id, force=True)
    elif state == "start":
        manager.guest_start(guest_id)
    elif state == "stop":
        manager.guest_shutdown(guest_id, force=False)
    elif state == "pause":
        manager.guest_suspend(guest_id)
    elif state == "resume":
        manager.guest_resume(guest_id)

    manager.logout()

    return json.dumps({"action": state, "message": "ok"})
Initialize all valid properties.
dataset/ETHPy150Open locaweb/simplestack/src/simplestack/server.py/power_guest--crossover with--dataset/ETHPy150Open smart-on-fhir/client-py/fhirclient/models/imagingstudy.py/ImagingStudy.__init__