generated from pulumi/pulumi-tf-provider-boilerplate
/
getAttackOverview.go
243 lines (214 loc) · 8.06 KB
/
getAttackOverview.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
// 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 waf
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to query detailed information of waf attackOverview
//
// ## Example Usage
// ### Basic Query
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-tencentcloud/sdk/go/tencentcloud/Waf"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Waf"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Waf.GetAttackOverview(ctx, &waf.GetAttackOverviewArgs{
// FromTime: "2023-09-01 00:00:00",
// ToTime: "2023-09-07 00:00:00",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
// ### Query by filter
//
// ```go
// package main
//
// import (
// "github.com/pulumi/pulumi-tencentcloud/sdk/go/tencentcloud/Waf"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
// "github.com/tencentcloudstack/pulumi-tencentcloud/sdk/go/tencentcloud/Waf"
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := Waf.GetAttackOverview(ctx, &waf.GetAttackOverviewArgs{
// Appid: pulumi.IntRef(1304251372),
// Domain: pulumi.StringRef("test.com"),
// Edition: pulumi.StringRef("clb-waf"),
// FromTime: "2023-09-01 00:00:00",
// InstanceId: pulumi.StringRef("waf_2kxtlbky00b2v1fn"),
// ToTime: "2023-09-07 00:00:00",
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
// ```
func GetAttackOverview(ctx *pulumi.Context, args *GetAttackOverviewArgs, opts ...pulumi.InvokeOption) (*GetAttackOverviewResult, error) {
opts = pkgInvokeDefaultOpts(opts)
var rv GetAttackOverviewResult
err := ctx.Invoke("tencentcloud:Waf/getAttackOverview:getAttackOverview", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAttackOverview.
type GetAttackOverviewArgs struct {
// App id.
Appid *int `pulumi:"appid"`
// Domain.
Domain *string `pulumi:"domain"`
// support `sparta-waf`, `clb-waf`, otherwise not filter.
Edition *string `pulumi:"edition"`
// Begin time.
FromTime string `pulumi:"fromTime"`
// Waf instanceId, otherwise not filter.
InstanceId *string `pulumi:"instanceId"`
// Used to save results.
ResultOutputFile *string `pulumi:"resultOutputFile"`
// End time.
ToTime string `pulumi:"toTime"`
}
// A collection of values returned by getAttackOverview.
type GetAttackOverviewResult struct {
// Access count.
AccessCount int `pulumi:"accessCount"`
// Access control count.
AclCount int `pulumi:"aclCount"`
// Api asset count.
ApiAssetsCount int `pulumi:"apiAssetsCount"`
// Number of API risk events.
ApiRiskEventCount int `pulumi:"apiRiskEventCount"`
Appid *int `pulumi:"appid"`
// Attack count.
AttackCount int `pulumi:"attackCount"`
// Bot attack count.
BotCount int `pulumi:"botCount"`
// CC attack count.
CcCount int `pulumi:"ccCount"`
Domain *string `pulumi:"domain"`
Edition *string `pulumi:"edition"`
FromTime string `pulumi:"fromTime"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
InstanceId *string `pulumi:"instanceId"`
ResultOutputFile *string `pulumi:"resultOutputFile"`
ToTime string `pulumi:"toTime"`
}
func GetAttackOverviewOutput(ctx *pulumi.Context, args GetAttackOverviewOutputArgs, opts ...pulumi.InvokeOption) GetAttackOverviewResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetAttackOverviewResult, error) {
args := v.(GetAttackOverviewArgs)
r, err := GetAttackOverview(ctx, &args, opts...)
var s GetAttackOverviewResult
if r != nil {
s = *r
}
return s, err
}).(GetAttackOverviewResultOutput)
}
// A collection of arguments for invoking getAttackOverview.
type GetAttackOverviewOutputArgs struct {
// App id.
Appid pulumi.IntPtrInput `pulumi:"appid"`
// Domain.
Domain pulumi.StringPtrInput `pulumi:"domain"`
// support `sparta-waf`, `clb-waf`, otherwise not filter.
Edition pulumi.StringPtrInput `pulumi:"edition"`
// Begin time.
FromTime pulumi.StringInput `pulumi:"fromTime"`
// Waf instanceId, otherwise not filter.
InstanceId pulumi.StringPtrInput `pulumi:"instanceId"`
// Used to save results.
ResultOutputFile pulumi.StringPtrInput `pulumi:"resultOutputFile"`
// End time.
ToTime pulumi.StringInput `pulumi:"toTime"`
}
func (GetAttackOverviewOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetAttackOverviewArgs)(nil)).Elem()
}
// A collection of values returned by getAttackOverview.
type GetAttackOverviewResultOutput struct{ *pulumi.OutputState }
func (GetAttackOverviewResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetAttackOverviewResult)(nil)).Elem()
}
func (o GetAttackOverviewResultOutput) ToGetAttackOverviewResultOutput() GetAttackOverviewResultOutput {
return o
}
func (o GetAttackOverviewResultOutput) ToGetAttackOverviewResultOutputWithContext(ctx context.Context) GetAttackOverviewResultOutput {
return o
}
// Access count.
func (o GetAttackOverviewResultOutput) AccessCount() pulumi.IntOutput {
return o.ApplyT(func(v GetAttackOverviewResult) int { return v.AccessCount }).(pulumi.IntOutput)
}
// Access control count.
func (o GetAttackOverviewResultOutput) AclCount() pulumi.IntOutput {
return o.ApplyT(func(v GetAttackOverviewResult) int { return v.AclCount }).(pulumi.IntOutput)
}
// Api asset count.
func (o GetAttackOverviewResultOutput) ApiAssetsCount() pulumi.IntOutput {
return o.ApplyT(func(v GetAttackOverviewResult) int { return v.ApiAssetsCount }).(pulumi.IntOutput)
}
// Number of API risk events.
func (o GetAttackOverviewResultOutput) ApiRiskEventCount() pulumi.IntOutput {
return o.ApplyT(func(v GetAttackOverviewResult) int { return v.ApiRiskEventCount }).(pulumi.IntOutput)
}
func (o GetAttackOverviewResultOutput) Appid() pulumi.IntPtrOutput {
return o.ApplyT(func(v GetAttackOverviewResult) *int { return v.Appid }).(pulumi.IntPtrOutput)
}
// Attack count.
func (o GetAttackOverviewResultOutput) AttackCount() pulumi.IntOutput {
return o.ApplyT(func(v GetAttackOverviewResult) int { return v.AttackCount }).(pulumi.IntOutput)
}
// Bot attack count.
func (o GetAttackOverviewResultOutput) BotCount() pulumi.IntOutput {
return o.ApplyT(func(v GetAttackOverviewResult) int { return v.BotCount }).(pulumi.IntOutput)
}
// CC attack count.
func (o GetAttackOverviewResultOutput) CcCount() pulumi.IntOutput {
return o.ApplyT(func(v GetAttackOverviewResult) int { return v.CcCount }).(pulumi.IntOutput)
}
func (o GetAttackOverviewResultOutput) Domain() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetAttackOverviewResult) *string { return v.Domain }).(pulumi.StringPtrOutput)
}
func (o GetAttackOverviewResultOutput) Edition() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetAttackOverviewResult) *string { return v.Edition }).(pulumi.StringPtrOutput)
}
func (o GetAttackOverviewResultOutput) FromTime() pulumi.StringOutput {
return o.ApplyT(func(v GetAttackOverviewResult) string { return v.FromTime }).(pulumi.StringOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetAttackOverviewResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetAttackOverviewResult) string { return v.Id }).(pulumi.StringOutput)
}
func (o GetAttackOverviewResultOutput) InstanceId() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetAttackOverviewResult) *string { return v.InstanceId }).(pulumi.StringPtrOutput)
}
func (o GetAttackOverviewResultOutput) ResultOutputFile() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetAttackOverviewResult) *string { return v.ResultOutputFile }).(pulumi.StringPtrOutput)
}
func (o GetAttackOverviewResultOutput) ToTime() pulumi.StringOutput {
return o.ApplyT(func(v GetAttackOverviewResult) string { return v.ToTime }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterOutputType(GetAttackOverviewResultOutput{})
}