-
Notifications
You must be signed in to change notification settings - Fork 1
/
oJobNet.yaml
22 lines (19 loc) · 1 KB
/
oJobNet.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright 2023 Nuno Aguiar
jobs:
##################
# Tests a TCP port
#
- name: NET Port test
help: >
Tests access to TCP port (the result will be available as a boolean in args.__netPortTest[host][port]:
- args.host (String) The host or ip address to test with.
- args.port (Number) The port to test.
- args.timeout (Number) A timeout (in ms). Defaults to 1,5 seconds.
exec: |
ow.loadFormat();
_$(args.host).isString().$_("A host or ip address is needed to test connectivity to a port");
_$(args.port).isNumber().$_("A port is needed to test connectivity to a port");
_$(args.timeout).isNumber().default();
args.__netPortTest = _$(args.__netPortTest).isMap().default({});
args.__netPortTest[args.host] = _$(args.__netPortTest[args.host]).isMap().default({});
args.__netPortTest[args.host][args.port] = ow.format.testPort(args.host, args.port, args.timeout);