1. Packages
  2. Vcd Provider
  3. API Docs
  4. getIndependentDisk
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

vcd.getIndependentDisk

Explore with Pulumi AI

vcd logo
vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware

    Provides a VMware Cloud Director Independent disk data source. An independent disk data source can be used to reference an independent disk and use its data within other resources or data sources.

    Supported in provider v2.5+

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vcd from "@pulumi/vcd";
    
    export = async () => {
        const existing_disk = await vcd.getIndependentDisk({
            org: "my-org",
            vdc: "my-vdc",
            id: "urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e",
            name: "my-disk",
        });
        return {
            "disk-iops": existing_disk.iops,
            typeIsAttached: existing_disk.isAttached,
        };
    }
    
    import pulumi
    import pulumi_vcd as vcd
    
    existing_disk = vcd.get_independent_disk(org="my-org",
        vdc="my-vdc",
        id="urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e",
        name="my-disk")
    pulumi.export("disk-iops", existing_disk.iops)
    pulumi.export("typeIsAttached", existing_disk.is_attached)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vcd/v3/vcd"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		existing_disk, err := vcd.LookupIndependentDisk(ctx, &vcd.LookupIndependentDiskArgs{
    			Org:  pulumi.StringRef("my-org"),
    			Vdc:  pulumi.StringRef("my-vdc"),
    			Id:   pulumi.StringRef("urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e"),
    			Name: pulumi.StringRef("my-disk"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("disk-iops", existing_disk.Iops)
    		ctx.Export("typeIsAttached", existing_disk.IsAttached)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vcd = Pulumi.Vcd;
    
    return await Deployment.RunAsync(() => 
    {
        var existing_disk = Vcd.GetIndependentDisk.Invoke(new()
        {
            Org = "my-org",
            Vdc = "my-vdc",
            Id = "urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e",
            Name = "my-disk",
        });
    
        return new Dictionary<string, object?>
        {
            ["disk-iops"] = existing_disk.Apply(existing_disk => existing_disk.Apply(getIndependentDiskResult => getIndependentDiskResult.Iops)),
            ["typeIsAttached"] = existing_disk.Apply(existing_disk => existing_disk.Apply(getIndependentDiskResult => getIndependentDiskResult.IsAttached)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vcd.VcdFunctions;
    import com.pulumi.vcd.inputs.GetIndependentDiskArgs;
    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 existing-disk = VcdFunctions.getIndependentDisk(GetIndependentDiskArgs.builder()
                .org("my-org")
                .vdc("my-vdc")
                .id("urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e")
                .name("my-disk")
                .build());
    
            ctx.export("disk-iops", existing_disk.iops());
            ctx.export("typeIsAttached", existing_disk.isAttached());
        }
    }
    
    variables:
      existing-disk:
        fn::invoke:
          function: vcd:getIndependentDisk
          arguments:
            org: my-org
            vdc: my-vdc
            id: urn:vcloud:disk:1bbc273d-7701-4f06-97be-428b46b0805e
            name: my-disk
    outputs:
      disk-iops: ${["existing-disk"].iops}
      typeIsAttached: ${["existing-disk"].isAttached}
    

    Using getIndependentDisk

    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 getIndependentDisk(args: GetIndependentDiskArgs, opts?: InvokeOptions): Promise<GetIndependentDiskResult>
    function getIndependentDiskOutput(args: GetIndependentDiskOutputArgs, opts?: InvokeOptions): Output<GetIndependentDiskResult>
    def get_independent_disk(id: Optional[str] = None,
                             name: Optional[str] = None,
                             org: Optional[str] = None,
                             vdc: Optional[str] = None,
                             opts: Optional[InvokeOptions] = None) -> GetIndependentDiskResult
    def get_independent_disk_output(id: Optional[pulumi.Input[str]] = None,
                             name: Optional[pulumi.Input[str]] = None,
                             org: Optional[pulumi.Input[str]] = None,
                             vdc: Optional[pulumi.Input[str]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetIndependentDiskResult]
    func LookupIndependentDisk(ctx *Context, args *LookupIndependentDiskArgs, opts ...InvokeOption) (*LookupIndependentDiskResult, error)
    func LookupIndependentDiskOutput(ctx *Context, args *LookupIndependentDiskOutputArgs, opts ...InvokeOption) LookupIndependentDiskResultOutput

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

    public static class GetIndependentDisk 
    {
        public static Task<GetIndependentDiskResult> InvokeAsync(GetIndependentDiskArgs args, InvokeOptions? opts = null)
        public static Output<GetIndependentDiskResult> Invoke(GetIndependentDiskInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetIndependentDiskResult> getIndependentDisk(GetIndependentDiskArgs args, InvokeOptions options)
    public static Output<GetIndependentDiskResult> getIndependentDisk(GetIndependentDiskArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vcd:index/getIndependentDisk:getIndependentDisk
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
    Name string
    Disk name. Warning please use id as there is possibility to have more than one independent disk with same name. As result data source will fail.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    Vdc string
    The name of VDC to use, optional if defined at provider level
    Id string
    Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
    Name string
    Disk name. Warning please use id as there is possibility to have more than one independent disk with same name. As result data source will fail.
    Org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    Vdc string
    The name of VDC to use, optional if defined at provider level
    id String
    Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
    name String
    Disk name. Warning please use id as there is possibility to have more than one independent disk with same name. As result data source will fail.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    vdc String
    The name of VDC to use, optional if defined at provider level
    id string
    Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
    name string
    Disk name. Warning please use id as there is possibility to have more than one independent disk with same name. As result data source will fail.
    org string
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    vdc string
    The name of VDC to use, optional if defined at provider level
    id str
    Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
    name str
    Disk name. Warning please use id as there is possibility to have more than one independent disk with same name. As result data source will fail.
    org str
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    vdc str
    The name of VDC to use, optional if defined at provider level
    id String
    Disk id or name is required. If both provided - Id is used. Id can be found by using import function Listing independent disk IDs
    name String
    Disk name. Warning please use id as there is possibility to have more than one independent disk with same name. As result data source will fail.
    org String
    The name of organization to use, optional if defined at provider level. Useful when connected as sysadmin working across different organisations
    vdc String
    The name of VDC to use, optional if defined at provider level

    getIndependentDisk Result

    The following output properties are available:

    AttachedVmIds List<string>
    BusSubType string
    BusType string
    DatastoreName string
    Description string
    Encrypted bool
    Iops double
    IsAttached bool
    Metadata Dictionary<string, string>

    Deprecated: Deprecated

    MetadataEntries List<GetIndependentDiskMetadataEntry>
    OwnerName string
    SharingType string
    SizeInMb double
    StorageProfile string
    Uuid string
    Id string
    Name string
    Org string
    Vdc string
    AttachedVmIds []string
    BusSubType string
    BusType string
    DatastoreName string
    Description string
    Encrypted bool
    Iops float64
    IsAttached bool
    Metadata map[string]string

    Deprecated: Deprecated

    MetadataEntries []GetIndependentDiskMetadataEntry
    OwnerName string
    SharingType string
    SizeInMb float64
    StorageProfile string
    Uuid string
    Id string
    Name string
    Org string
    Vdc string
    attachedVmIds List<String>
    busSubType String
    busType String
    datastoreName String
    description String
    encrypted Boolean
    iops Double
    isAttached Boolean
    metadata Map<String,String>

    Deprecated: Deprecated

    metadataEntries List<GetIndependentDiskMetadataEntry>
    ownerName String
    sharingType String
    sizeInMb Double
    storageProfile String
    uuid String
    id String
    name String
    org String
    vdc String
    attachedVmIds string[]
    busSubType string
    busType string
    datastoreName string
    description string
    encrypted boolean
    iops number
    isAttached boolean
    metadata {[key: string]: string}

    Deprecated: Deprecated

    metadataEntries GetIndependentDiskMetadataEntry[]
    ownerName string
    sharingType string
    sizeInMb number
    storageProfile string
    uuid string
    id string
    name string
    org string
    vdc string
    attachedVmIds List<String>
    busSubType String
    busType String
    datastoreName String
    description String
    encrypted Boolean
    iops Number
    isAttached Boolean
    metadata Map<String>

    Deprecated: Deprecated

    metadataEntries List<Property Map>
    ownerName String
    sharingType String
    sizeInMb Number
    storageProfile String
    uuid String
    id String
    name String
    org String
    vdc String

    Supporting Types

    GetIndependentDiskMetadataEntry

    IsSystem bool
    Key string
    Type string
    UserAccess string
    Value string
    IsSystem bool
    Key string
    Type string
    UserAccess string
    Value string
    isSystem Boolean
    key String
    type String
    userAccess String
    value String
    isSystem boolean
    key string
    type string
    userAccess string
    value string
    isSystem Boolean
    key String
    type String
    userAccess String
    value String

    Package Details

    Repository
    vcd vmware/terraform-provider-vcd
    License
    Notes
    This Pulumi package is based on the vcd Terraform Provider.
    vcd logo
    vcd 3.14.1 published on Monday, Apr 14, 2025 by vmware