Skip to content

Commit

Permalink
feat(oncall): add escalationChain constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-bauer committed Dec 27, 2024
1 parent 518ac75 commit 382ca37
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions grafanaplane/main.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,31 @@ local raw = import './zz/main.libsonnet';

},

oncall: {
'#': d.package.newSub('oncall', ''),
escalationChain: {
local escalationChain = raw.oncall.v1alpha1.escalationChain,
'#new': d.func.new(
|||
`new` creates an Escalation Chain. The `name` is a display-friendly
string, and `resourceId` defaults to a slug-ified version of it.
`providerName` is the resource name (`myprovider.metadata.name`) of
the Provider.
|||,
[
d.argument.new('name', d.T.string),
d.argument.new('providerName', d.T.string),
d.argument.new('resourceId', d.T.string, default='rfc1123(name)'),
]
),
new(name, providerName, teamId=null, resourceId=null)::
local id = if resourceId != null then resourceId else xtd.ascii.stringToRFC1123(name);
escalationChain.new(id)
+ escalationChain.spec.parameters.providerConfigRef.withName(providerName)
+ escalationChain.spec.parameters.forProvider.withName(name),
},
},

sm: {
'#': d.package.newSub('sm', ''),

Expand Down

0 comments on commit 382ca37

Please sign in to comment.