Archives the specified servers.

		:param action: the server action url to exec against
		:param alias: short code for a particular account.  If none will use account's default alias
		:param servers: list of server names
774807
def _ServerActions(action,alias,servers):
		
		if alias is None:  alias = clc.v1.Account.GetAlias()
		results = []
		for server in servers:
			r = clc.v1.API.Call('post','Server/%sServer' % (action), {'AccountAlias': alias, 'Name': server })
			if int(r['StatusCode']) == 0:  results.append(r)
		return(results)
1034011
def action(func=None,
           cloudmap=None,
           instances=None,
           provider=None,
           instance=None,
           opts=None,
           **kwargs):
    '''
    
    '''
    info = {}
    client = _get_client()
    if isinstance(opts, dict):
        client.opts.update(opts)
    try:
        info = client.action(
            func,
            cloudmap,
            instances,
            provider,
            instance,
            salt.utils.args.clean_kwargs(**kwargs)
        )
    except SaltCloudConfigError as err:
        log.error(err)
    return info
1190320
def run(self, name, replace=None, actions=None):
        
        self.actions = actions # incase we use group

        action = actions.get(name)
        if not action:
            self.die("Action not found: {}", name)
        action['name'] = name
        action_type = action.get('type', "none")
        try:
            func = getattr(self, '_run__' + action_type)
        except AttributeError:
            self.die("Unsupported action type " + action_type)
        try:
            return func(action, replace)
        except Exception as err: # pylint: disable=broad-except
            if self._debug:
                self.debug(traceback.format_exc())
            self.die("Error running action name={} type={} error={}",
                     name, action_type, err)
232003
def make_action(app_factory, hostname='localhost', port=5000,
                threaded=False, processes=1, stream=None,
                sort_by=('time', 'calls'), restrictions=()):
    
    def action(hostname=('h', hostname), port=('p', port),
               threaded=threaded, processes=processes):
        """Start a new development server."""
        from werkzeug.serving import run_simple
        app = ProfilerMiddleware(app_factory(), stream, sort_by, restrictions)
        run_simple(hostname, port, app, False, None, threaded, processes)
    return action
839884
def define_actions(config)
      router.member do
        config.member_actions.each { |action| build_action(action) }
      end

      router.collection do
        config.collection_actions.each { |action| build_action(action) }
        router.post :batch_action if config.batch_actions_enabled?
      end
    end
840173
def _begin_disconnection_action(self, action):
        

        conn_key = action.data['id']
        callback = action.data['callback']

        if self._get_connection_state(conn_key) != self.Idle:
            callback(conn_key, self.id, False, 'Cannot start disconnection, connection is not idle')
            return

        # Cannot be None since we checked above to make sure it exists
        data = self._get_connection(conn_key)
        data['state'] = self.Disconnecting
        data['microstate'] = None
        data['callback'] = callback
        data['timeout'] = action.timeout
1103589
def exec_before_request_actions(actions, **kwargs):
    
    groups = ("before", "before_" + flask.request.method.lower())
    return execute_actions(actions, limit_groups=groups, **kwargs)
916005
def mx_servers
      return @mx_servers if @mx_servers
      @mx_servers = []
      mx_records.each do |mx|
        @mx_servers.push(preference: mx.preference, address: mx.exchange.to_s)
      end
      @mx_servers
    end
498493
def actions(self, req_action):
    """"""
    if FLAGS.sc2_log_actions:
      for action in req_action.actions:
        sys.stderr.write(str(action))
        sys.stderr.flush()

    return self._client.send(action=req_action)
810020
def alias_command(alias_name, name, *args)
      @commands[alias_name.to_s] = command name
      @aliases[alias_name.to_s] = args
    end
508115
def _serviceActions(self) -> int:
        
        if self.aqStash:
            tm = time.perf_counter()
            if tm > self.aqNextCheck:
                earliest = float('inf')
                for d in list(self.aqStash):
                    nxt, action = d
                    if tm > nxt:
                        self.actionQueue.appendleft(action)
                        self.aqStash.remove(d)
                    if nxt < earliest:
                        earliest = nxt
                self.aqNextCheck = earliest
        count = len(self.actionQueue)
        while self.actionQueue:
            action, aid = self.actionQueue.popleft()
            assert action in self.scheduled
            if aid in self.scheduled[action]:
                self.scheduled[action].remove(aid)
                logger.trace("{} running action {} with id {}".
                             format(self, get_func_name(action), aid))
                action()
            else:
                logger.trace("{} not running cancelled action {} with id {}".
                             format(self, get_func_name(action), aid))
        return count
853620
def _begin_operation_action(self, action):
        

        conn_key = action.data['id']
        callback = action.data['callback']

        if self._get_connection_state(conn_key) != self.Idle:
            callback(conn_key, self.id, False, 'Cannot start operation, connection is not idle')
            return

        data = self._get_connection(conn_key)
        data['state'] = self.InProgress
        data['microstate'] = action.data['operation_name']
        data['action'] = action
1347026
def Execute(self, action, *args, **kw):
        
        action = self.Action(action, *args, **kw)
        result = action([], [], self)
        if isinstance(result, SCons.Errors.BuildError):
            errstr = result.errstr
            if result.filename:
                errstr = result.filename + ': ' + errstr
            sys.stderr.write("scons: *** %s\n" % errstr)
            return result.status
        else:
            return result
740179
def service(name, action):
    
    if action == 'open':
        subprocess.check_output(['ufw', 'allow', str(name)],
                                universal_newlines=True)
    elif action == 'close':
        subprocess.check_output(['ufw', 'delete', 'allow', str(name)],
                                universal_newlines=True)
    else:
        raise UFWError(("'{}' not supported, use 'allow' "
                        "or 'delete'").format(action))
1019234
function(self, op, ns, ops, options, callback) {
  if (typeof options === 'function') (callback = options), (options = {});
  options = options || {};

  // Pick a server
  let server = pickProxy(self);
  // No server found error out
  if (!server) return callback(new MongoError('no mongos proxy available'));

  if (!options.retryWrites || !options.session || !isRetryableWritesSupported(self)) {
    // Execute the command
    return server[op](ns, ops, options, callback);
  }

  // increment and assign txnNumber
  options.willRetryWrite = true;
  options.session.incrementTransactionNumber();

  server[op](ns, ops, options, (err, result) => {
    if (!err) return callback(null, result);
    if (!isRetryableError(err)) {
      return callback(err);
    }

    // Pick another server
    server = pickProxy(self);

    // No server found error out with original error
    if (!server || !isRetryableWritesSupported(server)) {
      return callback(err);
    }

    // rerun the operation
    server[op](ns, ops, options, callback);
  });
}
946331
def GetAllServers(alias=None,name_groups=False):
		
		if alias is None:  alias = clc.v1.Account.GetAlias()
		servers = []
		clc.v1.Account.GetLocations()
		for location in clc.LOCATIONS:
			try:
				r = clc.v1.API.Call('post','Server/GetAllServers', {'AccountAlias': alias, 'Location': location }, hide_errors=[5,] )
				if name_groups:  r['Servers'] = clc.v1.Group.NameGroups(r['Servers'],'HardwareGroupUUID')
				if int(r['StatusCode']) == 0:  servers += r['Servers']
			except:
				pass
		return(servers)
212550
def server_by_name(name, profile=None, **kwargs):
    '''
    
    '''
    conn = _auth(profile, **kwargs)
    return conn.server_by_name(name)