Add load scenario command

Add alternative method of starting an instance by loading a scenario.
Since there's no save when starting a scenario it can only be used if
the save patching is disabled.
This commit is contained in:
Hornwitser committed 2020-07-06 13:10:26 +02:00
1 parent 9458155a1b
commit 8c6130adba
4 files changed
+99 -11

No files matched your search

+17
View File
@@ -395,6 +395,23 @@ commands.push(new Command({
},
}));
commands.push(new Command({
definition: ["load-scenario", "Start instance by loading a scenario", (yargs) => {
yargs.options({
"instance": { describe: "Instance to start", nargs: 1, type: "string", demandOption: true },
"scenario": { describe: "Scenario to load", nargs: 1, type: "string" },
});
}],
handler: async function(args, control) {
let instanceId = await resolveInstance(control, args.instance);
await link.messages.setInstanceOutputSubscriptions.send(control, { instance_ids: [instanceId] });
let response = await link.messages.loadScenario.send(control, {
instance_id: instanceId,
scenario: args.scenario || null,
});
},
}));
commands.push(new Command({
definition: ["stop-instance", "Stop instance", (yargs) => {
yargs.options({