1. Packages
  2. OpenStack
  3. API Docs
  4. blockstorage
  5. getVolumeV2
OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi

openstack.blockstorage.getVolumeV2

Explore with Pulumi AI

openstack logo
OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi

    Use this data source to get information about an existing volume.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const volume1 = openstack.blockstorage.getVolumeV2({
        name: "volume_1",
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    volume1 = openstack.blockstorage.get_volume_v2(name="volume_1")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/blockstorage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := blockstorage.LookupVolumeV2(ctx, &blockstorage.LookupVolumeV2Args{
    			Name: pulumi.StringRef("volume_1"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var volume1 = OpenStack.BlockStorage.GetVolumeV2.Invoke(new()
        {
            Name = "volume_1",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.blockstorage.BlockstorageFunctions;
    import com.pulumi.openstack.blockstorage.inputs.GetVolumeV2Args;
    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 volume1 = BlockstorageFunctions.getVolumeV2(GetVolumeV2Args.builder()
                .name("volume_1")
                .build());
    
        }
    }
    
    variables:
      volume1:
        fn::invoke:
          Function: openstack:blockstorage:getVolumeV2
          Arguments:
            name: volume_1
    

    Using getVolumeV2

    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 getVolumeV2(args: GetVolumeV2Args, opts?: InvokeOptions): Promise<GetVolumeV2Result>
    function getVolumeV2Output(args: GetVolumeV2OutputArgs, opts?: InvokeOptions): Output<GetVolumeV2Result>
    def get_volume_v2(bootable: Optional[str] = None,
                      metadata: Optional[Mapping[str, Any]] = None,
                      name: Optional[str] = None,
                      region: Optional[str] = None,
                      status: Optional[str] = None,
                      volume_type: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetVolumeV2Result
    def get_volume_v2_output(bootable: Optional[pulumi.Input[str]] = None,
                      metadata: Optional[pulumi.Input[Mapping[str, Any]]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      region: Optional[pulumi.Input[str]] = None,
                      status: Optional[pulumi.Input[str]] = None,
                      volume_type: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetVolumeV2Result]
    func LookupVolumeV2(ctx *Context, args *LookupVolumeV2Args, opts ...InvokeOption) (*LookupVolumeV2Result, error)
    func LookupVolumeV2Output(ctx *Context, args *LookupVolumeV2OutputArgs, opts ...InvokeOption) LookupVolumeV2ResultOutput

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

    public static class GetVolumeV2 
    {
        public static Task<GetVolumeV2Result> InvokeAsync(GetVolumeV2Args args, InvokeOptions? opts = null)
        public static Output<GetVolumeV2Result> Invoke(GetVolumeV2InvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVolumeV2Result> getVolumeV2(GetVolumeV2Args args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: openstack:blockstorage/getVolumeV2:getVolumeV2
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Bootable string
    Indicates if the volume is bootable.
    Metadata Dictionary<string, object>
    Metadata key/value pairs associated with the volume.
    Name string
    The name of the volume.
    Region string
    The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.
    Status string
    The status of the volume.
    VolumeType string
    The type of the volume.
    Bootable string
    Indicates if the volume is bootable.
    Metadata map[string]interface{}
    Metadata key/value pairs associated with the volume.
    Name string
    The name of the volume.
    Region string
    The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.
    Status string
    The status of the volume.
    VolumeType string
    The type of the volume.
    bootable String
    Indicates if the volume is bootable.
    metadata Map<String,Object>
    Metadata key/value pairs associated with the volume.
    name String
    The name of the volume.
    region String
    The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.
    status String
    The status of the volume.
    volumeType String
    The type of the volume.
    bootable string
    Indicates if the volume is bootable.
    metadata {[key: string]: any}
    Metadata key/value pairs associated with the volume.
    name string
    The name of the volume.
    region string
    The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.
    status string
    The status of the volume.
    volumeType string
    The type of the volume.
    bootable str
    Indicates if the volume is bootable.
    metadata Mapping[str, Any]
    Metadata key/value pairs associated with the volume.
    name str
    The name of the volume.
    region str
    The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.
    status str
    The status of the volume.
    volume_type str
    The type of the volume.
    bootable String
    Indicates if the volume is bootable.
    metadata Map<Any>
    Metadata key/value pairs associated with the volume.
    name String
    The name of the volume.
    region String
    The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.
    status String
    The status of the volume.
    volumeType String
    The type of the volume.

    getVolumeV2 Result

    The following output properties are available:

    Bootable string
    Indicates if the volume is bootable.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata Dictionary<string, object>
    See Argument Reference above.
    Name string
    See Argument Reference above.
    Region string
    See Argument Reference above.
    Size int
    The size of the volume in GBs.
    SourceVolumeId string
    The ID of the volume from which the current volume was created.
    Status string
    See Argument Reference above.
    VolumeType string
    The type of the volume.
    Bootable string
    Indicates if the volume is bootable.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata map[string]interface{}
    See Argument Reference above.
    Name string
    See Argument Reference above.
    Region string
    See Argument Reference above.
    Size int
    The size of the volume in GBs.
    SourceVolumeId string
    The ID of the volume from which the current volume was created.
    Status string
    See Argument Reference above.
    VolumeType string
    The type of the volume.
    bootable String
    Indicates if the volume is bootable.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String,Object>
    See Argument Reference above.
    name String
    See Argument Reference above.
    region String
    See Argument Reference above.
    size Integer
    The size of the volume in GBs.
    sourceVolumeId String
    The ID of the volume from which the current volume was created.
    status String
    See Argument Reference above.
    volumeType String
    The type of the volume.
    bootable string
    Indicates if the volume is bootable.
    id string
    The provider-assigned unique ID for this managed resource.
    metadata {[key: string]: any}
    See Argument Reference above.
    name string
    See Argument Reference above.
    region string
    See Argument Reference above.
    size number
    The size of the volume in GBs.
    sourceVolumeId string
    The ID of the volume from which the current volume was created.
    status string
    See Argument Reference above.
    volumeType string
    The type of the volume.
    bootable str
    Indicates if the volume is bootable.
    id str
    The provider-assigned unique ID for this managed resource.
    metadata Mapping[str, Any]
    See Argument Reference above.
    name str
    See Argument Reference above.
    region str
    See Argument Reference above.
    size int
    The size of the volume in GBs.
    source_volume_id str
    The ID of the volume from which the current volume was created.
    status str
    See Argument Reference above.
    volume_type str
    The type of the volume.
    bootable String
    Indicates if the volume is bootable.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<Any>
    See Argument Reference above.
    name String
    See Argument Reference above.
    region String
    See Argument Reference above.
    size Number
    The size of the volume in GBs.
    sourceVolumeId String
    The ID of the volume from which the current volume was created.
    status String
    See Argument Reference above.
    volumeType String
    The type of the volume.

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v3.15.2 published on Friday, Mar 29, 2024 by Pulumi