示例#1
0
 def get_task_signature(cls, droplet, serialized_droplet, **kwargs):
     return chain(
         BackendMethodTask().si(
             serialized_droplet, 'restart',
             state_transition='begin_updating',
             success_runtime_state=models.Droplet.RuntimeStates.ONLINE),
         tasks.WaitForActionComplete().s(serialized_droplet).set(countdown=10))
示例#2
0
 def get_task_signature(cls, droplet, serialized_droplet, **kwargs):
     if droplet.backend_id:
         return BackendMethodTask().si(serialized_droplet,
                                       'destroy',
                                       state_transition='begin_deleting')
     else:
         return StateTransitionTask().si(serialized_droplet,
                                         state_transition='begin_deleting')
示例#3
0
 def get_task_signature(cls, droplet, serialized_droplet, **kwargs):
     return chain(
         BackendMethodTask().si(
             serialized_droplet, 'create_droplet',
             state_transition='begin_creating',
             runtime_state='provisioning',
             success_runtime_state=RuntimeStateMixin.RuntimeStates.ONLINE,
             **kwargs),
         tasks.WaitForActionComplete().s(serialized_droplet).set(countdown=30))
示例#4
0
 def get_task_signature(cls, droplet, serialized_droplet, **kwargs):
     return chain(
         BackendMethodTask().si(
             serialized_droplet,
             'stop',
             state_transition='begin_updating',
             success_runtime_state=models.Droplet.RuntimeStates.OFFLINE,
         ),
         tasks.wait_for_action_complete.s(serialized_droplet).set(
             countdown=10),
     )
示例#5
0
 def get_task_signature(cls, droplet, serialized_droplet, **kwargs):
     size = kwargs.pop('size')
     disk = kwargs.pop('disk')
     return chain(
         BackendMethodTask().si(
             serialized_droplet, 'resize',
             state_transition='begin_updating',
             runtime_state='resizing',
             success_runtime_state=models.Droplet.RuntimeStates.ONLINE,
             backend_size_id=size.backend_id,
             disk=disk),
         tasks.WaitForActionComplete().s(serialized_droplet).set(countdown=10),
         tasks.LogDropletResized().si(serialized_droplet, core_utils.serialize_instance(size)))