generated from pulumi/pulumi-tf-provider-boilerplate
/
getAuditProfileAnalytic.go
164 lines (144 loc) · 7.71 KB
/
getAuditProfileAnalytic.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
// 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 datasafe
import (
"context"
"reflect"
"github.com/pulumi/pulumi-oci/sdk/go/oci/internal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides details about a specific Audit Profile Analytic resource in Oracle Cloud Infrastructure Data Safe service.
//
// Gets a list of audit profile aggregated details . A audit profile aggregation helps understand the overall state of audit profile profiles.
// As an example, it helps understand how many audit profiles have paid usage. It is especially useful to create dashboards or to support analytics.
//
// The parameter `accessLevel` specifies whether to return only those compartments for which the
// requestor has INSPECT permissions on at least one resource directly
// or indirectly (ACCESSIBLE) (the resource can be in a subcompartment) or to return Not Authorized if
// Principal doesn't have access to even one of the child compartments. This is valid only when
// `compartmentIdInSubtree` is set to `true`.
//
// The parameter `compartmentIdInSubtree` applies when you perform AuditProfileAnalytics on the
// `compartmentId` passed and when it is set to true, the entire hierarchy of compartments can be returned.
// To get a full list of all compartments and subcompartments in the tenancy (root compartment),
// set the parameter `compartmentIdInSubtree` to true and `accessLevel` to ACCESSIBLE.
//
// ## Example Usage
//
// ```go
// package main
//
// import (
//
// "github.com/pulumi/pulumi-oci/sdk/go/oci/DataSafe"
// "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
//
// )
//
// func main() {
// pulumi.Run(func(ctx *pulumi.Context) error {
// _, err := DataSafe.GetAuditProfileAnalytic(ctx, &datasafe.GetAuditProfileAnalyticArgs{
// CompartmentId: compartmentId,
// AccessLevel: pulumi.StringRef(auditProfileAnalyticAccessLevel),
// CompartmentIdInSubtree: pulumi.BoolRef(auditProfileAnalyticCompartmentIdInSubtree),
// GroupBies: auditProfileAnalyticGroupBy,
// }, nil)
// if err != nil {
// return err
// }
// return nil
// })
// }
//
// ```
func GetAuditProfileAnalytic(ctx *pulumi.Context, args *GetAuditProfileAnalyticArgs, opts ...pulumi.InvokeOption) (*GetAuditProfileAnalyticResult, error) {
opts = internal.PkgInvokeDefaultOpts(opts)
var rv GetAuditProfileAnalyticResult
err := ctx.Invoke("oci:DataSafe/getAuditProfileAnalytic:getAuditProfileAnalytic", args, &rv, opts...)
if err != nil {
return nil, err
}
return &rv, nil
}
// A collection of arguments for invoking getAuditProfileAnalytic.
type GetAuditProfileAnalyticArgs struct {
// Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
AccessLevel *string `pulumi:"accessLevel"`
// A filter to return only resources that match the specified compartment OCID.
CompartmentId string `pulumi:"compartmentId"`
// Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
CompartmentIdInSubtree *bool `pulumi:"compartmentIdInSubtree"`
// The group by parameter for summarize operation on audit.
GroupBies []string `pulumi:"groupBies"`
}
// A collection of values returned by getAuditProfileAnalytic.
type GetAuditProfileAnalyticResult struct {
AccessLevel *string `pulumi:"accessLevel"`
CompartmentId string `pulumi:"compartmentId"`
CompartmentIdInSubtree *bool `pulumi:"compartmentIdInSubtree"`
GroupBies []string `pulumi:"groupBies"`
// The provider-assigned unique ID for this managed resource.
Id string `pulumi:"id"`
// Array of audit profile aggregration data.
Items []GetAuditProfileAnalyticItem `pulumi:"items"`
}
func GetAuditProfileAnalyticOutput(ctx *pulumi.Context, args GetAuditProfileAnalyticOutputArgs, opts ...pulumi.InvokeOption) GetAuditProfileAnalyticResultOutput {
return pulumi.ToOutputWithContext(context.Background(), args).
ApplyT(func(v interface{}) (GetAuditProfileAnalyticResult, error) {
args := v.(GetAuditProfileAnalyticArgs)
r, err := GetAuditProfileAnalytic(ctx, &args, opts...)
var s GetAuditProfileAnalyticResult
if r != nil {
s = *r
}
return s, err
}).(GetAuditProfileAnalyticResultOutput)
}
// A collection of arguments for invoking getAuditProfileAnalytic.
type GetAuditProfileAnalyticOutputArgs struct {
// Valid values are RESTRICTED and ACCESSIBLE. Default is RESTRICTED. Setting this to ACCESSIBLE returns only those compartments for which the user has INSPECT permissions directly or indirectly (permissions can be on a resource in a subcompartment). When set to RESTRICTED permissions are checked and no partial results are displayed.
AccessLevel pulumi.StringPtrInput `pulumi:"accessLevel"`
// A filter to return only resources that match the specified compartment OCID.
CompartmentId pulumi.StringInput `pulumi:"compartmentId"`
// Default is false. When set to true, the hierarchy of compartments is traversed and all compartments and subcompartments in the tenancy are returned. Depends on the 'accessLevel' setting.
CompartmentIdInSubtree pulumi.BoolPtrInput `pulumi:"compartmentIdInSubtree"`
// The group by parameter for summarize operation on audit.
GroupBies pulumi.StringArrayInput `pulumi:"groupBies"`
}
func (GetAuditProfileAnalyticOutputArgs) ElementType() reflect.Type {
return reflect.TypeOf((*GetAuditProfileAnalyticArgs)(nil)).Elem()
}
// A collection of values returned by getAuditProfileAnalytic.
type GetAuditProfileAnalyticResultOutput struct{ *pulumi.OutputState }
func (GetAuditProfileAnalyticResultOutput) ElementType() reflect.Type {
return reflect.TypeOf((*GetAuditProfileAnalyticResult)(nil)).Elem()
}
func (o GetAuditProfileAnalyticResultOutput) ToGetAuditProfileAnalyticResultOutput() GetAuditProfileAnalyticResultOutput {
return o
}
func (o GetAuditProfileAnalyticResultOutput) ToGetAuditProfileAnalyticResultOutputWithContext(ctx context.Context) GetAuditProfileAnalyticResultOutput {
return o
}
func (o GetAuditProfileAnalyticResultOutput) AccessLevel() pulumi.StringPtrOutput {
return o.ApplyT(func(v GetAuditProfileAnalyticResult) *string { return v.AccessLevel }).(pulumi.StringPtrOutput)
}
func (o GetAuditProfileAnalyticResultOutput) CompartmentId() pulumi.StringOutput {
return o.ApplyT(func(v GetAuditProfileAnalyticResult) string { return v.CompartmentId }).(pulumi.StringOutput)
}
func (o GetAuditProfileAnalyticResultOutput) CompartmentIdInSubtree() pulumi.BoolPtrOutput {
return o.ApplyT(func(v GetAuditProfileAnalyticResult) *bool { return v.CompartmentIdInSubtree }).(pulumi.BoolPtrOutput)
}
func (o GetAuditProfileAnalyticResultOutput) GroupBies() pulumi.StringArrayOutput {
return o.ApplyT(func(v GetAuditProfileAnalyticResult) []string { return v.GroupBies }).(pulumi.StringArrayOutput)
}
// The provider-assigned unique ID for this managed resource.
func (o GetAuditProfileAnalyticResultOutput) Id() pulumi.StringOutput {
return o.ApplyT(func(v GetAuditProfileAnalyticResult) string { return v.Id }).(pulumi.StringOutput)
}
// Array of audit profile aggregration data.
func (o GetAuditProfileAnalyticResultOutput) Items() GetAuditProfileAnalyticItemArrayOutput {
return o.ApplyT(func(v GetAuditProfileAnalyticResult) []GetAuditProfileAnalyticItem { return v.Items }).(GetAuditProfileAnalyticItemArrayOutput)
}
func init() {
pulumi.RegisterOutputType(GetAuditProfileAnalyticResultOutput{})
}