generated from pulumi/pulumi-tf-provider-boilerplate
/
oncallIntegration.go
310 lines (258 loc) · 14 KB
/
oncallIntegration.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package grafana
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/internal"
)
type OncallIntegration struct {
pulumi.CustomResourceState
// The Default route for all alerts from the given integration
DefaultRoute OncallIntegrationDefaultRouteOutput `pulumi:"defaultRoute"`
// The link for using in an integrated tool.
Link pulumi.StringOutput `pulumi:"link"`
// The name of the service integration.
Name pulumi.StringOutput `pulumi:"name"`
// The ID of the OnCall team. To get one, create a team in Grafana, and navigate to the OnCall plugin (to sync the team
// with OnCall). You can then get the ID using the `grafana_oncall_team` datasource.
TeamId pulumi.StringPtrOutput `pulumi:"teamId"`
// Jinja2 templates for Alert payload. An empty templates block will be ignored.
Templates OncallIntegrationTemplatesPtrOutput `pulumi:"templates"`
// The type of integration. Can be grafana, grafana_alerting, webhook, alertmanager, kapacitor, fabric, newrelic, datadog,
// pagerduty, pingdom, elastalert, amazon_sns, curler, sentry, formatted_webhook, heartbeat, demo, manual, stackdriver,
// uptimerobot, sentry_platform, zabbix, prtg, slack_channel, inbound_email, direct_paging, jira.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewOncallIntegration registers a new resource with the given unique name, arguments, and options.
func NewOncallIntegration(ctx *pulumi.Context,
name string, args *OncallIntegrationArgs, opts ...pulumi.ResourceOption) (*OncallIntegration, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.DefaultRoute == nil {
return nil, errors.New("invalid value for required argument 'DefaultRoute'")
}
if args.Type == nil {
return nil, errors.New("invalid value for required argument 'Type'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource OncallIntegration
err := ctx.RegisterResource("grafana:index/oncallIntegration:OncallIntegration", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetOncallIntegration gets an existing OncallIntegration resource's state with the given name, ID, and optional
// state properties that are used to uniquely qualify the lookup (nil if not required).
func GetOncallIntegration(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *OncallIntegrationState, opts ...pulumi.ResourceOption) (*OncallIntegration, error) {
var resource OncallIntegration
err := ctx.ReadResource("grafana:index/oncallIntegration:OncallIntegration", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering OncallIntegration resources.
type oncallIntegrationState struct {
// The Default route for all alerts from the given integration
DefaultRoute *OncallIntegrationDefaultRoute `pulumi:"defaultRoute"`
// The link for using in an integrated tool.
Link *string `pulumi:"link"`
// The name of the service integration.
Name *string `pulumi:"name"`
// The ID of the OnCall team. To get one, create a team in Grafana, and navigate to the OnCall plugin (to sync the team
// with OnCall). You can then get the ID using the `grafana_oncall_team` datasource.
TeamId *string `pulumi:"teamId"`
// Jinja2 templates for Alert payload. An empty templates block will be ignored.
Templates *OncallIntegrationTemplates `pulumi:"templates"`
// The type of integration. Can be grafana, grafana_alerting, webhook, alertmanager, kapacitor, fabric, newrelic, datadog,
// pagerduty, pingdom, elastalert, amazon_sns, curler, sentry, formatted_webhook, heartbeat, demo, manual, stackdriver,
// uptimerobot, sentry_platform, zabbix, prtg, slack_channel, inbound_email, direct_paging, jira.
Type *string `pulumi:"type"`
}
type OncallIntegrationState struct {
// The Default route for all alerts from the given integration
DefaultRoute OncallIntegrationDefaultRoutePtrInput
// The link for using in an integrated tool.
Link pulumi.StringPtrInput
// The name of the service integration.
Name pulumi.StringPtrInput
// The ID of the OnCall team. To get one, create a team in Grafana, and navigate to the OnCall plugin (to sync the team
// with OnCall). You can then get the ID using the `grafana_oncall_team` datasource.
TeamId pulumi.StringPtrInput
// Jinja2 templates for Alert payload. An empty templates block will be ignored.
Templates OncallIntegrationTemplatesPtrInput
// The type of integration. Can be grafana, grafana_alerting, webhook, alertmanager, kapacitor, fabric, newrelic, datadog,
// pagerduty, pingdom, elastalert, amazon_sns, curler, sentry, formatted_webhook, heartbeat, demo, manual, stackdriver,
// uptimerobot, sentry_platform, zabbix, prtg, slack_channel, inbound_email, direct_paging, jira.
Type pulumi.StringPtrInput
}
func (OncallIntegrationState) ElementType() reflect.Type {
return reflect.TypeOf((*oncallIntegrationState)(nil)).Elem()
}
type oncallIntegrationArgs struct {
// The Default route for all alerts from the given integration
DefaultRoute OncallIntegrationDefaultRoute `pulumi:"defaultRoute"`
// The name of the service integration.
Name *string `pulumi:"name"`
// The ID of the OnCall team. To get one, create a team in Grafana, and navigate to the OnCall plugin (to sync the team
// with OnCall). You can then get the ID using the `grafana_oncall_team` datasource.
TeamId *string `pulumi:"teamId"`
// Jinja2 templates for Alert payload. An empty templates block will be ignored.
Templates *OncallIntegrationTemplates `pulumi:"templates"`
// The type of integration. Can be grafana, grafana_alerting, webhook, alertmanager, kapacitor, fabric, newrelic, datadog,
// pagerduty, pingdom, elastalert, amazon_sns, curler, sentry, formatted_webhook, heartbeat, demo, manual, stackdriver,
// uptimerobot, sentry_platform, zabbix, prtg, slack_channel, inbound_email, direct_paging, jira.
Type string `pulumi:"type"`
}
// The set of arguments for constructing a OncallIntegration resource.
type OncallIntegrationArgs struct {
// The Default route for all alerts from the given integration
DefaultRoute OncallIntegrationDefaultRouteInput
// The name of the service integration.
Name pulumi.StringPtrInput
// The ID of the OnCall team. To get one, create a team in Grafana, and navigate to the OnCall plugin (to sync the team
// with OnCall). You can then get the ID using the `grafana_oncall_team` datasource.
TeamId pulumi.StringPtrInput
// Jinja2 templates for Alert payload. An empty templates block will be ignored.
Templates OncallIntegrationTemplatesPtrInput
// The type of integration. Can be grafana, grafana_alerting, webhook, alertmanager, kapacitor, fabric, newrelic, datadog,
// pagerduty, pingdom, elastalert, amazon_sns, curler, sentry, formatted_webhook, heartbeat, demo, manual, stackdriver,
// uptimerobot, sentry_platform, zabbix, prtg, slack_channel, inbound_email, direct_paging, jira.
Type pulumi.StringInput
}
func (OncallIntegrationArgs) ElementType() reflect.Type {
return reflect.TypeOf((*oncallIntegrationArgs)(nil)).Elem()
}
type OncallIntegrationInput interface {
pulumi.Input
ToOncallIntegrationOutput() OncallIntegrationOutput
ToOncallIntegrationOutputWithContext(ctx context.Context) OncallIntegrationOutput
}
func (*OncallIntegration) ElementType() reflect.Type {
return reflect.TypeOf((**OncallIntegration)(nil)).Elem()
}
func (i *OncallIntegration) ToOncallIntegrationOutput() OncallIntegrationOutput {
return i.ToOncallIntegrationOutputWithContext(context.Background())
}
func (i *OncallIntegration) ToOncallIntegrationOutputWithContext(ctx context.Context) OncallIntegrationOutput {
return pulumi.ToOutputWithContext(ctx, i).(OncallIntegrationOutput)
}
// OncallIntegrationArrayInput is an input type that accepts OncallIntegrationArray and OncallIntegrationArrayOutput values.
// You can construct a concrete instance of `OncallIntegrationArrayInput` via:
//
// OncallIntegrationArray{ OncallIntegrationArgs{...} }
type OncallIntegrationArrayInput interface {
pulumi.Input
ToOncallIntegrationArrayOutput() OncallIntegrationArrayOutput
ToOncallIntegrationArrayOutputWithContext(context.Context) OncallIntegrationArrayOutput
}
type OncallIntegrationArray []OncallIntegrationInput
func (OncallIntegrationArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*OncallIntegration)(nil)).Elem()
}
func (i OncallIntegrationArray) ToOncallIntegrationArrayOutput() OncallIntegrationArrayOutput {
return i.ToOncallIntegrationArrayOutputWithContext(context.Background())
}
func (i OncallIntegrationArray) ToOncallIntegrationArrayOutputWithContext(ctx context.Context) OncallIntegrationArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(OncallIntegrationArrayOutput)
}
// OncallIntegrationMapInput is an input type that accepts OncallIntegrationMap and OncallIntegrationMapOutput values.
// You can construct a concrete instance of `OncallIntegrationMapInput` via:
//
// OncallIntegrationMap{ "key": OncallIntegrationArgs{...} }
type OncallIntegrationMapInput interface {
pulumi.Input
ToOncallIntegrationMapOutput() OncallIntegrationMapOutput
ToOncallIntegrationMapOutputWithContext(context.Context) OncallIntegrationMapOutput
}
type OncallIntegrationMap map[string]OncallIntegrationInput
func (OncallIntegrationMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*OncallIntegration)(nil)).Elem()
}
func (i OncallIntegrationMap) ToOncallIntegrationMapOutput() OncallIntegrationMapOutput {
return i.ToOncallIntegrationMapOutputWithContext(context.Background())
}
func (i OncallIntegrationMap) ToOncallIntegrationMapOutputWithContext(ctx context.Context) OncallIntegrationMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(OncallIntegrationMapOutput)
}
type OncallIntegrationOutput struct{ *pulumi.OutputState }
func (OncallIntegrationOutput) ElementType() reflect.Type {
return reflect.TypeOf((**OncallIntegration)(nil)).Elem()
}
func (o OncallIntegrationOutput) ToOncallIntegrationOutput() OncallIntegrationOutput {
return o
}
func (o OncallIntegrationOutput) ToOncallIntegrationOutputWithContext(ctx context.Context) OncallIntegrationOutput {
return o
}
// The Default route for all alerts from the given integration
func (o OncallIntegrationOutput) DefaultRoute() OncallIntegrationDefaultRouteOutput {
return o.ApplyT(func(v *OncallIntegration) OncallIntegrationDefaultRouteOutput { return v.DefaultRoute }).(OncallIntegrationDefaultRouteOutput)
}
// The link for using in an integrated tool.
func (o OncallIntegrationOutput) Link() pulumi.StringOutput {
return o.ApplyT(func(v *OncallIntegration) pulumi.StringOutput { return v.Link }).(pulumi.StringOutput)
}
// The name of the service integration.
func (o OncallIntegrationOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *OncallIntegration) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The ID of the OnCall team. To get one, create a team in Grafana, and navigate to the OnCall plugin (to sync the team
// with OnCall). You can then get the ID using the `grafana_oncall_team` datasource.
func (o OncallIntegrationOutput) TeamId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *OncallIntegration) pulumi.StringPtrOutput { return v.TeamId }).(pulumi.StringPtrOutput)
}
// Jinja2 templates for Alert payload. An empty templates block will be ignored.
func (o OncallIntegrationOutput) Templates() OncallIntegrationTemplatesPtrOutput {
return o.ApplyT(func(v *OncallIntegration) OncallIntegrationTemplatesPtrOutput { return v.Templates }).(OncallIntegrationTemplatesPtrOutput)
}
// The type of integration. Can be grafana, grafana_alerting, webhook, alertmanager, kapacitor, fabric, newrelic, datadog,
// pagerduty, pingdom, elastalert, amazon_sns, curler, sentry, formatted_webhook, heartbeat, demo, manual, stackdriver,
// uptimerobot, sentry_platform, zabbix, prtg, slack_channel, inbound_email, direct_paging, jira.
func (o OncallIntegrationOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *OncallIntegration) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type OncallIntegrationArrayOutput struct{ *pulumi.OutputState }
func (OncallIntegrationArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*OncallIntegration)(nil)).Elem()
}
func (o OncallIntegrationArrayOutput) ToOncallIntegrationArrayOutput() OncallIntegrationArrayOutput {
return o
}
func (o OncallIntegrationArrayOutput) ToOncallIntegrationArrayOutputWithContext(ctx context.Context) OncallIntegrationArrayOutput {
return o
}
func (o OncallIntegrationArrayOutput) Index(i pulumi.IntInput) OncallIntegrationOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *OncallIntegration {
return vs[0].([]*OncallIntegration)[vs[1].(int)]
}).(OncallIntegrationOutput)
}
type OncallIntegrationMapOutput struct{ *pulumi.OutputState }
func (OncallIntegrationMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*OncallIntegration)(nil)).Elem()
}
func (o OncallIntegrationMapOutput) ToOncallIntegrationMapOutput() OncallIntegrationMapOutput {
return o
}
func (o OncallIntegrationMapOutput) ToOncallIntegrationMapOutputWithContext(ctx context.Context) OncallIntegrationMapOutput {
return o
}
func (o OncallIntegrationMapOutput) MapIndex(k pulumi.StringInput) OncallIntegrationOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *OncallIntegration {
return vs[0].(map[string]*OncallIntegration)[vs[1].(string)]
}).(OncallIntegrationOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*OncallIntegrationInput)(nil)).Elem(), &OncallIntegration{})
pulumi.RegisterInputType(reflect.TypeOf((*OncallIntegrationArrayInput)(nil)).Elem(), OncallIntegrationArray{})
pulumi.RegisterInputType(reflect.TypeOf((*OncallIntegrationMapInput)(nil)).Elem(), OncallIntegrationMap{})
pulumi.RegisterOutputType(OncallIntegrationOutput{})
pulumi.RegisterOutputType(OncallIntegrationArrayOutput{})
pulumi.RegisterOutputType(OncallIntegrationMapOutput{})
}