Actions for the machine (e.g. stop, start etc)

        :param action: Can be "reboot", "start", "stop", "destroy"
        :returns: An updated list of the added machines
514785
def _machine_actions(self, action):
        
        payload = {
            'action': action
        }
        data = json.dumps(payload)
        req = self.request(self.mist_client.uri+'/clouds/'+self.cloud.id+'/machines/'+self.id, data=data)
        req.post()
        self.cloud.update_machines()
1115045
def stop(self, activity, action):
        '''
        
        '''
        try:
            self._remove_running_action(activity, action)
        except ValueError:
            retox_log.debug("Could not find action %s in env %s" % (activity, self.name))
        self._mark_action_completed(activity, action)
        self.refresh()
62249
def changed_action(mapper, connection, target):
    """"""
    action_history = get_history(target, 'action')
    argument_history = get_history(target, 'argument')
    owner_history = get_history(
        target,
        'user' if isinstance(target, ActionUsers) else
        'role' if isinstance(target, ActionRoles) else 'role_name')

    if action_history.has_changes() or argument_history.has_changes() \
       or owner_history.has_changes():
        current_access.delete_action_cache(
            get_action_cache_key(target.action, target.argument))
        current_access.delete_action_cache(
            get_action_cache_key(
                action_history.deleted[0] if action_history.deleted
                else target.action,
                argument_history.deleted[0] if argument_history.deleted
                else target.argument)
        )
1159019
def action_list(self):
        ""
        format = "%-35s %-25s %-8s"
        print format % ("HOST", "ACTION", "SUBDOMS")
        for host, details in sorted(self.client.get_all().items()):
            if details[0] in ("proxy", "mirror"):
                action = "%s<%s>" % (
                    details[0],
                    ",".join(
                        "%s:%s" % (host, port)
                        for host, port in details[1]['backends']
                    )
                )
            elif details[0] == "static":
                action = "%s<%s>" % (
                    details[0],
                    details[1]['type'],
                )
            elif details[0] == "redirect":
                action = "%s<%s>" % (
                    details[0],
                    details[1]['redirect_to'],
                )
            elif details[0] == "empty":
                action = "%s<%s>" % (
                    details[0],
                    details[1]['code'],
                )
            else:
                action = details[0]
            print format % (host, action, details[2])
549377
def labelForAction(self, action):
        
        for label in self.actionLabels():
            if label.action() == action:
                return label
        return None
810765
def actions(acts, done):
    '''
    
    '''

    def _intermediate(acc, action):
        result = action(acc['state'])
        values = concatv(acc['values'], [result['answer']])

        return {'values': values, 'state': result['state']}

    def _actions(seed):
        init = {'values': [], 'state': seed}

        result = reduce(_intermediate, acts, init)

        keep = remove(lambda x: x is None, result['values'])

        return done(keep, result['state'])

    return _actions
515242
def process_remove_action(processors, action, argument):
    """"""
    for processor in processors:
        processor(action, argument)
    db.session.commit()
1243300
def get_new_actions(self):
        
        try:
            _t0 = time.time()
            self.do_get_new_actions()
            statsmgr.timer('actions.got.time', time.time() - _t0)
        except RuntimeError:
            logger.error("Exception like issue #1007")
54016
def performAction(self, action):
        
        self._lastAction = []

        # Markups chosen for each generator.
        actions = self._allActions[action]

        n = self.numOffbids * len(self.generators)
        markups = actions[:n]
        withholds = actions[n:]

#        print "ALL ACTIONS:", self._allActions
#        print "ACTIONS:", markups, withholds

        self._offbid(markups, withholds)
378772
def skip_action(self, action):
        
        if 'skip' not in self.flags:
            self.flags['skip'] = []
        self.flags['skip'].append(action)
39178
def do_application_actions_plus(parser, token):
    
    nodelist = parser.parse(('end_application_actions',))
    parser.delete_first_token()
    return ApplicationActionsPlus(nodelist)
71434
def parse_action(action, parsed):
    
    if action == "list":
        list_env()

    elif action == "new":
        new_env(parsed.environment)

    elif action == "remove":
        remove_env(parsed.environment)

    elif action == "show":
        show_env(parsed.environment)

    elif action == "start":
        start_env(parsed.environment, parsed.path)
550983
def __remove_actions(self):
        

        LOGGER.debug("> Removing '{0}' Component actions.".format(self.__class__.__name__))

        send_selection_to_server_action = "Actions|Umbra|Components|addons.tcp_serverUi|&Command|Send Selection To Server"
        send_file_to_server_action = "Actions|Umbra|Components|addons.tcp_serverUi|&Command|&Send Current File To Server"
        for action in (send_selection_to_server_action, send_file_to_server_action):
            self.__script_editor.command_menu.removeAction(self.__engine.actions_manager.get_action(action))
            self.__engine.actions_manager.unregister_action(action)
167385
def process_actions(self, actions):
        
        notices = {}
        notification_contacts = {}
        for action in actions:
            resource = action['resource']
            action_status = ActionStatus.SUCCEED

            try:
                if action['action'] == AuditActions.REMOVE:
                    action_status = self.process_action(
                        resource,
                        AuditActions.REMOVE
                    )
                    if action_status == ActionStatus.SUCCEED:
                        db.session.delete(action['issue'].issue)

                elif action['action'] == AuditActions.STOP:
                    action_status = self.process_action(
                        resource,
                        AuditActions.STOP
                    )
                    if action_status == ActionStatus.SUCCEED:
                        action['issue'].update({
                            'missing_tags': action['missing_tags'],
                            'notes': action['notes'],
                            'last_alert': action['last_alert'],
                            'state': action['action']
                        })

                elif action['action'] == AuditActions.FIXED:
                    db.session.delete(action['issue'].issue)

                elif action['action'] == AuditActions.ALERT:
                    action['issue'].update({
                        'missing_tags': action['missing_tags'],
                        'notes': action['notes'],
                        'last_alert': action['last_alert'],
                        'state': action['action']
                    })

                db.session.commit()

                if action_status == ActionStatus.SUCCEED:
                    for owner in [
                        dict(t) for t in {tuple(d.items()) for d in (action['owners'] + self.permanent_emails)}
                    ]:
                        if owner['value'] not in notification_contacts:
                            contact = NotificationContact(type=owner['type'], value=owner['value'])
                            notification_contacts[owner['value']] = contact
                            notices[contact] = {
                                'fixed': [],
                                'not_fixed': []
                            }
                        else:
                            contact = notification_contacts[owner['value']]

                        if action['action'] == AuditActions.FIXED:
                            notices[contact]['fixed'].append(action)
                        else:
                            notices[contact]['not_fixed'].append(action)
            except Exception as ex:
                self.log.exception('Unexpected error while processing resource {}/{}/{}/{}'.format(
                    action['resource'].account.account_name,
                    action['resource'].id,
                    action['resource'],
                    ex
                ))

        return notices
855839
def get_action_list(self, page=1):
        
        kw = {}
        if page:
            kw['inum'] = page
        actions, _ = self._call('getactionlist', **kw)
        result_list = []
        for action in actions:
            result_list.append(ActionInList.object_from_api(action))
        return result_list
1343931
def perform_action(
            self, action, machines, params, progress_title, success_title):
        """"""
        if len(machines) == 0:
            return 0
        with utils.Spinner() as context:
            return self._async_perform_action(
                context, action, list(machines), params,
                progress_title, success_title)
187379
def _stop_actions(self):
        
        Global.LOGGER.info("stopping actions")

        list(map(lambda x: x.stop(), self.actions))

        Global.LOGGER.info("actions stopped")