/
detector.go
734 lines (668 loc) · 30.5 KB
/
detector.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
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
// 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 signalfx
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides a SignalFx detector resource. This can be used to create and manage detectors.
//
// > **NOTE** If you're interested in using SignalFx detector features such as Historical Anomaly, Resource Running Out, or others then consider building them in the UI first then using the "Show SignalFlow" feature to extract the value for `programText`. You may also consult the [documentation for detector functions in signalflow-library](https://github.com/signalfx/signalflow-library/tree/master/library/signalfx/detectors).
//
// ## Notification Format
//
// As SignalFx supports different notification mechanisms a comma-delimited string is used to provide inputs. If you'd like to specify multiple notifications, then each should be a member in the list, like so:
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// This will likely be changed in a future iteration of the provider. See [SignalFx Docs](https://developers.signalfx.com/detectors_reference.html#operation/Create%20Single%20Detector) for more information. For now, here are some example of how to configure each notification type:
//
// ### Email
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### Jira
//
// Note that the `credentialId` is the SignalFx-provided ID shown after setting up your Jira integration. (See also `jira.Integration`.)
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### Opsgenie
//
// Note that the `credentialId` is the SignalFx-provided ID shown after setting up your Opsgenie integration. `Team` here is hardcoded as the `responderType` as that is the only acceptable type as per the API docs.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### PagerDuty
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### Slack
//
// Exclude the `#` on the channel name!
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### Team
//
// Sends [notifications to a team](https://docs.signalfx.com/en/latest/managing/teams/team-notifications.html).
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### TeamEmail
//
// Sends an email to every member of a team.
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### VictorOps
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ### Webhook
//
// > **NOTE** You need to include all the commas even if you only use a credential id below.
//
// You can either configure a Webhook to use an existing integration's credential id:
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// or configure one inline:
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Detectors can be imported using their string ID (recoverable from URL`/#/detector/v2/abc123/edit`, e.g.
//
// ```sh
//
// $ pulumi import signalfx:index/detector:Detector application_delay abc123
//
// ```
type Detector struct {
pulumi.CustomResourceState
// Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
AuthorizedWriterTeams pulumi.StringArrayOutput `pulumi:"authorizedWriterTeams"`
// User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
AuthorizedWriterUsers pulumi.StringArrayOutput `pulumi:"authorizedWriterUsers"`
// Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
Description pulumi.StringPtrOutput `pulumi:"description"`
// When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
DisableSampling pulumi.BoolPtrOutput `pulumi:"disableSampling"`
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
EndTime pulumi.IntPtrOutput `pulumi:"endTime"`
// The resolutions of the detector alerts in milliseconds that indicate how often data is analyzed to determine if an alert should be triggered.
LabelResolutions pulumi.IntMapOutput `pulumi:"labelResolutions"`
// How long (in seconds) to wait for late datapoints. See [Delayed Datapoints](https://signalfx-product-docs.readthedocs-hosted.com/en/latest/charts/chart-builder.html#delayed-datapoints) for more info. Max value is `900` seconds (15 minutes). `Auto` (as little as possible) by default.
MaxDelay pulumi.IntPtrOutput `pulumi:"maxDelay"`
// How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
MinDelay pulumi.IntPtrOutput `pulumi:"minDelay"`
// Name of the detector.
Name pulumi.StringOutput `pulumi:"name"`
// Signalflow program text for the detector. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
ProgramText pulumi.StringOutput `pulumi:"programText"`
// Set of rules used for alerting.
Rules DetectorRuleArrayOutput `pulumi:"rules"`
// When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
ShowDataMarkers pulumi.BoolPtrOutput `pulumi:"showDataMarkers"`
// When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
ShowEventLines pulumi.BoolPtrOutput `pulumi:"showEventLines"`
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
StartTime pulumi.IntPtrOutput `pulumi:"startTime"`
// Tags associated with the detector.
Tags pulumi.StringArrayOutput `pulumi:"tags"`
// Team IDs to associate the detector to.
Teams pulumi.StringArrayOutput `pulumi:"teams"`
// Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
TimeRange pulumi.IntPtrOutput `pulumi:"timeRange"`
// The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
Timezone pulumi.StringPtrOutput `pulumi:"timezone"`
// The URL of the detector.
Url pulumi.StringOutput `pulumi:"url"`
// Plot-level customization options, associated with a publish statement.
VizOptions DetectorVizOptionArrayOutput `pulumi:"vizOptions"`
}
// NewDetector registers a new resource with the given unique name, arguments, and options.
func NewDetector(ctx *pulumi.Context,
name string, args *DetectorArgs, opts ...pulumi.ResourceOption) (*Detector, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ProgramText == nil {
return nil, errors.New("invalid value for required argument 'ProgramText'")
}
if args.Rules == nil {
return nil, errors.New("invalid value for required argument 'Rules'")
}
var resource Detector
err := ctx.RegisterResource("signalfx:index/detector:Detector", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetDetector gets an existing Detector 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 GetDetector(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *DetectorState, opts ...pulumi.ResourceOption) (*Detector, error) {
var resource Detector
err := ctx.ReadResource("signalfx:index/detector:Detector", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering Detector resources.
type detectorState struct {
// Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
AuthorizedWriterTeams []string `pulumi:"authorizedWriterTeams"`
// User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
AuthorizedWriterUsers []string `pulumi:"authorizedWriterUsers"`
// Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
Description *string `pulumi:"description"`
// When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
DisableSampling *bool `pulumi:"disableSampling"`
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
EndTime *int `pulumi:"endTime"`
// The resolutions of the detector alerts in milliseconds that indicate how often data is analyzed to determine if an alert should be triggered.
LabelResolutions map[string]int `pulumi:"labelResolutions"`
// How long (in seconds) to wait for late datapoints. See [Delayed Datapoints](https://signalfx-product-docs.readthedocs-hosted.com/en/latest/charts/chart-builder.html#delayed-datapoints) for more info. Max value is `900` seconds (15 minutes). `Auto` (as little as possible) by default.
MaxDelay *int `pulumi:"maxDelay"`
// How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
MinDelay *int `pulumi:"minDelay"`
// Name of the detector.
Name *string `pulumi:"name"`
// Signalflow program text for the detector. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
ProgramText *string `pulumi:"programText"`
// Set of rules used for alerting.
Rules []DetectorRule `pulumi:"rules"`
// When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
ShowDataMarkers *bool `pulumi:"showDataMarkers"`
// When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
ShowEventLines *bool `pulumi:"showEventLines"`
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
StartTime *int `pulumi:"startTime"`
// Tags associated with the detector.
Tags []string `pulumi:"tags"`
// Team IDs to associate the detector to.
Teams []string `pulumi:"teams"`
// Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
TimeRange *int `pulumi:"timeRange"`
// The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
Timezone *string `pulumi:"timezone"`
// The URL of the detector.
Url *string `pulumi:"url"`
// Plot-level customization options, associated with a publish statement.
VizOptions []DetectorVizOption `pulumi:"vizOptions"`
}
type DetectorState struct {
// Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
AuthorizedWriterTeams pulumi.StringArrayInput
// User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
AuthorizedWriterUsers pulumi.StringArrayInput
// Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
Description pulumi.StringPtrInput
// When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
DisableSampling pulumi.BoolPtrInput
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
EndTime pulumi.IntPtrInput
// The resolutions of the detector alerts in milliseconds that indicate how often data is analyzed to determine if an alert should be triggered.
LabelResolutions pulumi.IntMapInput
// How long (in seconds) to wait for late datapoints. See [Delayed Datapoints](https://signalfx-product-docs.readthedocs-hosted.com/en/latest/charts/chart-builder.html#delayed-datapoints) for more info. Max value is `900` seconds (15 minutes). `Auto` (as little as possible) by default.
MaxDelay pulumi.IntPtrInput
// How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
MinDelay pulumi.IntPtrInput
// Name of the detector.
Name pulumi.StringPtrInput
// Signalflow program text for the detector. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
ProgramText pulumi.StringPtrInput
// Set of rules used for alerting.
Rules DetectorRuleArrayInput
// When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
ShowDataMarkers pulumi.BoolPtrInput
// When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
ShowEventLines pulumi.BoolPtrInput
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
StartTime pulumi.IntPtrInput
// Tags associated with the detector.
Tags pulumi.StringArrayInput
// Team IDs to associate the detector to.
Teams pulumi.StringArrayInput
// Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
TimeRange pulumi.IntPtrInput
// The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
Timezone pulumi.StringPtrInput
// The URL of the detector.
Url pulumi.StringPtrInput
// Plot-level customization options, associated with a publish statement.
VizOptions DetectorVizOptionArrayInput
}
func (DetectorState) ElementType() reflect.Type {
return reflect.TypeOf((*detectorState)(nil)).Elem()
}
type detectorArgs struct {
// Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
AuthorizedWriterTeams []string `pulumi:"authorizedWriterTeams"`
// User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
AuthorizedWriterUsers []string `pulumi:"authorizedWriterUsers"`
// Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
Description *string `pulumi:"description"`
// When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
DisableSampling *bool `pulumi:"disableSampling"`
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
EndTime *int `pulumi:"endTime"`
// How long (in seconds) to wait for late datapoints. See [Delayed Datapoints](https://signalfx-product-docs.readthedocs-hosted.com/en/latest/charts/chart-builder.html#delayed-datapoints) for more info. Max value is `900` seconds (15 minutes). `Auto` (as little as possible) by default.
MaxDelay *int `pulumi:"maxDelay"`
// How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
MinDelay *int `pulumi:"minDelay"`
// Name of the detector.
Name *string `pulumi:"name"`
// Signalflow program text for the detector. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
ProgramText string `pulumi:"programText"`
// Set of rules used for alerting.
Rules []DetectorRule `pulumi:"rules"`
// When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
ShowDataMarkers *bool `pulumi:"showDataMarkers"`
// When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
ShowEventLines *bool `pulumi:"showEventLines"`
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
StartTime *int `pulumi:"startTime"`
// Tags associated with the detector.
Tags []string `pulumi:"tags"`
// Team IDs to associate the detector to.
Teams []string `pulumi:"teams"`
// Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
TimeRange *int `pulumi:"timeRange"`
// The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
Timezone *string `pulumi:"timezone"`
// Plot-level customization options, associated with a publish statement.
VizOptions []DetectorVizOption `pulumi:"vizOptions"`
}
// The set of arguments for constructing a Detector resource.
type DetectorArgs struct {
// Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
AuthorizedWriterTeams pulumi.StringArrayInput
// User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
AuthorizedWriterUsers pulumi.StringArrayInput
// Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
Description pulumi.StringPtrInput
// When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
DisableSampling pulumi.BoolPtrInput
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
EndTime pulumi.IntPtrInput
// How long (in seconds) to wait for late datapoints. See [Delayed Datapoints](https://signalfx-product-docs.readthedocs-hosted.com/en/latest/charts/chart-builder.html#delayed-datapoints) for more info. Max value is `900` seconds (15 minutes). `Auto` (as little as possible) by default.
MaxDelay pulumi.IntPtrInput
// How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
MinDelay pulumi.IntPtrInput
// Name of the detector.
Name pulumi.StringPtrInput
// Signalflow program text for the detector. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
ProgramText pulumi.StringInput
// Set of rules used for alerting.
Rules DetectorRuleArrayInput
// When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
ShowDataMarkers pulumi.BoolPtrInput
// When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
ShowEventLines pulumi.BoolPtrInput
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
StartTime pulumi.IntPtrInput
// Tags associated with the detector.
Tags pulumi.StringArrayInput
// Team IDs to associate the detector to.
Teams pulumi.StringArrayInput
// Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
TimeRange pulumi.IntPtrInput
// The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
Timezone pulumi.StringPtrInput
// Plot-level customization options, associated with a publish statement.
VizOptions DetectorVizOptionArrayInput
}
func (DetectorArgs) ElementType() reflect.Type {
return reflect.TypeOf((*detectorArgs)(nil)).Elem()
}
type DetectorInput interface {
pulumi.Input
ToDetectorOutput() DetectorOutput
ToDetectorOutputWithContext(ctx context.Context) DetectorOutput
}
func (*Detector) ElementType() reflect.Type {
return reflect.TypeOf((**Detector)(nil)).Elem()
}
func (i *Detector) ToDetectorOutput() DetectorOutput {
return i.ToDetectorOutputWithContext(context.Background())
}
func (i *Detector) ToDetectorOutputWithContext(ctx context.Context) DetectorOutput {
return pulumi.ToOutputWithContext(ctx, i).(DetectorOutput)
}
// DetectorArrayInput is an input type that accepts DetectorArray and DetectorArrayOutput values.
// You can construct a concrete instance of `DetectorArrayInput` via:
//
// DetectorArray{ DetectorArgs{...} }
type DetectorArrayInput interface {
pulumi.Input
ToDetectorArrayOutput() DetectorArrayOutput
ToDetectorArrayOutputWithContext(context.Context) DetectorArrayOutput
}
type DetectorArray []DetectorInput
func (DetectorArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Detector)(nil)).Elem()
}
func (i DetectorArray) ToDetectorArrayOutput() DetectorArrayOutput {
return i.ToDetectorArrayOutputWithContext(context.Background())
}
func (i DetectorArray) ToDetectorArrayOutputWithContext(ctx context.Context) DetectorArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(DetectorArrayOutput)
}
// DetectorMapInput is an input type that accepts DetectorMap and DetectorMapOutput values.
// You can construct a concrete instance of `DetectorMapInput` via:
//
// DetectorMap{ "key": DetectorArgs{...} }
type DetectorMapInput interface {
pulumi.Input
ToDetectorMapOutput() DetectorMapOutput
ToDetectorMapOutputWithContext(context.Context) DetectorMapOutput
}
type DetectorMap map[string]DetectorInput
func (DetectorMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Detector)(nil)).Elem()
}
func (i DetectorMap) ToDetectorMapOutput() DetectorMapOutput {
return i.ToDetectorMapOutputWithContext(context.Background())
}
func (i DetectorMap) ToDetectorMapOutputWithContext(ctx context.Context) DetectorMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(DetectorMapOutput)
}
type DetectorOutput struct{ *pulumi.OutputState }
func (DetectorOutput) ElementType() reflect.Type {
return reflect.TypeOf((**Detector)(nil)).Elem()
}
func (o DetectorOutput) ToDetectorOutput() DetectorOutput {
return o
}
func (o DetectorOutput) ToDetectorOutputWithContext(ctx context.Context) DetectorOutput {
return o
}
// Team IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's team id (or user id in `authorizedWriterUsers`).
func (o DetectorOutput) AuthorizedWriterTeams() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Detector) pulumi.StringArrayOutput { return v.AuthorizedWriterTeams }).(pulumi.StringArrayOutput)
}
// User IDs that have write access to this detector. Remember to use an admin's token if using this feature and to include that admin's user id (or team id in `authorizedWriterTeams`).
func (o DetectorOutput) AuthorizedWriterUsers() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Detector) pulumi.StringArrayOutput { return v.AuthorizedWriterUsers }).(pulumi.StringArrayOutput)
}
// Description for the rule. Displays as the alert condition in the Alert Rules tab of the detector editor in the web UI.
func (o DetectorOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// When `false`, the visualization may sample the output timeseries rather than displaying them all. `false` by default.
func (o DetectorOutput) DisableSampling() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.BoolPtrOutput { return v.DisableSampling }).(pulumi.BoolPtrOutput)
}
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
func (o DetectorOutput) EndTime() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.IntPtrOutput { return v.EndTime }).(pulumi.IntPtrOutput)
}
// The resolutions of the detector alerts in milliseconds that indicate how often data is analyzed to determine if an alert should be triggered.
func (o DetectorOutput) LabelResolutions() pulumi.IntMapOutput {
return o.ApplyT(func(v *Detector) pulumi.IntMapOutput { return v.LabelResolutions }).(pulumi.IntMapOutput)
}
// How long (in seconds) to wait for late datapoints. See [Delayed Datapoints](https://signalfx-product-docs.readthedocs-hosted.com/en/latest/charts/chart-builder.html#delayed-datapoints) for more info. Max value is `900` seconds (15 minutes). `Auto` (as little as possible) by default.
func (o DetectorOutput) MaxDelay() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.IntPtrOutput { return v.MaxDelay }).(pulumi.IntPtrOutput)
}
// How long (in seconds) to wait even if the datapoints are arriving in a timely fashion. Max value is 900 (15m).
func (o DetectorOutput) MinDelay() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.IntPtrOutput { return v.MinDelay }).(pulumi.IntPtrOutput)
}
// Name of the detector.
func (o DetectorOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Signalflow program text for the detector. More info [in the SignalFx docs](https://developers.signalfx.com/signalflow_analytics/signalflow_overview.html#_signalflow_programming_language).
func (o DetectorOutput) ProgramText() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.ProgramText }).(pulumi.StringOutput)
}
// Set of rules used for alerting.
func (o DetectorOutput) Rules() DetectorRuleArrayOutput {
return o.ApplyT(func(v *Detector) DetectorRuleArrayOutput { return v.Rules }).(DetectorRuleArrayOutput)
}
// When `true`, markers will be drawn for each datapoint within the visualization. `true` by default.
func (o DetectorOutput) ShowDataMarkers() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.BoolPtrOutput { return v.ShowDataMarkers }).(pulumi.BoolPtrOutput)
}
// When `true`, the visualization will display a vertical line for each event trigger. `false` by default.
func (o DetectorOutput) ShowEventLines() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.BoolPtrOutput { return v.ShowEventLines }).(pulumi.BoolPtrOutput)
}
// Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
func (o DetectorOutput) StartTime() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.IntPtrOutput { return v.StartTime }).(pulumi.IntPtrOutput)
}
// Tags associated with the detector.
func (o DetectorOutput) Tags() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Detector) pulumi.StringArrayOutput { return v.Tags }).(pulumi.StringArrayOutput)
}
// Team IDs to associate the detector to.
func (o DetectorOutput) Teams() pulumi.StringArrayOutput {
return o.ApplyT(func(v *Detector) pulumi.StringArrayOutput { return v.Teams }).(pulumi.StringArrayOutput)
}
// Seconds to display in the visualization. This is a rolling range from the current time. Example: `3600` corresponds to `-1h` in web UI. `3600` by default.
func (o DetectorOutput) TimeRange() pulumi.IntPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.IntPtrOutput { return v.TimeRange }).(pulumi.IntPtrOutput)
}
// The property value is a string that denotes the geographic region associated with the time zone, (e.g. Australia/Sydney)
func (o DetectorOutput) Timezone() pulumi.StringPtrOutput {
return o.ApplyT(func(v *Detector) pulumi.StringPtrOutput { return v.Timezone }).(pulumi.StringPtrOutput)
}
// The URL of the detector.
func (o DetectorOutput) Url() pulumi.StringOutput {
return o.ApplyT(func(v *Detector) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
}
// Plot-level customization options, associated with a publish statement.
func (o DetectorOutput) VizOptions() DetectorVizOptionArrayOutput {
return o.ApplyT(func(v *Detector) DetectorVizOptionArrayOutput { return v.VizOptions }).(DetectorVizOptionArrayOutput)
}
type DetectorArrayOutput struct{ *pulumi.OutputState }
func (DetectorArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*Detector)(nil)).Elem()
}
func (o DetectorArrayOutput) ToDetectorArrayOutput() DetectorArrayOutput {
return o
}
func (o DetectorArrayOutput) ToDetectorArrayOutputWithContext(ctx context.Context) DetectorArrayOutput {
return o
}
func (o DetectorArrayOutput) Index(i pulumi.IntInput) DetectorOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Detector {
return vs[0].([]*Detector)[vs[1].(int)]
}).(DetectorOutput)
}
type DetectorMapOutput struct{ *pulumi.OutputState }
func (DetectorMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*Detector)(nil)).Elem()
}
func (o DetectorMapOutput) ToDetectorMapOutput() DetectorMapOutput {
return o
}
func (o DetectorMapOutput) ToDetectorMapOutputWithContext(ctx context.Context) DetectorMapOutput {
return o
}
func (o DetectorMapOutput) MapIndex(k pulumi.StringInput) DetectorOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Detector {
return vs[0].(map[string]*Detector)[vs[1].(string)]
}).(DetectorOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*DetectorInput)(nil)).Elem(), &Detector{})
pulumi.RegisterInputType(reflect.TypeOf((*DetectorArrayInput)(nil)).Elem(), DetectorArray{})
pulumi.RegisterInputType(reflect.TypeOf((*DetectorMapInput)(nil)).Elem(), DetectorMap{})
pulumi.RegisterOutputType(DetectorOutput{})
pulumi.RegisterOutputType(DetectorArrayOutput{})
pulumi.RegisterOutputType(DetectorMapOutput{})
}