mirror of https://github.com/sipwise/ngcpcfg.git
Change-Id: I9847e1f62ce14bec878a44e67d4f4ebfc7171dbbchanges/62/22862/4
parent
ecbb5e97e4
commit
425540d71d
@ -0,0 +1,29 @@
|
||||
[%
|
||||
# vi: ft=tt2
|
||||
|
||||
# Return an array with name for all nodes.
|
||||
#
|
||||
# @param argv.status node status [ online, offline, inactive ]
|
||||
# default value: ['online', 'inactive']
|
||||
# @return out The array of fields "name", e.g.: [ 'sp1', 'sp2' ]
|
||||
|
||||
IF !argv.status.size;
|
||||
argv.status = ['online', 'inactive'];
|
||||
END;
|
||||
|
||||
status = {
|
||||
online = 0
|
||||
offline = 0
|
||||
inactive = 0
|
||||
};
|
||||
FOREACH val IN argv.status;
|
||||
status.$val = 1;
|
||||
END;
|
||||
|
||||
out = [];
|
||||
FOREACH host IN hosts.keys.sort;
|
||||
NEXT UNLESS status.item(hosts.$host.status);
|
||||
out.push( host );
|
||||
END;
|
||||
|
||||
-%]
|
@ -0,0 +1,30 @@
|
||||
[%
|
||||
# vi: ft=tt2
|
||||
|
||||
# Return an array of name for all neighbours (all nodes without self).
|
||||
#
|
||||
# @param argv.status node status [ online, offline, inactive ]
|
||||
# default value: ['online', 'inactive']
|
||||
# @return out The array of fields "name", e.g.: [ 'sp1', 'sp2' ]
|
||||
|
||||
IF !argv.status.size;
|
||||
argv.status = ['online', 'inactive'];
|
||||
END;
|
||||
|
||||
status = {
|
||||
online = 0
|
||||
offline = 0
|
||||
inactive = 0
|
||||
};
|
||||
FOREACH val IN argv.status;
|
||||
status.$val = 1;
|
||||
END;
|
||||
|
||||
out = [];
|
||||
FOREACH host IN hosts.keys.sort;
|
||||
NEXT UNLESS status.item(hosts.$host.status);
|
||||
NEXT IF host == ngcp.get_nodename();
|
||||
out.push( host );
|
||||
END;
|
||||
|
||||
-%]
|
Loading…
Reference in new issue