Skip to content

Instantly share code, notes, and snippets.

@jsteenb2
Last active May 7, 2020 19:51
Show Gist options
  • Save jsteenb2/b1f3254ea78fe2dd6a272fb1263f41b9 to your computer and use it in GitHub Desktop.
Save jsteenb2/b1f3254ea78fe2dd6a272fb1263f41b9 to your computer and use it in GitHub Desktop.
bucket uses jsonnet
local Label(name, desc, color) = {
apiVersion: 'influxdata.com/v2alpha1',
kind: 'Label',
metadata: {
name: name
},
spec: {
description: desc,
color: color
}
};
local LabelAssociations(names=[]) = [
{kind: 'Label', name: name}
for name in names
];
local Bucket(name, desc, secs, associations=LabelAssociations(['ruck-label-1'])) = {
apiVersion: 'influxdata.com/v2alpha1',
kind: 'Bucket',
metadata: {
name: name
},
spec: {
description: desc,
retentionRules: [
{type: 'expire', everySeconds: secs}
],
associations: associations
}
};
[
Label("ruck-label-1",desc="desc_1", color='#eee888'),
Bucket(name="ruck-1", desc="desc_1", secs=10000),
Bucket("ruck-2", "desc_2", 20000),
Bucket("ruck-3", "desc_3", 30000),
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment