1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DataSafe
  5. getAuditTrailAnalytic
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

oci.DataSafe.getAuditTrailAnalytic

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi

    This data source provides details about a specific Audit Trail Analytic resource in Oracle Cloud Infrastructure Data Safe service.

    Gets a list of audit trail aggregated details . A audit trail aggregation helps understand the overall state of trails. As an example, it helps understand how many trails are running or stopped. 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 AuditTrailAnalytics 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

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testAuditTrailAnalytic = oci.DataSafe.getAuditTrailAnalytic({
        compartmentId: compartmentId,
        accessLevel: auditTrailAnalyticAccessLevel,
        compartmentIdInSubtree: auditTrailAnalyticCompartmentIdInSubtree,
        groupBies: auditTrailAnalyticGroupBy,
        targetId: testTarget.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_audit_trail_analytic = oci.DataSafe.get_audit_trail_analytic(compartment_id=compartment_id,
        access_level=audit_trail_analytic_access_level,
        compartment_id_in_subtree=audit_trail_analytic_compartment_id_in_subtree,
        group_bies=audit_trail_analytic_group_by,
        target_id=test_target["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/DataSafe"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := DataSafe.GetAuditTrailAnalytic(ctx, &datasafe.GetAuditTrailAnalyticArgs{
    			CompartmentId:          compartmentId,
    			AccessLevel:            pulumi.StringRef(auditTrailAnalyticAccessLevel),
    			CompartmentIdInSubtree: pulumi.BoolRef(auditTrailAnalyticCompartmentIdInSubtree),
    			GroupBies:              auditTrailAnalyticGroupBy,
    			TargetId:               pulumi.StringRef(testTarget.Id),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testAuditTrailAnalytic = Oci.DataSafe.GetAuditTrailAnalytic.Invoke(new()
        {
            CompartmentId = compartmentId,
            AccessLevel = auditTrailAnalyticAccessLevel,
            CompartmentIdInSubtree = auditTrailAnalyticCompartmentIdInSubtree,
            GroupBies = auditTrailAnalyticGroupBy,
            TargetId = testTarget.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.DataSafe.DataSafeFunctions;
    import com.pulumi.oci.DataSafe.inputs.GetAuditTrailAnalyticArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var testAuditTrailAnalytic = DataSafeFunctions.getAuditTrailAnalytic(GetAuditTrailAnalyticArgs.builder()
                .compartmentId(compartmentId)
                .accessLevel(auditTrailAnalyticAccessLevel)
                .compartmentIdInSubtree(auditTrailAnalyticCompartmentIdInSubtree)
                .groupBies(auditTrailAnalyticGroupBy)
                .targetId(testTarget.id())
                .build());
    
        }
    }
    
    variables:
      testAuditTrailAnalytic:
        fn::invoke:
          Function: oci:DataSafe:getAuditTrailAnalytic
          Arguments:
            compartmentId: ${compartmentId}
            accessLevel: ${auditTrailAnalyticAccessLevel}
            compartmentIdInSubtree: ${auditTrailAnalyticCompartmentIdInSubtree}
            groupBies: ${auditTrailAnalyticGroupBy}
            targetId: ${testTarget.id}
    

    Using getAuditTrailAnalytic

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getAuditTrailAnalytic(args: GetAuditTrailAnalyticArgs, opts?: InvokeOptions): Promise<GetAuditTrailAnalyticResult>
    function getAuditTrailAnalyticOutput(args: GetAuditTrailAnalyticOutputArgs, opts?: InvokeOptions): Output<GetAuditTrailAnalyticResult>
    def get_audit_trail_analytic(access_level: Optional[str] = None,
                                 compartment_id: Optional[str] = None,
                                 compartment_id_in_subtree: Optional[bool] = None,
                                 group_bies: Optional[Sequence[str]] = None,
                                 target_id: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetAuditTrailAnalyticResult
    def get_audit_trail_analytic_output(access_level: Optional[pulumi.Input[str]] = None,
                                 compartment_id: Optional[pulumi.Input[str]] = None,
                                 compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
                                 group_bies: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 target_id: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetAuditTrailAnalyticResult]
    func GetAuditTrailAnalytic(ctx *Context, args *GetAuditTrailAnalyticArgs, opts ...InvokeOption) (*GetAuditTrailAnalyticResult, error)
    func GetAuditTrailAnalyticOutput(ctx *Context, args *GetAuditTrailAnalyticOutputArgs, opts ...InvokeOption) GetAuditTrailAnalyticResultOutput

    > Note: This function is named GetAuditTrailAnalytic in the Go SDK.

    public static class GetAuditTrailAnalytic 
    {
        public static Task<GetAuditTrailAnalyticResult> InvokeAsync(GetAuditTrailAnalyticArgs args, InvokeOptions? opts = null)
        public static Output<GetAuditTrailAnalyticResult> Invoke(GetAuditTrailAnalyticInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAuditTrailAnalyticResult> getAuditTrailAnalytic(GetAuditTrailAnalyticArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:DataSafe/getAuditTrailAnalytic:getAuditTrailAnalytic
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    A filter to return only resources that match the specified compartment OCID.
    AccessLevel string
    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.
    CompartmentIdInSubtree bool
    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.
    GroupBies List<string>
    The group by parameter for summarize operation on audit trail.
    TargetId string
    A filter to return only items related to a specific target OCID.
    CompartmentId string
    A filter to return only resources that match the specified compartment OCID.
    AccessLevel string
    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.
    CompartmentIdInSubtree bool
    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.
    GroupBies []string
    The group by parameter for summarize operation on audit trail.
    TargetId string
    A filter to return only items related to a specific target OCID.
    compartmentId String
    A filter to return only resources that match the specified compartment OCID.
    accessLevel String
    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.
    compartmentIdInSubtree Boolean
    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.
    groupBies List<String>
    The group by parameter for summarize operation on audit trail.
    targetId String
    A filter to return only items related to a specific target OCID.
    compartmentId string
    A filter to return only resources that match the specified compartment OCID.
    accessLevel string
    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.
    compartmentIdInSubtree boolean
    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.
    groupBies string[]
    The group by parameter for summarize operation on audit trail.
    targetId string
    A filter to return only items related to a specific target OCID.
    compartment_id str
    A filter to return only resources that match the specified compartment OCID.
    access_level str
    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.
    compartment_id_in_subtree bool
    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.
    group_bies Sequence[str]
    The group by parameter for summarize operation on audit trail.
    target_id str
    A filter to return only items related to a specific target OCID.
    compartmentId String
    A filter to return only resources that match the specified compartment OCID.
    accessLevel String
    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.
    compartmentIdInSubtree Boolean
    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.
    groupBies List<String>
    The group by parameter for summarize operation on audit trail.
    targetId String
    A filter to return only items related to a specific target OCID.

    getAuditTrailAnalytic Result

    The following output properties are available:

    CompartmentId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Items List<GetAuditTrailAnalyticItem>
    Array of audit trail aggregration data.
    AccessLevel string
    CompartmentIdInSubtree bool
    GroupBies List<string>
    TargetId string
    The OCID of the Data Safe target for which the audit trail is created.
    CompartmentId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Items []GetAuditTrailAnalyticItem
    Array of audit trail aggregration data.
    AccessLevel string
    CompartmentIdInSubtree bool
    GroupBies []string
    TargetId string
    The OCID of the Data Safe target for which the audit trail is created.
    compartmentId String
    id String
    The provider-assigned unique ID for this managed resource.
    items List<GetAuditTrailAnalyticItem>
    Array of audit trail aggregration data.
    accessLevel String
    compartmentIdInSubtree Boolean
    groupBies List<String>
    targetId String
    The OCID of the Data Safe target for which the audit trail is created.
    compartmentId string
    id string
    The provider-assigned unique ID for this managed resource.
    items GetAuditTrailAnalyticItem[]
    Array of audit trail aggregration data.
    accessLevel string
    compartmentIdInSubtree boolean
    groupBies string[]
    targetId string
    The OCID of the Data Safe target for which the audit trail is created.
    compartment_id str
    id str
    The provider-assigned unique ID for this managed resource.
    items Sequence[datasafe.GetAuditTrailAnalyticItem]
    Array of audit trail aggregration data.
    access_level str
    compartment_id_in_subtree bool
    group_bies Sequence[str]
    target_id str
    The OCID of the Data Safe target for which the audit trail is created.
    compartmentId String
    id String
    The provider-assigned unique ID for this managed resource.
    items List<Property Map>
    Array of audit trail aggregration data.
    accessLevel String
    compartmentIdInSubtree Boolean
    groupBies List<String>
    targetId String
    The OCID of the Data Safe target for which the audit trail is created.

    Supporting Types

    GetAuditTrailAnalyticItem

    Count string
    Total count of aggregated metric.
    Dimensions List<GetAuditTrailAnalyticItemDimension>
    Details of aggregation dimensions used for summarizing audit trails.
    Count string
    Total count of aggregated metric.
    Dimensions []GetAuditTrailAnalyticItemDimension
    Details of aggregation dimensions used for summarizing audit trails.
    count String
    Total count of aggregated metric.
    dimensions List<GetAuditTrailAnalyticItemDimension>
    Details of aggregation dimensions used for summarizing audit trails.
    count string
    Total count of aggregated metric.
    dimensions GetAuditTrailAnalyticItemDimension[]
    Details of aggregation dimensions used for summarizing audit trails.
    count str
    Total count of aggregated metric.
    dimensions Sequence[datasafe.GetAuditTrailAnalyticItemDimension]
    Details of aggregation dimensions used for summarizing audit trails.
    count String
    Total count of aggregated metric.
    dimensions List<Property Map>
    Details of aggregation dimensions used for summarizing audit trails.

    GetAuditTrailAnalyticItemDimension

    Location string
    The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
    State string
    The current state of the audit trail.
    Status string
    The current sub-state of the audit trail..
    TargetId string
    A filter to return only items related to a specific target OCID.
    Location string
    The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
    State string
    The current state of the audit trail.
    Status string
    The current sub-state of the audit trail..
    TargetId string
    A filter to return only items related to a specific target OCID.
    location String
    The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
    state String
    The current state of the audit trail.
    status String
    The current sub-state of the audit trail..
    targetId String
    A filter to return only items related to a specific target OCID.
    location string
    The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
    state string
    The current state of the audit trail.
    status string
    The current sub-state of the audit trail..
    targetId string
    A filter to return only items related to a specific target OCID.
    location str
    The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
    state str
    The current state of the audit trail.
    status str
    The current sub-state of the audit trail..
    target_id str
    A filter to return only items related to a specific target OCID.
    location String
    The location represents the source of audit records that provides documentary evidence of the sequence of activities in the target database.
    state String
    The current state of the audit trail.
    status String
    The current sub-state of the audit trail..
    targetId String
    A filter to return only items related to a specific target OCID.

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v2.17.0 published on Friday, Nov 15, 2024 by Pulumi