Files
mgmt/examples/lang/getval0.mcl
James Shubin 377d62999f engine: resources: The kv resource can set un-mapped values
Previously the resource could only set values in a per-hostname
namespace, but for single, user-managed values, we'd like to be able to
control things entirely. Now this resource can do that.
2024-01-22 17:43:24 -05:00

20 lines
430 B
Plaintext

# etcdctl --endpoints=localhost:2379 get --prefix / # to see all the values
# etcdctl --endpoints=localhost:2379 put /somekey somevalue # to put a value
import "world"
$key = "somekey"
$st = world.getval($key)
$val = $st->value
$exists = $st->exists
# stores a value in: /_mgmt/strings/${key}
kv "kv" {
key => $key,
value => "three",
}
file "/tmp/val" {
state => $const.res.file.state.exists,
content => "val: ${val}\n",
}