Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi
oci.LogAnalytics.getNamespaces
Explore with Pulumi AI
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/v2/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)
public static Output<GetNamespacesResult> getNamespaces(GetNamespacesArgs args, InvokeOptions options)
fn::invoke:
  function: oci:LogAnalytics/getNamespaces:getNamespaces
  arguments:
    # arguments dictionaryThe following arguments are supported:
- CompartmentId string
- The ID of the compartment in which to list resources.
- Filters
List<GetNamespaces Filter> 
- CompartmentId string
- The ID of the compartment in which to list resources.
- Filters
[]GetNamespaces Filter 
- compartmentId String
- The ID of the compartment in which to list resources.
- filters
List<GetNamespaces Filter> 
- compartmentId string
- The ID of the compartment in which to list resources.
- filters
GetNamespaces Filter[] 
- compartment_id str
- The ID of the compartment in which to list resources.
- filters
Sequence[loganalytics.Get Namespaces Filter] 
- 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<GetNamespaces Namespace Collection> 
- The list of namespace_collection.
- Filters
List<GetNamespaces Filter> 
- CompartmentId string
- The is the tenancy ID
- Id string
- The provider-assigned unique ID for this managed resource.
- NamespaceCollections []GetNamespaces Namespace Collection 
- The list of namespace_collection.
- Filters
[]GetNamespaces Filter 
- compartmentId String
- The is the tenancy ID
- id String
- The provider-assigned unique ID for this managed resource.
- namespaceCollections List<GetNamespaces Namespace Collection> 
- The list of namespace_collection.
- filters
List<GetNamespaces Filter> 
- compartmentId string
- The is the tenancy ID
- id string
- The provider-assigned unique ID for this managed resource.
- namespaceCollections GetNamespaces Namespace Collection[] 
- The list of namespace_collection.
- filters
GetNamespaces Filter[] 
- compartment_id str
- The is the tenancy ID
- id str
- The provider-assigned unique ID for this managed resource.
- namespace_collections Sequence[loganalytics.Get Namespaces Namespace Collection] 
- The list of namespace_collection.
- filters
Sequence[loganalytics.Get Namespaces Filter] 
- 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  
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 ociTerraform Provider.