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

oci.LogAnalytics.getNamespaces

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 Namespaces in Oracle Cloud Infrastructure Log Analytics service.

    Given a tenancy OCID, this API returns the namespace of the tenancy if it is valid and subscribed to the region. The result also indicates if the tenancy is onboarded with Logging Analytics.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testNamespaces = oci.LogAnalytics.getNamespaces({
        compartmentId: compartmentId,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_namespaces = oci.LogAnalytics.get_namespaces(compartment_id=compartment_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/LogAnalytics"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := LogAnalytics.GetNamespaces(ctx, &loganalytics.GetNamespacesArgs{
    			CompartmentId: compartmentId,
    		}, 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 testNamespaces = Oci.LogAnalytics.GetNamespaces.Invoke(new()
        {
            CompartmentId = compartmentId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.LogAnalytics.LogAnalyticsFunctions;
    import com.pulumi.oci.LogAnalytics.inputs.GetNamespacesArgs;
    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 testNamespaces = LogAnalyticsFunctions.getNamespaces(GetNamespacesArgs.builder()
                .compartmentId(compartmentId)
                .build());
    
        }
    }
    
    variables:
      testNamespaces:
        fn::invoke:
          Function: oci:LogAnalytics:getNamespaces
          Arguments:
            compartmentId: ${compartmentId}
    

    Using getNamespaces

    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 getNamespaces(args: GetNamespacesArgs, opts?: InvokeOptions): Promise<GetNamespacesResult>
    function getNamespacesOutput(args: GetNamespacesOutputArgs, opts?: InvokeOptions): Output<GetNamespacesResult>
    def get_namespaces(compartment_id: Optional[str] = None,
                       filters: Optional[Sequence[_loganalytics.GetNamespacesFilter]] = None,
                       opts: Optional[InvokeOptions] = None) -> GetNamespacesResult
    def get_namespaces_output(compartment_id: Optional[pulumi.Input[str]] = None,
                       filters: Optional[pulumi.Input[Sequence[pulumi.Input[_loganalytics.GetNamespacesFilterArgs]]]] = None,
                       opts: Optional[InvokeOptions] = None) -> Output[GetNamespacesResult]
    func GetNamespaces(ctx *Context, args *GetNamespacesArgs, opts ...InvokeOption) (*GetNamespacesResult, error)
    func GetNamespacesOutput(ctx *Context, args *GetNamespacesOutputArgs, opts ...InvokeOption) GetNamespacesResultOutput

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

    public static class GetNamespaces 
    {
        public static Task<GetNamespacesResult> InvokeAsync(GetNamespacesArgs args, InvokeOptions? opts = null)
        public static Output<GetNamespacesResult> Invoke(GetNamespacesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNamespacesResult> getNamespaces(GetNamespacesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:LogAnalytics/getNamespaces:getNamespaces
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The ID of the compartment in which to list resources.
    Filters List<GetNamespacesFilter>
    CompartmentId string
    The ID of the compartment in which to list resources.
    Filters []GetNamespacesFilter
    compartmentId String
    The ID of the compartment in which to list resources.
    filters List<GetNamespacesFilter>
    compartmentId string
    The ID of the compartment in which to list resources.
    filters GetNamespacesFilter[]
    compartment_id str
    The ID of the compartment in which to list resources.
    filters Sequence[loganalytics.GetNamespacesFilter]
    compartmentId String
    The ID of the compartment in which to list resources.
    filters List<Property Map>

    getNamespaces Result

    The following output properties are available:

    CompartmentId string
    The is the tenancy ID
    Id string
    The provider-assigned unique ID for this managed resource.
    NamespaceCollections List<GetNamespacesNamespaceCollection>
    The list of namespace_collection.
    Filters List<GetNamespacesFilter>
    CompartmentId string
    The is the tenancy ID
    Id string
    The provider-assigned unique ID for this managed resource.
    NamespaceCollections []GetNamespacesNamespaceCollection
    The list of namespace_collection.
    Filters []GetNamespacesFilter
    compartmentId String
    The is the tenancy ID
    id String
    The provider-assigned unique ID for this managed resource.
    namespaceCollections List<GetNamespacesNamespaceCollection>
    The list of namespace_collection.
    filters List<GetNamespacesFilter>
    compartmentId string
    The is the tenancy ID
    id string
    The provider-assigned unique ID for this managed resource.
    namespaceCollections GetNamespacesNamespaceCollection[]
    The list of namespace_collection.
    filters GetNamespacesFilter[]
    compartment_id str
    The is the tenancy ID
    id str
    The provider-assigned unique ID for this managed resource.
    namespace_collections Sequence[loganalytics.GetNamespacesNamespaceCollection]
    The list of namespace_collection.
    filters Sequence[loganalytics.GetNamespacesFilter]
    compartmentId String
    The is the tenancy ID
    id String
    The provider-assigned unique ID for this managed resource.
    namespaceCollections List<Property Map>
    The list of namespace_collection.
    filters List<Property Map>

    Supporting Types

    GetNamespacesFilter

    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

    GetNamespacesNamespaceCollection

    GetNamespacesNamespaceCollectionItem

    CompartmentId string
    The ID of the compartment in which to list resources.
    IsOnboarded bool
    This indicates if the tenancy is onboarded to Logging Analytics
    Namespace string
    This is the namespace name of a tenancy
    CompartmentId string
    The ID of the compartment in which to list resources.
    IsOnboarded bool
    This indicates if the tenancy is onboarded to Logging Analytics
    Namespace string
    This is the namespace name of a tenancy
    compartmentId String
    The ID of the compartment in which to list resources.
    isOnboarded Boolean
    This indicates if the tenancy is onboarded to Logging Analytics
    namespace String
    This is the namespace name of a tenancy
    compartmentId string
    The ID of the compartment in which to list resources.
    isOnboarded boolean
    This indicates if the tenancy is onboarded to Logging Analytics
    namespace string
    This is the namespace name of a tenancy
    compartment_id str
    The ID of the compartment in which to list resources.
    is_onboarded bool
    This indicates if the tenancy is onboarded to Logging Analytics
    namespace str
    This is the namespace name of a tenancy
    compartmentId String
    The ID of the compartment in which to list resources.
    isOnboarded Boolean
    This indicates if the tenancy is onboarded to Logging Analytics
    namespace String
    This is the namespace name of a tenancy

    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