forked from pulumi/pulumi-azure-native-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
smartDetectorAlertRule.go
275 lines (239 loc) · 10.4 KB
/
smartDetectorAlertRule.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
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package alertsmanagement
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-azure-native-sdk/v2/utilities"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// The alert rule information
// Azure REST API version: 2021-04-01. Prior API version in Azure Native 1.x: 2019-06-01.
type SmartDetectorAlertRule struct {
pulumi.CustomResourceState
// The alert rule actions.
ActionGroups ActionGroupsInformationResponseOutput `pulumi:"actionGroups"`
// The alert rule description.
Description pulumi.StringPtrOutput `pulumi:"description"`
// The alert rule's detector.
Detector DetectorResponseOutput `pulumi:"detector"`
// The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector.
Frequency pulumi.StringOutput `pulumi:"frequency"`
// The resource location.
Location pulumi.StringPtrOutput `pulumi:"location"`
// The resource name.
Name pulumi.StringOutput `pulumi:"name"`
// The alert rule resources scope.
Scope pulumi.StringArrayOutput `pulumi:"scope"`
// The alert rule severity.
Severity pulumi.StringOutput `pulumi:"severity"`
// The alert rule state.
State pulumi.StringOutput `pulumi:"state"`
// The resource tags.
Tags pulumi.StringMapOutput `pulumi:"tags"`
// The alert rule throttling information.
Throttling ThrottlingInformationResponsePtrOutput `pulumi:"throttling"`
// The resource type.
Type pulumi.StringOutput `pulumi:"type"`
}
// NewSmartDetectorAlertRule registers a new resource with the given unique name, arguments, and options.
func NewSmartDetectorAlertRule(ctx *pulumi.Context,
name string, args *SmartDetectorAlertRuleArgs, opts ...pulumi.ResourceOption) (*SmartDetectorAlertRule, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ActionGroups == nil {
return nil, errors.New("invalid value for required argument 'ActionGroups'")
}
if args.Detector == nil {
return nil, errors.New("invalid value for required argument 'Detector'")
}
if args.Frequency == nil {
return nil, errors.New("invalid value for required argument 'Frequency'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.Scope == nil {
return nil, errors.New("invalid value for required argument 'Scope'")
}
if args.Severity == nil {
return nil, errors.New("invalid value for required argument 'Severity'")
}
if args.State == nil {
return nil, errors.New("invalid value for required argument 'State'")
}
if args.Location == nil {
args.Location = pulumi.StringPtr("global")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-native:alertsmanagement/v20190301:SmartDetectorAlertRule"),
},
{
Type: pulumi.String("azure-native:alertsmanagement/v20190601:SmartDetectorAlertRule"),
},
{
Type: pulumi.String("azure-native:alertsmanagement/v20210401:SmartDetectorAlertRule"),
},
})
opts = append(opts, aliases)
opts = utilities.PkgResourceDefaultOpts(opts)
var resource SmartDetectorAlertRule
err := ctx.RegisterResource("azure-native:alertsmanagement:SmartDetectorAlertRule", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetSmartDetectorAlertRule gets an existing SmartDetectorAlertRule 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 GetSmartDetectorAlertRule(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *SmartDetectorAlertRuleState, opts ...pulumi.ResourceOption) (*SmartDetectorAlertRule, error) {
var resource SmartDetectorAlertRule
err := ctx.ReadResource("azure-native:alertsmanagement:SmartDetectorAlertRule", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering SmartDetectorAlertRule resources.
type smartDetectorAlertRuleState struct {
}
type SmartDetectorAlertRuleState struct {
}
func (SmartDetectorAlertRuleState) ElementType() reflect.Type {
return reflect.TypeOf((*smartDetectorAlertRuleState)(nil)).Elem()
}
type smartDetectorAlertRuleArgs struct {
// The alert rule actions.
ActionGroups ActionGroupsInformation `pulumi:"actionGroups"`
// The name of the alert rule.
AlertRuleName *string `pulumi:"alertRuleName"`
// The alert rule description.
Description *string `pulumi:"description"`
// The alert rule's detector.
Detector Detector `pulumi:"detector"`
// The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector.
Frequency string `pulumi:"frequency"`
// The resource location.
Location *string `pulumi:"location"`
// The name of the resource group.
ResourceGroupName string `pulumi:"resourceGroupName"`
// The alert rule resources scope.
Scope []string `pulumi:"scope"`
// The alert rule severity.
Severity string `pulumi:"severity"`
// The alert rule state.
State string `pulumi:"state"`
// The resource tags.
Tags map[string]string `pulumi:"tags"`
// The alert rule throttling information.
Throttling *ThrottlingInformation `pulumi:"throttling"`
}
// The set of arguments for constructing a SmartDetectorAlertRule resource.
type SmartDetectorAlertRuleArgs struct {
// The alert rule actions.
ActionGroups ActionGroupsInformationInput
// The name of the alert rule.
AlertRuleName pulumi.StringPtrInput
// The alert rule description.
Description pulumi.StringPtrInput
// The alert rule's detector.
Detector DetectorInput
// The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector.
Frequency pulumi.StringInput
// The resource location.
Location pulumi.StringPtrInput
// The name of the resource group.
ResourceGroupName pulumi.StringInput
// The alert rule resources scope.
Scope pulumi.StringArrayInput
// The alert rule severity.
Severity pulumi.StringInput
// The alert rule state.
State pulumi.StringInput
// The resource tags.
Tags pulumi.StringMapInput
// The alert rule throttling information.
Throttling ThrottlingInformationPtrInput
}
func (SmartDetectorAlertRuleArgs) ElementType() reflect.Type {
return reflect.TypeOf((*smartDetectorAlertRuleArgs)(nil)).Elem()
}
type SmartDetectorAlertRuleInput interface {
pulumi.Input
ToSmartDetectorAlertRuleOutput() SmartDetectorAlertRuleOutput
ToSmartDetectorAlertRuleOutputWithContext(ctx context.Context) SmartDetectorAlertRuleOutput
}
func (*SmartDetectorAlertRule) ElementType() reflect.Type {
return reflect.TypeOf((**SmartDetectorAlertRule)(nil)).Elem()
}
func (i *SmartDetectorAlertRule) ToSmartDetectorAlertRuleOutput() SmartDetectorAlertRuleOutput {
return i.ToSmartDetectorAlertRuleOutputWithContext(context.Background())
}
func (i *SmartDetectorAlertRule) ToSmartDetectorAlertRuleOutputWithContext(ctx context.Context) SmartDetectorAlertRuleOutput {
return pulumi.ToOutputWithContext(ctx, i).(SmartDetectorAlertRuleOutput)
}
type SmartDetectorAlertRuleOutput struct{ *pulumi.OutputState }
func (SmartDetectorAlertRuleOutput) ElementType() reflect.Type {
return reflect.TypeOf((**SmartDetectorAlertRule)(nil)).Elem()
}
func (o SmartDetectorAlertRuleOutput) ToSmartDetectorAlertRuleOutput() SmartDetectorAlertRuleOutput {
return o
}
func (o SmartDetectorAlertRuleOutput) ToSmartDetectorAlertRuleOutputWithContext(ctx context.Context) SmartDetectorAlertRuleOutput {
return o
}
// The alert rule actions.
func (o SmartDetectorAlertRuleOutput) ActionGroups() ActionGroupsInformationResponseOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) ActionGroupsInformationResponseOutput { return v.ActionGroups }).(ActionGroupsInformationResponseOutput)
}
// The alert rule description.
func (o SmartDetectorAlertRuleOutput) Description() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
}
// The alert rule's detector.
func (o SmartDetectorAlertRuleOutput) Detector() DetectorResponseOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) DetectorResponseOutput { return v.Detector }).(DetectorResponseOutput)
}
// The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1 minute, depending on the detector.
func (o SmartDetectorAlertRuleOutput) Frequency() pulumi.StringOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringOutput { return v.Frequency }).(pulumi.StringOutput)
}
// The resource location.
func (o SmartDetectorAlertRuleOutput) Location() pulumi.StringPtrOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringPtrOutput { return v.Location }).(pulumi.StringPtrOutput)
}
// The resource name.
func (o SmartDetectorAlertRuleOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// The alert rule resources scope.
func (o SmartDetectorAlertRuleOutput) Scope() pulumi.StringArrayOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringArrayOutput { return v.Scope }).(pulumi.StringArrayOutput)
}
// The alert rule severity.
func (o SmartDetectorAlertRuleOutput) Severity() pulumi.StringOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringOutput { return v.Severity }).(pulumi.StringOutput)
}
// The alert rule state.
func (o SmartDetectorAlertRuleOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// The resource tags.
func (o SmartDetectorAlertRuleOutput) Tags() pulumi.StringMapOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringMapOutput { return v.Tags }).(pulumi.StringMapOutput)
}
// The alert rule throttling information.
func (o SmartDetectorAlertRuleOutput) Throttling() ThrottlingInformationResponsePtrOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) ThrottlingInformationResponsePtrOutput { return v.Throttling }).(ThrottlingInformationResponsePtrOutput)
}
// The resource type.
func (o SmartDetectorAlertRuleOutput) Type() pulumi.StringOutput {
return o.ApplyT(func(v *SmartDetectorAlertRule) pulumi.StringOutput { return v.Type }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(SmartDetectorAlertRuleOutput{})
}