|
1260 | 1260 | "t": "set", |
1261 | 1261 | "p": "url", |
1262 | 1262 | "pt": "msg", |
1263 | | - "to": "\"http://localhost/containers/\" & msg.payload.id & \"/json -H 'content-type: application/json'\"", |
| 1263 | + "to": "\"http://localhost/containers/\" & (msg.payload.id ? msg.payload.id : msg.payload.Actor.ID) & \"/json -H 'content-type: application/json'\"", |
1264 | 1264 | "tot": "jsonata" |
1265 | 1265 | } |
1266 | 1266 | ], |
|
2219 | 2219 | "t": "set", |
2220 | 2220 | "p": "payload", |
2221 | 2221 | "pt": "msg", |
2222 | | - "to": "{\t \"host\": msg.config.id,\t \"name\": $replace(msg.result.Name,\"/\",\"\"),\t \"hostname\": msg.result.Config.Hostname,\t \"status\": msg.result.State.Status = \"running\"\t ? \"running \" & $ceil(\t (\t $toMillis($now()) - $toMillis(msg.result.State.StartedAt)\t ) / 1000 / 60 / 60 / 24\t ) & \"d\"\t : \"na\",\t \"state\": msg.result.State.Status,\t \"operation\": \"none\",\t \"restart_policy\": msg.result.HostConfig.RestartPolicy.Name = \"\" ? \"no\" : msg.result.HostConfig.RestartPolicy.Name,\t \"image\": {\t \"host\": msg.config.id,\t \"ImageID\": msg.result.Image\t },\t \"HealthCheck\": msg.result.Config.Healthcheck,\t \"ContainerID\": msg.result.Id,\t \"cap_add\": msg.result.HostConfig.CapAdd,\t \"cap_drop\": msg.result.HostConfig.CapDrop,\t \"extra_hosts\": msg.result.HostConfig.ExtraHosts,\t \"pid_mode\": msg.result.HostConfig.PidMode,\t \"network_settings\": [\t $each(\t msg.result.NetworkSettings.Networks,\t function($v, $k) {\t {\t \"network\": { \"host\": msg.config.id, \"name\": $k } \t }\t }\t )\t ],\t \"ports\":msg.result.HostConfig.PortBindings ? [\t $each(\t msg.result.HostConfig.PortBindings,\t function($v, $k) {\t {\t \"public_port\": $count($v) = 0 or $v[0] = null or $length($v[0].HostPort) = 0 ? 0 : $v[0].HostPort,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ] : msg.result.NetworkSettings.Ports\t ? [\t $each(\t msg.result.NetworkSettings.Ports,\t function($v, $k) {\t {\t \"public_port\": -1,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ]\t : [],\t \"env\": [\t $map(\t msg.result.Config.Env,\t function($v, $k) {\t {\t \"var_name\": $substringBefore($v, \"=\"),\t \"value\": $substringAfter($v, \"=\")\t }\t }\t )\t ],\t \"labels\": [\t $each(\t msg.result.Config.Labels,\t function($v, $k) {\t { \"key\": $k, \"value\": $v }\t }\t )\t ],\t \"devices\": msg.result.HostConfig.Devices\t ? [\t $map(\t msg.result.HostConfig.Devices,\t function($v, $k) {\t {\t \"container_path\": $v.PathInContainer,\t \"host_path\": $v.PathOnHost\t }\t }\t )\t ],\t \"mounts\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"volume\"\t ? {\t \"source\": $v.Destination,\t \"volume\": {\t \"name\": $v.Name,\t \"host\": msg.config.id \t },\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"binds\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"bind\"\t ? {\t \"host_path\": $v.Source,\t \"container_path\": $v.Destination,\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"log_driver\": msg.result.HostConfig.LogConfig.Type,\t \"log_driver_options\": [\t $each(\t msg.result.HostConfig.LogConfig.Config,\t function($v, $k) {\t {\t \"option_name\": $k,\t \"value\": $v\t }\t }\t )\t ],\t \"cmd\": msg.result.Config.Cmd\t}", |
| 2222 | + "to": "{\t \"host\": msg.config.id,\t \"name\": $replace(msg.result.Name,\"/\",\"\"),\t \"hostname\": msg.result.Config.Hostname,\t \"status\": msg.result.State.Status = \"running\"\t ? \"running \" & $ceil(\t (\t $toMillis($now()) - $toMillis(msg.result.State.StartedAt)\t ) / 1000 / 60 / 60 / 24\t ) & \"d\"\t : \"na\",\t \"state\": msg.result.State.Status,\t \"operation\": \"none\",\t \"restart_policy\": msg.result.HostConfig.RestartPolicy.Name = \"\" ? \"no\" : msg.result.HostConfig.RestartPolicy.Name,\t \"image\": {\t \"host\": msg.config.id,\t \"ImageID\": msg.result.Image\t },\t \"HealthCheck\": msg.result.Config.Healthcheck,\t \"ContainerID\": msg.result.Id,\t \"cap_add\": msg.result.HostConfig.CapAdd != null ? msg.result.HostConfig.CapAdd.$replace(\"CAP_\", \"\")[] : msg.result.HostConfig.CapAdd,\t \"cap_drop\": msg.result.HostConfig.CapDrop != null ? msg.result.HostConfig.CapDrop.$replace(\"CAP_\", \"\")[] : msg.result.HostConfig.CapDrop,\t \"extra_hosts\": msg.result.HostConfig.ExtraHosts,\t \"pid_mode\": msg.result.HostConfig.PidMode,\t \"network_settings\": [\t $each(\t msg.result.NetworkSettings.Networks,\t function($v, $k) {\t {\t \"network\": { \"host\": msg.config.id, \"name\": $k } \t }\t }\t )\t ],\t \"ports\":msg.result.HostConfig.PortBindings ? [\t $each(\t msg.result.HostConfig.PortBindings,\t function($v, $k) {\t {\t \"public_port\": $count($v) = 0 or $v[0] = null or $length($v[0].HostPort) = 0 ? 0 : $v[0].HostPort,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ] : msg.result.NetworkSettings.Ports\t ? [\t $each(\t msg.result.NetworkSettings.Ports,\t function($v, $k) {\t {\t \"public_port\": -1,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ]\t : [],\t \"env\": [\t $map(\t msg.result.Config.Env,\t function($v, $k) {\t {\t \"var_name\": $substringBefore($v, \"=\"),\t \"value\": $substringAfter($v, \"=\")\t }\t }\t )\t ],\t \"labels\": [\t $each(\t msg.result.Config.Labels,\t function($v, $k) {\t { \"key\": $k, \"value\": $v }\t }\t )\t ],\t \"devices\": msg.result.HostConfig.Devices\t ? [\t $map(\t msg.result.HostConfig.Devices,\t function($v, $k) {\t {\t \"container_path\": $v.PathInContainer,\t \"host_path\": $v.PathOnHost\t }\t }\t )\t ],\t \"mounts\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"volume\"\t ? {\t \"source\": $v.Destination,\t \"volume\": {\t \"name\": $v.Name,\t \"host\": msg.config.id \t },\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"binds\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"bind\"\t ? {\t \"host_path\": $v.Source,\t \"container_path\": $v.Destination,\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"log_driver\": msg.result.HostConfig.LogConfig.Type,\t \"log_driver_options\": [\t $each(\t msg.result.HostConfig.LogConfig.Config,\t function($v, $k) {\t {\t \"option_name\": $k,\t \"value\": $v\t }\t }\t )\t ],\t \"cmd\": msg.result.Config.Cmd\t}", |
2223 | 2223 | "tot": "jsonata" |
2224 | 2224 | } |
2225 | 2225 | ], |
|
4526 | 4526 | "t": "set", |
4527 | 4527 | "p": "payload", |
4528 | 4528 | "pt": "msg", |
4529 | | - "to": "{\t \"Image\": msg.input.data.image.name & \":\" & msg.input.data.image.version,\t \"Hostname\": msg.input.data.hostname\t}", |
| 4529 | + "to": "{\t \"Image\": msg.input.data.image.name & \":\" & msg.input.data.image.version,\t \"Hostname\": msg.input.data.hostname,\t \"HostConfig\": {\t \"CapAdd\": msg.input.data.cap_add,\t \"CapDrop\": msg.input.data.cap_drop\t }\t}", |
4530 | 4530 | "tot": "jsonata" |
4531 | 4531 | }, |
4532 | 4532 | { |
|
6641 | 6641 | "t": "set", |
6642 | 6642 | "p": "payload", |
6643 | 6643 | "pt": "msg", |
6644 | | - "to": "[\t {\t \"id\": msg.input.data.id,\t \"host\": msg.input.data.host.id,\t \"name\": $replace(msg.result.Name,\"/\",\"\"),\t \"hostname\": msg.result.Config.Hostname,\t \"operation\": \"none\",\t \"state\": msg.result.State.Status,\t \"extra_hosts\": msg.result.HostConfig.ExtraHosts,\t \"restart_policy\": msg.result.HostConfig.RestartPolicy.Name = \"\" ? \"no\" : msg.result.HostConfig.RestartPolicy.Name,\t \"status\": msg.result.State.Status = \"running\"\t ? \"running \" & $ceil(\t (\t $toMillis($now()) - $toMillis(msg.result.State.StartedAt)\t ) / 1000 / 60 / 60 / 24\t ) & \"d\"\t : \"na\",\t \"image\": {\t \"host\": msg.input.data.host.id,\t \"ImageID\": msg.result.Image\t },\t \"ContainerID\": msg.result.Id,\t \"network_settings\": [\t $each(\t msg.result.NetworkSettings.Networks,\t function($v, $k) {\t {\t \"network\": { \"name\": $k, \"host\": msg.config.id } \t }\t }\t )\t ],\t \"ports\":msg.result.HostConfig.PortBindings ? [\t $each(\t msg.result.HostConfig.PortBindings,\t function($v, $k) {\t {\t \"public_port\": $count($v) = 0 or $v[0] = null or $length($v[0].HostPort) = 0 ? 0 : $v[0].HostPort,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ] : msg.result.NetworkSettings.Ports\t ? [\t $each(\t msg.result.NetworkSettings.Ports,\t function($v, $k) {\t {\t \"public_port\": -1,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ]\t : [],\t \"env\": [\t $map(\t msg.result.Config.Env,\t function($v, $k) {\t {\t \"var_name\": $substringBefore($v, \"=\"),\t \"value\": $substringAfter($v, \"=\")\t }\t }\t )\t ],\t \"labels\": [\t $each(\t msg.result.Config.Labels,\t function($v, $k) {\t { \"key\": $k, \"value\": $v }\t }\t )\t ],\t \"mounts\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"volume\"\t ? {\t \"source\": $v.Destination,\t \"volume\": {\t \"name\": $v.Name,\t \"host\": msg.config.id \t },\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"binds\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"bind\"\t ? {\t \"host_path\": $v.Source,\t \"container_path\": $v.Destination,\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"log_driver\": msg.result.HostConfig.LogConfig.Type,\t \"log_driver_options\": [\t $each(\t msg.result.HostConfig.LogConfig.Config,\t function($v, $k) {\t {\t \"option_name\": $k,\t \"value\": $v\t }\t }\t )\t ],\t \"cmd\": msg.result.Config.Cmd\t}\t]", |
| 6644 | + "to": "[\t {\t \"id\": msg.input.data.id,\t \"host\": msg.input.data.host.id,\t \"name\": $replace(msg.result.Name,\"/\",\"\"),\t \"hostname\": msg.result.Config.Hostname,\t \"operation\": \"none\",\t \"state\": msg.result.State.Status,\t \"extra_hosts\": msg.result.HostConfig.ExtraHosts,\t \"restart_policy\": msg.result.HostConfig.RestartPolicy.Name = \"\" ? \"no\" : msg.result.HostConfig.RestartPolicy.Name,\t \"status\": msg.result.State.Status = \"running\"\t ? \"running \" & $ceil(\t (\t $toMillis($now()) - $toMillis(msg.result.State.StartedAt)\t ) / 1000 / 60 / 60 / 24\t ) & \"d\"\t : \"na\",\t \"image\": {\t \"host\": msg.input.data.host.id,\t \"ImageID\": msg.result.Image\t },\t \"ContainerID\": msg.result.Id,\t \"cap_add\": msg.result.HostConfig.CapAdd != null ? msg.result.HostConfig.CapAdd.$replace(\"CAP_\", \"\")[] : msg.result.HostConfig.CapAdd,\t \"cap_drop\": msg.result.HostConfig.CapDrop != null ? msg.result.HostConfig.CapDrop.$replace(\"CAP_\", \"\")[] : msg.result.HostConfig.CapDrop,\t \"network_settings\": [\t $each(\t msg.result.NetworkSettings.Networks,\t function($v, $k) {\t {\t \"network\": { \"name\": $k, \"host\": msg.config.id } \t }\t }\t )\t ],\t \"ports\":msg.result.HostConfig.PortBindings ? [\t $each(\t msg.result.HostConfig.PortBindings,\t function($v, $k) {\t {\t \"public_port\": $count($v) = 0 or $v[0] = null or $length($v[0].HostPort) = 0 ? 0 : $v[0].HostPort,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ] : msg.result.NetworkSettings.Ports\t ? [\t $each(\t msg.result.NetworkSettings.Ports,\t function($v, $k) {\t {\t \"public_port\": -1,\t \"private_port\": $split($k,\"/\")[0],\t \"type\": $split($k,\"/\")[1]\t }\t }\t )\t ]\t : [],\t \"env\": [\t $map(\t msg.result.Config.Env,\t function($v, $k) {\t {\t \"var_name\": $substringBefore($v, \"=\"),\t \"value\": $substringAfter($v, \"=\")\t }\t }\t )\t ],\t \"labels\": [\t $each(\t msg.result.Config.Labels,\t function($v, $k) {\t { \"key\": $k, \"value\": $v }\t }\t )\t ],\t \"mounts\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"volume\"\t ? {\t \"source\": $v.Destination,\t \"volume\": {\t \"name\": $v.Name,\t \"host\": msg.config.id \t },\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"binds\": [\t $map(\t msg.result.Mounts,\t function($v, $k) {\t $v.Type = \"bind\"\t ? {\t \"host_path\": $v.Source,\t \"container_path\": $v.Destination,\t \"read_only\": $not($v.RW)\t }\t }\t )\t ],\t \"log_driver\": msg.result.HostConfig.LogConfig.Type,\t \"log_driver_options\": [\t $each(\t msg.result.HostConfig.LogConfig.Config,\t function($v, $k) {\t {\t \"option_name\": $k,\t \"value\": $v\t }\t }\t )\t ],\t \"cmd\": msg.result.Config.Cmd\t}\t]", |
6645 | 6645 | "tot": "jsonata" |
6646 | 6646 | } |
6647 | 6647 | ], |
|
6678 | 6678 | "y": 760, |
6679 | 6679 | "wires": [ |
6680 | 6680 | [ |
6681 | | - "d10c0e59950649aa" |
| 6681 | + "d10c0e59950649aa", |
| 6682 | + "8257b4684780cee7" |
6682 | 6683 | ] |
6683 | 6684 | ] |
6684 | 6685 | }, |
|
7287 | 7288 | [ |
7288 | 7289 | "f97a2faad0f4275a", |
7289 | 7290 | "c469b4b880927dc6", |
7290 | | - "a97b672b9bc9201e" |
| 7291 | + "a97b672b9bc9201e", |
| 7292 | + "516ce4d613bc361e" |
7291 | 7293 | ], |
7292 | 7294 | [] |
7293 | 7295 | ] |
|
7522 | 7524 | [] |
7523 | 7525 | ] |
7524 | 7526 | }, |
| 7527 | + { |
| 7528 | + "id": "8257b4684780cee7", |
| 7529 | + "type": "debug", |
| 7530 | + "z": "8e85e8c54d776ddc", |
| 7531 | + "name": "debug 1", |
| 7532 | + "active": true, |
| 7533 | + "tosidebar": true, |
| 7534 | + "console": false, |
| 7535 | + "tostatus": false, |
| 7536 | + "complete": "true", |
| 7537 | + "targetType": "full", |
| 7538 | + "statusVal": "", |
| 7539 | + "statusType": "auto", |
| 7540 | + "x": 1440, |
| 7541 | + "y": 860, |
| 7542 | + "wires": [] |
| 7543 | + }, |
| 7544 | + { |
| 7545 | + "id": "516ce4d613bc361e", |
| 7546 | + "type": "debug", |
| 7547 | + "z": "8e85e8c54d776ddc", |
| 7548 | + "name": "debug 2", |
| 7549 | + "active": true, |
| 7550 | + "tosidebar": true, |
| 7551 | + "console": false, |
| 7552 | + "tostatus": false, |
| 7553 | + "complete": "true", |
| 7554 | + "targetType": "full", |
| 7555 | + "statusVal": "", |
| 7556 | + "statusType": "auto", |
| 7557 | + "x": 1080, |
| 7558 | + "y": 920, |
| 7559 | + "wires": [] |
| 7560 | + }, |
7525 | 7561 | { |
7526 | 7562 | "id": "3eb97ccb653722a0", |
7527 | 7563 | "type": "http in", |
|
0 commit comments