This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
/
webTest.go
352 lines (328 loc) · 15.1 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
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
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20201005preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// An Application Insights WebTest definition.
type WebTest struct {
pulumi.CustomResourceState
// An XML configuration specification for a WebTest.
Configuration WebTestPropertiesResponseConfigurationPtrOutput `pulumi:"configuration"`
// The collection of content validation properties
ContentValidation WebTestPropertiesResponseContentValidationPtrOutput `pulumi:"contentValidation"`
// User defined description for this WebTest.
Description pulumi.StringPtrOutput `pulumi:"description"`
// Is the test actively being monitored.
Enabled pulumi.BoolPtrOutput `pulumi:"enabled"`
// Validate that the WebTest returns the http status code provided.
ExpectedHttpStatusCode pulumi.IntPtrOutput `pulumi:"expectedHttpStatusCode"`
// Interval in seconds between test runs for this WebTest. Default value is 300.
Frequency pulumi.IntPtrOutput `pulumi:"frequency"`
// When set, validation will ignore the status code.
IgnoreHttpsStatusCode pulumi.BoolPtrOutput `pulumi:"ignoreHttpsStatusCode"`
// The kind of WebTest that this web test watches. Choices are ping and multistep.
Kind pulumi.StringPtrOutput `pulumi:"kind"`
// Resource location
Location pulumi.StringOutput `pulumi:"location"`
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
Locations WebTestGeolocationResponseArrayOutput `pulumi:"locations"`
// Azure resource name
Name pulumi.StringOutput `pulumi:"name"`
// Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.
ProvisioningState pulumi.StringOutput `pulumi:"provisioningState"`
// The collection of request properties
Request WebTestPropertiesResponseRequestPtrOutput `pulumi:"request"`
// Allow for retries should this WebTest fail.
RetryEnabled pulumi.BoolPtrOutput `pulumi:"retryEnabled"`
// A number of days to check still remain before the the existing SSL cert expires.
SSLCertRemainingLifetimeCheck pulumi.IntPtrOutput `pulumi:"sSLCertRemainingLifetimeCheck"`
// Checks to see if the SSL cert is still valid.
SSLCheck pulumi.BoolPtrOutput `pulumi:"sSLCheck"`
// Unique ID of this WebTest. This is typically the same value as the Name field.
SyntheticMonitorId pulumi.StringOutput `pulumi:"syntheticMonitorId"`
// Resource tags
Tags pulumi.StringMapOutput `pulumi:"tags"`
// Seconds until this WebTest will timeout and fail. Default value is 30.
Timeout pulumi.IntPtrOutput `pulumi:"timeout"`
// Azure resource type
Type pulumi.StringOutput `pulumi:"type"`
// The kind of web test this is, valid choices are ping, multistep, basic, and standard.
WebTestKind pulumi.StringOutput `pulumi:"webTestKind"`
// User defined name if this WebTest.
WebTestName pulumi.StringOutput `pulumi:"webTestName"`
}
// NewWebTest registers a new resource with the given unique name, arguments, and options.
func NewWebTest(ctx *pulumi.Context,
name string, args *WebTestArgs, opts ...pulumi.ResourceOption) (*WebTest, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.Locations == nil {
return nil, errors.New("invalid value for required argument 'Locations'")
}
if args.ResourceGroupName == nil {
return nil, errors.New("invalid value for required argument 'ResourceGroupName'")
}
if args.SyntheticMonitorId == nil {
return nil, errors.New("invalid value for required argument 'SyntheticMonitorId'")
}
if args.WebTestName == nil {
return nil, errors.New("invalid value for required argument 'WebTestName'")
}
if args.Frequency == nil {
args.Frequency = pulumi.IntPtr(300)
}
if args.Kind == nil {
e := WebTestKind("ping")
args.Kind = &e
}
if args.Timeout == nil {
args.Timeout = pulumi.IntPtr(30)
}
if args.WebTestKind == "" {
args.WebTestKind = WebTestKindEnum("ping")
}
aliases := pulumi.Aliases([]pulumi.Alias{
{
Type: pulumi.String("azure-nextgen:insights/latest:WebTest"),
},
{
Type: pulumi.String("azure-nextgen:insights/v20150501:WebTest"),
},
})
opts = append(opts, aliases)
var resource WebTest
err := ctx.RegisterResource("azure-nextgen:insights/v20201005preview:WebTest", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, 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.IDInput, state *WebTestState, opts ...pulumi.ResourceOption) (*WebTest, error) {
var resource WebTest
err := ctx.ReadResource("azure-nextgen:insights/v20201005preview:WebTest", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering WebTest resources.
type webTestState struct {
// An XML configuration specification for a WebTest.
Configuration *WebTestPropertiesResponseConfiguration `pulumi:"configuration"`
// The collection of content validation properties
ContentValidation *WebTestPropertiesResponseContentValidation `pulumi:"contentValidation"`
// User defined description for this WebTest.
Description *string `pulumi:"description"`
// Is the test actively being monitored.
Enabled *bool `pulumi:"enabled"`
// Validate that the WebTest returns the http status code provided.
ExpectedHttpStatusCode *int `pulumi:"expectedHttpStatusCode"`
// Interval in seconds between test runs for this WebTest. Default value is 300.
Frequency *int `pulumi:"frequency"`
// When set, validation will ignore the status code.
IgnoreHttpsStatusCode *bool `pulumi:"ignoreHttpsStatusCode"`
// The kind of WebTest that this web test watches. Choices are ping and multistep.
Kind *string `pulumi:"kind"`
// Resource location
Location *string `pulumi:"location"`
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
Locations []WebTestGeolocationResponse `pulumi:"locations"`
// Azure resource name
Name *string `pulumi:"name"`
// Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.
ProvisioningState *string `pulumi:"provisioningState"`
// The collection of request properties
Request *WebTestPropertiesResponseRequest `pulumi:"request"`
// Allow for retries should this WebTest fail.
RetryEnabled *bool `pulumi:"retryEnabled"`
// A number of days to check still remain before the the existing SSL cert expires.
SSLCertRemainingLifetimeCheck *int `pulumi:"sSLCertRemainingLifetimeCheck"`
// Checks to see if the SSL cert is still valid.
SSLCheck *bool `pulumi:"sSLCheck"`
// Unique ID of this WebTest. This is typically the same value as the Name field.
SyntheticMonitorId *string `pulumi:"syntheticMonitorId"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
// Seconds until this WebTest will timeout and fail. Default value is 30.
Timeout *int `pulumi:"timeout"`
// Azure resource type
Type *string `pulumi:"type"`
// The kind of web test this is, valid choices are ping, multistep, basic, and standard.
WebTestKind *string `pulumi:"webTestKind"`
// User defined name if this WebTest.
WebTestName *string `pulumi:"webTestName"`
}
type WebTestState struct {
// An XML configuration specification for a WebTest.
Configuration WebTestPropertiesResponseConfigurationPtrInput
// The collection of content validation properties
ContentValidation WebTestPropertiesResponseContentValidationPtrInput
// User defined description for this WebTest.
Description pulumi.StringPtrInput
// Is the test actively being monitored.
Enabled pulumi.BoolPtrInput
// Validate that the WebTest returns the http status code provided.
ExpectedHttpStatusCode pulumi.IntPtrInput
// Interval in seconds between test runs for this WebTest. Default value is 300.
Frequency pulumi.IntPtrInput
// When set, validation will ignore the status code.
IgnoreHttpsStatusCode pulumi.BoolPtrInput
// The kind of WebTest that this web test watches. Choices are ping and multistep.
Kind pulumi.StringPtrInput
// Resource location
Location pulumi.StringPtrInput
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
Locations WebTestGeolocationResponseArrayInput
// Azure resource name
Name pulumi.StringPtrInput
// Current state of this component, whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Succeeded, Deploying, Canceled, and Failed.
ProvisioningState pulumi.StringPtrInput
// The collection of request properties
Request WebTestPropertiesResponseRequestPtrInput
// Allow for retries should this WebTest fail.
RetryEnabled pulumi.BoolPtrInput
// A number of days to check still remain before the the existing SSL cert expires.
SSLCertRemainingLifetimeCheck pulumi.IntPtrInput
// Checks to see if the SSL cert is still valid.
SSLCheck pulumi.BoolPtrInput
// Unique ID of this WebTest. This is typically the same value as the Name field.
SyntheticMonitorId pulumi.StringPtrInput
// Resource tags
Tags pulumi.StringMapInput
// Seconds until this WebTest will timeout and fail. Default value is 30.
Timeout pulumi.IntPtrInput
// Azure resource type
Type pulumi.StringPtrInput
// The kind of web test this is, valid choices are ping, multistep, basic, and standard.
WebTestKind pulumi.StringPtrInput
// User defined name if this WebTest.
WebTestName pulumi.StringPtrInput
}
func (WebTestState) ElementType() reflect.Type {
return reflect.TypeOf((*webTestState)(nil)).Elem()
}
type webTestArgs struct {
// An XML configuration specification for a WebTest.
Configuration *WebTestPropertiesConfiguration `pulumi:"configuration"`
// The collection of content validation properties
ContentValidation *WebTestPropertiesContentValidation `pulumi:"contentValidation"`
// User defined description for this WebTest.
Description *string `pulumi:"description"`
// Is the test actively being monitored.
Enabled *bool `pulumi:"enabled"`
// Validate that the WebTest returns the http status code provided.
ExpectedHttpStatusCode *int `pulumi:"expectedHttpStatusCode"`
// Interval in seconds between test runs for this WebTest. Default value is 300.
Frequency *int `pulumi:"frequency"`
// When set, validation will ignore the status code.
IgnoreHttpsStatusCode *bool `pulumi:"ignoreHttpsStatusCode"`
// The kind of WebTest that this web test watches. Choices are ping and multistep.
Kind *string `pulumi:"kind"`
// Resource location
Location *string `pulumi:"location"`
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
Locations []WebTestGeolocation `pulumi:"locations"`
// The collection of request properties
Request *WebTestPropertiesRequest `pulumi:"request"`
// The name of the resource group. The name is case insensitive.
ResourceGroupName string `pulumi:"resourceGroupName"`
// Allow for retries should this WebTest fail.
RetryEnabled *bool `pulumi:"retryEnabled"`
// A number of days to check still remain before the the existing SSL cert expires.
SSLCertRemainingLifetimeCheck *int `pulumi:"sSLCertRemainingLifetimeCheck"`
// Checks to see if the SSL cert is still valid.
SSLCheck *bool `pulumi:"sSLCheck"`
// Unique ID of this WebTest. This is typically the same value as the Name field.
SyntheticMonitorId string `pulumi:"syntheticMonitorId"`
// Resource tags
Tags map[string]string `pulumi:"tags"`
// Seconds until this WebTest will timeout and fail. Default value is 30.
Timeout *int `pulumi:"timeout"`
// The kind of web test this is, valid choices are ping, multistep, basic, and standard.
WebTestKind string `pulumi:"webTestKind"`
// User defined name if this WebTest.
WebTestName string `pulumi:"webTestName"`
}
// The set of arguments for constructing a WebTest resource.
type WebTestArgs struct {
// An XML configuration specification for a WebTest.
Configuration WebTestPropertiesConfigurationPtrInput
// The collection of content validation properties
ContentValidation WebTestPropertiesContentValidationPtrInput
// User defined description for this WebTest.
Description pulumi.StringPtrInput
// Is the test actively being monitored.
Enabled pulumi.BoolPtrInput
// Validate that the WebTest returns the http status code provided.
ExpectedHttpStatusCode pulumi.IntPtrInput
// Interval in seconds between test runs for this WebTest. Default value is 300.
Frequency pulumi.IntPtrInput
// When set, validation will ignore the status code.
IgnoreHttpsStatusCode pulumi.BoolPtrInput
// The kind of WebTest that this web test watches. Choices are ping and multistep.
Kind *WebTestKind
// Resource location
Location pulumi.StringPtrInput
// A list of where to physically run the tests from to give global coverage for accessibility of your application.
Locations WebTestGeolocationArrayInput
// The collection of request properties
Request WebTestPropertiesRequestPtrInput
// The name of the resource group. The name is case insensitive.
ResourceGroupName pulumi.StringInput
// Allow for retries should this WebTest fail.
RetryEnabled pulumi.BoolPtrInput
// A number of days to check still remain before the the existing SSL cert expires.
SSLCertRemainingLifetimeCheck pulumi.IntPtrInput
// Checks to see if the SSL cert is still valid.
SSLCheck pulumi.BoolPtrInput
// Unique ID of this WebTest. This is typically the same value as the Name field.
SyntheticMonitorId pulumi.StringInput
// Resource tags
Tags pulumi.StringMapInput
// Seconds until this WebTest will timeout and fail. Default value is 30.
Timeout pulumi.IntPtrInput
// The kind of web test this is, valid choices are ping, multistep, basic, and standard.
WebTestKind WebTestKindEnum
// User defined name if this WebTest.
WebTestName pulumi.StringInput
}
func (WebTestArgs) ElementType() reflect.Type {
return reflect.TypeOf((*webTestArgs)(nil)).Elem()
}
type WebTestInput interface {
pulumi.Input
ToWebTestOutput() WebTestOutput
ToWebTestOutputWithContext(ctx context.Context) WebTestOutput
}
func (*WebTest) ElementType() reflect.Type {
return reflect.TypeOf((*WebTest)(nil))
}
func (i *WebTest) ToWebTestOutput() WebTestOutput {
return i.ToWebTestOutputWithContext(context.Background())
}
func (i *WebTest) ToWebTestOutputWithContext(ctx context.Context) WebTestOutput {
return pulumi.ToOutputWithContext(ctx, i).(WebTestOutput)
}
type WebTestOutput struct {
*pulumi.OutputState
}
func (WebTestOutput) ElementType() reflect.Type {
return reflect.TypeOf((*WebTest)(nil))
}
func (o WebTestOutput) ToWebTestOutput() WebTestOutput {
return o
}
func (o WebTestOutput) ToWebTestOutputWithContext(ctx context.Context) WebTestOutput {
return o
}
func init() {
pulumi.RegisterOutputType(WebTestOutput{})
}