/
view.go
381 lines (325 loc) · 13.4 KB
/
view.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
// 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 log
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-signalfx/sdk/v7/go/signalfx/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// You can add logs data to your Observability Cloud dashboards without turning your logs into metrics first.
//
// A log view displays log lines in a table form in a dashboard and shows you in detail what is happening and why.
//
// ## Example
//
// ## Arguments
//
// The following arguments are supported in the resource block:
//
// * `name` - (Required) Name of the log view.
// * `programText` - (Required) Signalflow program text for the log view. More info at https://developers.signalfx.com/docs/signalflow-overview.
// * `description` - (Optional) Description of the log view.
// * `timeRange` - (Optional) From when to display data. Splunk Observability Cloud time syntax (e.g. `"-5m"`, `"-1h"`). Conflicts with `startTime` and `endTime`.
// * `startTime` - (Optional) Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
// * `endTime` - (Optional) Seconds since epoch. Used for visualization. Conflicts with `timeRange`.
// * `columns` - (Optional) The column headers to show on the log view.
// * `sortOptions` - (Optional) The sorting options configuration to specify if the log view table needs to be sorted in a particular field.
// * `defaultConnection` - (Optional) The connection that the log view uses to fetch data. This could be Splunk Enterprise, Splunk Enterprise Cloud or Observability Cloud.
//
// ## Attributes
//
// In a addition to all arguments above, the following attributes are exported:
//
// * `id` - The ID of the log view.
// * `url` - The URL of the log view.
type View struct {
pulumi.CustomResourceState
// Column configuration
Columns ViewColumnArrayOutput `pulumi:"columns"`
// default connection that the dashboard uses
DefaultConnection pulumi.StringPtrOutput `pulumi:"defaultConnection"`
// Description of the chart (Optional)
Description pulumi.StringPtrOutput `pulumi:"description"`
// Seconds since epoch to end the visualization
EndTime pulumi.IntPtrOutput `pulumi:"endTime"`
// Name of the chart
Name pulumi.StringOutput `pulumi:"name"`
// Signalflow program text for the chart. More info at "https://developers.signalfx.com/docs/signalflow-overview"
ProgramText pulumi.StringOutput `pulumi:"programText"`
// Sorting options configuration
SortOptions ViewSortOptionArrayOutput `pulumi:"sortOptions"`
// Seconds since epoch to start the visualization
StartTime pulumi.IntPtrOutput `pulumi:"startTime"`
// Seconds to display in the visualization. This is a rolling range from the current time. Example: 3600 = `-1h`
TimeRange pulumi.IntPtrOutput `pulumi:"timeRange"`
// URL of the chart
Url pulumi.StringOutput `pulumi:"url"`
}
// NewView registers a new resource with the given unique name, arguments, and options.
func NewView(ctx *pulumi.Context,
name string, args *ViewArgs, opts ...pulumi.ResourceOption) (*View, 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'")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("signalfx:logs/view:View"),
},
})
opts = append(opts, aliases)
opts = internal.PkgResourceDefaultOpts(opts)
var resource View
err := ctx.RegisterResource("signalfx:log/view:View", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetView gets an existing View 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 GetView(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *ViewState, opts ...pulumi.ResourceOption) (*View, error) {
var resource View
err := ctx.ReadResource("signalfx:log/view:View", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering View resources.
type viewState struct {
// Column configuration
Columns []ViewColumn `pulumi:"columns"`
// default connection that the dashboard uses
DefaultConnection *string `pulumi:"defaultConnection"`
// Description of the chart (Optional)
Description *string `pulumi:"description"`
// Seconds since epoch to end the visualization
EndTime *int `pulumi:"endTime"`
// Name of the chart
Name *string `pulumi:"name"`
// Signalflow program text for the chart. More info at "https://developers.signalfx.com/docs/signalflow-overview"
ProgramText *string `pulumi:"programText"`
// Sorting options configuration
SortOptions []ViewSortOption `pulumi:"sortOptions"`
// Seconds since epoch to start the visualization
StartTime *int `pulumi:"startTime"`
// Seconds to display in the visualization. This is a rolling range from the current time. Example: 3600 = `-1h`
TimeRange *int `pulumi:"timeRange"`
// URL of the chart
Url *string `pulumi:"url"`
}
type ViewState struct {
// Column configuration
Columns ViewColumnArrayInput
// default connection that the dashboard uses
DefaultConnection pulumi.StringPtrInput
// Description of the chart (Optional)
Description pulumi.StringPtrInput
// Seconds since epoch to end the visualization
EndTime pulumi.IntPtrInput
// Name of the chart
Name pulumi.StringPtrInput
// Signalflow program text for the chart. More info at "https://developers.signalfx.com/docs/signalflow-overview"
ProgramText pulumi.StringPtrInput
// Sorting options configuration
SortOptions ViewSortOptionArrayInput
// Seconds since epoch to start the visualization
StartTime pulumi.IntPtrInput
// Seconds to display in the visualization. This is a rolling range from the current time. Example: 3600 = `-1h`
TimeRange pulumi.IntPtrInput
// URL of the chart
Url pulumi.StringPtrInput
}
func (ViewState) ElementType() reflect.Type {
return reflect.TypeOf((*viewState)(nil)).Elem()
}
type viewArgs struct {
// Column configuration
Columns []ViewColumn `pulumi:"columns"`
// default connection that the dashboard uses
DefaultConnection *string `pulumi:"defaultConnection"`
// Description of the chart (Optional)
Description *string `pulumi:"description"`
// Seconds since epoch to end the visualization
EndTime *int `pulumi:"endTime"`
// Name of the chart
Name *string `pulumi:"name"`
// Signalflow program text for the chart. More info at "https://developers.signalfx.com/docs/signalflow-overview"
ProgramText string `pulumi:"programText"`
// Sorting options configuration
SortOptions []ViewSortOption `pulumi:"sortOptions"`
// Seconds since epoch to start the visualization
StartTime *int `pulumi:"startTime"`
// Seconds to display in the visualization. This is a rolling range from the current time. Example: 3600 = `-1h`
TimeRange *int `pulumi:"timeRange"`
}
// The set of arguments for constructing a View resource.
type ViewArgs struct {
// Column configuration
Columns ViewColumnArrayInput
// default connection that the dashboard uses
DefaultConnection pulumi.StringPtrInput
// Description of the chart (Optional)
Description pulumi.StringPtrInput
// Seconds since epoch to end the visualization
EndTime pulumi.IntPtrInput
// Name of the chart
Name pulumi.StringPtrInput
// Signalflow program text for the chart. More info at "https://developers.signalfx.com/docs/signalflow-overview"
ProgramText pulumi.StringInput
// Sorting options configuration
SortOptions ViewSortOptionArrayInput
// Seconds since epoch to start the visualization
StartTime pulumi.IntPtrInput
// Seconds to display in the visualization. This is a rolling range from the current time. Example: 3600 = `-1h`
TimeRange pulumi.IntPtrInput
}
func (ViewArgs) ElementType() reflect.Type {
return reflect.TypeOf((*viewArgs)(nil)).Elem()
}
type ViewInput interface {
pulumi.Input
ToViewOutput() ViewOutput
ToViewOutputWithContext(ctx context.Context) ViewOutput
}
func (*View) ElementType() reflect.Type {
return reflect.TypeOf((**View)(nil)).Elem()
}
func (i *View) ToViewOutput() ViewOutput {
return i.ToViewOutputWithContext(context.Background())
}
func (i *View) ToViewOutputWithContext(ctx context.Context) ViewOutput {
return pulumi.ToOutputWithContext(ctx, i).(ViewOutput)
}
// ViewArrayInput is an input type that accepts ViewArray and ViewArrayOutput values.
// You can construct a concrete instance of `ViewArrayInput` via:
//
// ViewArray{ ViewArgs{...} }
type ViewArrayInput interface {
pulumi.Input
ToViewArrayOutput() ViewArrayOutput
ToViewArrayOutputWithContext(context.Context) ViewArrayOutput
}
type ViewArray []ViewInput
func (ViewArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*View)(nil)).Elem()
}
func (i ViewArray) ToViewArrayOutput() ViewArrayOutput {
return i.ToViewArrayOutputWithContext(context.Background())
}
func (i ViewArray) ToViewArrayOutputWithContext(ctx context.Context) ViewArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(ViewArrayOutput)
}
// ViewMapInput is an input type that accepts ViewMap and ViewMapOutput values.
// You can construct a concrete instance of `ViewMapInput` via:
//
// ViewMap{ "key": ViewArgs{...} }
type ViewMapInput interface {
pulumi.Input
ToViewMapOutput() ViewMapOutput
ToViewMapOutputWithContext(context.Context) ViewMapOutput
}
type ViewMap map[string]ViewInput
func (ViewMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*View)(nil)).Elem()
}
func (i ViewMap) ToViewMapOutput() ViewMapOutput {
return i.ToViewMapOutputWithContext(context.Background())
}
func (i ViewMap) ToViewMapOutputWithContext(ctx context.Context) ViewMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(ViewMapOutput)
}
type ViewOutput struct{ *pulumi.OutputState }
func (ViewOutput) ElementType() reflect.Type {
return reflect.TypeOf((**View)(nil)).Elem()
}
func (o ViewOutput) ToViewOutput() ViewOutput {
return o
}
func (o ViewOutput) ToViewOutputWithContext(ctx context.Context) ViewOutput {
return o
}
// Column configuration
func (o ViewOutput) Columns() ViewColumnArrayOutput {
return o.ApplyT(func(v *View) ViewColumnArrayOutput { return v.Columns }).(ViewColumnArrayOutput)
}
// default connection that the dashboard uses
func (o ViewOutput) DefaultConnection() pulumi.StringPtrOutput {
return o.ApplyT(func(v *View) pulumi.StringPtrOutput { return v.DefaultConnection }).(pulumi.StringPtrOutput)
}
// Description of the chart (Optional)
func (o ViewOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *View) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// Seconds since epoch to end the visualization
func (o ViewOutput) EndTime() pulumi.IntPtrOutput {
return o.ApplyT(func(v *View) pulumi.IntPtrOutput { return v.EndTime }).(pulumi.IntPtrOutput)
}
// Name of the chart
func (o ViewOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *View) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Signalflow program text for the chart. More info at "https://developers.signalfx.com/docs/signalflow-overview"
func (o ViewOutput) ProgramText() pulumi.StringOutput {
return o.ApplyT(func(v *View) pulumi.StringOutput { return v.ProgramText }).(pulumi.StringOutput)
}
// Sorting options configuration
func (o ViewOutput) SortOptions() ViewSortOptionArrayOutput {
return o.ApplyT(func(v *View) ViewSortOptionArrayOutput { return v.SortOptions }).(ViewSortOptionArrayOutput)
}
// Seconds since epoch to start the visualization
func (o ViewOutput) StartTime() pulumi.IntPtrOutput {
return o.ApplyT(func(v *View) pulumi.IntPtrOutput { return v.StartTime }).(pulumi.IntPtrOutput)
}
// Seconds to display in the visualization. This is a rolling range from the current time. Example: 3600 = `-1h`
func (o ViewOutput) TimeRange() pulumi.IntPtrOutput {
return o.ApplyT(func(v *View) pulumi.IntPtrOutput { return v.TimeRange }).(pulumi.IntPtrOutput)
}
// URL of the chart
func (o ViewOutput) Url() pulumi.StringOutput {
return o.ApplyT(func(v *View) pulumi.StringOutput { return v.Url }).(pulumi.StringOutput)
}
type ViewArrayOutput struct{ *pulumi.OutputState }
func (ViewArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*View)(nil)).Elem()
}
func (o ViewArrayOutput) ToViewArrayOutput() ViewArrayOutput {
return o
}
func (o ViewArrayOutput) ToViewArrayOutputWithContext(ctx context.Context) ViewArrayOutput {
return o
}
func (o ViewArrayOutput) Index(i pulumi.IntInput) ViewOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *View {
return vs[0].([]*View)[vs[1].(int)]
}).(ViewOutput)
}
type ViewMapOutput struct{ *pulumi.OutputState }
func (ViewMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*View)(nil)).Elem()
}
func (o ViewMapOutput) ToViewMapOutput() ViewMapOutput {
return o
}
func (o ViewMapOutput) ToViewMapOutputWithContext(ctx context.Context) ViewMapOutput {
return o
}
func (o ViewMapOutput) MapIndex(k pulumi.StringInput) ViewOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *View {
return vs[0].(map[string]*View)[vs[1].(string)]
}).(ViewOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*ViewInput)(nil)).Elem(), &View{})
pulumi.RegisterInputType(reflect.TypeOf((*ViewArrayInput)(nil)).Elem(), ViewArray{})
pulumi.RegisterInputType(reflect.TypeOf((*ViewMapInput)(nil)).Elem(), ViewMap{})
pulumi.RegisterOutputType(ViewOutput{})
pulumi.RegisterOutputType(ViewArrayOutput{})
pulumi.RegisterOutputType(ViewMapOutput{})
}