1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. ObjectStorage
  5. getNamespace
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

oci.ObjectStorage.getNamespace

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.32.0 published on Thursday, Apr 18, 2024 by Pulumi

    This data source provides details about a specific Namespace resource in Oracle Cloud Infrastructure Object Storage service.

    Each Oracle Cloud Infrastructure tenant is assigned one unique and uneditable Object Storage namespace. The namespace is a system-generated string assigned during account creation. For some older tenancies, the namespace string may be the tenancy name in all lower-case letters. You cannot edit a namespace.

    GetNamespace returns the name of the Object Storage namespace for the user making the request. If an optional compartmentId query parameter is provided, GetNamespace returns the namespace name of the corresponding tenancy, provided the user has access to it.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testNamespace = oci.ObjectStorage.getNamespace({
        compartmentId: _var.compartment_id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_namespace = oci.ObjectStorage.get_namespace(compartment_id=var["compartment_id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/ObjectStorage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ObjectStorage.GetNamespace(ctx, &objectstorage.GetNamespaceArgs{
    			CompartmentId: pulumi.StringRef(_var.Compartment_id),
    		}, 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 testNamespace = Oci.ObjectStorage.GetNamespace.Invoke(new()
        {
            CompartmentId = @var.Compartment_id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.ObjectStorage.ObjectStorageFunctions;
    import com.pulumi.oci.ObjectStorage.inputs.GetNamespaceArgs;
    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 testNamespace = ObjectStorageFunctions.getNamespace(GetNamespaceArgs.builder()
                .compartmentId(var_.compartment_id())
                .build());
    
        }
    }
    
    variables:
      testNamespace:
        fn::invoke:
          Function: oci:ObjectStorage:getNamespace
          Arguments:
            compartmentId: ${var.compartment_id}
    

    Using getNamespace

    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 getNamespace(args: GetNamespaceArgs, opts?: InvokeOptions): Promise<GetNamespaceResult>
    function getNamespaceOutput(args: GetNamespaceOutputArgs, opts?: InvokeOptions): Output<GetNamespaceResult>
    def get_namespace(compartment_id: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetNamespaceResult
    def get_namespace_output(compartment_id: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetNamespaceResult]
    func GetNamespace(ctx *Context, args *GetNamespaceArgs, opts ...InvokeOption) (*GetNamespaceResult, error)
    func GetNamespaceOutput(ctx *Context, args *GetNamespaceOutputArgs, opts ...InvokeOption) GetNamespaceResultOutput

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

    public static class GetNamespace 
    {
        public static Task<GetNamespaceResult> InvokeAsync(GetNamespaceArgs args, InvokeOptions? opts = null)
        public static Output<GetNamespaceResult> Invoke(GetNamespaceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetNamespaceResult> getNamespace(GetNamespaceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:ObjectStorage/getNamespace:getNamespace
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    This is an optional field representing either the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace is to be retrieved.
    CompartmentId string
    This is an optional field representing either the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace is to be retrieved.
    compartmentId String
    This is an optional field representing either the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace is to be retrieved.
    compartmentId string
    This is an optional field representing either the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace is to be retrieved.
    compartment_id str
    This is an optional field representing either the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace is to be retrieved.
    compartmentId String
    This is an optional field representing either the tenancy OCID or the compartment OCID within the tenancy whose Object Storage namespace is to be retrieved.

    getNamespace Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Namespace string
    (Computed) The name of the user's namespace.
    CompartmentId string
    Id string
    The provider-assigned unique ID for this managed resource.
    Namespace string
    (Computed) The name of the user's namespace.
    CompartmentId string
    id String
    The provider-assigned unique ID for this managed resource.
    namespace String
    (Computed) The name of the user's namespace.
    compartmentId String
    id string
    The provider-assigned unique ID for this managed resource.
    namespace string
    (Computed) The name of the user's namespace.
    compartmentId string
    id str
    The provider-assigned unique ID for this managed resource.
    namespace str
    (Computed) The name of the user's namespace.
    compartment_id str
    id String
    The provider-assigned unique ID for this managed resource.
    namespace String
    (Computed) The name of the user's namespace.
    compartmentId String

    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.32.0 published on Thursday, Apr 18, 2024 by Pulumi