1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. CloudGuard
  5. getSavedQueries
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

oci.CloudGuard.getSavedQueries

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi

    This data source provides the list of Saved Queries in Oracle Cloud Infrastructure Cloud Guard service.

    Returns a list of saved queries run in a tenancy.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testSavedQueries = oci.CloudGuard.getSavedQueries({
        compartmentId: compartmentId,
        accessLevel: savedQueryAccessLevel,
        compartmentIdInSubtree: savedQueryCompartmentIdInSubtree,
        displayName: savedQueryDisplayName,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_saved_queries = oci.CloudGuard.get_saved_queries(compartment_id=compartment_id,
        access_level=saved_query_access_level,
        compartment_id_in_subtree=saved_query_compartment_id_in_subtree,
        display_name=saved_query_display_name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/CloudGuard"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := CloudGuard.GetSavedQueries(ctx, &cloudguard.GetSavedQueriesArgs{
    			CompartmentId:          compartmentId,
    			AccessLevel:            pulumi.StringRef(savedQueryAccessLevel),
    			CompartmentIdInSubtree: pulumi.BoolRef(savedQueryCompartmentIdInSubtree),
    			DisplayName:            pulumi.StringRef(savedQueryDisplayName),
    		}, 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 testSavedQueries = Oci.CloudGuard.GetSavedQueries.Invoke(new()
        {
            CompartmentId = compartmentId,
            AccessLevel = savedQueryAccessLevel,
            CompartmentIdInSubtree = savedQueryCompartmentIdInSubtree,
            DisplayName = savedQueryDisplayName,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.CloudGuard.CloudGuardFunctions;
    import com.pulumi.oci.CloudGuard.inputs.GetSavedQueriesArgs;
    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 testSavedQueries = CloudGuardFunctions.getSavedQueries(GetSavedQueriesArgs.builder()
                .compartmentId(compartmentId)
                .accessLevel(savedQueryAccessLevel)
                .compartmentIdInSubtree(savedQueryCompartmentIdInSubtree)
                .displayName(savedQueryDisplayName)
                .build());
    
        }
    }
    
    variables:
      testSavedQueries:
        fn::invoke:
          Function: oci:CloudGuard:getSavedQueries
          Arguments:
            compartmentId: ${compartmentId}
            accessLevel: ${savedQueryAccessLevel}
            compartmentIdInSubtree: ${savedQueryCompartmentIdInSubtree}
            displayName: ${savedQueryDisplayName}
    

    Using getSavedQueries

    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 getSavedQueries(args: GetSavedQueriesArgs, opts?: InvokeOptions): Promise<GetSavedQueriesResult>
    function getSavedQueriesOutput(args: GetSavedQueriesOutputArgs, opts?: InvokeOptions): Output<GetSavedQueriesResult>
    def get_saved_queries(access_level: Optional[str] = None,
                          compartment_id: Optional[str] = None,
                          compartment_id_in_subtree: Optional[bool] = None,
                          display_name: Optional[str] = None,
                          filters: Optional[Sequence[_cloudguard.GetSavedQueriesFilter]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetSavedQueriesResult
    def get_saved_queries_output(access_level: Optional[pulumi.Input[str]] = None,
                          compartment_id: Optional[pulumi.Input[str]] = None,
                          compartment_id_in_subtree: Optional[pulumi.Input[bool]] = None,
                          display_name: Optional[pulumi.Input[str]] = None,
                          filters: Optional[pulumi.Input[Sequence[pulumi.Input[_cloudguard.GetSavedQueriesFilterArgs]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetSavedQueriesResult]
    func GetSavedQueries(ctx *Context, args *GetSavedQueriesArgs, opts ...InvokeOption) (*GetSavedQueriesResult, error)
    func GetSavedQueriesOutput(ctx *Context, args *GetSavedQueriesOutputArgs, opts ...InvokeOption) GetSavedQueriesResultOutput

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

    public static class GetSavedQueries 
    {
        public static Task<GetSavedQueriesResult> InvokeAsync(GetSavedQueriesArgs args, InvokeOptions? opts = null)
        public static Output<GetSavedQueriesResult> Invoke(GetSavedQueriesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSavedQueriesResult> getSavedQueries(GetSavedQueriesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:CloudGuard/getSavedQueries:getSavedQueries
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment in which to list resources.
    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 depending on the setting of accessLevel.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters List<GetSavedQueriesFilter>
    CompartmentId string
    The OCID of the compartment in which to list resources.
    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 depending on the setting of accessLevel.
    DisplayName string
    A filter to return only resources that match the entire display name given.
    Filters []GetSavedQueriesFilter
    compartmentId String
    The OCID of the compartment in which to list resources.
    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 depending on the setting of accessLevel.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<GetSavedQueriesFilter>
    compartmentId string
    The OCID of the compartment in which to list resources.
    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 depending on the setting of accessLevel.
    displayName string
    A filter to return only resources that match the entire display name given.
    filters GetSavedQueriesFilter[]
    compartment_id str
    The OCID of the compartment in which to list resources.
    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 depending on the setting of accessLevel.
    display_name str
    A filter to return only resources that match the entire display name given.
    filters Sequence[cloudguard.GetSavedQueriesFilter]
    compartmentId String
    The OCID of the compartment in which to list resources.
    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 depending on the setting of accessLevel.
    displayName String
    A filter to return only resources that match the entire display name given.
    filters List<Property Map>

    getSavedQueries Result

    The following output properties are available:

    CompartmentId string
    Compartment OCID of the saved query
    Id string
    The provider-assigned unique ID for this managed resource.
    SavedQueryCollections List<GetSavedQueriesSavedQueryCollection>
    The list of saved_query_collection.
    AccessLevel string
    CompartmentIdInSubtree bool
    DisplayName string
    Display name of the saved query
    Filters List<GetSavedQueriesFilter>
    CompartmentId string
    Compartment OCID of the saved query
    Id string
    The provider-assigned unique ID for this managed resource.
    SavedQueryCollections []GetSavedQueriesSavedQueryCollection
    The list of saved_query_collection.
    AccessLevel string
    CompartmentIdInSubtree bool
    DisplayName string
    Display name of the saved query
    Filters []GetSavedQueriesFilter
    compartmentId String
    Compartment OCID of the saved query
    id String
    The provider-assigned unique ID for this managed resource.
    savedQueryCollections List<GetSavedQueriesSavedQueryCollection>
    The list of saved_query_collection.
    accessLevel String
    compartmentIdInSubtree Boolean
    displayName String
    Display name of the saved query
    filters List<GetSavedQueriesFilter>
    compartmentId string
    Compartment OCID of the saved query
    id string
    The provider-assigned unique ID for this managed resource.
    savedQueryCollections GetSavedQueriesSavedQueryCollection[]
    The list of saved_query_collection.
    accessLevel string
    compartmentIdInSubtree boolean
    displayName string
    Display name of the saved query
    filters GetSavedQueriesFilter[]
    compartment_id str
    Compartment OCID of the saved query
    id str
    The provider-assigned unique ID for this managed resource.
    saved_query_collections Sequence[cloudguard.GetSavedQueriesSavedQueryCollection]
    The list of saved_query_collection.
    access_level str
    compartment_id_in_subtree bool
    display_name str
    Display name of the saved query
    filters Sequence[cloudguard.GetSavedQueriesFilter]
    compartmentId String
    Compartment OCID of the saved query
    id String
    The provider-assigned unique ID for this managed resource.
    savedQueryCollections List<Property Map>
    The list of saved_query_collection.
    accessLevel String
    compartmentIdInSubtree Boolean
    displayName String
    Display name of the saved query
    filters List<Property Map>

    Supporting Types

    GetSavedQueriesFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetSavedQueriesSavedQueryCollection

    GetSavedQueriesSavedQueryCollectionItem

    CompartmentId string
    The OCID of the compartment in which to list resources.
    DefinedTags Dictionary<string, object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    Description of the saved query
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags Dictionary<string, object>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    OCID for the saved query
    Query string
    The saved query expression
    State string
    The current lifecycle state of the resource
    SystemTags Dictionary<string, object>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The date and time the saved query was created. Format defined by RFC3339.
    TimeUpdated string
    The date and time the saved query was updated. Format defined by RFC3339.
    CompartmentId string
    The OCID of the compartment in which to list resources.
    DefinedTags map[string]interface{}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    Description string
    Description of the saved query
    DisplayName string
    A filter to return only resources that match the entire display name given.
    FreeformTags map[string]interface{}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    Id string
    OCID for the saved query
    Query string
    The saved query expression
    State string
    The current lifecycle state of the resource
    SystemTags map[string]interface{}
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    TimeCreated string
    The date and time the saved query was created. Format defined by RFC3339.
    TimeUpdated string
    The date and time the saved query was updated. Format defined by RFC3339.
    compartmentId String
    The OCID of the compartment in which to list resources.
    definedTags Map<String,Object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    Description of the saved query
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<String,Object>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    OCID for the saved query
    query String
    The saved query expression
    state String
    The current lifecycle state of the resource
    systemTags Map<String,Object>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The date and time the saved query was created. Format defined by RFC3339.
    timeUpdated String
    The date and time the saved query was updated. Format defined by RFC3339.
    compartmentId string
    The OCID of the compartment in which to list resources.
    definedTags {[key: string]: any}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description string
    Description of the saved query
    displayName string
    A filter to return only resources that match the entire display name given.
    freeformTags {[key: string]: any}
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id string
    OCID for the saved query
    query string
    The saved query expression
    state string
    The current lifecycle state of the resource
    systemTags {[key: string]: any}
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated string
    The date and time the saved query was created. Format defined by RFC3339.
    timeUpdated string
    The date and time the saved query was updated. Format defined by RFC3339.
    compartment_id str
    The OCID of the compartment in which to list resources.
    defined_tags Mapping[str, Any]
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description str
    Description of the saved query
    display_name str
    A filter to return only resources that match the entire display name given.
    freeform_tags Mapping[str, Any]
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id str
    OCID for the saved query
    query str
    The saved query expression
    state str
    The current lifecycle state of the resource
    system_tags Mapping[str, Any]
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    time_created str
    The date and time the saved query was created. Format defined by RFC3339.
    time_updated str
    The date and time the saved query was updated. Format defined by RFC3339.
    compartmentId String
    The OCID of the compartment in which to list resources.
    definedTags Map<Any>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"foo-namespace.bar-key": "value"}
    description String
    Description of the saved query
    displayName String
    A filter to return only resources that match the entire display name given.
    freeformTags Map<Any>
    Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: {"bar-key": "value"}
    id String
    OCID for the saved query
    query String
    The saved query expression
    state String
    The current lifecycle state of the resource
    systemTags Map<Any>
    System tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. System tags can be viewed by users, but can only be created by the system. Example: {"orcl-cloud.free-tier-retained": "true"}
    timeCreated String
    The date and time the saved query was created. Format defined by RFC3339.
    timeUpdated String
    The date and time the saved query was updated. Format defined by RFC3339.

    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 v1.41.0 published on Wednesday, Jun 19, 2024 by Pulumi