1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. LogAnalytics
  5. Namespace
Oracle Cloud Infrastructure v2.29.0 published on Wednesday, Apr 9, 2025 by Pulumi

oci.LogAnalytics.Namespace

Explore with Pulumi AI

This resource provides the Namespace resource in Oracle Cloud Infrastructure Log Analytics service.

Onboards a tenancy with Log Analytics or Offboards a tenancy from Log Analytics functionality.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testNamespace = new oci.loganalytics.Namespace("test_namespace", {
    compartmentId: compartmentId,
    isOnboarded: isOnboarded,
    namespace: namespaceNamespace,
});
Copy
import pulumi
import pulumi_oci as oci

test_namespace = oci.log_analytics.Namespace("test_namespace",
    compartment_id=compartment_id,
    is_onboarded=is_onboarded,
    namespace=namespace_namespace)
Copy
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.NewNamespace(ctx, "test_namespace", &loganalytics.NamespaceArgs{
			CompartmentId: pulumi.Any(compartmentId),
			IsOnboarded:   pulumi.Any(isOnboarded),
			Namespace:     pulumi.Any(namespaceNamespace),
		})
		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 testNamespace = new Oci.LogAnalytics.Namespace("test_namespace", new()
    {
        CompartmentId = compartmentId,
        IsOnboarded = isOnboarded,
        NamespaceName = namespaceNamespace,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.LogAnalytics.Namespace;
import com.pulumi.oci.LogAnalytics.NamespaceArgs;
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) {
        var testNamespace = new Namespace("testNamespace", NamespaceArgs.builder()
            .compartmentId(compartmentId)
            .isOnboarded(isOnboarded)
            .namespace(namespaceNamespace)
            .build());

    }
}
Copy
resources:
  testNamespace:
    type: oci:LogAnalytics:Namespace
    name: test_namespace
    properties:
      compartmentId: ${compartmentId}
      isOnboarded: ${isOnboarded}
      namespace: ${namespaceNamespace}
Copy

Create Namespace Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Namespace(name: string, args: NamespaceArgs, opts?: CustomResourceOptions);
@overload
def Namespace(resource_name: str,
              args: NamespaceArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def Namespace(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              compartment_id: Optional[str] = None,
              is_onboarded: Optional[bool] = None,
              namespace: Optional[str] = None)
func NewNamespace(ctx *Context, name string, args NamespaceArgs, opts ...ResourceOption) (*Namespace, error)
public Namespace(string name, NamespaceArgs args, CustomResourceOptions? opts = null)
public Namespace(String name, NamespaceArgs args)
public Namespace(String name, NamespaceArgs args, CustomResourceOptions options)
type: oci:LogAnalytics:Namespace
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. NamespaceArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var namespaceResource = new Oci.LogAnalytics.Namespace("namespaceResource", new()
{
    CompartmentId = "string",
    IsOnboarded = false,
    NamespaceName = "string",
});
Copy
example, err := LogAnalytics.NewNamespace(ctx, "namespaceResource", &LogAnalytics.NamespaceArgs{
	CompartmentId: pulumi.String("string"),
	IsOnboarded:   pulumi.Bool(false),
	Namespace:     pulumi.String("string"),
})
Copy
var namespaceResource = new Namespace("namespaceResource", NamespaceArgs.builder()
    .compartmentId("string")
    .isOnboarded(false)
    .namespace("string")
    .build());
Copy
namespace_resource = oci.log_analytics.Namespace("namespaceResource",
    compartment_id="string",
    is_onboarded=False,
    namespace="string")
Copy
const namespaceResource = new oci.loganalytics.Namespace("namespaceResource", {
    compartmentId: "string",
    isOnboarded: false,
    namespace: "string",
});
Copy
type: oci:LogAnalytics:Namespace
properties:
    compartmentId: string
    isOnboarded: false
    namespace: string
Copy

Namespace Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Namespace resource accepts the following input properties:

CompartmentId This property is required. string
The OCID of the root compartment i.e. OCID of the tenancy.
IsOnboarded This property is required. bool
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
NamespaceName This property is required. string
The Log Analytics namespace used for the request.
CompartmentId This property is required. string
The OCID of the root compartment i.e. OCID of the tenancy.
IsOnboarded This property is required. bool
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
Namespace This property is required. string
The Log Analytics namespace used for the request.
compartmentId This property is required. String
The OCID of the root compartment i.e. OCID of the tenancy.
isOnboarded This property is required. Boolean
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace This property is required. String
The Log Analytics namespace used for the request.
compartmentId This property is required. string
The OCID of the root compartment i.e. OCID of the tenancy.
isOnboarded This property is required. boolean
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace This property is required. string
The Log Analytics namespace used for the request.
compartment_id This property is required. str
The OCID of the root compartment i.e. OCID of the tenancy.
is_onboarded This property is required. bool
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace This property is required. str
The Log Analytics namespace used for the request.
compartmentId This property is required. String
The OCID of the root compartment i.e. OCID of the tenancy.
isOnboarded This property is required. Boolean
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace This property is required. String
The Log Analytics namespace used for the request.

Outputs

All input properties are implicitly available as output properties. Additionally, the Namespace resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing Namespace Resource

Get an existing Namespace resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: NamespaceState, opts?: CustomResourceOptions): Namespace
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        compartment_id: Optional[str] = None,
        is_onboarded: Optional[bool] = None,
        namespace: Optional[str] = None) -> Namespace
func GetNamespace(ctx *Context, name string, id IDInput, state *NamespaceState, opts ...ResourceOption) (*Namespace, error)
public static Namespace Get(string name, Input<string> id, NamespaceState? state, CustomResourceOptions? opts = null)
public static Namespace get(String name, Output<String> id, NamespaceState state, CustomResourceOptions options)
resources:  _:    type: oci:LogAnalytics:Namespace    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
CompartmentId string
The OCID of the root compartment i.e. OCID of the tenancy.
IsOnboarded bool
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
NamespaceName string
The Log Analytics namespace used for the request.
CompartmentId string
The OCID of the root compartment i.e. OCID of the tenancy.
IsOnboarded bool
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
Namespace string
The Log Analytics namespace used for the request.
compartmentId String
The OCID of the root compartment i.e. OCID of the tenancy.
isOnboarded Boolean
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace String
The Log Analytics namespace used for the request.
compartmentId string
The OCID of the root compartment i.e. OCID of the tenancy.
isOnboarded boolean
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace string
The Log Analytics namespace used for the request.
compartment_id str
The OCID of the root compartment i.e. OCID of the tenancy.
is_onboarded bool
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace str
The Log Analytics namespace used for the request.
compartmentId String
The OCID of the root compartment i.e. OCID of the tenancy.
isOnboarded Boolean
Use true if tenancy is to be onboarded to logging analytics and false if tenancy is to be offboarded
namespace String
The Log Analytics namespace used for the request.

Import

Namespace can be imported using the compartment_id and namespace, e.g.

$ pulumi import oci:LogAnalytics/namespace:Namespace test_namespace "compartmentId/{compartment_id}/namespace/{namespace}"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.