1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. LogAnalytics
  5. Namespace
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.LogAnalytics.Namespace

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

    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,
    });
    
    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)
    
    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
    	})
    }
    
    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,
        });
    
    });
    
    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());
    
        }
    }
    
    resources:
      testNamespace:
        type: oci:LogAnalytics:Namespace
        name: test_namespace
        properties:
          compartmentId: ${compartmentId}
          isOnboarded: ${isOnboarded}
          namespace: ${namespaceNamespace}
    

    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 string
    The unique name of the resource.
    args NamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args NamespaceArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NamespaceArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
    });
    
    example, err := LogAnalytics.NewNamespace(ctx, "namespaceResource", &LogAnalytics.NamespaceArgs{
    	CompartmentId: pulumi.String("string"),
    	IsOnboarded:   pulumi.Bool(false),
    	Namespace:     pulumi.String("string"),
    })
    
    var namespaceResource = new Namespace("namespaceResource", NamespaceArgs.builder()
        .compartmentId("string")
        .isOnboarded(false)
        .namespace("string")
        .build());
    
    namespace_resource = oci.log_analytics.Namespace("namespaceResource",
        compartment_id="string",
        is_onboarded=False,
        namespace="string")
    
    const namespaceResource = new oci.loganalytics.Namespace("namespaceResource", {
        compartmentId: "string",
        isOnboarded: false,
        namespace: "string",
    });
    
    type: oci:LogAnalytics:Namespace
    properties:
        compartmentId: string
        isOnboarded: false
        namespace: string
    

    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

    The Namespace resource accepts the following input properties:

    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.

    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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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}"
    

    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.
    oci logo
    Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi