-
Notifications
You must be signed in to change notification settings - Fork 2
/
automationActionsAction.go
374 lines (318 loc) · 16.2 KB
/
automationActionsAction.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
// 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 pagerduty
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// An Automation Actions [action](https://developer.pagerduty.com/api-reference/d64584a4371d3-create-an-automation-action) invokes jobs and workflows that are staged in Runbook Automation or Process Automation. It may also execute a command line script run by a Process Automation runner installed in your infrastructure.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := pagerduty.NewAutomationActionsAction(ctx, "pa_action_example", &pagerduty.AutomationActionsActionArgs{
// Name: pulumi.String("PA Action created via TF"),
// Description: pulumi.String("Description of the PA Action created via TF"),
// ActionType: pulumi.String("process_automation"),
// ActionDataReference: &pagerduty.AutomationActionsActionActionDataReferenceArgs{
// ProcessAutomationJobId: pulumi.String("P123456"),
// },
// })
// if err != nil {
// return err
// }
// _, err = pagerduty.NewAutomationActionsAction(ctx, "script_action_example", &pagerduty.AutomationActionsActionArgs{
// Name: pulumi.String("Script Action created via TF"),
// Description: pulumi.String("Description of the Script Action created via TF"),
// ActionType: pulumi.String("script"),
// ActionDataReference: &pagerduty.AutomationActionsActionActionDataReferenceArgs{
// Script: pulumi.String("print(\"Hello from a Python script!\")"),
// InvocationCommand: pulumi.String("/usr/local/bin/python3"),
// },
// })
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
//
// ## Import
//
// Actions can be imported using the `id`, e.g.
//
// ```sh
// $ pulumi import pagerduty:index/automationActionsAction:AutomationActionsAction example 01DER7CUUBF7TH4116K0M4WKPU
// ```
type AutomationActionsAction struct {
pulumi.CustomResourceState
ActionClassification pulumi.StringPtrOutput `pulumi:"actionClassification"`
ActionDataReference AutomationActionsActionActionDataReferenceOutput `pulumi:"actionDataReference"`
ActionType pulumi.StringOutput `pulumi:"actionType"`
// The time action was created. Represented as an ISO 8601 timestamp.
CreationTime pulumi.StringOutput `pulumi:"creationTime"`
Description pulumi.StringPtrOutput `pulumi:"description"`
// (Optional) The last time action has been modified. Represented as an ISO 8601 timestamp.
ModifyTime pulumi.StringOutput `pulumi:"modifyTime"`
Name pulumi.StringOutput `pulumi:"name"`
RunnerId pulumi.StringPtrOutput `pulumi:"runnerId"`
// (Optional) The type of the runner associated with the action.
RunnerType pulumi.StringOutput `pulumi:"runnerType"`
// The type of object. The value returned will be `action`.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewAutomationActionsAction registers a new resource with the given unique name, arguments, and options.
func NewAutomationActionsAction(ctx *pulumi.Context,
name string, args *AutomationActionsActionArgs, opts ...pulumi.ResourceOption) (*AutomationActionsAction, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ActionDataReference == nil {
return nil, errors.New("invalid value for required argument 'ActionDataReference'")
}
if args.ActionType == nil {
return nil, errors.New("invalid value for required argument 'ActionType'")
}
opts = internal.PkgResourceDefaultOpts(opts)
var resource AutomationActionsAction
err := ctx.RegisterResource("pagerduty:index/automationActionsAction:AutomationActionsAction", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetAutomationActionsAction gets an existing AutomationActionsAction 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 GetAutomationActionsAction(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *AutomationActionsActionState, opts ...pulumi.ResourceOption) (*AutomationActionsAction, error) {
var resource AutomationActionsAction
err := ctx.ReadResource("pagerduty:index/automationActionsAction:AutomationActionsAction", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering AutomationActionsAction resources.
type automationActionsActionState struct {
ActionClassification *string `pulumi:"actionClassification"`
ActionDataReference *AutomationActionsActionActionDataReference `pulumi:"actionDataReference"`
ActionType *string `pulumi:"actionType"`
// The time action was created. Represented as an ISO 8601 timestamp.
CreationTime *string `pulumi:"creationTime"`
Description *string `pulumi:"description"`
// (Optional) The last time action has been modified. Represented as an ISO 8601 timestamp.
ModifyTime *string `pulumi:"modifyTime"`
Name *string `pulumi:"name"`
RunnerId *string `pulumi:"runnerId"`
// (Optional) The type of the runner associated with the action.
RunnerType *string `pulumi:"runnerType"`
// The type of object. The value returned will be `action`.
Type *string `pulumi:"type"`
}
type AutomationActionsActionState struct {
ActionClassification pulumi.StringPtrInput
ActionDataReference AutomationActionsActionActionDataReferencePtrInput
ActionType pulumi.StringPtrInput
// The time action was created. Represented as an ISO 8601 timestamp.
CreationTime pulumi.StringPtrInput
Description pulumi.StringPtrInput
// (Optional) The last time action has been modified. Represented as an ISO 8601 timestamp.
ModifyTime pulumi.StringPtrInput
Name pulumi.StringPtrInput
RunnerId pulumi.StringPtrInput
// (Optional) The type of the runner associated with the action.
RunnerType pulumi.StringPtrInput
// The type of object. The value returned will be `action`.
Type pulumi.StringPtrInput
}
func (AutomationActionsActionState) ElementType() reflect.Type {
return reflect.TypeOf((*automationActionsActionState)(nil)).Elem()
}
type automationActionsActionArgs struct {
ActionClassification *string `pulumi:"actionClassification"`
ActionDataReference AutomationActionsActionActionDataReference `pulumi:"actionDataReference"`
ActionType string `pulumi:"actionType"`
// The time action was created. Represented as an ISO 8601 timestamp.
CreationTime *string `pulumi:"creationTime"`
Description *string `pulumi:"description"`
// (Optional) The last time action has been modified. Represented as an ISO 8601 timestamp.
ModifyTime *string `pulumi:"modifyTime"`
Name *string `pulumi:"name"`
RunnerId *string `pulumi:"runnerId"`
// (Optional) The type of the runner associated with the action.
RunnerType *string `pulumi:"runnerType"`
// The type of object. The value returned will be `action`.
Type *string `pulumi:"type"`
}
// The set of arguments for constructing a AutomationActionsAction resource.
type AutomationActionsActionArgs struct {
ActionClassification pulumi.StringPtrInput
ActionDataReference AutomationActionsActionActionDataReferenceInput
ActionType pulumi.StringInput
// The time action was created. Represented as an ISO 8601 timestamp.
CreationTime pulumi.StringPtrInput
Description pulumi.StringPtrInput
// (Optional) The last time action has been modified. Represented as an ISO 8601 timestamp.
ModifyTime pulumi.StringPtrInput
Name pulumi.StringPtrInput
RunnerId pulumi.StringPtrInput
// (Optional) The type of the runner associated with the action.
RunnerType pulumi.StringPtrInput
// The type of object. The value returned will be `action`.
Type pulumi.StringPtrInput
}
func (AutomationActionsActionArgs) ElementType() reflect.Type {
return reflect.TypeOf((*automationActionsActionArgs)(nil)).Elem()
}
type AutomationActionsActionInput interface {
pulumi.Input
ToAutomationActionsActionOutput() AutomationActionsActionOutput
ToAutomationActionsActionOutputWithContext(ctx context.Context) AutomationActionsActionOutput
}
func (*AutomationActionsAction) ElementType() reflect.Type {
return reflect.TypeOf((**AutomationActionsAction)(nil)).Elem()
}
func (i *AutomationActionsAction) ToAutomationActionsActionOutput() AutomationActionsActionOutput {
return i.ToAutomationActionsActionOutputWithContext(context.Background())
}
func (i *AutomationActionsAction) ToAutomationActionsActionOutputWithContext(ctx context.Context) AutomationActionsActionOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutomationActionsActionOutput)
}
// AutomationActionsActionArrayInput is an input type that accepts AutomationActionsActionArray and AutomationActionsActionArrayOutput values.
// You can construct a concrete instance of `AutomationActionsActionArrayInput` via:
//
// AutomationActionsActionArray{ AutomationActionsActionArgs{...} }
type AutomationActionsActionArrayInput interface {
pulumi.Input
ToAutomationActionsActionArrayOutput() AutomationActionsActionArrayOutput
ToAutomationActionsActionArrayOutputWithContext(context.Context) AutomationActionsActionArrayOutput
}
type AutomationActionsActionArray []AutomationActionsActionInput
func (AutomationActionsActionArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AutomationActionsAction)(nil)).Elem()
}
func (i AutomationActionsActionArray) ToAutomationActionsActionArrayOutput() AutomationActionsActionArrayOutput {
return i.ToAutomationActionsActionArrayOutputWithContext(context.Background())
}
func (i AutomationActionsActionArray) ToAutomationActionsActionArrayOutputWithContext(ctx context.Context) AutomationActionsActionArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutomationActionsActionArrayOutput)
}
// AutomationActionsActionMapInput is an input type that accepts AutomationActionsActionMap and AutomationActionsActionMapOutput values.
// You can construct a concrete instance of `AutomationActionsActionMapInput` via:
//
// AutomationActionsActionMap{ "key": AutomationActionsActionArgs{...} }
type AutomationActionsActionMapInput interface {
pulumi.Input
ToAutomationActionsActionMapOutput() AutomationActionsActionMapOutput
ToAutomationActionsActionMapOutputWithContext(context.Context) AutomationActionsActionMapOutput
}
type AutomationActionsActionMap map[string]AutomationActionsActionInput
func (AutomationActionsActionMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AutomationActionsAction)(nil)).Elem()
}
func (i AutomationActionsActionMap) ToAutomationActionsActionMapOutput() AutomationActionsActionMapOutput {
return i.ToAutomationActionsActionMapOutputWithContext(context.Background())
}
func (i AutomationActionsActionMap) ToAutomationActionsActionMapOutputWithContext(ctx context.Context) AutomationActionsActionMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(AutomationActionsActionMapOutput)
}
type AutomationActionsActionOutput struct{ *pulumi.OutputState }
func (AutomationActionsActionOutput) ElementType() reflect.Type {
return reflect.TypeOf((**AutomationActionsAction)(nil)).Elem()
}
func (o AutomationActionsActionOutput) ToAutomationActionsActionOutput() AutomationActionsActionOutput {
return o
}
func (o AutomationActionsActionOutput) ToAutomationActionsActionOutputWithContext(ctx context.Context) AutomationActionsActionOutput {
return o
}
func (o AutomationActionsActionOutput) ActionClassification() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringPtrOutput { return v.ActionClassification }).(pulumi.StringPtrOutput)
}
func (o AutomationActionsActionOutput) ActionDataReference() AutomationActionsActionActionDataReferenceOutput {
return o.ApplyT(func(v *AutomationActionsAction) AutomationActionsActionActionDataReferenceOutput {
return v.ActionDataReference
}).(AutomationActionsActionActionDataReferenceOutput)
}
func (o AutomationActionsActionOutput) ActionType() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringOutput { return v.ActionType }).(pulumi.StringOutput)
}
// The time action was created. Represented as an ISO 8601 timestamp.
func (o AutomationActionsActionOutput) CreationTime() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringOutput { return v.CreationTime }).(pulumi.StringOutput)
}
func (o AutomationActionsActionOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// (Optional) The last time action has been modified. Represented as an ISO 8601 timestamp.
func (o AutomationActionsActionOutput) ModifyTime() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringOutput { return v.ModifyTime }).(pulumi.StringOutput)
}
func (o AutomationActionsActionOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
func (o AutomationActionsActionOutput) RunnerId() pulumi.StringPtrOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringPtrOutput { return v.RunnerId }).(pulumi.StringPtrOutput)
}
// (Optional) The type of the runner associated with the action.
func (o AutomationActionsActionOutput) RunnerType() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringOutput { return v.RunnerType }).(pulumi.StringOutput)
}
// The type of object. The value returned will be `action`.
func (o AutomationActionsActionOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *AutomationActionsAction) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
type AutomationActionsActionArrayOutput struct{ *pulumi.OutputState }
func (AutomationActionsActionArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*AutomationActionsAction)(nil)).Elem()
}
func (o AutomationActionsActionArrayOutput) ToAutomationActionsActionArrayOutput() AutomationActionsActionArrayOutput {
return o
}
func (o AutomationActionsActionArrayOutput) ToAutomationActionsActionArrayOutputWithContext(ctx context.Context) AutomationActionsActionArrayOutput {
return o
}
func (o AutomationActionsActionArrayOutput) Index(i pulumi.IntInput) AutomationActionsActionOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *AutomationActionsAction {
return vs[0].([]*AutomationActionsAction)[vs[1].(int)]
}).(AutomationActionsActionOutput)
}
type AutomationActionsActionMapOutput struct{ *pulumi.OutputState }
func (AutomationActionsActionMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*AutomationActionsAction)(nil)).Elem()
}
func (o AutomationActionsActionMapOutput) ToAutomationActionsActionMapOutput() AutomationActionsActionMapOutput {
return o
}
func (o AutomationActionsActionMapOutput) ToAutomationActionsActionMapOutputWithContext(ctx context.Context) AutomationActionsActionMapOutput {
return o
}
func (o AutomationActionsActionMapOutput) MapIndex(k pulumi.StringInput) AutomationActionsActionOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *AutomationActionsAction {
return vs[0].(map[string]*AutomationActionsAction)[vs[1].(string)]
}).(AutomationActionsActionOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*AutomationActionsActionInput)(nil)).Elem(), &AutomationActionsAction{})
pulumi.RegisterInputType(reflect.TypeOf((*AutomationActionsActionArrayInput)(nil)).Elem(), AutomationActionsActionArray{})
pulumi.RegisterInputType(reflect.TypeOf((*AutomationActionsActionMapInput)(nil)).Elem(), AutomationActionsActionMap{})
pulumi.RegisterOutputType(AutomationActionsActionOutput{})
pulumi.RegisterOutputType(AutomationActionsActionArrayOutput{})
pulumi.RegisterOutputType(AutomationActionsActionMapOutput{})
}