summaryrefslogtreecommitdiff
path: root/modules/ri-base/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2021-02-05 10:51:00 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2021-02-05 10:51:00 +0100
commitba6bd2c40a22a4a9cf2307ceec0f71e4fbdc842c (patch)
treebec9840fc8108d1ec9d656b7c905f1c4c1ab93ec /modules/ri-base/src
parent6ae284b9b61558078e9003defc50966c3e41e45c (diff)
downloadrules-sandbox-ba6bd2c40a22a4a9cf2307ceec0f71e4fbdc842c.tar.gz
rules-sandbox-ba6bd2c40a22a4a9cf2307ceec0f71e4fbdc842c.tar.bz2
rules-sandbox-ba6bd2c40a22a4a9cf2307ceec0f71e4fbdc842c.tar.xz
rules-sandbox-ba6bd2c40a22a4a9cf2307ceec0f71e4fbdc842c.zip
Better dba rules.
Diffstat (limited to 'modules/ri-base/src')
-rw-r--r--modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl9
1 files changed, 4 insertions, 5 deletions
diff --git a/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl b/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl
index c31bc57..f1a1da2 100644
--- a/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl
+++ b/modules/ri-base/src/main/resources/io/trygvis/rules/dba/dba.drl
@@ -14,19 +14,18 @@ global io.trygvis.rules.engine.TemplateEngine te;
dialect "mvel"
declare DbaMachineRole
- machine : String
+ machine : Machine
roles : String[]
end
rule "Assign containers to machine"
when
- $machine : Machine()
- $machineRole : DbaMachineRole(machine == $machine.name)
+ $machineRole : DbaMachineRole(machine)
$container : Container(machine == null, $machineRole.roles contains machineRole)
then
- System.out.println("Assigning container to machine: " + $machine.name);
+ System.out.println("Assigning container " + $container.cluster.name + "/" + $container.name + " to machine: " + $machineRole.machine.name);
modify ($container) {
- machine = $machine
+ machine = $machineRole.machine
}
end