1. Packages
  2. Vultr
  3. API Docs
  4. getBlockStorage
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

vultr.getBlockStorage

Explore with Pulumi AI

vultr logo
Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien

    Get information about a Vultr block storage subscription.

    Example Usage

    Get the information for a block storage subscription by label:

    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const myBlockStorage = vultr.getBlockStorage({
        filters: [{
            name: "label",
            values: ["my-block-storage-label"],
        }],
    });
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_block_storage = vultr.get_block_storage(filters=[vultr.GetBlockStorageFilterArgs(
        name="label",
        values=["my-block-storage-label"],
    )])
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.LookupBlockStorage(ctx, &vultr.LookupBlockStorageArgs{
    			Filters: []vultr.GetBlockStorageFilter{
    				{
    					Name: "label",
    					Values: []string{
    						"my-block-storage-label",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = Pulumi.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var myBlockStorage = Vultr.GetBlockStorage.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetBlockStorageFilterInputArgs
                {
                    Name = "label",
                    Values = new[]
                    {
                        "my-block-storage-label",
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.VultrFunctions;
    import com.pulumi.vultr.inputs.GetBlockStorageArgs;
    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 myBlockStorage = VultrFunctions.getBlockStorage(GetBlockStorageArgs.builder()
                .filters(GetBlockStorageFilterArgs.builder()
                    .name("label")
                    .values("my-block-storage-label")
                    .build())
                .build());
    
        }
    }
    
    variables:
      myBlockStorage:
        fn::invoke:
          Function: vultr:getBlockStorage
          Arguments:
            filters:
              - name: label
                values:
                  - my-block-storage-label
    

    Using getBlockStorage

    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 getBlockStorage(args: GetBlockStorageArgs, opts?: InvokeOptions): Promise<GetBlockStorageResult>
    function getBlockStorageOutput(args: GetBlockStorageOutputArgs, opts?: InvokeOptions): Output<GetBlockStorageResult>
    def get_block_storage(filters: Optional[Sequence[GetBlockStorageFilter]] = None,
                          opts: Optional[InvokeOptions] = None) -> GetBlockStorageResult
    def get_block_storage_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetBlockStorageFilterArgs]]]] = None,
                          opts: Optional[InvokeOptions] = None) -> Output[GetBlockStorageResult]
    func LookupBlockStorage(ctx *Context, args *LookupBlockStorageArgs, opts ...InvokeOption) (*LookupBlockStorageResult, error)
    func LookupBlockStorageOutput(ctx *Context, args *LookupBlockStorageOutputArgs, opts ...InvokeOption) LookupBlockStorageResultOutput

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

    public static class GetBlockStorage 
    {
        public static Task<GetBlockStorageResult> InvokeAsync(GetBlockStorageArgs args, InvokeOptions? opts = null)
        public static Output<GetBlockStorageResult> Invoke(GetBlockStorageInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBlockStorageResult> getBlockStorage(GetBlockStorageArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vultr:index/getBlockStorage:getBlockStorage
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<ediri.Vultr.Inputs.GetBlockStorageFilter>
    Query parameters for finding block storage subscriptions.
    Filters []GetBlockStorageFilter
    Query parameters for finding block storage subscriptions.
    filters List<GetBlockStorageFilter>
    Query parameters for finding block storage subscriptions.
    filters GetBlockStorageFilter[]
    Query parameters for finding block storage subscriptions.
    filters Sequence[GetBlockStorageFilter]
    Query parameters for finding block storage subscriptions.
    filters List<Property Map>
    Query parameters for finding block storage subscriptions.

    getBlockStorage Result

    The following output properties are available:

    AttachedToInstance string
    The ID of the VPS the block storage subscription is attached to.
    BlockType string
    The type of block storage volume.
    Cost int
    The cost per month of the block storage subscription in USD.
    DateCreated string
    The date the block storage subscription was added to your Vultr account.
    Id string
    The provider-assigned unique ID for this managed resource.
    Label string
    The label of the block storage subscription.
    MountId string
    An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
    Region string
    The region ID of the block storage subscription.
    SizeGb int
    The size of the block storage subscription in GB.
    Status string
    The status of the block storage subscription.
    Filters List<ediri.Vultr.Outputs.GetBlockStorageFilter>
    AttachedToInstance string
    The ID of the VPS the block storage subscription is attached to.
    BlockType string
    The type of block storage volume.
    Cost int
    The cost per month of the block storage subscription in USD.
    DateCreated string
    The date the block storage subscription was added to your Vultr account.
    Id string
    The provider-assigned unique ID for this managed resource.
    Label string
    The label of the block storage subscription.
    MountId string
    An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
    Region string
    The region ID of the block storage subscription.
    SizeGb int
    The size of the block storage subscription in GB.
    Status string
    The status of the block storage subscription.
    Filters []GetBlockStorageFilter
    attachedToInstance String
    The ID of the VPS the block storage subscription is attached to.
    blockType String
    The type of block storage volume.
    cost Integer
    The cost per month of the block storage subscription in USD.
    dateCreated String
    The date the block storage subscription was added to your Vultr account.
    id String
    The provider-assigned unique ID for this managed resource.
    label String
    The label of the block storage subscription.
    mountId String
    An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
    region String
    The region ID of the block storage subscription.
    sizeGb Integer
    The size of the block storage subscription in GB.
    status String
    The status of the block storage subscription.
    filters List<GetBlockStorageFilter>
    attachedToInstance string
    The ID of the VPS the block storage subscription is attached to.
    blockType string
    The type of block storage volume.
    cost number
    The cost per month of the block storage subscription in USD.
    dateCreated string
    The date the block storage subscription was added to your Vultr account.
    id string
    The provider-assigned unique ID for this managed resource.
    label string
    The label of the block storage subscription.
    mountId string
    An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
    region string
    The region ID of the block storage subscription.
    sizeGb number
    The size of the block storage subscription in GB.
    status string
    The status of the block storage subscription.
    filters GetBlockStorageFilter[]
    attached_to_instance str
    The ID of the VPS the block storage subscription is attached to.
    block_type str
    The type of block storage volume.
    cost int
    The cost per month of the block storage subscription in USD.
    date_created str
    The date the block storage subscription was added to your Vultr account.
    id str
    The provider-assigned unique ID for this managed resource.
    label str
    The label of the block storage subscription.
    mount_id str
    An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
    region str
    The region ID of the block storage subscription.
    size_gb int
    The size of the block storage subscription in GB.
    status str
    The status of the block storage subscription.
    filters Sequence[GetBlockStorageFilter]
    attachedToInstance String
    The ID of the VPS the block storage subscription is attached to.
    blockType String
    The type of block storage volume.
    cost Number
    The cost per month of the block storage subscription in USD.
    dateCreated String
    The date the block storage subscription was added to your Vultr account.
    id String
    The provider-assigned unique ID for this managed resource.
    label String
    The label of the block storage subscription.
    mountId String
    An ID associated with the instance, when mounted the ID can be found in /dev/disk/by-id prefixed with virtio.
    region String
    The region ID of the block storage subscription.
    sizeGb Number
    The size of the block storage subscription in GB.
    status String
    The status of the block storage subscription.
    filters List<Property Map>

    Supporting Types

    GetBlockStorageFilter

    Name string
    Attribute name to filter with.
    Values List<string>
    One or more values filter with.
    Name string
    Attribute name to filter with.
    Values []string
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.
    name string
    Attribute name to filter with.
    values string[]
    One or more values filter with.
    name str
    Attribute name to filter with.
    values Sequence[str]
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.

    Package Details

    Repository
    vultr dirien/pulumi-vultr
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vultr Terraform Provider.
    vultr logo
    Vultr v2.21.1 published on Monday, Jul 22, 2024 by dirien