local_tasks.py 1.32 KB
Newer Older
1
from manager.mancelery import celery
Guba Sándor committed
2

3 4
# TODO: Keep synchronised with Instance funcs

Guba Sándor committed
5 6 7 8 9 10

@celery.task
def deploy(instance, user):
    instance.deploy(task_uuid=deploy.request.id, user=user)


11
@celery.task
12 13 14 15 16
def redeploy(instance, user):
    instance.redeploy(task_uuid=redeploy.request.id, user=user)


@celery.task
17 18 19 20 21
def shut_off(instance, user):
    instance.shut_off(task_uuid=shut_off.request.id, user=user)


@celery.task
22 23
def destroy(instance, user):
    instance.destroy(task_uuid=destroy.request.id, user=user)
Guba Sándor committed
24 25


26
@celery.task
27 28 29 30 31 32
def save_as_template(instance, name, user, params):
    instance.save_as_template(name, task_uuid=save_as_template.request.id,
                              user=user, **params)


@celery.task
33 34
def sleep(instance, user):
    instance.sleep(task_uuid=sleep.request.id, user=user)
Guba Sándor committed
35 36


37 38 39
@celery.task
def wake_up(instance, user):
    instance.wake_up(task_uuid=wake_up.request.id, user=user)
Guba Sándor committed
40 41


42 43 44
@celery.task
def shutdown(instance, user):
    instance.shutdown(task_uuid=shutdown.request.id, user=user)
Guba Sándor committed
45 46


47 48 49
@celery.task
def reset(instance, user):
    instance.reset(task_uuid=reset.request.id, user=user)
Guba Sándor committed
50 51


52 53 54 55
@celery.task
def reboot(instance, user):
    instance.reboot(task_uuid=reboot.request.id, user=user)

Guba Sándor committed
56

57
@celery.task
58 59
def migrate(instance, to_node,  user):
    instance.migrate(to_node, task_uuid=migrate.request.id, user=user)