repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
Alignak-monitoring/alignak
alignak/util.py
filter_host_by_regex
def filter_host_by_regex(regex): """Filter for host Filter on regex :param regex: regex to filter :type regex: str :return: Filter :rtype: bool """ host_re = re.compile(regex) def inner_filter(items): """Inner filter for host. Accept if regex match host_name""" host...
python
def filter_host_by_regex(regex): """Filter for host Filter on regex :param regex: regex to filter :type regex: str :return: Filter :rtype: bool """ host_re = re.compile(regex) def inner_filter(items): """Inner filter for host. Accept if regex match host_name""" host...
[ "def", "filter_host_by_regex", "(", "regex", ")", ":", "host_re", "=", "re", ".", "compile", "(", "regex", ")", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for host. Accept if regex match host_name\"\"\"", "host", "=", "items", "[", "\"host\""...
Filter for host Filter on regex :param regex: regex to filter :type regex: str :return: Filter :rtype: bool
[ "Filter", "for", "host", "Filter", "on", "regex" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L958-L976
Alignak-monitoring/alignak
alignak/util.py
filter_host_by_group
def filter_host_by_group(group): """Filter for host Filter on group :param group: group name to filter :type group: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if group in host.hostgroups""" host = items["host"] ...
python
def filter_host_by_group(group): """Filter for host Filter on group :param group: group name to filter :type group: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if group in host.hostgroups""" host = items["host"] ...
[ "def", "filter_host_by_group", "(", "group", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for host. Accept if group in host.hostgroups\"\"\"", "host", "=", "items", "[", "\"host\"", "]", "if", "host", "is", "None", ":", "return", "Fal...
Filter for host Filter on group :param group: group name to filter :type group: str :return: Filter :rtype: bool
[ "Filter", "for", "host", "Filter", "on", "group" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L979-L996
Alignak-monitoring/alignak
alignak/util.py
filter_host_by_tag
def filter_host_by_tag(tpl): """Filter for host Filter on tag :param tpl: tag to filter :type tpl: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if tag in host.tags""" host = items["host"] if host is None: ...
python
def filter_host_by_tag(tpl): """Filter for host Filter on tag :param tpl: tag to filter :type tpl: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if tag in host.tags""" host = items["host"] if host is None: ...
[ "def", "filter_host_by_tag", "(", "tpl", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for host. Accept if tag in host.tags\"\"\"", "host", "=", "items", "[", "\"host\"", "]", "if", "host", "is", "None", ":", "return", "False", "retu...
Filter for host Filter on tag :param tpl: tag to filter :type tpl: str :return: Filter :rtype: bool
[ "Filter", "for", "host", "Filter", "on", "tag" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L999-L1016
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_name
def filter_service_by_name(name): """Filter for service Filter on name :param name: name to filter :type name: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if service_description == name""" service = items["service"] ...
python
def filter_service_by_name(name): """Filter for service Filter on name :param name: name to filter :type name: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if service_description == name""" service = items["service"] ...
[ "def", "filter_service_by_name", "(", "name", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if service_description == name\"\"\"", "service", "=", "items", "[", "\"service\"", "]", "if", "service", "is", "None", ":", ...
Filter for service Filter on name :param name: name to filter :type name: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "name" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1019-L1036
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_regex_name
def filter_service_by_regex_name(regex): """Filter for service Filter on regex :param regex: regex to filter :type regex: str :return: Filter :rtype: bool """ host_re = re.compile(regex) def inner_filter(items): """Inner filter for service. Accept if regex match service_des...
python
def filter_service_by_regex_name(regex): """Filter for service Filter on regex :param regex: regex to filter :type regex: str :return: Filter :rtype: bool """ host_re = re.compile(regex) def inner_filter(items): """Inner filter for service. Accept if regex match service_des...
[ "def", "filter_service_by_regex_name", "(", "regex", ")", ":", "host_re", "=", "re", ".", "compile", "(", "regex", ")", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if regex match service_description\"\"\"", "service", "=", "ite...
Filter for service Filter on regex :param regex: regex to filter :type regex: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "regex" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1039-L1057
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_host_name
def filter_service_by_host_name(host_name): """Filter for service Filter on host_name :param host_name: host_name to filter :type host_name: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if service.host.host_name == host_name"...
python
def filter_service_by_host_name(host_name): """Filter for service Filter on host_name :param host_name: host_name to filter :type host_name: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if service.host.host_name == host_name"...
[ "def", "filter_service_by_host_name", "(", "host_name", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if service.host.host_name == host_name\"\"\"", "service", "=", "items", "[", "\"service\"", "]", "host", "=", "items", ...
Filter for service Filter on host_name :param host_name: host_name to filter :type host_name: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "host_name" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1060-L1078
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_regex_host_name
def filter_service_by_regex_host_name(regex): """Filter for service Filter on regex host_name :param regex: regex to filter :type regex: str :return: Filter :rtype: bool """ host_re = re.compile(regex) def inner_filter(items): """Inner filter for service. Accept if regex ma...
python
def filter_service_by_regex_host_name(regex): """Filter for service Filter on regex host_name :param regex: regex to filter :type regex: str :return: Filter :rtype: bool """ host_re = re.compile(regex) def inner_filter(items): """Inner filter for service. Accept if regex ma...
[ "def", "filter_service_by_regex_host_name", "(", "regex", ")", ":", "host_re", "=", "re", ".", "compile", "(", "regex", ")", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if regex match service.host.host_name\"\"\"", "service", "="...
Filter for service Filter on regex host_name :param regex: regex to filter :type regex: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "regex", "host_name" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1081-L1100
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_hostgroup_name
def filter_service_by_hostgroup_name(group): """Filter for service Filter on hostgroup :param group: hostgroup to filter :type group: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if hostgroup in service.host.hostgroups""" ...
python
def filter_service_by_hostgroup_name(group): """Filter for service Filter on hostgroup :param group: hostgroup to filter :type group: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if hostgroup in service.host.hostgroups""" ...
[ "def", "filter_service_by_hostgroup_name", "(", "group", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if hostgroup in service.host.hostgroups\"\"\"", "service", "=", "items", "[", "\"service\"", "]", "host", "=", "items", ...
Filter for service Filter on hostgroup :param group: hostgroup to filter :type group: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "hostgroup" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1103-L1121
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_host_tag_name
def filter_service_by_host_tag_name(tpl): """Filter for service Filter on tag :param tpl: tag to filter :type tpl: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if tpl in service.host.tags""" service = items["service"]...
python
def filter_service_by_host_tag_name(tpl): """Filter for service Filter on tag :param tpl: tag to filter :type tpl: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if tpl in service.host.tags""" service = items["service"]...
[ "def", "filter_service_by_host_tag_name", "(", "tpl", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if tpl in service.host.tags\"\"\"", "service", "=", "items", "[", "\"service\"", "]", "host", "=", "items", "[", "\"hos...
Filter for service Filter on tag :param tpl: tag to filter :type tpl: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "tag" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1124-L1142
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_servicegroup_name
def filter_service_by_servicegroup_name(group): """Filter for service Filter on group :param group: group to filter :type group: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if group in service.servicegroups""" servic...
python
def filter_service_by_servicegroup_name(group): """Filter for service Filter on group :param group: group to filter :type group: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if group in service.servicegroups""" servic...
[ "def", "filter_service_by_servicegroup_name", "(", "group", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if group in service.servicegroups\"\"\"", "service", "=", "items", "[", "\"service\"", "]", "if", "service", "is", ...
Filter for service Filter on group :param group: group to filter :type group: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "group" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1145-L1162
Alignak-monitoring/alignak
alignak/util.py
filter_host_by_bp_rule_label
def filter_host_by_bp_rule_label(label): """Filter for host Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if label in host.labels""" host = items["host"] ...
python
def filter_host_by_bp_rule_label(label): """Filter for host Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for host. Accept if label in host.labels""" host = items["host"] ...
[ "def", "filter_host_by_bp_rule_label", "(", "label", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for host. Accept if label in host.labels\"\"\"", "host", "=", "items", "[", "\"host\"", "]", "if", "host", "is", "None", ":", "return", ...
Filter for host Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool
[ "Filter", "for", "host", "Filter", "on", "label" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1165-L1182
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_host_bp_rule_label
def filter_service_by_host_bp_rule_label(label): """Filter for service Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if label in service.host.labels""" service...
python
def filter_service_by_host_bp_rule_label(label): """Filter for service Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if label in service.host.labels""" service...
[ "def", "filter_service_by_host_bp_rule_label", "(", "label", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if label in service.host.labels\"\"\"", "service", "=", "items", "[", "\"service\"", "]", "host", "=", "items", "[...
Filter for service Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "label" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1185-L1203
Alignak-monitoring/alignak
alignak/util.py
filter_service_by_bp_rule_label
def filter_service_by_bp_rule_label(label): """Filter for service Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if label in service.labels""" service = items["s...
python
def filter_service_by_bp_rule_label(label): """Filter for service Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool """ def inner_filter(items): """Inner filter for service. Accept if label in service.labels""" service = items["s...
[ "def", "filter_service_by_bp_rule_label", "(", "label", ")", ":", "def", "inner_filter", "(", "items", ")", ":", "\"\"\"Inner filter for service. Accept if label in service.labels\"\"\"", "service", "=", "items", "[", "\"service\"", "]", "if", "service", "is", "None", "...
Filter for service Filter on label :param label: label to filter :type label: str :return: Filter :rtype: bool
[ "Filter", "for", "service", "Filter", "on", "label" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1206-L1222
Alignak-monitoring/alignak
alignak/util.py
parse_daemon_args
def parse_daemon_args(arbiter=False): """Generic parsing function for daemons All daemons: '-n', "--name": Set the name of the daemon to pick in the configuration files. This allows an arbiter to find its own configuration in the whole Alignak configuration Using this parameter is manda...
python
def parse_daemon_args(arbiter=False): """Generic parsing function for daemons All daemons: '-n', "--name": Set the name of the daemon to pick in the configuration files. This allows an arbiter to find its own configuration in the whole Alignak configuration Using this parameter is manda...
[ "def", "parse_daemon_args", "(", "arbiter", "=", "False", ")", ":", "parser", "=", "argparse", ".", "ArgumentParser", "(", "description", "=", "\"Alignak version %s daemon parameters\"", "%", "VERSION", ",", "epilog", "=", "\"And that's it!\"", ")", "if", "arbiter",...
Generic parsing function for daemons All daemons: '-n', "--name": Set the name of the daemon to pick in the configuration files. This allows an arbiter to find its own configuration in the whole Alignak configuration Using this parameter is mandatory for all the daemons except for the arbit...
[ "Generic", "parsing", "function", "for", "daemons" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/util.py#L1240-L1353
Alignak-monitoring/alignak
alignak/worker.py
Worker.manage_signal
def manage_signal(self, sig, frame): # pylint: disable=unused-argument """Manage signals caught by the process but I do not do anything... our master daemon is managing our termination. :param sig: signal caught by daemon :type sig: str :param frame: current stack frame ...
python
def manage_signal(self, sig, frame): # pylint: disable=unused-argument """Manage signals caught by the process but I do not do anything... our master daemon is managing our termination. :param sig: signal caught by daemon :type sig: str :param frame: current stack frame ...
[ "def", "manage_signal", "(", "self", ",", "sig", ",", "frame", ")", ":", "# pylint: disable=unused-argument", "logger", ".", "info", "(", "\"worker '%s' (pid=%d) received a signal: %s\"", ",", "self", ".", "_id", ",", "os", ".", "getpid", "(", ")", ",", "SIGNALS...
Manage signals caught by the process but I do not do anything... our master daemon is managing our termination. :param sig: signal caught by daemon :type sig: str :param frame: current stack frame :type frame: :return: None
[ "Manage", "signals", "caught", "by", "the", "process", "but", "I", "do", "not", "do", "anything", "...", "our", "master", "daemon", "is", "managing", "our", "termination", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L183-L196
Alignak-monitoring/alignak
alignak/worker.py
Worker.set_exit_handler
def set_exit_handler(self): """Set the signal handler to manage_signal (defined in this class) Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2 :return: None """ signal.signal(signal.SIGINT, self.manage_signal) signal.signal(signal.SIGT...
python
def set_exit_handler(self): """Set the signal handler to manage_signal (defined in this class) Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2 :return: None """ signal.signal(signal.SIGINT, self.manage_signal) signal.signal(signal.SIGT...
[ "def", "set_exit_handler", "(", "self", ")", ":", "signal", ".", "signal", "(", "signal", ".", "SIGINT", ",", "self", ".", "manage_signal", ")", "signal", ".", "signal", "(", "signal", ".", "SIGTERM", ",", "self", ".", "manage_signal", ")", "signal", "."...
Set the signal handler to manage_signal (defined in this class) Only set handlers for signal.SIGTERM, signal.SIGINT, signal.SIGUSR1, signal.SIGUSR2 :return: None
[ "Set", "the", "signal", "handler", "to", "manage_signal", "(", "defined", "in", "this", "class", ")", "Only", "set", "handlers", "for", "signal", ".", "SIGTERM", "signal", ".", "SIGINT", "signal", ".", "SIGUSR1", "signal", ".", "SIGUSR2" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L198-L207
Alignak-monitoring/alignak
alignak/worker.py
Worker.get_new_checks
def get_new_checks(self, queue, return_queue): """Get new checks if less than nb_checks_max If no new checks got and no check in queue, sleep for 1 sec REF: doc/alignak-action-queues.png (3) :return: None """ try: logger.debug("get_new_checks: %s / %s", len(s...
python
def get_new_checks(self, queue, return_queue): """Get new checks if less than nb_checks_max If no new checks got and no check in queue, sleep for 1 sec REF: doc/alignak-action-queues.png (3) :return: None """ try: logger.debug("get_new_checks: %s / %s", len(s...
[ "def", "get_new_checks", "(", "self", ",", "queue", ",", "return_queue", ")", ":", "try", ":", "logger", ".", "debug", "(", "\"get_new_checks: %s / %s\"", ",", "len", "(", "self", ".", "checks", ")", ",", "self", ".", "processes_by_worker", ")", "while", "...
Get new checks if less than nb_checks_max If no new checks got and no check in queue, sleep for 1 sec REF: doc/alignak-action-queues.png (3) :return: None
[ "Get", "new", "checks", "if", "less", "than", "nb_checks_max", "If", "no", "new", "checks", "got", "and", "no", "check", "in", "queue", "sleep", "for", "1", "sec", "REF", ":", "doc", "/", "alignak", "-", "action", "-", "queues", ".", "png", "(", "3",...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L241-L280
Alignak-monitoring/alignak
alignak/worker.py
Worker.launch_new_checks
def launch_new_checks(self): """Launch checks that are in status REF: doc/alignak-action-queues.png (4) :return: None """ # queue for chk in self.checks: if chk.status not in [ACT_STATUS_QUEUED]: continue logger.debug("Launch check...
python
def launch_new_checks(self): """Launch checks that are in status REF: doc/alignak-action-queues.png (4) :return: None """ # queue for chk in self.checks: if chk.status not in [ACT_STATUS_QUEUED]: continue logger.debug("Launch check...
[ "def", "launch_new_checks", "(", "self", ")", ":", "# queue", "for", "chk", "in", "self", ".", "checks", ":", "if", "chk", ".", "status", "not", "in", "[", "ACT_STATUS_QUEUED", "]", ":", "continue", "logger", ".", "debug", "(", "\"Launch check: %s\"", ",",...
Launch checks that are in status REF: doc/alignak-action-queues.png (4) :return: None
[ "Launch", "checks", "that", "are", "in", "status", "REF", ":", "doc", "/", "alignak", "-", "action", "-", "queues", ".", "png", "(", "4", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L282-L303
Alignak-monitoring/alignak
alignak/worker.py
Worker.manage_finished_checks
def manage_finished_checks(self, queue): """Check the status of checks if done, return message finished :) REF: doc/alignak-action-queues.png (5) :return: None """ to_del = [] wait_time = 1.0 now = time.time() logger.debug("--- manage finished che...
python
def manage_finished_checks(self, queue): """Check the status of checks if done, return message finished :) REF: doc/alignak-action-queues.png (5) :return: None """ to_del = [] wait_time = 1.0 now = time.time() logger.debug("--- manage finished che...
[ "def", "manage_finished_checks", "(", "self", ",", "queue", ")", ":", "to_del", "=", "[", "]", "wait_time", "=", "1.0", "now", "=", "time", ".", "time", "(", ")", "logger", ".", "debug", "(", "\"--- manage finished checks\"", ")", "for", "action", "in", ...
Check the status of checks if done, return message finished :) REF: doc/alignak-action-queues.png (5) :return: None
[ "Check", "the", "status", "of", "checks", "if", "done", "return", "message", "finished", ":", ")", "REF", ":", "doc", "/", "alignak", "-", "action", "-", "queues", ".", "png", "(", "5", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L305-L341
Alignak-monitoring/alignak
alignak/worker.py
Worker.check_for_system_time_change
def check_for_system_time_change(self): # pragma: no cover, hardly testable with unit tests... """Check if our system time change. If so, change our :return: 0 if the difference < 900, difference else :rtype: int """ now = time.time() difference = now - self.t_each_loop...
python
def check_for_system_time_change(self): # pragma: no cover, hardly testable with unit tests... """Check if our system time change. If so, change our :return: 0 if the difference < 900, difference else :rtype: int """ now = time.time() difference = now - self.t_each_loop...
[ "def", "check_for_system_time_change", "(", "self", ")", ":", "# pragma: no cover, hardly testable with unit tests...", "now", "=", "time", ".", "time", "(", ")", "difference", "=", "now", "-", "self", ".", "t_each_loop", "# Now set the new value for the tick loop", "self...
Check if our system time change. If so, change our :return: 0 if the difference < 900, difference else :rtype: int
[ "Check", "if", "our", "system", "time", "change", ".", "If", "so", "change", "our" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L343-L360
Alignak-monitoring/alignak
alignak/worker.py
Worker.work
def work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover """Wrapper function for do_work in order to catch the exception to see the real work, look at do_work :param actions_queue: Global Queue Master->Slave :type actions_queue: Queue.Queue :param re...
python
def work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover """Wrapper function for do_work in order to catch the exception to see the real work, look at do_work :param actions_queue: Global Queue Master->Slave :type actions_queue: Queue.Queue :param re...
[ "def", "work", "(", "self", ",", "actions_queue", ",", "returns_queue", ",", "control_queue", "=", "None", ")", ":", "# pragma: no cover", "try", ":", "logger", ".", "info", "(", "\"[%s] (pid=%d) starting my job...\"", ",", "self", ".", "_id", ",", "os", ".", ...
Wrapper function for do_work in order to catch the exception to see the real work, look at do_work :param actions_queue: Global Queue Master->Slave :type actions_queue: Queue.Queue :param returns_queue: queue managed by manager :type returns_queue: Queue.Queue :return: N...
[ "Wrapper", "function", "for", "do_work", "in", "order", "to", "catch", "the", "exception", "to", "see", "the", "real", "work", "look", "at", "do_work" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L362-L384
Alignak-monitoring/alignak
alignak/worker.py
Worker.do_work
def do_work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover """Main function of the worker. * Get checks * Launch new checks * Manage finished checks :param actions_queue: Global Queue Master->Slave :type actions_queue: Queue.Queue :p...
python
def do_work(self, actions_queue, returns_queue, control_queue=None): # pragma: no cover """Main function of the worker. * Get checks * Launch new checks * Manage finished checks :param actions_queue: Global Queue Master->Slave :type actions_queue: Queue.Queue :p...
[ "def", "do_work", "(", "self", ",", "actions_queue", ",", "returns_queue", ",", "control_queue", "=", "None", ")", ":", "# pragma: no cover", "# restore default signal handler for the workers:", "# signal.signal(signal.SIGTERM, signal.SIG_DFL)", "self", ".", "interrupted", "=...
Main function of the worker. * Get checks * Launch new checks * Manage finished checks :param actions_queue: Global Queue Master->Slave :type actions_queue: Queue.Queue :param returns_queue: queue managed by manager :type returns_queue: Queue.Queue :retur...
[ "Main", "function", "of", "the", "worker", ".", "*", "Get", "checks", "*", "Launch", "new", "checks", "*", "Manage", "finished", "checks" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/worker.py#L386-L466
Alignak-monitoring/alignak
setup.py
read_requirements
def read_requirements(filename='requirements.txt'): """Reads the list of requirements from given file. :param filename: Filename to read the requirements from. Uses ``'requirements.txt'`` by default. :return: Requirments as list of strings. """ # allow for some leeway with the...
python
def read_requirements(filename='requirements.txt'): """Reads the list of requirements from given file. :param filename: Filename to read the requirements from. Uses ``'requirements.txt'`` by default. :return: Requirments as list of strings. """ # allow for some leeway with the...
[ "def", "read_requirements", "(", "filename", "=", "'requirements.txt'", ")", ":", "# allow for some leeway with the argument", "if", "not", "filename", ".", "startswith", "(", "'requirements'", ")", ":", "filename", "=", "'requirements-'", "+", "filename", "if", "not"...
Reads the list of requirements from given file. :param filename: Filename to read the requirements from. Uses ``'requirements.txt'`` by default. :return: Requirments as list of strings.
[ "Reads", "the", "list", "of", "requirements", "from", "given", "file", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/setup.py#L21-L48
Alignak-monitoring/alignak
alignak/objects/item.py
Item.init_running_properties
def init_running_properties(self): """ Initialize the running_properties. Each instance have own property. :return: None """ for prop, entry in list(self.__class__.running_properties.items()): val = entry.default # Make a copy of the value for com...
python
def init_running_properties(self): """ Initialize the running_properties. Each instance have own property. :return: None """ for prop, entry in list(self.__class__.running_properties.items()): val = entry.default # Make a copy of the value for com...
[ "def", "init_running_properties", "(", "self", ")", ":", "for", "prop", ",", "entry", "in", "list", "(", "self", ".", "__class__", ".", "running_properties", ".", "items", "(", ")", ")", ":", "val", "=", "entry", ".", "default", "# Make a copy of the value f...
Initialize the running_properties. Each instance have own property. :return: None
[ "Initialize", "the", "running_properties", ".", "Each", "instance", "have", "own", "property", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L247-L258
Alignak-monitoring/alignak
alignak/objects/item.py
Item.copy
def copy(self): """ Get a copy of this item but with a new id :return: copy of this object with a new id :rtype: object """ # New dummy item with it's own running properties copied_item = self.__class__({}) # Now, copy the properties for prop in s...
python
def copy(self): """ Get a copy of this item but with a new id :return: copy of this object with a new id :rtype: object """ # New dummy item with it's own running properties copied_item = self.__class__({}) # Now, copy the properties for prop in s...
[ "def", "copy", "(", "self", ")", ":", "# New dummy item with it's own running properties", "copied_item", "=", "self", ".", "__class__", "(", "{", "}", ")", "# Now, copy the properties", "for", "prop", "in", "self", ".", "__class__", ".", "properties", ":", "if", ...
Get a copy of this item but with a new id :return: copy of this object with a new id :rtype: object
[ "Get", "a", "copy", "of", "this", "item", "but", "with", "a", "new", "id" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L260-L287
Alignak-monitoring/alignak
alignak/objects/item.py
Item.clean
def clean(self): """ Clean properties only needed for initialization and configuration :return: None """ for prop in ('imported_from', 'use', 'plus', 'templates', 'register'): try: delattr(self, prop) except AttributeError: ...
python
def clean(self): """ Clean properties only needed for initialization and configuration :return: None """ for prop in ('imported_from', 'use', 'plus', 'templates', 'register'): try: delattr(self, prop) except AttributeError: ...
[ "def", "clean", "(", "self", ")", ":", "for", "prop", "in", "(", "'imported_from'", ",", "'use'", ",", "'plus'", ",", "'templates'", ",", "'register'", ")", ":", "try", ":", "delattr", "(", "self", ",", "prop", ")", "except", "AttributeError", ":", "pa...
Clean properties only needed for initialization and configuration :return: None
[ "Clean", "properties", "only", "needed", "for", "initialization", "and", "configuration" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L289-L305
Alignak-monitoring/alignak
alignak/objects/item.py
Item.serialize
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here is the generic function that simply export attributes declared in the properties dictionary and the running_properties of the object...
python
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here is the generic function that simply export attributes declared in the properties dictionary and the running_properties of the object...
[ "def", "serialize", "(", "self", ")", ":", "cls", "=", "self", ".", "__class__", "# id is not in *_properties", "res", "=", "{", "'uuid'", ":", "self", ".", "uuid", "}", "for", "prop", "in", "cls", ".", "properties", ":", "if", "hasattr", "(", "self", ...
This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here is the generic function that simply export attributes declared in the properties dictionary and the running_properties of the object. :return: Dictionary c...
[ "This", "function", "serialize", "into", "a", "simple", "dict", "object", ".", "It", "is", "used", "when", "transferring", "data", "to", "other", "daemons", "over", "the", "network", "(", "http", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L327-L347
Alignak-monitoring/alignak
alignak/objects/item.py
Item.load_global_conf
def load_global_conf(cls, global_configuration): """ Apply global Alignak configuration. Some objects inherit some properties from the global configuration if they do not define their own value. E.g. the global 'accept_passive_service_checks' is inherited by the services as 'acc...
python
def load_global_conf(cls, global_configuration): """ Apply global Alignak configuration. Some objects inherit some properties from the global configuration if they do not define their own value. E.g. the global 'accept_passive_service_checks' is inherited by the services as 'acc...
[ "def", "load_global_conf", "(", "cls", ",", "global_configuration", ")", ":", "logger", ".", "debug", "(", "\"Propagate global parameter for %s:\"", ",", "cls", ")", "for", "prop", ",", "entry", "in", "global_configuration", ".", "properties", ".", "items", "(", ...
Apply global Alignak configuration. Some objects inherit some properties from the global configuration if they do not define their own value. E.g. the global 'accept_passive_service_checks' is inherited by the services as 'accept_passive_checks' :param cls: parent object :type ...
[ "Apply", "global", "Alignak", "configuration", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L350-L378
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_templates
def get_templates(self): """ Get list of templates this object use :return: list of templates :rtype: list """ use = getattr(self, 'use', '') if isinstance(use, list): return [n.strip() for n in use if n.strip()] return [n.strip() for n in us...
python
def get_templates(self): """ Get list of templates this object use :return: list of templates :rtype: list """ use = getattr(self, 'use', '') if isinstance(use, list): return [n.strip() for n in use if n.strip()] return [n.strip() for n in us...
[ "def", "get_templates", "(", "self", ")", ":", "use", "=", "getattr", "(", "self", ",", "'use'", ",", "''", ")", "if", "isinstance", "(", "use", ",", "list", ")", ":", "return", "[", "n", ".", "strip", "(", ")", "for", "n", "in", "use", "if", "...
Get list of templates this object use :return: list of templates :rtype: list
[ "Get", "list", "of", "templates", "this", "object", "use" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L380-L391
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_all_plus_and_delete
def get_all_plus_and_delete(self): """ Get all self.plus items of list. We copy it, delete the original and return the copy list :return: list of self.plus :rtype: list """ res = {} props = list(self.plus.keys()) # we delete entries, so no for ... in ... ...
python
def get_all_plus_and_delete(self): """ Get all self.plus items of list. We copy it, delete the original and return the copy list :return: list of self.plus :rtype: list """ res = {} props = list(self.plus.keys()) # we delete entries, so no for ... in ... ...
[ "def", "get_all_plus_and_delete", "(", "self", ")", ":", "res", "=", "{", "}", "props", "=", "list", "(", "self", ".", "plus", ".", "keys", "(", ")", ")", "# we delete entries, so no for ... in ...", "for", "prop", "in", "props", ":", "res", "[", "prop", ...
Get all self.plus items of list. We copy it, delete the original and return the copy list :return: list of self.plus :rtype: list
[ "Get", "all", "self", ".", "plus", "items", "of", "list", ".", "We", "copy", "it", "delete", "the", "original", "and", "return", "the", "copy", "list" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L409-L420
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_plus_and_delete
def get_plus_and_delete(self, prop): """ get a copy of the property (parameter) in self.plus, delete the original and return the value of copy :param prop: a property :type prop: str :return: return the value of the property :rtype: str """ val = ...
python
def get_plus_and_delete(self, prop): """ get a copy of the property (parameter) in self.plus, delete the original and return the value of copy :param prop: a property :type prop: str :return: return the value of the property :rtype: str """ val = ...
[ "def", "get_plus_and_delete", "(", "self", ",", "prop", ")", ":", "val", "=", "self", ".", "plus", "[", "prop", "]", "del", "self", ".", "plus", "[", "prop", "]", "return", "val" ]
get a copy of the property (parameter) in self.plus, delete the original and return the value of copy :param prop: a property :type prop: str :return: return the value of the property :rtype: str
[ "get", "a", "copy", "of", "the", "property", "(", "parameter", ")", "in", "self", ".", "plus", "delete", "the", "original", "and", "return", "the", "value", "of", "copy" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L422-L434
Alignak-monitoring/alignak
alignak/objects/item.py
Item.add_error
def add_error(self, txt): """Add a message in the configuration errors list so we can print them all in one place Set the object configuration as not correct :param txt: error message :type txt: str :return: None """ self.configuration_errors.append(tx...
python
def add_error(self, txt): """Add a message in the configuration errors list so we can print them all in one place Set the object configuration as not correct :param txt: error message :type txt: str :return: None """ self.configuration_errors.append(tx...
[ "def", "add_error", "(", "self", ",", "txt", ")", ":", "self", ".", "configuration_errors", ".", "append", "(", "txt", ")", "self", ".", "conf_is_correct", "=", "False" ]
Add a message in the configuration errors list so we can print them all in one place Set the object configuration as not correct :param txt: error message :type txt: str :return: None
[ "Add", "a", "message", "in", "the", "configuration", "errors", "list", "so", "we", "can", "print", "them", "all", "in", "one", "place" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L436-L447
Alignak-monitoring/alignak
alignak/objects/item.py
Item.is_correct
def is_correct(self): """ Check if this object is correct This function: - checks if the required properties are defined, ignoring special_properties if some exist - logs the previously found warnings and errors :return: True if it's correct, otherwise False :rt...
python
def is_correct(self): """ Check if this object is correct This function: - checks if the required properties are defined, ignoring special_properties if some exist - logs the previously found warnings and errors :return: True if it's correct, otherwise False :rt...
[ "def", "is_correct", "(", "self", ")", ":", "state", "=", "self", ".", "conf_is_correct", "properties", "=", "self", ".", "__class__", ".", "properties", "for", "prop", ",", "entry", "in", "list", "(", "properties", ".", "items", "(", ")", ")", ":", "i...
Check if this object is correct This function: - checks if the required properties are defined, ignoring special_properties if some exist - logs the previously found warnings and errors :return: True if it's correct, otherwise False :rtype: bool
[ "Check", "if", "this", "object", "is", "correct" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L459-L481
Alignak-monitoring/alignak
alignak/objects/item.py
Item.old_properties_names_to_new
def old_properties_names_to_new(self): """ This function is used by service and hosts to transform Nagios2 parameters to Nagios3 ones, like normal_check_interval to check_interval. There is a old_parameters tab in Classes that give such modifications to do. :return: None ...
python
def old_properties_names_to_new(self): """ This function is used by service and hosts to transform Nagios2 parameters to Nagios3 ones, like normal_check_interval to check_interval. There is a old_parameters tab in Classes that give such modifications to do. :return: None ...
[ "def", "old_properties_names_to_new", "(", "self", ")", ":", "old_properties", "=", "getattr", "(", "self", ".", "__class__", ",", "\"old_properties\"", ",", "{", "}", ")", "for", "old_name", ",", "new_name", "in", "list", "(", "old_properties", ".", "items", ...
This function is used by service and hosts to transform Nagios2 parameters to Nagios3 ones, like normal_check_interval to check_interval. There is a old_parameters tab in Classes that give such modifications to do. :return: None
[ "This", "function", "is", "used", "by", "service", "and", "hosts", "to", "transform", "Nagios2", "parameters", "to", "Nagios3", "ones", "like", "normal_check_interval", "to", "check_interval", ".", "There", "is", "a", "old_parameters", "tab", "in", "Classes", "t...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L483-L498
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_raw_import_values
def get_raw_import_values(self): # pragma: no cover, never used """ Get properties => values of this object TODO: never called anywhere, still useful? :return: dictionary of properties => values :rtype: dict """ res = {} properties = list(self.__class__...
python
def get_raw_import_values(self): # pragma: no cover, never used """ Get properties => values of this object TODO: never called anywhere, still useful? :return: dictionary of properties => values :rtype: dict """ res = {} properties = list(self.__class__...
[ "def", "get_raw_import_values", "(", "self", ")", ":", "# pragma: no cover, never used", "res", "=", "{", "}", "properties", "=", "list", "(", "self", ".", "__class__", ".", "properties", ".", "keys", "(", ")", ")", "# Register is not by default in the properties", ...
Get properties => values of this object TODO: never called anywhere, still useful? :return: dictionary of properties => values :rtype: dict
[ "Get", "properties", "=", ">", "values", "of", "this", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L500-L519
Alignak-monitoring/alignak
alignak/objects/item.py
Item.del_downtime
def del_downtime(self, downtime_id): """ Delete a downtime in this object :param downtime_id: id of the downtime to delete :type downtime_id: int :return: None """ if downtime_id in self.downtimes: self.downtimes[downtime_id].can_be_deleted = True ...
python
def del_downtime(self, downtime_id): """ Delete a downtime in this object :param downtime_id: id of the downtime to delete :type downtime_id: int :return: None """ if downtime_id in self.downtimes: self.downtimes[downtime_id].can_be_deleted = True ...
[ "def", "del_downtime", "(", "self", ",", "downtime_id", ")", ":", "if", "downtime_id", "in", "self", ".", "downtimes", ":", "self", ".", "downtimes", "[", "downtime_id", "]", ".", "can_be_deleted", "=", "True", "del", "self", ".", "downtimes", "[", "downti...
Delete a downtime in this object :param downtime_id: id of the downtime to delete :type downtime_id: int :return: None
[ "Delete", "a", "downtime", "in", "this", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L531-L541
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_property_value_for_brok
def get_property_value_for_brok(self, prop, tab): """ Get the property of an object and brok_transformation if needed and return the value :param prop: property name :type prop: str :param tab: object with all properties of an object :type tab: object :return: va...
python
def get_property_value_for_brok(self, prop, tab): """ Get the property of an object and brok_transformation if needed and return the value :param prop: property name :type prop: str :param tab: object with all properties of an object :type tab: object :return: va...
[ "def", "get_property_value_for_brok", "(", "self", ",", "prop", ",", "tab", ")", ":", "entry", "=", "tab", "[", "prop", "]", "# Get the current value, or the default if need", "value", "=", "getattr", "(", "self", ",", "prop", ",", "entry", ".", "default", ")"...
Get the property of an object and brok_transformation if needed and return the value :param prop: property name :type prop: str :param tab: object with all properties of an object :type tab: object :return: value of the property original or brok converted :rtype: str
[ "Get", "the", "property", "of", "an", "object", "and", "brok_transformation", "if", "needed", "and", "return", "the", "value" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L564-L585
Alignak-monitoring/alignak
alignak/objects/item.py
Item.fill_data_brok_from
def fill_data_brok_from(self, data, brok_type): """ Add properties to 'data' parameter with properties of this object when 'brok_type' parameter is defined in fill_brok of these properties :param data: object to fill :type data: object :param brok_type: name of brok_type...
python
def fill_data_brok_from(self, data, brok_type): """ Add properties to 'data' parameter with properties of this object when 'brok_type' parameter is defined in fill_brok of these properties :param data: object to fill :type data: object :param brok_type: name of brok_type...
[ "def", "fill_data_brok_from", "(", "self", ",", "data", ",", "brok_type", ")", ":", "cls", "=", "self", ".", "__class__", "# Configuration properties", "for", "prop", ",", "entry", "in", "list", "(", "cls", ".", "properties", ".", "items", "(", ")", ")", ...
Add properties to 'data' parameter with properties of this object when 'brok_type' parameter is defined in fill_brok of these properties :param data: object to fill :type data: object :param brok_type: name of brok_type :type brok_type: var :return: None
[ "Add", "properties", "to", "data", "parameter", "with", "properties", "of", "this", "object", "when", "brok_type", "parameter", "is", "defined", "in", "fill_brok", "of", "these", "properties" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L587-L611
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_initial_status_brok
def get_initial_status_brok(self, extra=None): """ Create an initial status brok :param extra: some extra information to be added in the brok data :type extra: dict :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill...
python
def get_initial_status_brok(self, extra=None): """ Create an initial status brok :param extra: some extra information to be added in the brok data :type extra: dict :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill...
[ "def", "get_initial_status_brok", "(", "self", ",", "extra", "=", "None", ")", ":", "data", "=", "{", "'uuid'", ":", "self", ".", "uuid", "}", "self", ".", "fill_data_brok_from", "(", "data", ",", "'full_status'", ")", "if", "extra", ":", "data", ".", ...
Create an initial status brok :param extra: some extra information to be added in the brok data :type extra: dict :return: Brok object :rtype: alignak.Brok
[ "Create", "an", "initial", "status", "brok" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L613-L626
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_update_status_brok
def get_update_status_brok(self): """ Create an update item brok :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill_data_brok_from(data, 'full_status') return Brok({'type': 'update_' + self.my_type + '_status', 'data': data...
python
def get_update_status_brok(self): """ Create an update item brok :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill_data_brok_from(data, 'full_status') return Brok({'type': 'update_' + self.my_type + '_status', 'data': data...
[ "def", "get_update_status_brok", "(", "self", ")", ":", "data", "=", "{", "'uuid'", ":", "self", ".", "uuid", "}", "self", ".", "fill_data_brok_from", "(", "data", ",", "'full_status'", ")", "return", "Brok", "(", "{", "'type'", ":", "'update_'", "+", "s...
Create an update item brok :return: Brok object :rtype: alignak.Brok
[ "Create", "an", "update", "item", "brok" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L639-L648
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_check_result_brok
def get_check_result_brok(self): """ Create check_result brok :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill_data_brok_from(data, 'check_result') return Brok({'type': self.my_type + '_check_result', 'data': data})
python
def get_check_result_brok(self): """ Create check_result brok :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill_data_brok_from(data, 'check_result') return Brok({'type': self.my_type + '_check_result', 'data': data})
[ "def", "get_check_result_brok", "(", "self", ")", ":", "data", "=", "{", "'uuid'", ":", "self", ".", "uuid", "}", "self", ".", "fill_data_brok_from", "(", "data", ",", "'check_result'", ")", "return", "Brok", "(", "{", "'type'", ":", "self", ".", "my_typ...
Create check_result brok :return: Brok object :rtype: alignak.Brok
[ "Create", "check_result", "brok" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L650-L659
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_next_schedule_brok
def get_next_schedule_brok(self): """ Create next_schedule (next check) brok :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill_data_brok_from(data, 'next_schedule') return Brok({'type': self.my_type + '_next_schedule', 'da...
python
def get_next_schedule_brok(self): """ Create next_schedule (next check) brok :return: Brok object :rtype: alignak.Brok """ data = {'uuid': self.uuid} self.fill_data_brok_from(data, 'next_schedule') return Brok({'type': self.my_type + '_next_schedule', 'da...
[ "def", "get_next_schedule_brok", "(", "self", ")", ":", "data", "=", "{", "'uuid'", ":", "self", ".", "uuid", "}", "self", ".", "fill_data_brok_from", "(", "data", ",", "'next_schedule'", ")", "return", "Brok", "(", "{", "'type'", ":", "self", ".", "my_t...
Create next_schedule (next check) brok :return: Brok object :rtype: alignak.Brok
[ "Create", "next_schedule", "(", "next", "check", ")", "brok" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L661-L670
Alignak-monitoring/alignak
alignak/objects/item.py
Item.get_snapshot_brok
def get_snapshot_brok(self, snap_output, exit_status): """ Create snapshot (check_result type) brok :param snap_output: value of output :type snap_output: str :param exit_status: status of exit :type exit_status: integer :return: Brok object :rtype: align...
python
def get_snapshot_brok(self, snap_output, exit_status): """ Create snapshot (check_result type) brok :param snap_output: value of output :type snap_output: str :param exit_status: status of exit :type exit_status: integer :return: Brok object :rtype: align...
[ "def", "get_snapshot_brok", "(", "self", ",", "snap_output", ",", "exit_status", ")", ":", "data", "=", "{", "'uuid'", ":", "self", ".", "uuid", ",", "'snapshot_output'", ":", "snap_output", ",", "'snapshot_time'", ":", "int", "(", "time", ".", "time", "("...
Create snapshot (check_result type) brok :param snap_output: value of output :type snap_output: str :param exit_status: status of exit :type exit_status: integer :return: Brok object :rtype: alignak.Brok
[ "Create", "snapshot", "(", "check_result", "type", ")", "brok" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L672-L690
Alignak-monitoring/alignak
alignak/objects/item.py
Item.dump
def dump(self, dump_file_name=None): # pragma: no cover, never called # pylint: disable=unused-argument """ Dump Item object properties :return: dictionary with properties :rtype: dict """ dump = {} for prop in self.properties: if not hasattr...
python
def dump(self, dump_file_name=None): # pragma: no cover, never called # pylint: disable=unused-argument """ Dump Item object properties :return: dictionary with properties :rtype: dict """ dump = {} for prop in self.properties: if not hasattr...
[ "def", "dump", "(", "self", ",", "dump_file_name", "=", "None", ")", ":", "# pragma: no cover, never called", "# pylint: disable=unused-argument", "dump", "=", "{", "}", "for", "prop", "in", "self", ".", "properties", ":", "if", "not", "hasattr", "(", "self", ...
Dump Item object properties :return: dictionary with properties :rtype: dict
[ "Dump", "Item", "object", "properties" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L692-L711
Alignak-monitoring/alignak
alignak/objects/item.py
Items.add_items
def add_items(self, items, index_items): """ Add items to template if is template, else add in item list :param items: items list to add :type items: alignak.objects.item.Items :param index_items: Flag indicating if the items should be indexed on the fly. :type index_ite...
python
def add_items(self, items, index_items): """ Add items to template if is template, else add in item list :param items: items list to add :type items: alignak.objects.item.Items :param index_items: Flag indicating if the items should be indexed on the fly. :type index_ite...
[ "def", "add_items", "(", "self", ",", "items", ",", "index_items", ")", ":", "count_templates", "=", "0", "count_items", "=", "0", "generated_items", "=", "[", "]", "for", "item", "in", "items", ":", "if", "item", ".", "is_tpl", "(", ")", ":", "self", ...
Add items to template if is template, else add in item list :param items: items list to add :type items: alignak.objects.item.Items :param index_items: Flag indicating if the items should be indexed on the fly. :type index_items: bool :return: None
[ "Add", "items", "to", "template", "if", "is", "template", "else", "add", "in", "item", "list" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L816-L841
Alignak-monitoring/alignak
alignak/objects/item.py
Items.manage_conflict
def manage_conflict(self, item, name): """ Checks if an object holding the same name already exists in the index. If so, it compares their definition order: the lowest definition order is kept. If definition order equal, an error is risen.Item The method returns the item that s...
python
def manage_conflict(self, item, name): """ Checks if an object holding the same name already exists in the index. If so, it compares their definition order: the lowest definition order is kept. If definition order equal, an error is risen.Item The method returns the item that s...
[ "def", "manage_conflict", "(", "self", ",", "item", ",", "name", ")", ":", "if", "item", ".", "is_tpl", "(", ")", ":", "existing", "=", "self", ".", "name_to_template", "[", "name", "]", "else", ":", "existing", "=", "self", ".", "name_to_item", "[", ...
Checks if an object holding the same name already exists in the index. If so, it compares their definition order: the lowest definition order is kept. If definition order equal, an error is risen.Item The method returns the item that should be added after it has decided which one shoul...
[ "Checks", "if", "an", "object", "holding", "the", "same", "name", "already", "exists", "in", "the", "index", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L843-L896
Alignak-monitoring/alignak
alignak/objects/item.py
Items.add_template
def add_template(self, tpl): """ Add and index a template into the `templates` container. :param tpl: The template to add :type tpl: alignak.objects.item.Item :return: None """ tpl = self.index_template(tpl) self.templates[tpl.uuid] = tpl
python
def add_template(self, tpl): """ Add and index a template into the `templates` container. :param tpl: The template to add :type tpl: alignak.objects.item.Item :return: None """ tpl = self.index_template(tpl) self.templates[tpl.uuid] = tpl
[ "def", "add_template", "(", "self", ",", "tpl", ")", ":", "tpl", "=", "self", ".", "index_template", "(", "tpl", ")", "self", ".", "templates", "[", "tpl", ".", "uuid", "]", "=", "tpl" ]
Add and index a template into the `templates` container. :param tpl: The template to add :type tpl: alignak.objects.item.Item :return: None
[ "Add", "and", "index", "a", "template", "into", "the", "templates", "container", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L898-L907
Alignak-monitoring/alignak
alignak/objects/item.py
Items.index_template
def index_template(self, tpl): """ Indexes a template by `name` into the `name_to_template` dictionary. :param tpl: The template to index :type tpl: alignak.objects.item.Item :return: None """ objcls = self.inner_class.my_type name = getattr(tpl, 'name', ...
python
def index_template(self, tpl): """ Indexes a template by `name` into the `name_to_template` dictionary. :param tpl: The template to index :type tpl: alignak.objects.item.Item :return: None """ objcls = self.inner_class.my_type name = getattr(tpl, 'name', ...
[ "def", "index_template", "(", "self", ",", "tpl", ")", ":", "objcls", "=", "self", ".", "inner_class", ".", "my_type", "name", "=", "getattr", "(", "tpl", ",", "'name'", ",", "''", ")", "if", "not", "name", ":", "mesg", "=", "\"a %s template has been def...
Indexes a template by `name` into the `name_to_template` dictionary. :param tpl: The template to index :type tpl: alignak.objects.item.Item :return: None
[ "Indexes", "a", "template", "by", "name", "into", "the", "name_to_template", "dictionary", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L909-L928
Alignak-monitoring/alignak
alignak/objects/item.py
Items.remove_template
def remove_template(self, tpl): """ Removes and un-index a template from the `templates` container. :param tpl: The template to remove :type tpl: alignak.objects.item.Item :return: None """ try: del self.templates[tpl.uuid] except KeyError: #...
python
def remove_template(self, tpl): """ Removes and un-index a template from the `templates` container. :param tpl: The template to remove :type tpl: alignak.objects.item.Item :return: None """ try: del self.templates[tpl.uuid] except KeyError: #...
[ "def", "remove_template", "(", "self", ",", "tpl", ")", ":", "try", ":", "del", "self", ".", "templates", "[", "tpl", ".", "uuid", "]", "except", "KeyError", ":", "# pragma: no cover, simple protection", "pass", "self", ".", "unindex_template", "(", "tpl", "...
Removes and un-index a template from the `templates` container. :param tpl: The template to remove :type tpl: alignak.objects.item.Item :return: None
[ "Removes", "and", "un", "-", "index", "a", "template", "from", "the", "templates", "container", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L930-L942
Alignak-monitoring/alignak
alignak/objects/item.py
Items.unindex_template
def unindex_template(self, tpl): """ Unindex a template from the `templates` container. :param tpl: The template to un-index :type tpl: alignak.objects.item.Item :return: None """ name = getattr(tpl, 'name', '') try: del self.name_to_template[...
python
def unindex_template(self, tpl): """ Unindex a template from the `templates` container. :param tpl: The template to un-index :type tpl: alignak.objects.item.Item :return: None """ name = getattr(tpl, 'name', '') try: del self.name_to_template[...
[ "def", "unindex_template", "(", "self", ",", "tpl", ")", ":", "name", "=", "getattr", "(", "tpl", ",", "'name'", ",", "''", ")", "try", ":", "del", "self", ".", "name_to_template", "[", "name", "]", "except", "KeyError", ":", "# pragma: no cover, simple pr...
Unindex a template from the `templates` container. :param tpl: The template to un-index :type tpl: alignak.objects.item.Item :return: None
[ "Unindex", "a", "template", "from", "the", "templates", "container", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L944-L956
Alignak-monitoring/alignak
alignak/objects/item.py
Items.add_item
def add_item(self, item, index=True): # pylint: disable=too-many-branches, too-many-locals, too-many-nested-blocks """ Add an item into our containers, and index it depending on the `index` flag. :param item: object to add :type item: alignak.objects.item.Item :param ind...
python
def add_item(self, item, index=True): # pylint: disable=too-many-branches, too-many-locals, too-many-nested-blocks """ Add an item into our containers, and index it depending on the `index` flag. :param item: object to add :type item: alignak.objects.item.Item :param ind...
[ "def", "add_item", "(", "self", ",", "item", ",", "index", "=", "True", ")", ":", "# pylint: disable=too-many-branches, too-many-locals, too-many-nested-blocks", "name_property", "=", "getattr", "(", "self", ".", "__class__", ",", "\"name_property\"", ",", "None", ")"...
Add an item into our containers, and index it depending on the `index` flag. :param item: object to add :type item: alignak.objects.item.Item :param index: Flag indicating if the item should be indexed :type index: bool :return: the new items created :rtype list
[ "Add", "an", "item", "into", "our", "containers", "and", "index", "it", "depending", "on", "the", "index", "flag", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L958-L1029
Alignak-monitoring/alignak
alignak/objects/item.py
Items.remove_item
def remove_item(self, item): """ Remove (and un-index) an object :param item: object to remove :type item: alignak.objects.item.Item :return: None """ self.unindex_item(item) self.items.pop(item.uuid, None)
python
def remove_item(self, item): """ Remove (and un-index) an object :param item: object to remove :type item: alignak.objects.item.Item :return: None """ self.unindex_item(item) self.items.pop(item.uuid, None)
[ "def", "remove_item", "(", "self", ",", "item", ")", ":", "self", ".", "unindex_item", "(", "item", ")", "self", ".", "items", ".", "pop", "(", "item", ".", "uuid", ",", "None", ")" ]
Remove (and un-index) an object :param item: object to remove :type item: alignak.objects.item.Item :return: None
[ "Remove", "(", "and", "un", "-", "index", ")", "an", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1031-L1040
Alignak-monitoring/alignak
alignak/objects/item.py
Items.index_item
def index_item(self, item): """ Index an item into our `name_to_item` dictionary. If an object holding the same item's name/key already exists in the index then the conflict is managed by the `manage_conflict` method. :param item: item to index :type item: alignak.object...
python
def index_item(self, item): """ Index an item into our `name_to_item` dictionary. If an object holding the same item's name/key already exists in the index then the conflict is managed by the `manage_conflict` method. :param item: item to index :type item: alignak.object...
[ "def", "index_item", "(", "self", ",", "item", ")", ":", "name_property", "=", "getattr", "(", "self", ".", "__class__", ",", "\"name_property\"", ",", "None", ")", "if", "name_property", "is", "None", ":", "return", "None", "name", "=", "getattr", "(", ...
Index an item into our `name_to_item` dictionary. If an object holding the same item's name/key already exists in the index then the conflict is managed by the `manage_conflict` method. :param item: item to index :type item: alignak.objects.item.Item :return: item modified ...
[ "Index", "an", "item", "into", "our", "name_to_item", "dictionary", ".", "If", "an", "object", "holding", "the", "same", "item", "s", "name", "/", "key", "already", "exists", "in", "the", "index", "then", "the", "conflict", "is", "managed", "by", "the", ...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1042-L1064
Alignak-monitoring/alignak
alignak/objects/item.py
Items.unindex_item
def unindex_item(self, item): """ Un-index an item from our name_to_item dict. :param item: the item to un-index :type item: alignak.objects.item.Item :return: None """ name_property = getattr(self.__class__, "name_property", None) if name_property is None...
python
def unindex_item(self, item): """ Un-index an item from our name_to_item dict. :param item: the item to un-index :type item: alignak.objects.item.Item :return: None """ name_property = getattr(self.__class__, "name_property", None) if name_property is None...
[ "def", "unindex_item", "(", "self", ",", "item", ")", ":", "name_property", "=", "getattr", "(", "self", ".", "__class__", ",", "\"name_property\"", ",", "None", ")", "if", "name_property", "is", "None", ":", "return", "name", "=", "getattr", "(", "item", ...
Un-index an item from our name_to_item dict. :param item: the item to un-index :type item: alignak.objects.item.Item :return: None
[ "Un", "-", "index", "an", "item", "from", "our", "name_to_item", "dict", ".", ":", "param", "item", ":", "the", "item", "to", "un", "-", "index", ":", "type", "item", ":", "alignak", ".", "objects", ".", "item", ".", "Item", ":", "return", ":", "No...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1066-L1079
Alignak-monitoring/alignak
alignak/objects/item.py
Items.old_properties_names_to_new
def old_properties_names_to_new(self): # pragma: no cover, never called """Convert old Nagios2 names to Nagios3 new names TODO: still useful? :return: None """ for i in itertools.chain(iter(list(self.items.values())), iter(list(self.templates.v...
python
def old_properties_names_to_new(self): # pragma: no cover, never called """Convert old Nagios2 names to Nagios3 new names TODO: still useful? :return: None """ for i in itertools.chain(iter(list(self.items.values())), iter(list(self.templates.v...
[ "def", "old_properties_names_to_new", "(", "self", ")", ":", "# pragma: no cover, never called", "for", "i", "in", "itertools", ".", "chain", "(", "iter", "(", "list", "(", "self", ".", "items", ".", "values", "(", ")", ")", ")", ",", "iter", "(", "list", ...
Convert old Nagios2 names to Nagios3 new names TODO: still useful? :return: None
[ "Convert", "old", "Nagios2", "names", "to", "Nagios3", "new", "names" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1092-L1101
Alignak-monitoring/alignak
alignak/objects/item.py
Items.get_all_tags
def get_all_tags(self, item): """ Get all tags of an item :param item: an item :type item: Item :return: list of tags :rtype: list """ all_tags = item.get_templates() for template_id in item.templates: template = self.templates[templa...
python
def get_all_tags(self, item): """ Get all tags of an item :param item: an item :type item: Item :return: list of tags :rtype: list """ all_tags = item.get_templates() for template_id in item.templates: template = self.templates[templa...
[ "def", "get_all_tags", "(", "self", ",", "item", ")", ":", "all_tags", "=", "item", ".", "get_templates", "(", ")", "for", "template_id", "in", "item", ".", "templates", ":", "template", "=", "self", ".", "templates", "[", "template_id", "]", "all_tags", ...
Get all tags of an item :param item: an item :type item: Item :return: list of tags :rtype: list
[ "Get", "all", "tags", "of", "an", "item" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1114-L1129
Alignak-monitoring/alignak
alignak/objects/item.py
Items.linkify_item_templates
def linkify_item_templates(self, item): """ Link templates :param item: an item :type item: alignak.objects.item.Item :return: None """ tpls = [] tpl_names = item.get_templates() for name in tpl_names: template = self.find_tpl_by_name...
python
def linkify_item_templates(self, item): """ Link templates :param item: an item :type item: alignak.objects.item.Item :return: None """ tpls = [] tpl_names = item.get_templates() for name in tpl_names: template = self.find_tpl_by_name...
[ "def", "linkify_item_templates", "(", "self", ",", "item", ")", ":", "tpls", "=", "[", "]", "tpl_names", "=", "item", ".", "get_templates", "(", ")", "for", "name", "in", "tpl_names", ":", "template", "=", "self", ".", "find_tpl_by_name", "(", "name", ")...
Link templates :param item: an item :type item: alignak.objects.item.Item :return: None
[ "Link", "templates" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1131-L1154
Alignak-monitoring/alignak
alignak/objects/item.py
Items.linkify_templates
def linkify_templates(self): """ Link all templates, and create the template graph too :return: None """ # First we create a list of all templates for i in itertools.chain(iter(list(self.items.values())), iter(list(self.templates.values()...
python
def linkify_templates(self): """ Link all templates, and create the template graph too :return: None """ # First we create a list of all templates for i in itertools.chain(iter(list(self.items.values())), iter(list(self.templates.values()...
[ "def", "linkify_templates", "(", "self", ")", ":", "# First we create a list of all templates", "for", "i", "in", "itertools", ".", "chain", "(", "iter", "(", "list", "(", "self", ".", "items", ".", "values", "(", ")", ")", ")", ",", "iter", "(", "list", ...
Link all templates, and create the template graph too :return: None
[ "Link", "all", "templates", "and", "create", "the", "template", "graph", "too" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1156-L1167
Alignak-monitoring/alignak
alignak/objects/item.py
Items.is_correct
def is_correct(self): """ Check if the items list configuration is correct :: * check if duplicate items exist in the list and warn about this * set alias and display_name property for each item in the list if they do not exist * check each item in the list * log all pre...
python
def is_correct(self): """ Check if the items list configuration is correct :: * check if duplicate items exist in the list and warn about this * set alias and display_name property for each item in the list if they do not exist * check each item in the list * log all pre...
[ "def", "is_correct", "(", "self", ")", ":", "# we are ok at the beginning. Hope we are still ok at the end...", "valid", "=", "True", "# Better check individual items before displaying the global items list errors and warnings", "for", "i", "in", "self", ":", "# Alias and display_nam...
Check if the items list configuration is correct :: * check if duplicate items exist in the list and warn about this * set alias and display_name property for each item in the list if they do not exist * check each item in the list * log all previous warnings * log all previous ...
[ "Check", "if", "the", "items", "list", "configuration", "is", "correct", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1169-L1216
Alignak-monitoring/alignak
alignak/objects/item.py
Items.serialize
def serialize(self): """This function serialize items into a simple dict object. It is used when transferring data to other daemons over the network (http) Here is the generic function that simply serialize each item of the items object :return: Dictionary containing item's uuid as key...
python
def serialize(self): """This function serialize items into a simple dict object. It is used when transferring data to other daemons over the network (http) Here is the generic function that simply serialize each item of the items object :return: Dictionary containing item's uuid as key...
[ "def", "serialize", "(", "self", ")", ":", "res", "=", "{", "}", "for", "key", ",", "item", "in", "list", "(", "self", ".", "items", ".", "items", "(", ")", ")", ":", "res", "[", "key", "]", "=", "item", ".", "serialize", "(", ")", "return", ...
This function serialize items into a simple dict object. It is used when transferring data to other daemons over the network (http) Here is the generic function that simply serialize each item of the items object :return: Dictionary containing item's uuid as key and item as value :rtyp...
[ "This", "function", "serialize", "items", "into", "a", "simple", "dict", "object", ".", "It", "is", "used", "when", "transferring", "data", "to", "other", "daemons", "over", "the", "network", "(", "http", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1244-L1256
Alignak-monitoring/alignak
alignak/objects/item.py
Items.apply_partial_inheritance
def apply_partial_inheritance(self, prop): """ Define property with inheritance value of the property :param prop: property :type prop: str :return: None """ for i in itertools.chain(iter(list(self.items.values())), iter(list(self...
python
def apply_partial_inheritance(self, prop): """ Define property with inheritance value of the property :param prop: property :type prop: str :return: None """ for i in itertools.chain(iter(list(self.items.values())), iter(list(self...
[ "def", "apply_partial_inheritance", "(", "self", ",", "prop", ")", ":", "for", "i", "in", "itertools", ".", "chain", "(", "iter", "(", "list", "(", "self", ".", "items", ".", "values", "(", ")", ")", ")", ",", "iter", "(", "list", "(", "self", ".",...
Define property with inheritance value of the property :param prop: property :type prop: str :return: None
[ "Define", "property", "with", "inheritance", "value", "of", "the", "property" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1258-L1274
Alignak-monitoring/alignak
alignak/objects/item.py
Items.apply_inheritance
def apply_inheritance(self): """ For all items and templates inherit properties and custom variables. :return: None """ # We check for all Class properties if the host has it # if not, it check all host templates for a value cls = self.inner_class for pro...
python
def apply_inheritance(self): """ For all items and templates inherit properties and custom variables. :return: None """ # We check for all Class properties if the host has it # if not, it check all host templates for a value cls = self.inner_class for pro...
[ "def", "apply_inheritance", "(", "self", ")", ":", "# We check for all Class properties if the host has it", "# if not, it check all host templates for a value", "cls", "=", "self", ".", "inner_class", "for", "prop", "in", "cls", ".", "properties", ":", "self", ".", "appl...
For all items and templates inherit properties and custom variables. :return: None
[ "For", "all", "items", "and", "templates", "inherit", "properties", "and", "custom", "variables", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1276-L1289
Alignak-monitoring/alignak
alignak/objects/item.py
Items.linkify_with_contacts
def linkify_with_contacts(self, contacts): """ Link items with contacts items :param contacts: all contacts object :type contacts: alignak.objects.contact.Contacts :return: None """ for i in self: if not hasattr(i, 'contacts'): continu...
python
def linkify_with_contacts(self, contacts): """ Link items with contacts items :param contacts: all contacts object :type contacts: alignak.objects.contact.Contacts :return: None """ for i in self: if not hasattr(i, 'contacts'): continu...
[ "def", "linkify_with_contacts", "(", "self", ",", "contacts", ")", ":", "for", "i", "in", "self", ":", "if", "not", "hasattr", "(", "i", ",", "'contacts'", ")", ":", "continue", "links_list", "=", "strip_and_uniq", "(", "i", ".", "contacts", ")", "new", ...
Link items with contacts items :param contacts: all contacts object :type contacts: alignak.objects.contact.Contacts :return: None
[ "Link", "items", "with", "contacts", "items" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1291-L1313
Alignak-monitoring/alignak
alignak/objects/item.py
Items.linkify_with_escalations
def linkify_with_escalations(self, escalations): """ Link with escalations :param escalations: all escalations object :type escalations: alignak.objects.escalation.Escalations :return: None """ for i in self: if not hasattr(i, 'escalations'): ...
python
def linkify_with_escalations(self, escalations): """ Link with escalations :param escalations: all escalations object :type escalations: alignak.objects.escalation.Escalations :return: None """ for i in self: if not hasattr(i, 'escalations'): ...
[ "def", "linkify_with_escalations", "(", "self", ",", "escalations", ")", ":", "for", "i", "in", "self", ":", "if", "not", "hasattr", "(", "i", ",", "'escalations'", ")", ":", "continue", "links_list", "=", "strip_and_uniq", "(", "i", ".", "escalations", ")...
Link with escalations :param escalations: all escalations object :type escalations: alignak.objects.escalation.Escalations :return: None
[ "Link", "with", "escalations" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1315-L1337
Alignak-monitoring/alignak
alignak/objects/item.py
Items.explode_contact_groups_into_contacts
def explode_contact_groups_into_contacts(item, contactgroups): """ Get all contacts of contact_groups and put them in contacts container :param item: item where have contact_groups property :type item: object :param contactgroups: all contactgroups object :type contactgr...
python
def explode_contact_groups_into_contacts(item, contactgroups): """ Get all contacts of contact_groups and put them in contacts container :param item: item where have contact_groups property :type item: object :param contactgroups: all contactgroups object :type contactgr...
[ "def", "explode_contact_groups_into_contacts", "(", "item", ",", "contactgroups", ")", ":", "if", "not", "hasattr", "(", "item", ",", "'contact_groups'", ")", ":", "return", "# TODO : See if we can remove this if", "cgnames", "=", "''", "if", "item", ".", "contact_g...
Get all contacts of contact_groups and put them in contacts container :param item: item where have contact_groups property :type item: object :param contactgroups: all contactgroups object :type contactgroups: alignak.objects.contactgroup.Contactgroups :return: None
[ "Get", "all", "contacts", "of", "contact_groups", "and", "put", "them", "in", "contacts", "container" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1390-L1425
Alignak-monitoring/alignak
alignak/objects/item.py
Items.linkify_with_timeperiods
def linkify_with_timeperiods(self, timeperiods, prop): """ Link items with timeperiods items :param timeperiods: all timeperiods object :type timeperiods: alignak.objects.timeperiod.Timeperiods :param prop: property name :type prop: str :return: None """ ...
python
def linkify_with_timeperiods(self, timeperiods, prop): """ Link items with timeperiods items :param timeperiods: all timeperiods object :type timeperiods: alignak.objects.timeperiod.Timeperiods :param prop: property name :type prop: str :return: None """ ...
[ "def", "linkify_with_timeperiods", "(", "self", ",", "timeperiods", ",", "prop", ")", ":", "for", "i", "in", "self", ":", "if", "not", "hasattr", "(", "i", ",", "prop", ")", ":", "continue", "tpname", "=", "getattr", "(", "i", ",", "prop", ")", ".", ...
Link items with timeperiods items :param timeperiods: all timeperiods object :type timeperiods: alignak.objects.timeperiod.Timeperiods :param prop: property name :type prop: str :return: None
[ "Link", "items", "with", "timeperiods", "items" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1427-L1454
Alignak-monitoring/alignak
alignak/objects/item.py
Items.linkify_with_checkmodulations
def linkify_with_checkmodulations(self, checkmodulations): """ Link checkmodulation object :param checkmodulations: checkmodulations object :type checkmodulations: alignak.objects.checkmodulation.Checkmodulations :return: None """ for i in self: if no...
python
def linkify_with_checkmodulations(self, checkmodulations): """ Link checkmodulation object :param checkmodulations: checkmodulations object :type checkmodulations: alignak.objects.checkmodulation.Checkmodulations :return: None """ for i in self: if no...
[ "def", "linkify_with_checkmodulations", "(", "self", ",", "checkmodulations", ")", ":", "for", "i", "in", "self", ":", "if", "not", "hasattr", "(", "i", ",", "'checkmodulations'", ")", ":", "continue", "links_list", "=", "strip_and_uniq", "(", "i", ".", "che...
Link checkmodulation object :param checkmodulations: checkmodulations object :type checkmodulations: alignak.objects.checkmodulation.Checkmodulations :return: None
[ "Link", "checkmodulation", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1456-L1478
Alignak-monitoring/alignak
alignak/objects/item.py
Items.linkify_s_by_module
def linkify_s_by_module(self, modules): """ Link modules to items :param modules: Modules object (list of all the modules found in the configuration) :type modules: alignak.objects.module.Modules :return: None """ for i in self: links_list = strip_an...
python
def linkify_s_by_module(self, modules): """ Link modules to items :param modules: Modules object (list of all the modules found in the configuration) :type modules: alignak.objects.module.Modules :return: None """ for i in self: links_list = strip_an...
[ "def", "linkify_s_by_module", "(", "self", ",", "modules", ")", ":", "for", "i", "in", "self", ":", "links_list", "=", "strip_and_uniq", "(", "i", ".", "modules", ")", "new", "=", "[", "]", "for", "name", "in", "[", "e", "for", "e", "in", "links_list...
Link modules to items :param modules: Modules object (list of all the modules found in the configuration) :type modules: alignak.objects.module.Modules :return: None
[ "Link", "modules", "to", "items" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1504-L1523
Alignak-monitoring/alignak
alignak/objects/item.py
Items.evaluate_hostgroup_expression
def evaluate_hostgroup_expression(expr, hosts, hostgroups, look_in='hostgroups'): """ Evaluate hostgroup expression :param expr: an expression :type expr: str :param hosts: hosts object (all hosts) :type hosts: alignak.objects.host.Hosts :param hostgroups: hostgr...
python
def evaluate_hostgroup_expression(expr, hosts, hostgroups, look_in='hostgroups'): """ Evaluate hostgroup expression :param expr: an expression :type expr: str :param hosts: hosts object (all hosts) :type hosts: alignak.objects.host.Hosts :param hostgroups: hostgr...
[ "def", "evaluate_hostgroup_expression", "(", "expr", ",", "hosts", ",", "hostgroups", ",", "look_in", "=", "'hostgroups'", ")", ":", "# Maybe exp is a list, like numerous hostgroups entries in a service, link them", "if", "isinstance", "(", "expr", ",", "list", ")", ":", ...
Evaluate hostgroup expression :param expr: an expression :type expr: str :param hosts: hosts object (all hosts) :type hosts: alignak.objects.host.Hosts :param hostgroups: hostgroups object (all hostgroups) :type hostgroups: alignak.objects.hostgroup.Hostgroups :p...
[ "Evaluate", "hostgroup", "expression" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1526-L1553
Alignak-monitoring/alignak
alignak/objects/item.py
Items.get_hosts_from_hostgroups
def get_hosts_from_hostgroups(hgname, hostgroups): """ Get hosts of hostgroups :param hgname: hostgroup name :type hgname: str :param hostgroups: hostgroups object (all hostgroups) :type hostgroups: alignak.objects.hostgroup.Hostgroups :return: list of hosts ...
python
def get_hosts_from_hostgroups(hgname, hostgroups): """ Get hosts of hostgroups :param hgname: hostgroup name :type hgname: str :param hostgroups: hostgroups object (all hostgroups) :type hostgroups: alignak.objects.hostgroup.Hostgroups :return: list of hosts ...
[ "def", "get_hosts_from_hostgroups", "(", "hgname", ",", "hostgroups", ")", ":", "if", "not", "isinstance", "(", "hgname", ",", "list", ")", ":", "hgname", "=", "[", "e", ".", "strip", "(", ")", "for", "e", "in", "hgname", ".", "split", "(", "','", ")...
Get hosts of hostgroups :param hgname: hostgroup name :type hgname: str :param hostgroups: hostgroups object (all hostgroups) :type hostgroups: alignak.objects.hostgroup.Hostgroups :return: list of hosts :rtype: list
[ "Get", "hosts", "of", "hostgroups" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1556-L1578
Alignak-monitoring/alignak
alignak/objects/item.py
Items.explode_host_groups_into_hosts
def explode_host_groups_into_hosts(self, item, hosts, hostgroups): """ Get all hosts of hostgroups and add all in host_name container :param item: the item object :type item: alignak.objects.item.Item :param hosts: hosts object :type hosts: alignak.objects.host.Hosts ...
python
def explode_host_groups_into_hosts(self, item, hosts, hostgroups): """ Get all hosts of hostgroups and add all in host_name container :param item: the item object :type item: alignak.objects.item.Item :param hosts: hosts object :type hosts: alignak.objects.host.Hosts ...
[ "def", "explode_host_groups_into_hosts", "(", "self", ",", "item", ",", "hosts", ",", "hostgroups", ")", ":", "hnames_list", "=", "[", "]", "# Gets item's hostgroup_name", "hgnames", "=", "getattr", "(", "item", ",", "\"hostgroup_name\"", ",", "''", ")", "or", ...
Get all hosts of hostgroups and add all in host_name container :param item: the item object :type item: alignak.objects.item.Item :param hosts: hosts object :type hosts: alignak.objects.host.Hosts :param hostgroups: hostgroups object :type hostgroups: alignak.objects.hos...
[ "Get", "all", "hosts", "of", "hostgroups", "and", "add", "all", "in", "host_name", "container" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1580-L1629
Alignak-monitoring/alignak
alignak/objects/item.py
Items.no_loop_in_parents
def no_loop_in_parents(self, attr1, attr2): # pylint: disable=too-many-branches """ Find loop in dependencies. For now, used with the following attributes : :(self, parents): host dependencies from host object :(host_name, dependent_host_name):\ ho...
python
def no_loop_in_parents(self, attr1, attr2): # pylint: disable=too-many-branches """ Find loop in dependencies. For now, used with the following attributes : :(self, parents): host dependencies from host object :(host_name, dependent_host_name):\ ho...
[ "def", "no_loop_in_parents", "(", "self", ",", "attr1", ",", "attr2", ")", ":", "# pylint: disable=too-many-branches", "# Ok, we say \"from now, no loop :) \"", "# in_loop = []", "# Create parent graph", "parents", "=", "Graph", "(", ")", "# Start with all items as nodes", "f...
Find loop in dependencies. For now, used with the following attributes : :(self, parents): host dependencies from host object :(host_name, dependent_host_name):\ host dependencies from hostdependencies object :(service_description, dependent_service_description): ...
[ "Find", "loop", "in", "dependencies", ".", "For", "now", "used", "with", "the", "following", "attributes", ":", ":", "(", "self", "parents", ")", ":", "host", "dependencies", "from", "host", "object", ":", "(", "host_name", "dependent_host_name", ")", ":", ...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1631-L1693
Alignak-monitoring/alignak
alignak/objects/item.py
Items.get_property_by_inheritance
def get_property_by_inheritance(self, obj, prop): # pylint: disable=too-many-branches, too-many-nested-blocks """ Get the property asked in parameter to this object or from defined templates of this object todo: rewrite this function which is really too complex! :param ...
python
def get_property_by_inheritance(self, obj, prop): # pylint: disable=too-many-branches, too-many-nested-blocks """ Get the property asked in parameter to this object or from defined templates of this object todo: rewrite this function which is really too complex! :param ...
[ "def", "get_property_by_inheritance", "(", "self", ",", "obj", ",", "prop", ")", ":", "# pylint: disable=too-many-branches, too-many-nested-blocks", "if", "prop", "==", "'register'", ":", "# We do not inherit the register property", "return", "None", "# If I have the property, ...
Get the property asked in parameter to this object or from defined templates of this object todo: rewrite this function which is really too complex! :param obj: the object to search the property :type obj: alignak.objects.item.Item :param prop: name of property :type pr...
[ "Get", "the", "property", "asked", "in", "parameter", "to", "this", "object", "or", "from", "defined", "templates", "of", "this", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1695-L1851
Alignak-monitoring/alignak
alignak/objects/item.py
Items.get_customs_properties_by_inheritance
def get_customs_properties_by_inheritance(self, obj): """ Get custom properties from the templates defined in this object :param obj: the oject to search the property :type obj: alignak.objects.item.Item :return: list of custom properties :rtype: list """ ...
python
def get_customs_properties_by_inheritance(self, obj): """ Get custom properties from the templates defined in this object :param obj: the oject to search the property :type obj: alignak.objects.item.Item :return: list of custom properties :rtype: list """ ...
[ "def", "get_customs_properties_by_inheritance", "(", "self", ",", "obj", ")", ":", "for", "t_id", "in", "obj", ".", "templates", ":", "template", "=", "self", ".", "templates", "[", "t_id", "]", "tpl_cv", "=", "self", ".", "get_customs_properties_by_inheritance"...
Get custom properties from the templates defined in this object :param obj: the oject to search the property :type obj: alignak.objects.item.Item :return: list of custom properties :rtype: list
[ "Get", "custom", "properties", "from", "the", "templates", "defined", "in", "this", "object" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/objects/item.py#L1853-L1886
Alignak-monitoring/alignak
alignak/graph.py
Graph.add_edge
def add_edge(self, from_node, to_node): """Add edge between two node The edge is oriented :param from_node: node where edge starts :type from_node: object :param to_node: node where edge ends :type to_node: object :return: None """ # Maybe to_node...
python
def add_edge(self, from_node, to_node): """Add edge between two node The edge is oriented :param from_node: node where edge starts :type from_node: object :param to_node: node where edge ends :type to_node: object :return: None """ # Maybe to_node...
[ "def", "add_edge", "(", "self", ",", "from_node", ",", "to_node", ")", ":", "# Maybe to_node is unknown", "if", "to_node", "not", "in", "self", ".", "nodes", ":", "self", ".", "add_node", "(", "to_node", ")", "try", ":", "self", ".", "nodes", "[", "from_...
Add edge between two node The edge is oriented :param from_node: node where edge starts :type from_node: object :param to_node: node where edge ends :type to_node: object :return: None
[ "Add", "edge", "between", "two", "node", "The", "edge", "is", "oriented" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L81-L99
Alignak-monitoring/alignak
alignak/graph.py
Graph.loop_check
def loop_check(self): """Check if we have a loop in the graph :return: Nodes in loop :rtype: list """ in_loop = [] # Add the tag for dfs check for node in list(self.nodes.values()): node['dfs_loop_status'] = 'DFS_UNCHECKED' # Now do the job ...
python
def loop_check(self): """Check if we have a loop in the graph :return: Nodes in loop :rtype: list """ in_loop = [] # Add the tag for dfs check for node in list(self.nodes.values()): node['dfs_loop_status'] = 'DFS_UNCHECKED' # Now do the job ...
[ "def", "loop_check", "(", "self", ")", ":", "in_loop", "=", "[", "]", "# Add the tag for dfs check", "for", "node", "in", "list", "(", "self", ".", "nodes", ".", "values", "(", ")", ")", ":", "node", "[", "'dfs_loop_status'", "]", "=", "'DFS_UNCHECKED'", ...
Check if we have a loop in the graph :return: Nodes in loop :rtype: list
[ "Check", "if", "we", "have", "a", "loop", "in", "the", "graph" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L101-L125
Alignak-monitoring/alignak
alignak/graph.py
Graph.dfs_loop_search
def dfs_loop_search(self, root): """Main algorithm to look for loop. It tags nodes and find ones stuck in loop. * Init all nodes with DFS_UNCHECKED value * DFS_TEMPORARY_CHECKED means we found it once * DFS_OK : this node (and all sons) are fine * DFS_NEAR_LOOP : One pro...
python
def dfs_loop_search(self, root): """Main algorithm to look for loop. It tags nodes and find ones stuck in loop. * Init all nodes with DFS_UNCHECKED value * DFS_TEMPORARY_CHECKED means we found it once * DFS_OK : this node (and all sons) are fine * DFS_NEAR_LOOP : One pro...
[ "def", "dfs_loop_search", "(", "self", ",", "root", ")", ":", "# Make the root temporary checked", "self", ".", "nodes", "[", "root", "]", "[", "'dfs_loop_status'", "]", "=", "'DFS_TEMPORARY_CHECKED'", "# We are scanning the sons", "for", "child", "in", "self", ".",...
Main algorithm to look for loop. It tags nodes and find ones stuck in loop. * Init all nodes with DFS_UNCHECKED value * DFS_TEMPORARY_CHECKED means we found it once * DFS_OK : this node (and all sons) are fine * DFS_NEAR_LOOP : One problem was found in of of the son * DF...
[ "Main", "algorithm", "to", "look", "for", "loop", ".", "It", "tags", "nodes", "and", "find", "ones", "stuck", "in", "loop", "." ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L127-L170
Alignak-monitoring/alignak
alignak/graph.py
Graph.get_accessibility_packs
def get_accessibility_packs(self): """Get accessibility packs of the graph: in one pack element are related in a way. Between packs, there is no relation at all. TODO: Make it work for directional graph too Because for now, edge must be father->son AND son->father :return: packs...
python
def get_accessibility_packs(self): """Get accessibility packs of the graph: in one pack element are related in a way. Between packs, there is no relation at all. TODO: Make it work for directional graph too Because for now, edge must be father->son AND son->father :return: packs...
[ "def", "get_accessibility_packs", "(", "self", ")", ":", "packs", "=", "[", "]", "# Add the tag for dfs check", "for", "node", "in", "list", "(", "self", ".", "nodes", ".", "values", "(", ")", ")", ":", "node", "[", "'dfs_loop_status'", "]", "=", "'DFS_UNC...
Get accessibility packs of the graph: in one pack element are related in a way. Between packs, there is no relation at all. TODO: Make it work for directional graph too Because for now, edge must be father->son AND son->father :return: packs of nodes :rtype: list
[ "Get", "accessibility", "packs", "of", "the", "graph", ":", "in", "one", "pack", "element", "are", "related", "in", "a", "way", ".", "Between", "packs", "there", "is", "no", "relation", "at", "all", ".", "TODO", ":", "Make", "it", "work", "for", "direc...
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L172-L195
Alignak-monitoring/alignak
alignak/graph.py
Graph.dfs_get_all_childs
def dfs_get_all_childs(self, root): """Recursively get all sons of this node :param root: node to get sons :type root: :return: sons :rtype: list """ self.nodes[root]['dfs_loop_status'] = 'DFS_CHECKED' ret = set() # Me ret.add(root) ...
python
def dfs_get_all_childs(self, root): """Recursively get all sons of this node :param root: node to get sons :type root: :return: sons :rtype: list """ self.nodes[root]['dfs_loop_status'] = 'DFS_CHECKED' ret = set() # Me ret.add(root) ...
[ "def", "dfs_get_all_childs", "(", "self", ",", "root", ")", ":", "self", ".", "nodes", "[", "root", "]", "[", "'dfs_loop_status'", "]", "=", "'DFS_CHECKED'", "ret", "=", "set", "(", ")", "# Me", "ret", ".", "add", "(", "root", ")", "# And my sons", "re...
Recursively get all sons of this node :param root: node to get sons :type root: :return: sons :rtype: list
[ "Recursively", "get", "all", "sons", "of", "this", "node" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/graph.py#L197-L218
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface.identity
def identity(self): """Get the daemon identity This will return an object containing some properties: - alignak: the Alignak instance name - version: the Alignak version - type: the daemon type - name: the daemon name :return: daemon identity :rtype: dic...
python
def identity(self): """Get the daemon identity This will return an object containing some properties: - alignak: the Alignak instance name - version: the Alignak version - type: the daemon type - name: the daemon name :return: daemon identity :rtype: dic...
[ "def", "identity", "(", "self", ")", ":", "res", "=", "self", ".", "app", ".", "get_id", "(", ")", "res", ".", "update", "(", "{", "\"start_time\"", ":", "self", ".", "start_time", "}", ")", "res", ".", "update", "(", "{", "\"running_id\"", ":", "s...
Get the daemon identity This will return an object containing some properties: - alignak: the Alignak instance name - version: the Alignak version - type: the daemon type - name: the daemon name :return: daemon identity :rtype: dict
[ "Get", "the", "daemon", "identity" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L76-L91
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface.api
def api(self): """List the methods available on the daemon Web service interface :return: a list of methods and parameters :rtype: dict """ functions = [x[0]for x in inspect.getmembers(self, predicate=inspect.ismethod) if not x[0].startswith('_')] f...
python
def api(self): """List the methods available on the daemon Web service interface :return: a list of methods and parameters :rtype: dict """ functions = [x[0]for x in inspect.getmembers(self, predicate=inspect.ismethod) if not x[0].startswith('_')] f...
[ "def", "api", "(", "self", ")", ":", "functions", "=", "[", "x", "[", "0", "]", "for", "x", "in", "inspect", ".", "getmembers", "(", "self", ",", "predicate", "=", "inspect", ".", "ismethod", ")", "if", "not", "x", "[", "0", "]", ".", "startswith...
List the methods available on the daemon Web service interface :return: a list of methods and parameters :rtype: dict
[ "List", "the", "methods", "available", "on", "the", "daemon", "Web", "service", "interface" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L95-L138
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface.stop_request
def stop_request(self, stop_now='0'): """Request the daemon to stop If `stop_now` is set to '1' the daemon will stop now. Else, the daemon will enter the stop wait mode. In this mode the daemon stops its activity and waits until it receives a new `stop_now` request to stop really. ...
python
def stop_request(self, stop_now='0'): """Request the daemon to stop If `stop_now` is set to '1' the daemon will stop now. Else, the daemon will enter the stop wait mode. In this mode the daemon stops its activity and waits until it receives a new `stop_now` request to stop really. ...
[ "def", "stop_request", "(", "self", ",", "stop_now", "=", "'0'", ")", ":", "self", ".", "app", ".", "interrupted", "=", "(", "stop_now", "==", "'1'", ")", "self", ".", "app", ".", "will_stop", "=", "True", "return", "True" ]
Request the daemon to stop If `stop_now` is set to '1' the daemon will stop now. Else, the daemon will enter the stop wait mode. In this mode the daemon stops its activity and waits until it receives a new `stop_now` request to stop really. :param stop_now: stop now or go to stop wait ...
[ "Request", "the", "daemon", "to", "stop" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L143-L157
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface.get_log_level
def get_log_level(self): """Get the current daemon log level Returns an object with the daemon identity and a `log_level` property. running_id :return: current log level :rtype: str """ level_names = { logging.DEBUG: 'DEBUG', logging.INFO: 'INFO', lo...
python
def get_log_level(self): """Get the current daemon log level Returns an object with the daemon identity and a `log_level` property. running_id :return: current log level :rtype: str """ level_names = { logging.DEBUG: 'DEBUG', logging.INFO: 'INFO', lo...
[ "def", "get_log_level", "(", "self", ")", ":", "level_names", "=", "{", "logging", ".", "DEBUG", ":", "'DEBUG'", ",", "logging", ".", "INFO", ":", "'INFO'", ",", "logging", ".", "WARNING", ":", "'WARNING'", ",", "logging", ".", "ERROR", ":", "'ERROR'", ...
Get the current daemon log level Returns an object with the daemon identity and a `log_level` property. running_id :return: current log level :rtype: str
[ "Get", "the", "current", "daemon", "log", "level" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L161-L179
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface.set_log_level
def set_log_level(self, log_level=None): """Set the current log level for the daemon The `log_level` parameter must be in [DEBUG, INFO, WARNING, ERROR, CRITICAL] In case of any error, this function returns an object containing some properties: '_status': 'ERR' because of the error ...
python
def set_log_level(self, log_level=None): """Set the current log level for the daemon The `log_level` parameter must be in [DEBUG, INFO, WARNING, ERROR, CRITICAL] In case of any error, this function returns an object containing some properties: '_status': 'ERR' because of the error ...
[ "def", "set_log_level", "(", "self", ",", "log_level", "=", "None", ")", ":", "if", "log_level", "is", "None", ":", "log_level", "=", "cherrypy", ".", "request", ".", "json", "[", "'log_level'", "]", "if", "log_level", "not", "in", "[", "'DEBUG'", ",", ...
Set the current log level for the daemon The `log_level` parameter must be in [DEBUG, INFO, WARNING, ERROR, CRITICAL] In case of any error, this function returns an object containing some properties: '_status': 'ERR' because of the error `_message`: some more explanations about the err...
[ "Set", "the", "current", "log", "level", "for", "the", "daemon" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L184-L209
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface.stats
def stats(self, details=False): """Get statistics and information from the daemon Returns an object with the daemon identity, the daemon start_time and some extra properties depending upon the daemon type. All daemons provide these ones: - program_start: the Alignak start times...
python
def stats(self, details=False): """Get statistics and information from the daemon Returns an object with the daemon identity, the daemon start_time and some extra properties depending upon the daemon type. All daemons provide these ones: - program_start: the Alignak start times...
[ "def", "stats", "(", "self", ",", "details", "=", "False", ")", ":", "if", "details", "is", "not", "False", ":", "details", "=", "bool", "(", "details", ")", "res", "=", "self", ".", "identity", "(", ")", "res", ".", "update", "(", "self", ".", "...
Get statistics and information from the daemon Returns an object with the daemon identity, the daemon start_time and some extra properties depending upon the daemon type. All daemons provide these ones: - program_start: the Alignak start timestamp - spare: to indicate if the da...
[ "Get", "statistics", "and", "information", "from", "the", "daemon" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L240-L263
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface._wait_new_conf
def _wait_new_conf(self): """Ask the daemon to drop its configuration and wait for a new one :return: None """ with self.app.conf_lock: logger.debug("My Arbiter wants me to wait for a new configuration.") # Clear can occur while setting up a new conf and lead to ...
python
def _wait_new_conf(self): """Ask the daemon to drop its configuration and wait for a new one :return: None """ with self.app.conf_lock: logger.debug("My Arbiter wants me to wait for a new configuration.") # Clear can occur while setting up a new conf and lead to ...
[ "def", "_wait_new_conf", "(", "self", ")", ":", "with", "self", ".", "app", ".", "conf_lock", ":", "logger", ".", "debug", "(", "\"My Arbiter wants me to wait for a new configuration.\"", ")", "# Clear can occur while setting up a new conf and lead to error.", "self", ".", ...
Ask the daemon to drop its configuration and wait for a new one :return: None
[ "Ask", "the", "daemon", "to", "drop", "its", "configuration", "and", "wait", "for", "a", "new", "one" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L276-L285
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface._push_configuration
def _push_configuration(self, pushed_configuration=None): """Send a new configuration to the daemon This function is not intended for external use. It is quite complex to build a configuration for a daemon and it is the arbiter dispatcher job ;) :param pushed_configuration: new conf to...
python
def _push_configuration(self, pushed_configuration=None): """Send a new configuration to the daemon This function is not intended for external use. It is quite complex to build a configuration for a daemon and it is the arbiter dispatcher job ;) :param pushed_configuration: new conf to...
[ "def", "_push_configuration", "(", "self", ",", "pushed_configuration", "=", "None", ")", ":", "if", "pushed_configuration", "is", "None", ":", "confs", "=", "cherrypy", ".", "request", ".", "json", "pushed_configuration", "=", "confs", "[", "'conf'", "]", "# ...
Send a new configuration to the daemon This function is not intended for external use. It is quite complex to build a configuration for a daemon and it is the arbiter dispatcher job ;) :param pushed_configuration: new conf to send :return: None
[ "Send", "a", "new", "configuration", "to", "the", "daemon" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L290-L305
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface._have_conf
def _have_conf(self, magic_hash=None): """Get the daemon current configuration state If the daemon has received a configuration from its arbiter, this will return True If a `magic_hash` is provided it is compared with the one included in the daemon configuration and this functi...
python
def _have_conf(self, magic_hash=None): """Get the daemon current configuration state If the daemon has received a configuration from its arbiter, this will return True If a `magic_hash` is provided it is compared with the one included in the daemon configuration and this functi...
[ "def", "_have_conf", "(", "self", ",", "magic_hash", "=", "None", ")", ":", "self", ".", "app", ".", "have_conf", "=", "getattr", "(", "self", ".", "app", ",", "'cur_conf'", ",", "None", ")", "not", "in", "[", "None", ",", "{", "}", "]", "if", "m...
Get the daemon current configuration state If the daemon has received a configuration from its arbiter, this will return True If a `magic_hash` is provided it is compared with the one included in the daemon configuration and this function returns True only if they match! :retu...
[ "Get", "the", "daemon", "current", "configuration", "state" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L310-L329
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface._push_actions
def _push_actions(self): """Push actions to the poller/reactionner This function is used by the scheduler to send the actions to get executed to the poller/reactionner {'actions': actions, 'instance_id': scheduler_instance_id} :return:None """ data = cherrypy.r...
python
def _push_actions(self): """Push actions to the poller/reactionner This function is used by the scheduler to send the actions to get executed to the poller/reactionner {'actions': actions, 'instance_id': scheduler_instance_id} :return:None """ data = cherrypy.r...
[ "def", "_push_actions", "(", "self", ")", ":", "data", "=", "cherrypy", ".", "request", ".", "json", "with", "self", ".", "app", ".", "lock", ":", "self", ".", "app", ".", "add_actions", "(", "data", "[", "'actions'", "]", ",", "data", "[", "'schedul...
Push actions to the poller/reactionner This function is used by the scheduler to send the actions to get executed to the poller/reactionner {'actions': actions, 'instance_id': scheduler_instance_id} :return:None
[ "Push", "actions", "to", "the", "poller", "/", "reactionner" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L334-L346
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface._results
def _results(self, scheduler_instance_id): """Get the results of the executed actions for the scheduler which instance id is provided Calling this method for daemons that are not configured as passive do not make sense. Indeed, this service should only be exposed on poller and reactionner daemo...
python
def _results(self, scheduler_instance_id): """Get the results of the executed actions for the scheduler which instance id is provided Calling this method for daemons that are not configured as passive do not make sense. Indeed, this service should only be exposed on poller and reactionner daemo...
[ "def", "_results", "(", "self", ",", "scheduler_instance_id", ")", ":", "with", "self", ".", "app", ".", "lock", ":", "res", "=", "self", ".", "app", ".", "get_results_from_passive", "(", "scheduler_instance_id", ")", "return", "serialize", "(", "res", ",", ...
Get the results of the executed actions for the scheduler which instance id is provided Calling this method for daemons that are not configured as passive do not make sense. Indeed, this service should only be exposed on poller and reactionner daemons. :param scheduler_instance_id: instance id...
[ "Get", "the", "results", "of", "the", "executed", "actions", "for", "the", "scheduler", "which", "instance", "id", "is", "provided" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L367-L380
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface._broks
def _broks(self, broker_name): # pylint: disable=unused-argument """Get the broks from the daemon This is used by the brokers to get the broks list of a daemon :return: Brok list serialized :rtype: dict """ with self.app.broks_lock: res = self.app.get_broks...
python
def _broks(self, broker_name): # pylint: disable=unused-argument """Get the broks from the daemon This is used by the brokers to get the broks list of a daemon :return: Brok list serialized :rtype: dict """ with self.app.broks_lock: res = self.app.get_broks...
[ "def", "_broks", "(", "self", ",", "broker_name", ")", ":", "# pylint: disable=unused-argument", "with", "self", ".", "app", ".", "broks_lock", ":", "res", "=", "self", ".", "app", ".", "get_broks", "(", ")", "return", "serialize", "(", "res", ",", "True",...
Get the broks from the daemon This is used by the brokers to get the broks list of a daemon :return: Brok list serialized :rtype: dict
[ "Get", "the", "broks", "from", "the", "daemon" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L384-L394
Alignak-monitoring/alignak
alignak/http/generic_interface.py
GenericInterface._events
def _events(self): """Get the monitoring events from the daemon This is used by the arbiter to get the monitoring events from all its satellites :return: Events list serialized :rtype: list """ with self.app.events_lock: res = self.app.get_events() r...
python
def _events(self): """Get the monitoring events from the daemon This is used by the arbiter to get the monitoring events from all its satellites :return: Events list serialized :rtype: list """ with self.app.events_lock: res = self.app.get_events() r...
[ "def", "_events", "(", "self", ")", ":", "with", "self", ".", "app", ".", "events_lock", ":", "res", "=", "self", ".", "app", ".", "get_events", "(", ")", "return", "serialize", "(", "res", ",", "True", ")" ]
Get the monitoring events from the daemon This is used by the arbiter to get the monitoring events from all its satellites :return: Events list serialized :rtype: list
[ "Get", "the", "monitoring", "events", "from", "the", "daemon" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/http/generic_interface.py#L398-L408
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.serialize
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a DependencyNode :rtype: dict """ return ...
python
def serialize(self): """This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a DependencyNode :rtype: dict """ return ...
[ "def", "serialize", "(", "self", ")", ":", "return", "{", "'operand'", ":", "self", ".", "operand", ",", "'sons'", ":", "[", "serialize", "(", "elem", ")", "for", "elem", "in", "self", ".", "sons", "]", ",", "'of_values'", ":", "self", ".", "of_value...
This function serialize into a simple dict object. It is used when transferring data to other daemons over the network (http) Here we directly return all attributes :return: json representation of a DependencyNode :rtype: dict
[ "This", "function", "serialize", "into", "a", "simple", "dict", "object", ".", "It", "is", "used", "when", "transferring", "data", "to", "other", "daemons", "over", "the", "network", "(", "http", ")" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L103-L114
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.get_state
def get_state(self, hosts, services): """Get node state by looking recursively over sons and applying operand :param hosts: list of available hosts to search for :param services: list of available services to search for :return: Node state :rtype: int """ # If we...
python
def get_state(self, hosts, services): """Get node state by looking recursively over sons and applying operand :param hosts: list of available hosts to search for :param services: list of available services to search for :return: Node state :rtype: int """ # If we...
[ "def", "get_state", "(", "self", ",", "hosts", ",", "services", ")", ":", "# If we are a host or a service, we just got the host/service", "# hard state", "if", "self", ".", "operand", "==", "'host'", ":", "host", "=", "hosts", "[", "self", ".", "sons", "[", "0"...
Get node state by looking recursively over sons and applying operand :param hosts: list of available hosts to search for :param services: list of available services to search for :return: Node state :rtype: int
[ "Get", "node", "state", "by", "looking", "recursively", "over", "sons", "and", "applying", "operand" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L140-L171
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.get_host_node_state
def get_host_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime): """Get host node state, simplest case :: * Handle not value (revert) for host and consider 1 as 2 :return: 0, 1 or 2 :rtype: int """ # Make DOWN look as CRITICAL (2 instead of 1)...
python
def get_host_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime): """Get host node state, simplest case :: * Handle not value (revert) for host and consider 1 as 2 :return: 0, 1 or 2 :rtype: int """ # Make DOWN look as CRITICAL (2 instead of 1)...
[ "def", "get_host_node_state", "(", "self", ",", "state", ",", "problem_has_been_acknowledged", ",", "in_scheduled_downtime", ")", ":", "# Make DOWN look as CRITICAL (2 instead of 1)", "if", "state", "==", "1", ":", "state", "=", "2", "# If our node is acknowledged or in dow...
Get host node state, simplest case :: * Handle not value (revert) for host and consider 1 as 2 :return: 0, 1 or 2 :rtype: int
[ "Get", "host", "node", "state", "simplest", "case", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L173-L192
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.get_service_node_state
def get_service_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime): """Get service node state, simplest case :: * Handle not value (revert) for service :return: 0, 1 or 2 :rtype: int """ # If our node is acknowledged or in downtime, state is o...
python
def get_service_node_state(self, state, problem_has_been_acknowledged, in_scheduled_downtime): """Get service node state, simplest case :: * Handle not value (revert) for service :return: 0, 1 or 2 :rtype: int """ # If our node is acknowledged or in downtime, state is o...
[ "def", "get_service_node_state", "(", "self", ",", "state", ",", "problem_has_been_acknowledged", ",", "in_scheduled_downtime", ")", ":", "# If our node is acknowledged or in downtime, state is ok/up", "if", "problem_has_been_acknowledged", "or", "in_scheduled_downtime", ":", "st...
Get service node state, simplest case :: * Handle not value (revert) for service :return: 0, 1 or 2 :rtype: int
[ "Get", "service", "node", "state", "simplest", "case", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L194-L214
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.get_complex_or_node_state
def get_complex_or_node_state(self, hosts, services): """Get state , handle OR aggregation :: * Get the best state (min of sons) * Revert if it's a not node :param hosts: host objects :param services: service objects :return: 0, 1 or 2 :rtype: int ...
python
def get_complex_or_node_state(self, hosts, services): """Get state , handle OR aggregation :: * Get the best state (min of sons) * Revert if it's a not node :param hosts: host objects :param services: service objects :return: 0, 1 or 2 :rtype: int ...
[ "def", "get_complex_or_node_state", "(", "self", ",", "hosts", ",", "services", ")", ":", "# First we get the state of all our sons", "states", "=", "[", "s", ".", "get_state", "(", "hosts", ",", "services", ")", "for", "s", "in", "self", ".", "sons", "]", "...
Get state , handle OR aggregation :: * Get the best state (min of sons) * Revert if it's a not node :param hosts: host objects :param services: service objects :return: 0, 1 or 2 :rtype: int
[ "Get", "state", "handle", "OR", "aggregation", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L216-L234
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.get_complex_and_node_state
def get_complex_and_node_state(self, hosts, services): """Get state , handle AND aggregation :: * Get the worst state. 2 or max of sons (3 <=> UNKNOWN < CRITICAL <=> 2) * Revert if it's a not node :param hosts: host objects :param services: service objects :return...
python
def get_complex_and_node_state(self, hosts, services): """Get state , handle AND aggregation :: * Get the worst state. 2 or max of sons (3 <=> UNKNOWN < CRITICAL <=> 2) * Revert if it's a not node :param hosts: host objects :param services: service objects :return...
[ "def", "get_complex_and_node_state", "(", "self", ",", "hosts", ",", "services", ")", ":", "# First we get the state of all our sons", "states", "=", "[", "s", ".", "get_state", "(", "hosts", ",", "services", ")", "for", "s", "in", "self", ".", "sons", "]", ...
Get state , handle AND aggregation :: * Get the worst state. 2 or max of sons (3 <=> UNKNOWN < CRITICAL <=> 2) * Revert if it's a not node :param hosts: host objects :param services: service objects :return: 0, 1 or 2 :rtype: int
[ "Get", "state", "handle", "AND", "aggregation", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L236-L257
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.get_complex_xof_node_state
def get_complex_xof_node_state(self, hosts, services): # pylint: disable=too-many-locals, too-many-return-statements, too-many-branches """Get state , handle X of aggregation :: * Count the number of OK, WARNING, CRITICAL * Try too apply, in this order, Critical, Warning, OK rule ...
python
def get_complex_xof_node_state(self, hosts, services): # pylint: disable=too-many-locals, too-many-return-statements, too-many-branches """Get state , handle X of aggregation :: * Count the number of OK, WARNING, CRITICAL * Try too apply, in this order, Critical, Warning, OK rule ...
[ "def", "get_complex_xof_node_state", "(", "self", ",", "hosts", ",", "services", ")", ":", "# pylint: disable=too-many-locals, too-many-return-statements, too-many-branches", "# First we get the state of all our sons", "states", "=", "[", "s", ".", "get_state", "(", "hosts", ...
Get state , handle X of aggregation :: * Count the number of OK, WARNING, CRITICAL * Try too apply, in this order, Critical, Warning, OK rule * Return the code for first match (2, 1, 0) * If no rule apply, return OK for simple X of and worst state for multiple X of ...
[ "Get", "state", "handle", "X", "of", "aggregation", "::" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L259-L354
Alignak-monitoring/alignak
alignak/dependencynode.py
DependencyNode.list_all_elements
def list_all_elements(self): """Get all host/service uuid in our node and below :return: list of hosts/services uuids :rtype: list """ res = [] # We are a host/service if self.operand in ['host', 'service']: return [self.sons[0]] for son in ...
python
def list_all_elements(self): """Get all host/service uuid in our node and below :return: list of hosts/services uuids :rtype: list """ res = [] # We are a host/service if self.operand in ['host', 'service']: return [self.sons[0]] for son in ...
[ "def", "list_all_elements", "(", "self", ")", ":", "res", "=", "[", "]", "# We are a host/service", "if", "self", ".", "operand", "in", "[", "'host'", ",", "'service'", "]", ":", "return", "[", "self", ".", "sons", "[", "0", "]", "]", "for", "son", "...
Get all host/service uuid in our node and below :return: list of hosts/services uuids :rtype: list
[ "Get", "all", "host", "/", "service", "uuid", "in", "our", "node", "and", "below" ]
train
https://github.com/Alignak-monitoring/alignak/blob/f3c145207e83159b799d3714e4241399c7740a64/alignak/dependencynode.py#L356-L372