1. Packages
  2. Packages
  3. Vsphere Provider
  4. API Docs
  5. getNamespace
Viewing docs for vSphere v4.17.0
published on Thursday, Jun 25, 2026 by Pulumi
vsphere logo
Viewing docs for vSphere v4.17.0
published on Thursday, Jun 25, 2026 by Pulumi

    This data source can be used to read the properties of a vSphere Namespace.

    Example Usage

    S

    Create a Namespace

    import * as pulumi from "@pulumi/pulumi";
    import * as vsphere from "@pulumi/vsphere";
    
    const example = vsphere.getNamespace({
        name: "example-namespace",
    });
    
    import pulumi
    import pulumi_vsphere as vsphere
    
    example = vsphere.get_namespace(name="example-namespace")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-vsphere/sdk/v4/go/vsphere"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vsphere.GetNamespace(ctx, &vsphere.LookupNamespaceArgs{
    			Name: "example-namespace",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using VSphere = Pulumi.VSphere;
    
    return await Deployment.RunAsync(() => 
    {
        var example = VSphere.GetNamespace.Invoke(new()
        {
            Name = "example-namespace",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vsphere.VsphereFunctions;
    import com.pulumi.vsphere.inputs.GetNamespaceArgs;
    import java.util.ArrayList;
    import java.util.Arrays;
    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 example = VsphereFunctions.getNamespace(GetNamespaceArgs.builder()
                .name("example-namespace")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: vsphere:getNamespace
          arguments:
            name: example-namespace
    
    pulumi {
      required_providers {
        vsphere = {
          source = "pulumi/vsphere"
        }
      }
    }
    
    data "vsphere_getnamespace" "example" {
      name = "example-namespace"
    }
    

    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(name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetNamespaceResult
    def get_namespace_output(name: pulumi.Input[Optional[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetNamespaceResult]
    func LookupNamespace(ctx *Context, args *LookupNamespaceArgs, opts ...InvokeOption) (*LookupNamespaceResult, error)
    func LookupNamespaceOutput(ctx *Context, args *LookupNamespaceOutputArgs, opts ...InvokeOption) LookupNamespaceResultOutput

    > Note: This function is named LookupNamespace 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)
    public static Output<GetNamespaceResult> getNamespace(GetNamespaceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vsphere:index/getNamespace:getNamespace
      arguments:
        # arguments dictionary
    data "vsphere_getnamespace" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    The name of the vSphere namespace.
    Name string
    The name of the vSphere namespace.
    name string
    The name of the vSphere namespace.
    name String
    The name of the vSphere namespace.
    name string
    The name of the vSphere namespace.
    name str
    The name of the vSphere namespace.
    name String
    The name of the vSphere namespace.

    getNamespace Result

    The following output properties are available:

    ConfigStatus string
    CpuUsage int
    Id string
    The provider-assigned unique ID for this managed resource.
    MemoryUsage int
    Name string
    StoragePolicies List<string>
    The list of storage policies that are available in the vSphere Namespace.
    StorageUsage int
    Supervisor string
    The identifier of the vSphere Supervisor managing the namespace.
    VmServices List<Pulumi.VSphere.Outputs.GetNamespaceVmService>
    The configuration for VM Service in the vSphere Namespace.
    ConfigStatus string
    CpuUsage int
    Id string
    The provider-assigned unique ID for this managed resource.
    MemoryUsage int
    Name string
    StoragePolicies []string
    The list of storage policies that are available in the vSphere Namespace.
    StorageUsage int
    Supervisor string
    The identifier of the vSphere Supervisor managing the namespace.
    VmServices []GetNamespaceVmService
    The configuration for VM Service in the vSphere Namespace.
    config_status string
    cpu_usage number
    id string
    The provider-assigned unique ID for this managed resource.
    memory_usage number
    name string
    storage_policies list(string)
    The list of storage policies that are available in the vSphere Namespace.
    storage_usage number
    supervisor string
    The identifier of the vSphere Supervisor managing the namespace.
    vm_services list(object)
    The configuration for VM Service in the vSphere Namespace.
    configStatus String
    cpuUsage Integer
    id String
    The provider-assigned unique ID for this managed resource.
    memoryUsage Integer
    name String
    storagePolicies List<String>
    The list of storage policies that are available in the vSphere Namespace.
    storageUsage Integer
    supervisor String
    The identifier of the vSphere Supervisor managing the namespace.
    vmServices List<GetNamespaceVmService>
    The configuration for VM Service in the vSphere Namespace.
    configStatus string
    cpuUsage number
    id string
    The provider-assigned unique ID for this managed resource.
    memoryUsage number
    name string
    storagePolicies string[]
    The list of storage policies that are available in the vSphere Namespace.
    storageUsage number
    supervisor string
    The identifier of the vSphere Supervisor managing the namespace.
    vmServices GetNamespaceVmService[]
    The configuration for VM Service in the vSphere Namespace.
    config_status str
    cpu_usage int
    id str
    The provider-assigned unique ID for this managed resource.
    memory_usage int
    name str
    storage_policies Sequence[str]
    The list of storage policies that are available in the vSphere Namespace.
    storage_usage int
    supervisor str
    The identifier of the vSphere Supervisor managing the namespace.
    vm_services Sequence[GetNamespaceVmService]
    The configuration for VM Service in the vSphere Namespace.
    configStatus String
    cpuUsage Number
    id String
    The provider-assigned unique ID for this managed resource.
    memoryUsage Number
    name String
    storagePolicies List<String>
    The list of storage policies that are available in the vSphere Namespace.
    storageUsage Number
    supervisor String
    The identifier of the vSphere Supervisor managing the namespace.
    vmServices List<Property Map>
    The configuration for VM Service in the vSphere Namespace.

    Supporting Types

    GetNamespaceVmService

    ContentLibraries List<string>
    The list of content libraries associated with the VM Service.
    VmClasses List<string>
    The list of VM Classes associated with the VM Service.
    ContentLibraries []string
    The list of content libraries associated with the VM Service.
    VmClasses []string
    The list of VM Classes associated with the VM Service.
    content_libraries list(string)
    The list of content libraries associated with the VM Service.
    vm_classes list(string)
    The list of VM Classes associated with the VM Service.
    contentLibraries List<String>
    The list of content libraries associated with the VM Service.
    vmClasses List<String>
    The list of VM Classes associated with the VM Service.
    contentLibraries string[]
    The list of content libraries associated with the VM Service.
    vmClasses string[]
    The list of VM Classes associated with the VM Service.
    content_libraries Sequence[str]
    The list of content libraries associated with the VM Service.
    vm_classes Sequence[str]
    The list of VM Classes associated with the VM Service.
    contentLibraries List<String>
    The list of content libraries associated with the VM Service.
    vmClasses List<String>
    The list of VM Classes associated with the VM Service.

    Package Details

    Repository
    vSphere pulumi/pulumi-vsphere
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vsphere Terraform Provider.
    vsphere logo
    Viewing docs for vSphere v4.17.0
    published on Thursday, Jun 25, 2026 by Pulumi

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial