/
getEventOrchestrationServiceCacheVariable.go
188 lines (168 loc) · 8.58 KB
/
getEventOrchestrationServiceCacheVariable.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
// 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"
"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get information about a specific [Cache Variable](https://support.pagerduty.com/docs/event-orchestration-variables) for a Service Event Orchestration.
//
// ## Example Usage
//
// <!--Start PulumiCodeChooser -->
// ```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 {
// engineering, err := pagerduty.NewTeam(ctx, "engineering", nil)
// if err != nil {
// return err
// }
// exampleUser, err := pagerduty.NewUser(ctx, "exampleUser", &pagerduty.UserArgs{
// Email: pulumi.String("125.greenholt.earline@graham.name"),
// Teams: pulumi.StringArray{
// engineering.ID(),
// },
// })
// if err != nil {
// return err
// }
// exampleEscalationPolicy, err := pagerduty.NewEscalationPolicy(ctx, "exampleEscalationPolicy", &pagerduty.EscalationPolicyArgs{
// NumLoops: pulumi.Int(2),
// Rules: pagerduty.EscalationPolicyRuleArray{
// &pagerduty.EscalationPolicyRuleArgs{
// EscalationDelayInMinutes: pulumi.Int(10),
// Targets: pagerduty.EscalationPolicyRuleTargetArray{
// &pagerduty.EscalationPolicyRuleTargetArgs{
// Type: pulumi.String("user"),
// Id: exampleUser.ID(),
// },
// },
// },
// },
// })
// if err != nil {
// return err
// }
// service, err := pagerduty.NewService(ctx, "service", &pagerduty.ServiceArgs{
// AutoResolveTimeout: pulumi.String("14400"),
// AcknowledgementTimeout: pulumi.String("600"),
// EscalationPolicy: exampleEscalationPolicy.ID(),
// AlertCreation: pulumi.String("create_alerts_and_incidents"),
// })
// if err != nil {
// return err
// }
// _ = pagerduty.LookupEventOrchestrationServiceCacheVariableOutput(ctx, pagerduty.GetEventOrchestrationServiceCacheVariableOutputArgs{
// Service: service.ID(),
// Name: pulumi.String("example_cache_variable"),
// }, nil)
// return nil
// })
// }
//
// ```
// <!--End PulumiCodeChooser -->
func LookupEventOrchestrationServiceCacheVariable(ctx *pulumi.Context, args *LookupEventOrchestrationServiceCacheVariableArgs, opts ...pulumi.InvokeOption) (*LookupEventOrchestrationServiceCacheVariableResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv LookupEventOrchestrationServiceCacheVariableResult
err := ctx.Invoke("pagerduty:index/getEventOrchestrationServiceCacheVariable:getEventOrchestrationServiceCacheVariable", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getEventOrchestrationServiceCacheVariable.
type LookupEventOrchestrationServiceCacheVariableArgs struct {
// ID of the Cache Variable associated with the Service Event Orchestration. Specify either `id` or `name`. If both are specified `id` takes precedence.
Id *string `pulumi:"id"`
// Name of the Cache Variable associated with the Service Event Orchestration. Specify either `id` or `name`. If both are specified `id` takes precedence.
Name *string `pulumi:"name"`
// ID of the Service Event Orchestration to which this Cache Variable belongs.
Service string `pulumi:"service"`
}
// A collection of values returned by getEventOrchestrationServiceCacheVariable.
type LookupEventOrchestrationServiceCacheVariableResult struct {
// Conditions to be evaluated in order to determine whether or not to update the Cache Variable's stored value.
Conditions []GetEventOrchestrationServiceCacheVariableCondition `pulumi:"conditions"`
// A configuration object to define what and how values will be stored in the Cache Variable.
Configurations []GetEventOrchestrationServiceCacheVariableConfiguration `pulumi:"configurations"`
// Indicates whether the Cache Variable is disabled and would therefore not be evaluated.
Disabled bool `pulumi:"disabled"`
Id *string `pulumi:"id"`
Name *string `pulumi:"name"`
Service string `pulumi:"service"`
}
func LookupEventOrchestrationServiceCacheVariableOutput(ctx *pulumi.Context, args LookupEventOrchestrationServiceCacheVariableOutputArgs, opts ...pulumi.InvokeOption) LookupEventOrchestrationServiceCacheVariableResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (LookupEventOrchestrationServiceCacheVariableResult, error) {
args := v.(LookupEventOrchestrationServiceCacheVariableArgs)
r, err := LookupEventOrchestrationServiceCacheVariable(ctx, &args, opts...)
var s LookupEventOrchestrationServiceCacheVariableResult
if r != nil {
s = *r
}
return s, err
}).(LookupEventOrchestrationServiceCacheVariableResultOutput)
}
// A collection of arguments for invoking getEventOrchestrationServiceCacheVariable.
type LookupEventOrchestrationServiceCacheVariableOutputArgs struct {
// ID of the Cache Variable associated with the Service Event Orchestration. Specify either `id` or `name`. If both are specified `id` takes precedence.
Id pulumi.StringPtrInput `pulumi:"id"`
// Name of the Cache Variable associated with the Service Event Orchestration. Specify either `id` or `name`. If both are specified `id` takes precedence.
Name pulumi.StringPtrInput `pulumi:"name"`
// ID of the Service Event Orchestration to which this Cache Variable belongs.
Service pulumi.StringInput `pulumi:"service"`
}
func (LookupEventOrchestrationServiceCacheVariableOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*LookupEventOrchestrationServiceCacheVariableArgs)(nil)).Elem()
}
// A collection of values returned by getEventOrchestrationServiceCacheVariable.
type LookupEventOrchestrationServiceCacheVariableResultOutput struct{ *pulumi.OutputState }
func (LookupEventOrchestrationServiceCacheVariableResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*LookupEventOrchestrationServiceCacheVariableResult)(nil)).Elem()
}
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) ToLookupEventOrchestrationServiceCacheVariableResultOutput() LookupEventOrchestrationServiceCacheVariableResultOutput {
return o
}
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) ToLookupEventOrchestrationServiceCacheVariableResultOutputWithContext(ctx context.Context) LookupEventOrchestrationServiceCacheVariableResultOutput {
return o
}
// Conditions to be evaluated in order to determine whether or not to update the Cache Variable's stored value.
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) Conditions() GetEventOrchestrationServiceCacheVariableConditionArrayOutput {
return o.ApplyT(func(v LookupEventOrchestrationServiceCacheVariableResult) []GetEventOrchestrationServiceCacheVariableCondition {
return v.Conditions
}).(GetEventOrchestrationServiceCacheVariableConditionArrayOutput)
}
// A configuration object to define what and how values will be stored in the Cache Variable.
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) Configurations() GetEventOrchestrationServiceCacheVariableConfigurationArrayOutput {
return o.ApplyT(func(v LookupEventOrchestrationServiceCacheVariableResult) []GetEventOrchestrationServiceCacheVariableConfiguration {
return v.Configurations
}).(GetEventOrchestrationServiceCacheVariableConfigurationArrayOutput)
}
// Indicates whether the Cache Variable is disabled and would therefore not be evaluated.
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) Disabled() pulumi.BoolOutput {
return o.ApplyT(func(v LookupEventOrchestrationServiceCacheVariableResult) bool { return v.Disabled }).(pulumi.BoolOutput)
}
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) Id() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupEventOrchestrationServiceCacheVariableResult) *string { return v.Id }).(pulumi.StringPtrOutput)
}
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) Name() pulumi.StringPtrOutput {
return o.ApplyT(func(v LookupEventOrchestrationServiceCacheVariableResult) *string { return v.Name }).(pulumi.StringPtrOutput)
}
func (o LookupEventOrchestrationServiceCacheVariableResultOutput) Service() pulumi.StringOutput {
return o.ApplyT(func(v LookupEventOrchestrationServiceCacheVariableResult) string { return v.Service }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(LookupEventOrchestrationServiceCacheVariableResultOutput{})
}