-
Notifications
You must be signed in to change notification settings - Fork 50
/
webTest.go
237 lines (214 loc) · 8.45 KB
/
webTest.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
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package appinsights
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an Application Insights WebTest.
//
// > This content is derived from https://github.com/terraform-providers/terraform-provider-azurerm/blob/master/website/docs/r/application_insights_web_test.html.markdown.
type WebTest struct {
s *pulumi.ResourceState
}
// NewWebTest registers a new resource with the given unique name, arguments, and options.
func NewWebTest(ctx *pulumi.Context,
name string, args *WebTestArgs, opts ...pulumi.ResourceOpt) (*WebTest, error) {
if args == nil || args.ApplicationInsightsId == nil {
return nil, errors.New("missing required argument 'ApplicationInsightsId'")
}
if args == nil || args.Configuration == nil {
return nil, errors.New("missing required argument 'Configuration'")
}
if args == nil || args.GeoLocations == nil {
return nil, errors.New("missing required argument 'GeoLocations'")
}
if args == nil || args.Kind == nil {
return nil, errors.New("missing required argument 'Kind'")
}
if args == nil || args.ResourceGroupName == nil {
return nil, errors.New("missing required argument 'ResourceGroupName'")
}
inputs := make(map[string]interface{})
if args == nil {
inputs["applicationInsightsId"] = nil
inputs["configuration"] = nil
inputs["description"] = nil
inputs["enabled"] = nil
inputs["frequency"] = nil
inputs["geoLocations"] = nil
inputs["kind"] = nil
inputs["location"] = nil
inputs["name"] = nil
inputs["resourceGroupName"] = nil
inputs["retryEnabled"] = nil
inputs["tags"] = nil
inputs["timeout"] = nil
} else {
inputs["applicationInsightsId"] = args.ApplicationInsightsId
inputs["configuration"] = args.Configuration
inputs["description"] = args.Description
inputs["enabled"] = args.Enabled
inputs["frequency"] = args.Frequency
inputs["geoLocations"] = args.GeoLocations
inputs["kind"] = args.Kind
inputs["location"] = args.Location
inputs["name"] = args.Name
inputs["resourceGroupName"] = args.ResourceGroupName
inputs["retryEnabled"] = args.RetryEnabled
inputs["tags"] = args.Tags
inputs["timeout"] = args.Timeout
}
inputs["syntheticMonitorId"] = nil
s, err := ctx.RegisterResource("azure:appinsights/webTest:WebTest", name, true, inputs, opts...)
if err != nil {
return nil, err
}
return &WebTest{s: s}, nil
}
// GetWebTest gets an existing WebTest 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 GetWebTest(ctx *pulumi.Context,
name string, id pulumi.ID, state *WebTestState, opts ...pulumi.ResourceOpt) (*WebTest, error) {
inputs := make(map[string]interface{})
if state != nil {
inputs["applicationInsightsId"] = state.ApplicationInsightsId
inputs["configuration"] = state.Configuration
inputs["description"] = state.Description
inputs["enabled"] = state.Enabled
inputs["frequency"] = state.Frequency
inputs["geoLocations"] = state.GeoLocations
inputs["kind"] = state.Kind
inputs["location"] = state.Location
inputs["name"] = state.Name
inputs["resourceGroupName"] = state.ResourceGroupName
inputs["retryEnabled"] = state.RetryEnabled
inputs["syntheticMonitorId"] = state.SyntheticMonitorId
inputs["tags"] = state.Tags
inputs["timeout"] = state.Timeout
}
s, err := ctx.ReadResource("azure:appinsights/webTest:WebTest", name, id, inputs, opts...)
if err != nil {
return nil, err
}
return &WebTest{s: s}, nil
}
// URN is this resource's unique name assigned by Pulumi.
func (r *WebTest) URN() *pulumi.URNOutput {
return r.s.URN()
}
// ID is this resource's unique identifier assigned by its provider.
func (r *WebTest) ID() *pulumi.IDOutput {
return r.s.ID()
}
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
func (r *WebTest) ApplicationInsightsId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["applicationInsightsId"])
}
// An XML configuration specification for a WebTest.
func (r *WebTest) Configuration() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["configuration"])
}
// Purpose/user defined descriptive test for this WebTest.
func (r *WebTest) Description() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["description"])
}
// Is the test actively being monitored.
func (r *WebTest) Enabled() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["enabled"])
}
// Interval in seconds between test runs for this WebTest. Default is `300`.
func (r *WebTest) Frequency() *pulumi.IntOutput {
return (*pulumi.IntOutput)(r.s.State["frequency"])
}
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
func (r *WebTest) GeoLocations() *pulumi.ArrayOutput {
return (*pulumi.ArrayOutput)(r.s.State["geoLocations"])
}
func (r *WebTest) Kind() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["kind"])
}
// The location of the resource group.
func (r *WebTest) Location() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["location"])
}
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
func (r *WebTest) Name() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["name"])
}
func (r *WebTest) ResourceGroupName() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["resourceGroupName"])
}
// Allow for retries should this WebTest fail.
func (r *WebTest) RetryEnabled() *pulumi.BoolOutput {
return (*pulumi.BoolOutput)(r.s.State["retryEnabled"])
}
func (r *WebTest) SyntheticMonitorId() *pulumi.StringOutput {
return (*pulumi.StringOutput)(r.s.State["syntheticMonitorId"])
}
// Resource tags.
func (r *WebTest) Tags() *pulumi.MapOutput {
return (*pulumi.MapOutput)(r.s.State["tags"])
}
// Seconds until this WebTest will timeout and fail. Default is `30`.
func (r *WebTest) Timeout() *pulumi.IntOutput {
return (*pulumi.IntOutput)(r.s.State["timeout"])
}
// Input properties used for looking up and filtering WebTest resources.
type WebTestState struct {
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
ApplicationInsightsId interface{}
// An XML configuration specification for a WebTest.
Configuration interface{}
// Purpose/user defined descriptive test for this WebTest.
Description interface{}
// Is the test actively being monitored.
Enabled interface{}
// Interval in seconds between test runs for this WebTest. Default is `300`.
Frequency interface{}
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
GeoLocations interface{}
Kind interface{}
// The location of the resource group.
Location interface{}
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
Name interface{}
ResourceGroupName interface{}
// Allow for retries should this WebTest fail.
RetryEnabled interface{}
SyntheticMonitorId interface{}
// Resource tags.
Tags interface{}
// Seconds until this WebTest will timeout and fail. Default is `30`.
Timeout interface{}
}
// The set of arguments for constructing a WebTest resource.
type WebTestArgs struct {
// The ID of the Application Insights component on which the WebTest operates. Changing this forces a new resource to be created.
ApplicationInsightsId interface{}
// An XML configuration specification for a WebTest.
Configuration interface{}
// Purpose/user defined descriptive test for this WebTest.
Description interface{}
// Is the test actively being monitored.
Enabled interface{}
// Interval in seconds between test runs for this WebTest. Default is `300`.
Frequency interface{}
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
GeoLocations interface{}
Kind interface{}
// The location of the resource group.
Location interface{}
// Specifies the name of the Application Insights WebTest. Changing this forces a
// new resource to be created.
Name interface{}
ResourceGroupName interface{}
// Allow for retries should this WebTest fail.
RetryEnabled interface{}
// Resource tags.
Tags interface{}
// Seconds until this WebTest will timeout and fail. Default is `30`.
Timeout interface{}
}