This repository has been archived by the owner on Aug 15, 2022. It is now read-only.
generated from pulumi/pulumi-tf-provider-boilerplate
/
cchttpPolicy.go
379 lines (322 loc) · 15.8 KB
/
cchttpPolicy.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
375
376
377
378
379
// 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 dayu
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type CCHttpPolicy struct {
pulumi.CustomResourceState
// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
Action pulumi.StringOutput `pulumi:"action"`
// Create time of the CC self-define http policy.
CreateTime pulumi.StringOutput `pulumi:"createTime"`
// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
Frequency pulumi.IntOutput `pulumi:"frequency"`
// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
// set one.
Ip pulumi.StringOutput `pulumi:"ip"`
// Name of the CC self-define http policy. Length should between 1 and 20.
Name pulumi.StringOutput `pulumi:"name"`
// Id of the CC self-define http policy.
PolicyId pulumi.StringOutput `pulumi:"policyId"`
// ID of the resource that the CC self-define http policy works for.
ResourceId pulumi.StringOutput `pulumi:"resourceId"`
// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
// `net`.
ResourceType pulumi.StringOutput `pulumi:"resourceType"`
// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
RuleLists CCHttpPolicyRuleListArrayOutput `pulumi:"ruleLists"`
// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
// one.
Smode pulumi.StringPtrOutput `pulumi:"smode"`
// Indicate the CC self-define http policy takes effect or not.
Switch pulumi.BoolPtrOutput `pulumi:"switch"`
}
// NewCCHttpPolicy registers a new resource with the given unique name, arguments, and options.
func NewCCHttpPolicy(ctx *pulumi.Context,
name string, args *CCHttpPolicyArgs, opts ...pulumi.ResourceOption) (*CCHttpPolicy, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.ResourceId == nil {
return nil, errors.New("invalid value for required argument 'ResourceId'")
}
if args.ResourceType == nil {
return nil, errors.New("invalid value for required argument 'ResourceType'")
}
var resource CCHttpPolicy
err := ctx.RegisterResource("tctest:Dayu/cCHttpPolicy:CCHttpPolicy", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetCCHttpPolicy gets an existing CCHttpPolicy 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 GetCCHttpPolicy(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *CCHttpPolicyState, opts ...pulumi.ResourceOption) (*CCHttpPolicy, error) {
var resource CCHttpPolicy
err := ctx.ReadResource("tctest:Dayu/cCHttpPolicy:CCHttpPolicy", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering CCHttpPolicy resources.
type cchttpPolicyState struct {
// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
Action *string `pulumi:"action"`
// Create time of the CC self-define http policy.
CreateTime *string `pulumi:"createTime"`
// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
Frequency *int `pulumi:"frequency"`
// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
// set one.
Ip *string `pulumi:"ip"`
// Name of the CC self-define http policy. Length should between 1 and 20.
Name *string `pulumi:"name"`
// Id of the CC self-define http policy.
PolicyId *string `pulumi:"policyId"`
// ID of the resource that the CC self-define http policy works for.
ResourceId *string `pulumi:"resourceId"`
// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
// `net`.
ResourceType *string `pulumi:"resourceType"`
// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
RuleLists []CCHttpPolicyRuleList `pulumi:"ruleLists"`
// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
// one.
Smode *string `pulumi:"smode"`
// Indicate the CC self-define http policy takes effect or not.
Switch *bool `pulumi:"switch"`
}
type CCHttpPolicyState struct {
// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
Action pulumi.StringPtrInput
// Create time of the CC self-define http policy.
CreateTime pulumi.StringPtrInput
// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
Frequency pulumi.IntPtrInput
// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
// set one.
Ip pulumi.StringPtrInput
// Name of the CC self-define http policy. Length should between 1 and 20.
Name pulumi.StringPtrInput
// Id of the CC self-define http policy.
PolicyId pulumi.StringPtrInput
// ID of the resource that the CC self-define http policy works for.
ResourceId pulumi.StringPtrInput
// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
// `net`.
ResourceType pulumi.StringPtrInput
// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
RuleLists CCHttpPolicyRuleListArrayInput
// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
// one.
Smode pulumi.StringPtrInput
// Indicate the CC self-define http policy takes effect or not.
Switch pulumi.BoolPtrInput
}
func (CCHttpPolicyState) ElementType() reflect.Type {
return reflect.TypeOf((*cchttpPolicyState)(nil)).Elem()
}
type cchttpPolicyArgs struct {
// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
Action *string `pulumi:"action"`
// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
Frequency *int `pulumi:"frequency"`
// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
// set one.
Ip *string `pulumi:"ip"`
// Name of the CC self-define http policy. Length should between 1 and 20.
Name *string `pulumi:"name"`
// ID of the resource that the CC self-define http policy works for.
ResourceId string `pulumi:"resourceId"`
// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
// `net`.
ResourceType string `pulumi:"resourceType"`
// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
RuleLists []CCHttpPolicyRuleList `pulumi:"ruleLists"`
// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
// one.
Smode *string `pulumi:"smode"`
// Indicate the CC self-define http policy takes effect or not.
Switch *bool `pulumi:"switch"`
}
// The set of arguments for constructing a CCHttpPolicy resource.
type CCHttpPolicyArgs struct {
// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
Action pulumi.StringPtrInput
// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
Frequency pulumi.IntPtrInput
// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
// set one.
Ip pulumi.StringPtrInput
// Name of the CC self-define http policy. Length should between 1 and 20.
Name pulumi.StringPtrInput
// ID of the resource that the CC self-define http policy works for.
ResourceId pulumi.StringInput
// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
// `net`.
ResourceType pulumi.StringInput
// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
RuleLists CCHttpPolicyRuleListArrayInput
// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
// one.
Smode pulumi.StringPtrInput
// Indicate the CC self-define http policy takes effect or not.
Switch pulumi.BoolPtrInput
}
func (CCHttpPolicyArgs) ElementType() reflect.Type {
return reflect.TypeOf((*cchttpPolicyArgs)(nil)).Elem()
}
type CCHttpPolicyInput interface {
pulumi.Input
ToCCHttpPolicyOutput() CCHttpPolicyOutput
ToCCHttpPolicyOutputWithContext(ctx context.Context) CCHttpPolicyOutput
}
func (*CCHttpPolicy) ElementType() reflect.Type {
return reflect.TypeOf((**CCHttpPolicy)(nil)).Elem()
}
func (i *CCHttpPolicy) ToCCHttpPolicyOutput() CCHttpPolicyOutput {
return i.ToCCHttpPolicyOutputWithContext(context.Background())
}
func (i *CCHttpPolicy) ToCCHttpPolicyOutputWithContext(ctx context.Context) CCHttpPolicyOutput {
return pulumi.ToOutputWithContext(ctx, i).(CCHttpPolicyOutput)
}
// CCHttpPolicyArrayInput is an input type that accepts CCHttpPolicyArray and CCHttpPolicyArrayOutput values.
// You can construct a concrete instance of `CCHttpPolicyArrayInput` via:
//
// CCHttpPolicyArray{ CCHttpPolicyArgs{...} }
type CCHttpPolicyArrayInput interface {
pulumi.Input
ToCCHttpPolicyArrayOutput() CCHttpPolicyArrayOutput
ToCCHttpPolicyArrayOutputWithContext(context.Context) CCHttpPolicyArrayOutput
}
type CCHttpPolicyArray []CCHttpPolicyInput
func (CCHttpPolicyArray) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CCHttpPolicy)(nil)).Elem()
}
func (i CCHttpPolicyArray) ToCCHttpPolicyArrayOutput() CCHttpPolicyArrayOutput {
return i.ToCCHttpPolicyArrayOutputWithContext(context.Background())
}
func (i CCHttpPolicyArray) ToCCHttpPolicyArrayOutputWithContext(ctx context.Context) CCHttpPolicyArrayOutput {
return pulumi.ToOutputWithContext(ctx, i).(CCHttpPolicyArrayOutput)
}
// CCHttpPolicyMapInput is an input type that accepts CCHttpPolicyMap and CCHttpPolicyMapOutput values.
// You can construct a concrete instance of `CCHttpPolicyMapInput` via:
//
// CCHttpPolicyMap{ "key": CCHttpPolicyArgs{...} }
type CCHttpPolicyMapInput interface {
pulumi.Input
ToCCHttpPolicyMapOutput() CCHttpPolicyMapOutput
ToCCHttpPolicyMapOutputWithContext(context.Context) CCHttpPolicyMapOutput
}
type CCHttpPolicyMap map[string]CCHttpPolicyInput
func (CCHttpPolicyMap) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CCHttpPolicy)(nil)).Elem()
}
func (i CCHttpPolicyMap) ToCCHttpPolicyMapOutput() CCHttpPolicyMapOutput {
return i.ToCCHttpPolicyMapOutputWithContext(context.Background())
}
func (i CCHttpPolicyMap) ToCCHttpPolicyMapOutputWithContext(ctx context.Context) CCHttpPolicyMapOutput {
return pulumi.ToOutputWithContext(ctx, i).(CCHttpPolicyMapOutput)
}
type CCHttpPolicyOutput struct{ *pulumi.OutputState }
func (CCHttpPolicyOutput) ElementType() reflect.Type {
return reflect.TypeOf((**CCHttpPolicy)(nil)).Elem()
}
func (o CCHttpPolicyOutput) ToCCHttpPolicyOutput() CCHttpPolicyOutput {
return o
}
func (o CCHttpPolicyOutput) ToCCHttpPolicyOutputWithContext(ctx context.Context) CCHttpPolicyOutput {
return o
}
// Action mode, only valid when `smode` is `matching`. Valid values are `alg` and `drop`.
func (o CCHttpPolicyOutput) Action() pulumi.StringOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringOutput { return v.Action }).(pulumi.StringOutput)
}
// Create time of the CC self-define http policy.
func (o CCHttpPolicyOutput) CreateTime() pulumi.StringOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringOutput { return v.CreateTime }).(pulumi.StringOutput)
}
// Max frequency per minute, only valid when `smode` is `speedlimit`, the valid value ranges from 1 to 10000.
func (o CCHttpPolicyOutput) Frequency() pulumi.IntOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.IntOutput { return v.Frequency }).(pulumi.IntOutput)
}
// Ip of the CC self-define http policy, only valid when `resource_type` is `bgp-multip`. The num of list items can only be
// set one.
func (o CCHttpPolicyOutput) Ip() pulumi.StringOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringOutput { return v.Ip }).(pulumi.StringOutput)
}
// Name of the CC self-define http policy. Length should between 1 and 20.
func (o CCHttpPolicyOutput) Name() pulumi.StringOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)
}
// Id of the CC self-define http policy.
func (o CCHttpPolicyOutput) PolicyId() pulumi.StringOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringOutput { return v.PolicyId }).(pulumi.StringOutput)
}
// ID of the resource that the CC self-define http policy works for.
func (o CCHttpPolicyOutput) ResourceId() pulumi.StringOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringOutput { return v.ResourceId }).(pulumi.StringOutput)
}
// Type of the resource that the CC self-define http policy works for, valid values are `bgpip`, `bgp`, `bgp-multip` and
// `net`.
func (o CCHttpPolicyOutput) ResourceType() pulumi.StringOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringOutput { return v.ResourceType }).(pulumi.StringOutput)
}
// Rule list of the CC self-define http policy, only valid when `smode` is `matching`.
func (o CCHttpPolicyOutput) RuleLists() CCHttpPolicyRuleListArrayOutput {
return o.ApplyT(func(v *CCHttpPolicy) CCHttpPolicyRuleListArrayOutput { return v.RuleLists }).(CCHttpPolicyRuleListArrayOutput)
}
// Match mode, and valid values are `matching`, `speedlimit`. Note: the speed limit type CC self-define policy can only set
// one.
func (o CCHttpPolicyOutput) Smode() pulumi.StringPtrOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.StringPtrOutput { return v.Smode }).(pulumi.StringPtrOutput)
}
// Indicate the CC self-define http policy takes effect or not.
func (o CCHttpPolicyOutput) Switch() pulumi.BoolPtrOutput {
return o.ApplyT(func(v *CCHttpPolicy) pulumi.BoolPtrOutput { return v.Switch }).(pulumi.BoolPtrOutput)
}
type CCHttpPolicyArrayOutput struct{ *pulumi.OutputState }
func (CCHttpPolicyArrayOutput) ElementType() reflect.Type {
return reflect.TypeOf((*[]*CCHttpPolicy)(nil)).Elem()
}
func (o CCHttpPolicyArrayOutput) ToCCHttpPolicyArrayOutput() CCHttpPolicyArrayOutput {
return o
}
func (o CCHttpPolicyArrayOutput) ToCCHttpPolicyArrayOutputWithContext(ctx context.Context) CCHttpPolicyArrayOutput {
return o
}
func (o CCHttpPolicyArrayOutput) Index(i pulumi.IntInput) CCHttpPolicyOutput {
return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CCHttpPolicy {
return vs[0].([]*CCHttpPolicy)[vs[1].(int)]
}).(CCHttpPolicyOutput)
}
type CCHttpPolicyMapOutput struct{ *pulumi.OutputState }
func (CCHttpPolicyMapOutput) ElementType() reflect.Type {
return reflect.TypeOf((*map[string]*CCHttpPolicy)(nil)).Elem()
}
func (o CCHttpPolicyMapOutput) ToCCHttpPolicyMapOutput() CCHttpPolicyMapOutput {
return o
}
func (o CCHttpPolicyMapOutput) ToCCHttpPolicyMapOutputWithContext(ctx context.Context) CCHttpPolicyMapOutput {
return o
}
func (o CCHttpPolicyMapOutput) MapIndex(k pulumi.StringInput) CCHttpPolicyOutput {
return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CCHttpPolicy {
return vs[0].(map[string]*CCHttpPolicy)[vs[1].(string)]
}).(CCHttpPolicyOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*CCHttpPolicyInput)(nil)).Elem(), &CCHttpPolicy{})
pulumi.RegisterInputType(reflect.TypeOf((*CCHttpPolicyArrayInput)(nil)).Elem(), CCHttpPolicyArray{})
pulumi.RegisterInputType(reflect.TypeOf((*CCHttpPolicyMapInput)(nil)).Elem(), CCHttpPolicyMap{})
pulumi.RegisterOutputType(CCHttpPolicyOutput{})
pulumi.RegisterOutputType(CCHttpPolicyArrayOutput{})
pulumi.RegisterOutputType(CCHttpPolicyMapOutput{})
}