mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 23:33:12 +09:00
Forward Factorio logs to clusterctl
Add instance output event that is forwarded by the master server to control connections that are subscribing to them. Add code subscribing to the relevant instance output when dealing with instances in clusterctl.
This commit is contained in:
1 parent
f2c3006046
commit
1dea5fddbe
4 files changed
+139
-12
No files matched your search
@@ -260,6 +260,18 @@ requests.listInstances = new Request({
|
||||
},
|
||||
});
|
||||
|
||||
requests.setInstanceOutputSubscriptions = new Request({
|
||||
type: 'set_instance_output_subscriptions',
|
||||
sources: ['control'],
|
||||
targets: ['master'],
|
||||
requestProperties: {
|
||||
"instance_ids": {
|
||||
type: "array",
|
||||
items: { type: "integer" },
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
requests.createInstanceCommand = new Request({
|
||||
type: 'create_instance',
|
||||
sources: ['control'],
|
||||
@@ -397,6 +409,31 @@ events.updateInstances = new Event({
|
||||
},
|
||||
});
|
||||
|
||||
events.instanceOutput = new Event({
|
||||
type: 'instance_output',
|
||||
sources: ['slave', 'master'],
|
||||
targets: ['master', 'control'],
|
||||
eventProperties: {
|
||||
"instance_id": { type: "integer" },
|
||||
"output": {
|
||||
type: "object",
|
||||
additionalProperties: false,
|
||||
required: ["source", "received", "format", "type", "message"],
|
||||
properties: {
|
||||
"source": { type: "string" },
|
||||
"received": { type: "number" },
|
||||
"format": { type: "string" },
|
||||
"time": { type: "string" },
|
||||
"level": { type: "string" },
|
||||
"file": { type: "string" },
|
||||
"type": { type: "string" },
|
||||
"action": { type: "string" },
|
||||
"message": { type: "string" },
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Attaches all requests and events to the given link
|
||||
|
||||
Reference in new issue
Block a user