Files
mgmt/examples/lang/schedule0.mcl
James Shubin 90fa83a5cf lang: funcs: core: Move world API functions
Some of the core functions interact with the remote "world" API. Move
them all into the same package.
2019-02-07 12:32:32 -05:00

22 lines
570 B
Plaintext

import "sys"
import "world"
# here are all the possible options:
#$opts = struct{strategy => "rr", max => 3, reuse => false, ttl => 10,}
# although an empty struct is valid too:
#$opts = struct{}
# we'll just use a smaller subset today:
$opts = struct{strategy => "rr", max => 2, ttl => 10,}
# schedule in a particular namespace with options:
$set = world.schedule("xsched", $opts)
# and if you want, you can omit the options entirely:
#$set = world.schedule("xsched")
file "/tmp/mgmt/scheduled-${sys.hostname()}" {
content => template("set: {{ . }}\n", $set),
}