Enable flap detection for a host
        Format of the line that triggers function call::

        ENABLE_HOST_FLAP_DETECTION;<host_name>

        :param host: host to edit
        :type host: alignak.objects.host.Host
        :return: None
354781
def enable_host_flap_detection(self, host):
        
        if not host.flap_detection_enabled:
            host.modified_attributes |= \
                DICT_MODATTR["MODATTR_FLAP_DETECTION_ENABLED"].value
            host.flap_detection_enabled = True
            self.send_an_element(host.get_update_status_brok())
412578
def cli(env, identifier):
    

    dh_mgr = SoftLayer.DedicatedHostManager(env.client)

    host_id = helpers.resolve_id(dh_mgr.resolve_ids, identifier, 'dedicated host')

    if not (env.skip_confirmations or formatting.no_going_back(host_id)):
        raise exceptions.CLIAbort('Aborted')

    table = formatting.Table(['id', 'server name', 'status'])

    result = dh_mgr.cancel_guests(host_id)

    if result:
        for status in result:
            table.add_row([
                status['id'],
                status['fqdn'],
                status['status']
            ])

        env.fout(table)
    else:
        click.secho('There is not any guest into the dedicated host %s' % host_id, fg='red')
74725
def valid_hostname(host):
    
    if len(host) > 255:
        return False

    if host[-1:] == '.':
        host = host[:-1]

    return all(_hostname_re.match(c) for c in host.split('.'))
975791
def enable_host_svc_checks(self, host):
        
        for service_id in host.services:
            if service_id in self.daemon.services:
                service = self.daemon.services[service_id]
                self.enable_svc_check(service)
                self.send_an_element(service.get_update_status_brok())
371467
public void setHost( String host )
    {
        _host = null;
        if ( host != null && host.length() > 0 )
        {
            //
            // Here's some very minimal support for IPv6 addresses.
            // If the literal IPv6 address is not enclosed in square brackets
            // then add them.
            //
            boolean needBrackets = ( ( host.indexOf( ':' ) >= 0 )
                    && !host.startsWith( "[" )
                    && !host.endsWith( "]" ) );

            if ( needBrackets )
            {
                _host = '[' + host + ']';
            }
            else
            {
                _host = host;
            }

            _opaque = false;
            setSchemeSpecificPart( null );
        }

        if ( _host == null )
        {
            setUserInfo( null );
            setPort( UNDEFINED_PORT );
        }
    }
752312
def enable_passive_host_checks(self, host):
        
        if not host.passive_checks_enabled:
            host.modified_attributes |= \
                DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            host.passive_checks_enabled = True
            self.send_an_element(host.get_update_status_brok())
665956
private static void setCleanHost(Matcher matcher, List<String> hosts) {
		// get the host but might be [ipv6]
		String maybeIPv6Host = matcher.group( 1 );
		Matcher ipv6Matcher = NAKED_IPV6_PATTERN.matcher( maybeIPv6Host );
		String cleanHost = maybeIPv6Host;
		if ( ipv6Matcher.matches() ) {
			cleanHost = ipv6Matcher.group( 1 );
			if ( cleanHost == null ) {
				cleanHost = maybeIPv6Host;
			}
		}
		hosts.add( cleanHost );
	}
1039703
public static void setInputHost(Configuration conf, String host) {
        log.info("setting " + INPUT_HOST + " to " + host);
        conf.set(INPUT_HOST, host);
    }
567867
def _ipv6_host(host, scheme):
    

    # httplib doesn't like it when we include brackets in IPv6 addresses
    # Specifically, if we include brackets but also pass the port then
    # httplib crazily doubles up the square brackets on the Host header.
    # Instead, we need to make sure we never pass ``None`` as the port.
    # However, for backward compatibility reasons we can't actually
    # *assert* that.  See http://bugs.python.org/issue28539
    #
    # Also if an IPv6 address literal has a zone identifier, the
    # percent sign might be URIencoded, convert it back into ASCII
    if host.startswith('[') and host.endswith(']'):
        host = host.replace('%25', '%').strip('[]')
    if scheme in NORMALIZABLE_SCHEMES:
        host = host.lower()
    return host
1194614
function (lines, ip, host) {
    // Try to update entry, if host already exists in file
    var didUpdate = false;
    lines = lines.map(function (line) {
      if (Array.isArray(line) && line[1] === host) {
        line[0] = ip;
        didUpdate = true;
      }
      return line;
    });

    // If entry did not exist, let's add it
    if (!didUpdate) {
      lines.push([ip, host]);
    }
    return lines;
  }
1211795
public static void enableHost(String hostName) throws Exception {
        Registry myRegistry = LocateRegistry.getRegistry("127.0.0.1", port);
        com.groupon.odo.proxylib.hostsedit.rmi.Message impl = (com.groupon.odo.proxylib.hostsedit.rmi.Message) myRegistry.lookup(SERVICE_NAME);

        impl.enableHost(hostName);
    }
87075
def start_accepting_passive_host_checks(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if not self.my_conf.accept_passive_host_checks:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            self.my_conf.accept_passive_host_checks = True
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
24742
def _ipv6_host(host):
    

    # httplib doesn't like it when we include brackets in IPv6 addresses
    # Specifically, if we include brackets but also pass the port then
    # httplib crazily doubles up the square brackets on the Host header.
    # Instead, we need to make sure we never pass ``None`` as the port.
    # However, for backward compatibility reasons we can't actually
    # *assert* that.  See http://bugs.python.org/issue28539
    #
    # Also if an IPv6 address literal has a zone identifier, the
    # percent sign might be URIencoded, convert it back into ASCII
    if host.startswith('[') and host.endswith(']'):
        host = host.replace('%25', '%').strip('[]')
    return host
82455
def disable_flap_detection(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if self.my_conf.enable_flap_detection:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_FLAP_DETECTION_ENABLED"].value
            self.my_conf.enable_flap_detection = False
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
            # Is need, disable flap state for hosts and services
            for service in self.my_conf.services:
                if service.is_flapping:
                    service.is_flapping = False
                    service.flapping_changes = []
                    self.send_an_element(service.get_update_status_brok())
            for host in self.my_conf.hosts:
                if host.is_flapping:
                    host.is_flapping = False
                    host.flapping_changes = []
                    self.send_an_element(host.get_update_status_brok())
1218212
def add_exclusion(host_or_ip)
      asset = host_or_ip
      unless host_or_ip.respond_to?(:host) || host_or_ip.respond_to?(:from)
        asset = HostOrIP.convert(host_or_ip)
      end
      @asset_exclusions << asset
    end
907973
def suggest_localhost(func):
    '''
    '''
    from fabric.network import handle_prompt_abort, to_dict

    @wraps(func)
    def host_prompting_wrapper(*args, **kwargs):
        while not env.get('host_string', False):
            handle_prompt_abort("the target host connection string")
            host_string = raw_input("No hosts found. Please specify "
                                    "host string for connection [localhost]: ")
            if host_string == '':
                host_string = 'localhost'
            env.update(to_dict(host_string))
        return func(*args, **kwargs)

    host_prompting_wrapper.undecorated = func

    return host_prompting_wrapper
737076
def enable_root(host)
      if host['user'] != 'root'
        if host['platform'] =~ /f5-/
          enable_root_f5(host)
        elsif host['platform'] =~ /netscaler/
          enable_root_netscaler(host)
        else
          copy_ssh_to_root(host, @options)
          enable_root_login(host, @options)
          host['user'] = 'root'
        end
        host.close
      end
    end