oci.ObjectStorage.getNamespace
Explore with Pulumi AI
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: compartmentId,
});
import pulumi
import pulumi_oci as oci
test_namespace = oci.ObjectStorage.get_namespace(compartment_id=compartment_id)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/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(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 testNamespace = Oci.ObjectStorage.GetNamespace.Invoke(new()
{
CompartmentId = compartmentId,
});
});
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(compartmentId)
.build());
}
}
variables:
testNamespace:
fn::invoke:
Function: oci:ObjectStorage:getNamespace
Arguments:
compartmentId: ${compartmentId}
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:
- Compartment
Id 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 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 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 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.
- compartment
Id 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.
- Compartment
Id string
- Id string
- The provider-assigned unique ID for this managed resource.
- Namespace string
- (Computed) The name of the user's namespace.
- Compartment
Id string
- id String
- The provider-assigned unique ID for this managed resource.
- namespace String
- (Computed) The name of the user's namespace.
- compartment
Id String
- id string
- The provider-assigned unique ID for this managed resource.
- namespace string
- (Computed) The name of the user's namespace.
- compartment
Id 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.
- compartment
Id String
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.