1. Packages
  2. Linode
  3. API Docs
  4. getVolumes
Linode v4.19.0 published on Wednesday, Apr 24, 2024 by Pulumi

linode.getVolumes

Explore with Pulumi AI

linode logo
Linode v4.19.0 published on Wednesday, Apr 24, 2024 by Pulumi

    Provides information about Linode volumes that match a set of filters.

    import * as pulumi from "@pulumi/pulumi";
    import * as linode from "@pulumi/linode";
    
    const filtered-volumes = linode.getVolumes({
        filters: [{
            name: "label",
            values: ["test-volume"],
        }],
    });
    export const volumes = filtered_volumes.then(filtered_volumes => filtered_volumes.volumes);
    
    import pulumi
    import pulumi_linode as linode
    
    filtered_volumes = linode.get_volumes(filters=[linode.GetVolumesFilterArgs(
        name="label",
        values=["test-volume"],
    )])
    pulumi.export("volumes", filtered_volumes.volumes)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-linode/sdk/v4/go/linode"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		filtered_volumes, err := linode.GetVolumes(ctx, &linode.GetVolumesArgs{
    			Filters: []linode.GetVolumesFilter{
    				{
    					Name: "label",
    					Values: []string{
    						"test-volume",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("volumes", filtered_volumes.Volumes)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Linode = Pulumi.Linode;
    
    return await Deployment.RunAsync(() => 
    {
        var filtered_volumes = Linode.GetVolumes.Invoke(new()
        {
            Filters = new[]
            {
                new Linode.Inputs.GetVolumesFilterInputArgs
                {
                    Name = "label",
                    Values = new[]
                    {
                        "test-volume",
                    },
                },
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["volumes"] = filtered_volumes.Apply(filtered_volumes => filtered_volumes.Apply(getVolumesResult => getVolumesResult.Volumes)),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.linode.LinodeFunctions;
    import com.pulumi.linode.inputs.GetVolumesArgs;
    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 filtered-volumes = LinodeFunctions.getVolumes(GetVolumesArgs.builder()
                .filters(GetVolumesFilterArgs.builder()
                    .name("label")
                    .values("test-volume")
                    .build())
                .build());
    
            ctx.export("volumes", filtered_volumes.volumes());
        }
    }
    
    variables:
      filtered-volumes:
        fn::invoke:
          Function: linode:getVolumes
          Arguments:
            filters:
              - name: label
                values:
                  - test-volume
    outputs:
      volumes: ${["filtered-volumes"].volumes}
    

    Filterable Fields

    • label

    • tags

    Using getVolumes

    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 getVolumes(args: GetVolumesArgs, opts?: InvokeOptions): Promise<GetVolumesResult>
    function getVolumesOutput(args: GetVolumesOutputArgs, opts?: InvokeOptions): Output<GetVolumesResult>
    def get_volumes(filters: Optional[Sequence[GetVolumesFilter]] = None,
                    order: Optional[str] = None,
                    order_by: Optional[str] = None,
                    volumes: Optional[Sequence[GetVolumesVolume]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetVolumesResult
    def get_volumes_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetVolumesFilterArgs]]]] = None,
                    order: Optional[pulumi.Input[str]] = None,
                    order_by: Optional[pulumi.Input[str]] = None,
                    volumes: Optional[pulumi.Input[Sequence[pulumi.Input[GetVolumesVolumeArgs]]]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetVolumesResult]
    func GetVolumes(ctx *Context, args *GetVolumesArgs, opts ...InvokeOption) (*GetVolumesResult, error)
    func GetVolumesOutput(ctx *Context, args *GetVolumesOutputArgs, opts ...InvokeOption) GetVolumesResultOutput

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

    public static class GetVolumes 
    {
        public static Task<GetVolumesResult> InvokeAsync(GetVolumesArgs args, InvokeOptions? opts = null)
        public static Output<GetVolumesResult> Invoke(GetVolumesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVolumesResult> getVolumes(GetVolumesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: linode:index/getVolumes:getVolumes
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetVolumesFilter>
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Volumes List<GetVolumesVolume>
    Filters []GetVolumesFilter
    Order string
    The order in which results should be returned. (asc, desc; default asc)
    OrderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    Volumes []GetVolumesVolume
    filters List<GetVolumesFilter>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    volumes List<GetVolumesVolume>
    filters GetVolumesFilter[]
    order string
    The order in which results should be returned. (asc, desc; default asc)
    orderBy string
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    volumes GetVolumesVolume[]
    filters Sequence[GetVolumesFilter]
    order str
    The order in which results should be returned. (asc, desc; default asc)
    order_by str
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    volumes Sequence[GetVolumesVolume]
    filters List<Property Map>
    order String
    The order in which results should be returned. (asc, desc; default asc)
    orderBy String
    The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
    volumes List<Property Map>

    getVolumes Result

    The following output properties are available:

    Id string
    The unique ID of this Volume.
    Filters List<GetVolumesFilter>
    Order string
    OrderBy string
    Volumes List<GetVolumesVolume>
    Id string
    The unique ID of this Volume.
    Filters []GetVolumesFilter
    Order string
    OrderBy string
    Volumes []GetVolumesVolume
    id String
    The unique ID of this Volume.
    filters List<GetVolumesFilter>
    order String
    orderBy String
    volumes List<GetVolumesVolume>
    id string
    The unique ID of this Volume.
    filters GetVolumesFilter[]
    order string
    orderBy string
    volumes GetVolumesVolume[]
    id String
    The unique ID of this Volume.
    filters List<Property Map>
    order String
    orderBy String
    volumes List<Property Map>

    Supporting Types

    GetVolumesFilter

    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values List<string>
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    Name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    Values []string
    A list of values for the filter to allow. These values should all be in string form.
    MatchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)
    name string
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values string[]
    A list of values for the filter to allow. These values should all be in string form.
    matchBy string
    The method to match the field by. (exact, regex, substring; default exact)
    name str
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values Sequence[str]
    A list of values for the filter to allow. These values should all be in string form.
    match_by str
    The method to match the field by. (exact, regex, substring; default exact)
    name String
    The name of the field to filter by. See the Filterable Fields section for a complete list of filterable fields.
    values List<String>
    A list of values for the filter to allow. These values should all be in string form.
    matchBy String
    The method to match the field by. (exact, regex, substring; default exact)

    GetVolumesVolume

    Created string
    When this Volume was created.
    FilesystemPath string
    The full filesystem path for the Volume based on the Volume's label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
    Id int
    The unique ID of this Volume.
    Label string
    This Volume's label is for display purposes only.
    LinodeId int
    If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. If the Volume is unattached, this value will be null.
    Region string
    The datacenter in which this Volume is located. See all regions here.
    Size int
    The Volume's size, in GiB.
    Status string
    The current status of the Volume. (creating, active, resizing, contact_support)
    Tags List<string>
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    Updated string
    When this Volume was last updated.
    Created string
    When this Volume was created.
    FilesystemPath string
    The full filesystem path for the Volume based on the Volume's label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
    Id int
    The unique ID of this Volume.
    Label string
    This Volume's label is for display purposes only.
    LinodeId int
    If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. If the Volume is unattached, this value will be null.
    Region string
    The datacenter in which this Volume is located. See all regions here.
    Size int
    The Volume's size, in GiB.
    Status string
    The current status of the Volume. (creating, active, resizing, contact_support)
    Tags []string
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    Updated string
    When this Volume was last updated.
    created String
    When this Volume was created.
    filesystemPath String
    The full filesystem path for the Volume based on the Volume's label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
    id Integer
    The unique ID of this Volume.
    label String
    This Volume's label is for display purposes only.
    linodeId Integer
    If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. If the Volume is unattached, this value will be null.
    region String
    The datacenter in which this Volume is located. See all regions here.
    size Integer
    The Volume's size, in GiB.
    status String
    The current status of the Volume. (creating, active, resizing, contact_support)
    tags List<String>
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated String
    When this Volume was last updated.
    created string
    When this Volume was created.
    filesystemPath string
    The full filesystem path for the Volume based on the Volume's label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
    id number
    The unique ID of this Volume.
    label string
    This Volume's label is for display purposes only.
    linodeId number
    If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. If the Volume is unattached, this value will be null.
    region string
    The datacenter in which this Volume is located. See all regions here.
    size number
    The Volume's size, in GiB.
    status string
    The current status of the Volume. (creating, active, resizing, contact_support)
    tags string[]
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated string
    When this Volume was last updated.
    created str
    When this Volume was created.
    filesystem_path str
    The full filesystem path for the Volume based on the Volume's label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
    id int
    The unique ID of this Volume.
    label str
    This Volume's label is for display purposes only.
    linode_id int
    If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. If the Volume is unattached, this value will be null.
    region str
    The datacenter in which this Volume is located. See all regions here.
    size int
    The Volume's size, in GiB.
    status str
    The current status of the Volume. (creating, active, resizing, contact_support)
    tags Sequence[str]
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated str
    When this Volume was last updated.
    created String
    When this Volume was created.
    filesystemPath String
    The full filesystem path for the Volume based on the Volume's label. Path is /dev/disk/by-id/scsi-0LinodeVolume + Volume label.
    id Number
    The unique ID of this Volume.
    label String
    This Volume's label is for display purposes only.
    linodeId Number
    If a Volume is attached to a specific Linode, the ID of that Linode will be displayed here. If the Volume is unattached, this value will be null.
    region String
    The datacenter in which this Volume is located. See all regions here.
    size Number
    The Volume's size, in GiB.
    status String
    The current status of the Volume. (creating, active, resizing, contact_support)
    tags List<String>
    An array of tags applied to this object. Tags are case-insensitive and are for organizational purposes only.
    updated String
    When this Volume was last updated.

    Package Details

    Repository
    Linode pulumi/pulumi-linode
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the linode Terraform Provider.
    linode logo
    Linode v4.19.0 published on Wednesday, Apr 24, 2024 by Pulumi