/
hostSecurityReport.go
266 lines (228 loc) · 14.6 KB
/
hostSecurityReport.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
// 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 v1
import (
"context"
"reflect"
"errors"
"github.com/pulumi/pulumi-google-native/sdk/go/google/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Submit a query at host level to be processed in the background. If the submission of the query succeeds, the API returns a 201 status and an ID that refer to the query. In addition to the HTTP status 201, the `state` of "enqueued" means that the request succeeded.
// Auto-naming is currently not supported for this resource.
// Note - this resource's API doesn't support deletion. When deleted, the resource will persist
// on Google Cloud even though it will be deleted from Pulumi state.
type HostSecurityReport struct {
pulumi.CustomResourceState
// Creation time of the query.
Created pulumi.StringOutput `pulumi:"created"`
// Display Name specified by the user.
DisplayName pulumi.StringOutput `pulumi:"displayName"`
// Hostname is available only when query is executed at host level.
EnvgroupHostname pulumi.StringOutput `pulumi:"envgroupHostname"`
// Error is set when query fails.
Error pulumi.StringOutput `pulumi:"error"`
// ExecutionTime is available only after the query is completed.
ExecutionTime pulumi.StringOutput `pulumi:"executionTime"`
OrganizationId pulumi.StringOutput `pulumi:"organizationId"`
// Contains information like metrics, dimenstions etc of the Security Report.
QueryParams GoogleCloudApigeeV1SecurityReportMetadataResponseOutput `pulumi:"queryParams"`
// Report Definition ID.
ReportDefinitionId pulumi.StringOutput `pulumi:"reportDefinitionId"`
// Result is available only after the query is completed.
Result GoogleCloudApigeeV1SecurityReportResultMetadataResponseOutput `pulumi:"result"`
// ResultFileSize is available only after the query is completed.
ResultFileSize pulumi.StringOutput `pulumi:"resultFileSize"`
// ResultRows is available only after the query is completed.
ResultRows pulumi.StringOutput `pulumi:"resultRows"`
// Self link of the query. Example: `/organizations/myorg/environments/myenv/securityReports/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` or following format if query is running at host level: `/organizations/myorg/hostSecurityReports/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd`
Self pulumi.StringOutput `pulumi:"self"`
// Query state could be "enqueued", "running", "completed", "expired" and "failed".
State pulumi.StringOutput `pulumi:"state"`
// Last updated timestamp for the query.
Updated pulumi.StringOutput `pulumi:"updated"`
}
// NewHostSecurityReport registers a new resource with the given unique name, arguments, and options.
func NewHostSecurityReport(ctx *pulumi.Context,
name string, args *HostSecurityReportArgs, opts ...pulumi.ResourceOption) (*HostSecurityReport, error) {
if args == nil {
return nil, errors.New("missing one or more required arguments")
}
if args.OrganizationId == nil {
return nil, errors.New("invalid value for required argument 'OrganizationId'")
}
if args.TimeRange == nil {
return nil, errors.New("invalid value for required argument 'TimeRange'")
}
replaceOnChanges := pulumi.ReplaceOnChanges([]string{
"organizationId",
})
opts = append(opts, replaceOnChanges)
opts = internal.PkgResourceDefaultOpts(opts)
var resource HostSecurityReport
err := ctx.RegisterResource("google-native:apigee/v1:HostSecurityReport", name, args, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// GetHostSecurityReport gets an existing HostSecurityReport 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 GetHostSecurityReport(ctx *pulumi.Context,
name string, id pulumi.IDInput, state *HostSecurityReportState, opts ...pulumi.ResourceOption) (*HostSecurityReport, error) {
var resource HostSecurityReport
err := ctx.ReadResource("google-native:apigee/v1:HostSecurityReport", name, id, state, &resource, opts...)
if err != nil {
return nil, err
}
return &resource, nil
}
// Input properties used for looking up and filtering HostSecurityReport resources.
type hostSecurityReportState struct {
}
type HostSecurityReportState struct {
}
func (HostSecurityReportState) ElementType() reflect.Type {
return reflect.TypeOf((*hostSecurityReportState)(nil)).Elem()
}
type hostSecurityReportArgs struct {
// Delimiter used in the CSV file, if `outputFormat` is set to `csv`. Defaults to the `,` (comma) character. Supported delimiter characters include comma (`,`), pipe (`|`), and tab (`\t`).
CsvDelimiter *string `pulumi:"csvDelimiter"`
// A list of dimensions. https://docs.apigee.com/api-platform/analytics/analytics-reference#dimensions
Dimensions []string `pulumi:"dimensions"`
// Security Report display name which users can specify.
DisplayName *string `pulumi:"displayName"`
// Hostname needs to be specified if query intends to run at host level. This field is only allowed when query is submitted by CreateHostSecurityReport where analytics data will be grouped by organization and hostname.
EnvgroupHostname *string `pulumi:"envgroupHostname"`
// Boolean expression that can be used to filter data. Filter expressions can be combined using AND/OR terms and should be fully parenthesized to avoid ambiguity. See Analytics metrics, dimensions, and filters reference https://docs.apigee.com/api-platform/analytics/analytics-reference for more information on the fields available to filter on. For more information on the tokens that you use to build filter expressions, see Filter expression syntax. https://docs.apigee.com/api-platform/analytics/asynch-reports-api#filter-expression-syntax
Filter *string `pulumi:"filter"`
// Time unit used to group the result set. Valid values include: second, minute, hour, day, week, or month. If a query includes groupByTimeUnit, then the result is an aggregation based on the specified time unit and the resultant timestamp does not include milliseconds precision. If a query omits groupByTimeUnit, then the resultant timestamp includes milliseconds precision.
GroupByTimeUnit *string `pulumi:"groupByTimeUnit"`
// Maximum number of rows that can be returned in the result.
Limit *int `pulumi:"limit"`
// A list of Metrics.
Metrics []GoogleCloudApigeeV1SecurityReportQueryMetric `pulumi:"metrics"`
// Valid values include: `csv` or `json`. Defaults to `json`. Note: Configure the delimiter for CSV output using the csvDelimiter property.
MimeType *string `pulumi:"mimeType"`
OrganizationId string `pulumi:"organizationId"`
// Report Definition ID.
ReportDefinitionId *string `pulumi:"reportDefinitionId"`
// Time range for the query. Can use the following predefined strings to specify the time range: `last60minutes` `last24hours` `last7days` Or, specify the timeRange as a structure describing start and end timestamps in the ISO format: yyyy-mm-ddThh:mm:ssZ. Example: "timeRange": { "start": "2018-07-29T00:13:00Z", "end": "2018-08-01T00:18:00Z" }
TimeRange interface{} `pulumi:"timeRange"`
}
// The set of arguments for constructing a HostSecurityReport resource.
type HostSecurityReportArgs struct {
// Delimiter used in the CSV file, if `outputFormat` is set to `csv`. Defaults to the `,` (comma) character. Supported delimiter characters include comma (`,`), pipe (`|`), and tab (`\t`).
CsvDelimiter pulumi.StringPtrInput
// A list of dimensions. https://docs.apigee.com/api-platform/analytics/analytics-reference#dimensions
Dimensions pulumi.StringArrayInput
// Security Report display name which users can specify.
DisplayName pulumi.StringPtrInput
// Hostname needs to be specified if query intends to run at host level. This field is only allowed when query is submitted by CreateHostSecurityReport where analytics data will be grouped by organization and hostname.
EnvgroupHostname pulumi.StringPtrInput
// Boolean expression that can be used to filter data. Filter expressions can be combined using AND/OR terms and should be fully parenthesized to avoid ambiguity. See Analytics metrics, dimensions, and filters reference https://docs.apigee.com/api-platform/analytics/analytics-reference for more information on the fields available to filter on. For more information on the tokens that you use to build filter expressions, see Filter expression syntax. https://docs.apigee.com/api-platform/analytics/asynch-reports-api#filter-expression-syntax
Filter pulumi.StringPtrInput
// Time unit used to group the result set. Valid values include: second, minute, hour, day, week, or month. If a query includes groupByTimeUnit, then the result is an aggregation based on the specified time unit and the resultant timestamp does not include milliseconds precision. If a query omits groupByTimeUnit, then the resultant timestamp includes milliseconds precision.
GroupByTimeUnit pulumi.StringPtrInput
// Maximum number of rows that can be returned in the result.
Limit pulumi.IntPtrInput
// A list of Metrics.
Metrics GoogleCloudApigeeV1SecurityReportQueryMetricArrayInput
// Valid values include: `csv` or `json`. Defaults to `json`. Note: Configure the delimiter for CSV output using the csvDelimiter property.
MimeType pulumi.StringPtrInput
OrganizationId pulumi.StringInput
// Report Definition ID.
ReportDefinitionId pulumi.StringPtrInput
// Time range for the query. Can use the following predefined strings to specify the time range: `last60minutes` `last24hours` `last7days` Or, specify the timeRange as a structure describing start and end timestamps in the ISO format: yyyy-mm-ddThh:mm:ssZ. Example: "timeRange": { "start": "2018-07-29T00:13:00Z", "end": "2018-08-01T00:18:00Z" }
TimeRange pulumi.Input
}
func (HostSecurityReportArgs) ElementType() reflect.Type {
return reflect.TypeOf((*hostSecurityReportArgs)(nil)).Elem()
}
type HostSecurityReportInput interface {
pulumi.Input
ToHostSecurityReportOutput() HostSecurityReportOutput
ToHostSecurityReportOutputWithContext(ctx context.Context) HostSecurityReportOutput
}
func (*HostSecurityReport) ElementType() reflect.Type {
return reflect.TypeOf((**HostSecurityReport)(nil)).Elem()
}
func (i *HostSecurityReport) ToHostSecurityReportOutput() HostSecurityReportOutput {
return i.ToHostSecurityReportOutputWithContext(context.Background())
}
func (i *HostSecurityReport) ToHostSecurityReportOutputWithContext(ctx context.Context) HostSecurityReportOutput {
return pulumi.ToOutputWithContext(ctx, i).(HostSecurityReportOutput)
}
type HostSecurityReportOutput struct{ *pulumi.OutputState }
func (HostSecurityReportOutput) ElementType() reflect.Type {
return reflect.TypeOf((**HostSecurityReport)(nil)).Elem()
}
func (o HostSecurityReportOutput) ToHostSecurityReportOutput() HostSecurityReportOutput {
return o
}
func (o HostSecurityReportOutput) ToHostSecurityReportOutputWithContext(ctx context.Context) HostSecurityReportOutput {
return o
}
// Creation time of the query.
func (o HostSecurityReportOutput) Created() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.Created }).(pulumi.StringOutput)
}
// Display Name specified by the user.
func (o HostSecurityReportOutput) DisplayName() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.DisplayName }).(pulumi.StringOutput)
}
// Hostname is available only when query is executed at host level.
func (o HostSecurityReportOutput) EnvgroupHostname() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.EnvgroupHostname }).(pulumi.StringOutput)
}
// Error is set when query fails.
func (o HostSecurityReportOutput) Error() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.Error }).(pulumi.StringOutput)
}
// ExecutionTime is available only after the query is completed.
func (o HostSecurityReportOutput) ExecutionTime() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.ExecutionTime }).(pulumi.StringOutput)
}
func (o HostSecurityReportOutput) OrganizationId() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.OrganizationId }).(pulumi.StringOutput)
}
// Contains information like metrics, dimenstions etc of the Security Report.
func (o HostSecurityReportOutput) QueryParams() GoogleCloudApigeeV1SecurityReportMetadataResponseOutput {
return o.ApplyT(func(v *HostSecurityReport) GoogleCloudApigeeV1SecurityReportMetadataResponseOutput {
return v.QueryParams
}).(GoogleCloudApigeeV1SecurityReportMetadataResponseOutput)
}
// Report Definition ID.
func (o HostSecurityReportOutput) ReportDefinitionId() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.ReportDefinitionId }).(pulumi.StringOutput)
}
// Result is available only after the query is completed.
func (o HostSecurityReportOutput) Result() GoogleCloudApigeeV1SecurityReportResultMetadataResponseOutput {
return o.ApplyT(func(v *HostSecurityReport) GoogleCloudApigeeV1SecurityReportResultMetadataResponseOutput {
return v.Result
}).(GoogleCloudApigeeV1SecurityReportResultMetadataResponseOutput)
}
// ResultFileSize is available only after the query is completed.
func (o HostSecurityReportOutput) ResultFileSize() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.ResultFileSize }).(pulumi.StringOutput)
}
// ResultRows is available only after the query is completed.
func (o HostSecurityReportOutput) ResultRows() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.ResultRows }).(pulumi.StringOutput)
}
// Self link of the query. Example: `/organizations/myorg/environments/myenv/securityReports/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd` or following format if query is running at host level: `/organizations/myorg/hostSecurityReports/9cfc0d85-0f30-46d6-ae6f-318d0cb961bd`
func (o HostSecurityReportOutput) Self() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.Self }).(pulumi.StringOutput)
}
// Query state could be "enqueued", "running", "completed", "expired" and "failed".
func (o HostSecurityReportOutput) State() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.State }).(pulumi.StringOutput)
}
// Last updated timestamp for the query.
func (o HostSecurityReportOutput) Updated() pulumi.StringOutput {
return o.ApplyT(func(v *HostSecurityReport) pulumi.StringOutput { return v.Updated }).(pulumi.StringOutput)
}
func init() {
pulumi.RegisterInputType(reflect.TypeOf((*HostSecurityReportInput)(nil)).Elem(), &HostSecurityReport{})
pulumi.RegisterOutputType(HostSecurityReportOutput{})
}