1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DataSafe
  5. getSqlCollectionAnalytics
Oracle Cloud Infrastructure v2.28.0 published on Thursday, Mar 27, 2025 by Pulumi

oci.DataSafe.getSqlCollectionAnalytics

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.28.0 published on Thursday, Mar 27, 2025 by Pulumi

This data source provides the list of Sql Collection Analytics in Oracle Cloud Infrastructure Data Safe service.

Retrieves a list of all SQL collection analytics in Data Safe.

The ListSqlCollectionAnalytics operation returns only the analytics for the SQL collections in the specified compartmentId.

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 ListSqlCollections 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 testSqlCollectionAnalytics = oci.DataSafe.getSqlCollectionAnalytics({
    compartmentId: compartmentId,
    accessLevel: sqlCollectionAnalyticAccessLevel,
    compartmentIdInSubtree: sqlCollectionAnalyticCompartmentIdInSubtree,
    groupBies: sqlCollectionAnalyticGroupBy,
    state: sqlCollectionAnalyticState,
    targetId: testTarget.id,
    timeEnded: sqlCollectionAnalyticTimeEnded,
    timeStarted: sqlCollectionAnalyticTimeStarted,
});
Copy
import pulumi
import pulumi_oci as oci

test_sql_collection_analytics = oci.DataSafe.get_sql_collection_analytics(compartment_id=compartment_id,
    access_level=sql_collection_analytic_access_level,
    compartment_id_in_subtree=sql_collection_analytic_compartment_id_in_subtree,
    group_bies=sql_collection_analytic_group_by,
    state=sql_collection_analytic_state,
    target_id=test_target["id"],
    time_ended=sql_collection_analytic_time_ended,
    time_started=sql_collection_analytic_time_started)
Copy
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.GetSqlCollectionAnalytics(ctx, &datasafe.GetSqlCollectionAnalyticsArgs{
			CompartmentId:          compartmentId,
			AccessLevel:            pulumi.StringRef(sqlCollectionAnalyticAccessLevel),
			CompartmentIdInSubtree: pulumi.BoolRef(sqlCollectionAnalyticCompartmentIdInSubtree),
			GroupBies:              sqlCollectionAnalyticGroupBy,
			State:                  pulumi.StringRef(sqlCollectionAnalyticState),
			TargetId:               pulumi.StringRef(testTarget.Id),
			TimeEnded:              pulumi.StringRef(sqlCollectionAnalyticTimeEnded),
			TimeStarted:            pulumi.StringRef(sqlCollectionAnalyticTimeStarted),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testSqlCollectionAnalytics = Oci.DataSafe.GetSqlCollectionAnalytics.Invoke(new()
    {
        CompartmentId = compartmentId,
        AccessLevel = sqlCollectionAnalyticAccessLevel,
        CompartmentIdInSubtree = sqlCollectionAnalyticCompartmentIdInSubtree,
        GroupBies = sqlCollectionAnalyticGroupBy,
        State = sqlCollectionAnalyticState,
        TargetId = testTarget.Id,
        TimeEnded = sqlCollectionAnalyticTimeEnded,
        TimeStarted = sqlCollectionAnalyticTimeStarted,
    });

});
Copy
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.GetSqlCollectionAnalyticsArgs;
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 testSqlCollectionAnalytics = DataSafeFunctions.getSqlCollectionAnalytics(GetSqlCollectionAnalyticsArgs.builder()
            .compartmentId(compartmentId)
            .accessLevel(sqlCollectionAnalyticAccessLevel)
            .compartmentIdInSubtree(sqlCollectionAnalyticCompartmentIdInSubtree)
            .groupBies(sqlCollectionAnalyticGroupBy)
            .state(sqlCollectionAnalyticState)
            .targetId(testTarget.id())
            .timeEnded(sqlCollectionAnalyticTimeEnded)
            .timeStarted(sqlCollectionAnalyticTimeStarted)
            .build());

    }
}
Copy
variables:
  testSqlCollectionAnalytics:
    fn::invoke:
      function: oci:DataSafe:getSqlCollectionAnalytics
      arguments:
        compartmentId: ${compartmentId}
        accessLevel: ${sqlCollectionAnalyticAccessLevel}
        compartmentIdInSubtree: ${sqlCollectionAnalyticCompartmentIdInSubtree}
        groupBies: ${sqlCollectionAnalyticGroupBy}
        state: ${sqlCollectionAnalyticState}
        targetId: ${testTarget.id}
        timeEnded: ${sqlCollectionAnalyticTimeEnded}
        timeStarted: ${sqlCollectionAnalyticTimeStarted}
Copy

Using getSqlCollectionAnalytics

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 getSqlCollectionAnalytics(args: GetSqlCollectionAnalyticsArgs, opts?: InvokeOptions): Promise<GetSqlCollectionAnalyticsResult>
function getSqlCollectionAnalyticsOutput(args: GetSqlCollectionAnalyticsOutputArgs, opts?: InvokeOptions): Output<GetSqlCollectionAnalyticsResult>
Copy
def get_sql_collection_analytics(access_level: Optional[str] = None,
                                 compartment_id: Optional[str] = None,
                                 compartment_id_in_subtree: Optional[bool] = None,
                                 filters: Optional[Sequence[_datasafe.GetSqlCollectionAnalyticsFilter]] = None,
                                 group_bies: Optional[Sequence[str]] = None,
                                 state: Optional[str] = None,
                                 target_id: Optional[str] = None,
                                 time_ended: Optional[str] = None,
                                 time_started: Optional[str] = None,
                                 opts: Optional[InvokeOptions] = None) -> GetSqlCollectionAnalyticsResult
def get_sql_collection_analytics_output(access_level: Optional[pulumi.Input[str]] = None,
                                 compartment_id: Optional[pulumi.Input[str]] = None,
                                 compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
                                 filters: Optional[pulumi.Input[Sequence[pulumi.Input[_datasafe.GetSqlCollectionAnalyticsFilterArgs]]]] = None,
                                 group_bies: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                                 state: Optional[pulumi.Input[str]] = None,
                                 target_id: Optional[pulumi.Input[str]] = None,
                                 time_ended: Optional[pulumi.Input[str]] = None,
                                 time_started: Optional[pulumi.Input[str]] = None,
                                 opts: Optional[InvokeOptions] = None) -> Output[GetSqlCollectionAnalyticsResult]
Copy
func GetSqlCollectionAnalytics(ctx *Context, args *GetSqlCollectionAnalyticsArgs, opts ...InvokeOption) (*GetSqlCollectionAnalyticsResult, error)
func GetSqlCollectionAnalyticsOutput(ctx *Context, args *GetSqlCollectionAnalyticsOutputArgs, opts ...InvokeOption) GetSqlCollectionAnalyticsResultOutput
Copy

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

public static class GetSqlCollectionAnalytics 
{
    public static Task<GetSqlCollectionAnalyticsResult> InvokeAsync(GetSqlCollectionAnalyticsArgs args, InvokeOptions? opts = null)
    public static Output<GetSqlCollectionAnalyticsResult> Invoke(GetSqlCollectionAnalyticsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetSqlCollectionAnalyticsResult> getSqlCollectionAnalytics(GetSqlCollectionAnalyticsArgs args, InvokeOptions options)
public static Output<GetSqlCollectionAnalyticsResult> getSqlCollectionAnalytics(GetSqlCollectionAnalyticsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:DataSafe/getSqlCollectionAnalytics:getSqlCollectionAnalytics
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

CompartmentId This property is required. 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.
Filters Changes to this property will trigger replacement. List<GetSqlCollectionAnalyticsFilter>
GroupBies List<string>
The group by parameter to summarize SQL collection aggregation.
State string
The current state of the SQL collection.
TargetId string
A filter to return only items related to a specific target OCID.
TimeEnded string
An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by RFC3339.
TimeStarted string
An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by RFC3339.
CompartmentId This property is required. 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.
Filters Changes to this property will trigger replacement. []GetSqlCollectionAnalyticsFilter
GroupBies []string
The group by parameter to summarize SQL collection aggregation.
State string
The current state of the SQL collection.
TargetId string
A filter to return only items related to a specific target OCID.
TimeEnded string
An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by RFC3339.
TimeStarted string
An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by RFC3339.
compartmentId This property is required. 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.
filters Changes to this property will trigger replacement. List<GetSqlCollectionAnalyticsFilter>
groupBies List<String>
The group by parameter to summarize SQL collection aggregation.
state String
The current state of the SQL collection.
targetId String
A filter to return only items related to a specific target OCID.
timeEnded String
An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by RFC3339.
timeStarted String
An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by RFC3339.
compartmentId This property is required. 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.
filters Changes to this property will trigger replacement. GetSqlCollectionAnalyticsFilter[]
groupBies string[]
The group by parameter to summarize SQL collection aggregation.
state string
The current state of the SQL collection.
targetId string
A filter to return only items related to a specific target OCID.
timeEnded string
An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by RFC3339.
timeStarted string
An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by RFC3339.
compartment_id This property is required. 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.
filters Changes to this property will trigger replacement. Sequence[datasafe.GetSqlCollectionAnalyticsFilter]
group_bies Sequence[str]
The group by parameter to summarize SQL collection aggregation.
state str
The current state of the SQL collection.
target_id str
A filter to return only items related to a specific target OCID.
time_ended str
An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by RFC3339.
time_started str
An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by RFC3339.
compartmentId This property is required. 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.
filters Changes to this property will trigger replacement. List<Property Map>
groupBies List<String>
The group by parameter to summarize SQL collection aggregation.
state String
The current state of the SQL collection.
targetId String
A filter to return only items related to a specific target OCID.
timeEnded String
An optional filter to return the stats of the SQL collection logs collected before the date-time specified, in the format defined by RFC3339.
timeStarted String
An optional filter to return the stats of the SQL collection logs collected after the date-time specified, in the format defined by RFC3339.

getSqlCollectionAnalytics Result

The following output properties are available:

CompartmentId string
Id string
The provider-assigned unique ID for this managed resource.
SqlCollectionAnalyticsCollections List<GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollection>
The list of sql_collection_analytics_collection.
AccessLevel string
CompartmentIdInSubtree bool
Filters List<GetSqlCollectionAnalyticsFilter>
GroupBies List<string>
State string
The current state of the SQL collection.
TargetId string
The OCID of the target corresponding to the security policy deployment.
TimeEnded string
TimeStarted string
CompartmentId string
Id string
The provider-assigned unique ID for this managed resource.
SqlCollectionAnalyticsCollections []GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollection
The list of sql_collection_analytics_collection.
AccessLevel string
CompartmentIdInSubtree bool
Filters []GetSqlCollectionAnalyticsFilter
GroupBies []string
State string
The current state of the SQL collection.
TargetId string
The OCID of the target corresponding to the security policy deployment.
TimeEnded string
TimeStarted string
compartmentId String
id String
The provider-assigned unique ID for this managed resource.
sqlCollectionAnalyticsCollections List<GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollection>
The list of sql_collection_analytics_collection.
accessLevel String
compartmentIdInSubtree Boolean
filters List<GetSqlCollectionAnalyticsFilter>
groupBies List<String>
state String
The current state of the SQL collection.
targetId String
The OCID of the target corresponding to the security policy deployment.
timeEnded String
timeStarted String
compartmentId string
id string
The provider-assigned unique ID for this managed resource.
sqlCollectionAnalyticsCollections GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollection[]
The list of sql_collection_analytics_collection.
accessLevel string
compartmentIdInSubtree boolean
filters GetSqlCollectionAnalyticsFilter[]
groupBies string[]
state string
The current state of the SQL collection.
targetId string
The OCID of the target corresponding to the security policy deployment.
timeEnded string
timeStarted string
compartment_id str
id str
The provider-assigned unique ID for this managed resource.
sql_collection_analytics_collections Sequence[datasafe.GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollection]
The list of sql_collection_analytics_collection.
access_level str
compartment_id_in_subtree bool
filters Sequence[datasafe.GetSqlCollectionAnalyticsFilter]
group_bies Sequence[str]
state str
The current state of the SQL collection.
target_id str
The OCID of the target corresponding to the security policy deployment.
time_ended str
time_started str
compartmentId String
id String
The provider-assigned unique ID for this managed resource.
sqlCollectionAnalyticsCollections List<Property Map>
The list of sql_collection_analytics_collection.
accessLevel String
compartmentIdInSubtree Boolean
filters List<Property Map>
groupBies List<String>
state String
The current state of the SQL collection.
targetId String
The OCID of the target corresponding to the security policy deployment.
timeEnded String
timeStarted String

Supporting Types

GetSqlCollectionAnalyticsFilter

Name This property is required. string
Values This property is required. List<string>
Regex bool
Name This property is required. string
Values This property is required. []string
Regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean
name This property is required. string
values This property is required. string[]
regex boolean
name This property is required. str
values This property is required. Sequence[str]
regex bool
name This property is required. String
values This property is required. List<String>
regex Boolean

GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollection

Items This property is required. List<GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItem>
The aggregated data point items.
Items This property is required. []GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItem
The aggregated data point items.
items This property is required. List<GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItem>
The aggregated data point items.
items This property is required. GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItem[]
The aggregated data point items.
items This property is required. Sequence[datasafe.GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItem]
The aggregated data point items.
items This property is required. List<Property Map>
The aggregated data point items.

GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItem

Dimensions This property is required. List<GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItemDimension>
The dimensions available for SQL collection analytics.
SqlCollectionAnalyticCount This property is required. string
The total count of the aggregated metric.
Dimensions This property is required. []GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItemDimension
The dimensions available for SQL collection analytics.
SqlCollectionAnalyticCount This property is required. string
The total count of the aggregated metric.
dimensions This property is required. List<GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItemDimension>
The dimensions available for SQL collection analytics.
sqlCollectionAnalyticCount This property is required. String
The total count of the aggregated metric.
dimensions This property is required. GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItemDimension[]
The dimensions available for SQL collection analytics.
sqlCollectionAnalyticCount This property is required. string
The total count of the aggregated metric.
dimensions This property is required. Sequence[datasafe.GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItemDimension]
The dimensions available for SQL collection analytics.
sql_collection_analytic_count This property is required. str
The total count of the aggregated metric.
dimensions This property is required. List<Property Map>
The dimensions available for SQL collection analytics.
sqlCollectionAnalyticCount This property is required. String
The total count of the aggregated metric.

GetSqlCollectionAnalyticsSqlCollectionAnalyticsCollectionItemDimension

State This property is required. string
The current state of the SQL collection.
TargetId This property is required. string
A filter to return only items related to a specific target OCID.
State This property is required. string
The current state of the SQL collection.
TargetId This property is required. string
A filter to return only items related to a specific target OCID.
state This property is required. String
The current state of the SQL collection.
targetId This property is required. String
A filter to return only items related to a specific target OCID.
state This property is required. string
The current state of the SQL collection.
targetId This property is required. string
A filter to return only items related to a specific target OCID.
state This property is required. str
The current state of the SQL collection.
target_id This property is required. str
A filter to return only items related to a specific target OCID.
state This property is required. String
The current state of the SQL collection.
targetId This property is required. 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.
Oracle Cloud Infrastructure v2.28.0 published on Thursday, Mar 27, 2025 by Pulumi