1. Packages
  2. Hcloud Provider
  3. API Docs
  4. getVolumes
Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi

hcloud.getVolumes

Explore with Pulumi AI

hcloud logo
Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi

    Provides details about multiple Hetzner Cloud Volumes.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hcloud from "@pulumi/hcloud";
    
    const volume_ = hcloud.getVolumes({});
    const volume3 = hcloud.getVolumes({
        withSelector: "key=value",
    });
    
    import pulumi
    import pulumi_hcloud as hcloud
    
    volume_ = hcloud.get_volumes()
    volume3 = hcloud.get_volumes(with_selector="key=value")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-hcloud/sdk/go/hcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := hcloud.GetVolumes(ctx, &hcloud.GetVolumesArgs{}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hcloud.GetVolumes(ctx, &hcloud.GetVolumesArgs{
    			WithSelector: pulumi.StringRef("key=value"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using HCloud = Pulumi.HCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var volume_ = HCloud.GetVolumes.Invoke();
    
        var volume3 = HCloud.GetVolumes.Invoke(new()
        {
            WithSelector = "key=value",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hcloud.HcloudFunctions;
    import com.pulumi.hcloud.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 volume_ = HcloudFunctions.getVolumes();
    
            final var volume3 = HcloudFunctions.getVolumes(GetVolumesArgs.builder()
                .withSelector("key=value")
                .build());
    
        }
    }
    
    variables:
      volume_:
        fn::invoke:
          Function: hcloud:getVolumes
          Arguments: {}
      volume3:
        fn::invoke:
          Function: hcloud:getVolumes
          Arguments:
            withSelector: key=value
    

    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(with_selector: Optional[str] = None,
                    with_statuses: Optional[Sequence[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> GetVolumesResult
    def get_volumes_output(with_selector: Optional[pulumi.Input[str]] = None,
                    with_statuses: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = 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: hcloud:index/getVolumes:getVolumes
      arguments:
        # arguments dictionary

    The following arguments are supported:

    WithSelector string
    Label selector
    WithStatuses List<string>
    List only volumes with the specified status, could contain creating or available.
    WithSelector string
    Label selector
    WithStatuses []string
    List only volumes with the specified status, could contain creating or available.
    withSelector String
    Label selector
    withStatuses List<String>
    List only volumes with the specified status, could contain creating or available.
    withSelector string
    Label selector
    withStatuses string[]
    List only volumes with the specified status, could contain creating or available.
    with_selector str
    Label selector
    with_statuses Sequence[str]
    List only volumes with the specified status, could contain creating or available.
    withSelector String
    Label selector
    withStatuses List<String>
    List only volumes with the specified status, could contain creating or available.

    getVolumes Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Volumes List<Pulumi.HCloud.Outputs.GetVolumesVolume>
    (list) List of all matching volumes. See data.hcloud_volume for schema.
    WithSelector string
    WithStatuses List<string>
    Id string
    The provider-assigned unique ID for this managed resource.
    Volumes []GetVolumesVolume
    (list) List of all matching volumes. See data.hcloud_volume for schema.
    WithSelector string
    WithStatuses []string
    id String
    The provider-assigned unique ID for this managed resource.
    volumes List<GetVolumesVolume>
    (list) List of all matching volumes. See data.hcloud_volume for schema.
    withSelector String
    withStatuses List<String>
    id string
    The provider-assigned unique ID for this managed resource.
    volumes GetVolumesVolume[]
    (list) List of all matching volumes. See data.hcloud_volume for schema.
    withSelector string
    withStatuses string[]
    id str
    The provider-assigned unique ID for this managed resource.
    volumes Sequence[GetVolumesVolume]
    (list) List of all matching volumes. See data.hcloud_volume for schema.
    with_selector str
    with_statuses Sequence[str]
    id String
    The provider-assigned unique ID for this managed resource.
    volumes List<Property Map>
    (list) List of all matching volumes. See data.hcloud_volume for schema.
    withSelector String
    withStatuses List<String>

    Supporting Types

    GetVolumesVolume

    DeleteProtection bool
    Id int
    Labels Dictionary<string, string>
    LinuxDevice string
    Name string
    Size int
    Location string
    ServerId int
    DeleteProtection bool
    Id int
    Labels map[string]string
    LinuxDevice string
    Name string
    Size int
    Location string
    ServerId int
    deleteProtection Boolean
    id Integer
    labels Map<String,String>
    linuxDevice String
    name String
    size Integer
    location String
    serverId Integer
    deleteProtection boolean
    id number
    labels {[key: string]: string}
    linuxDevice string
    name string
    size number
    location string
    serverId number
    delete_protection bool
    id int
    labels Mapping[str, str]
    linux_device str
    name str
    size int
    location str
    server_id int
    deleteProtection Boolean
    id Number
    labels Map<String>
    linuxDevice String
    name String
    size Number
    location String
    serverId Number

    Package Details

    Repository
    Hetzner Cloud pulumi/pulumi-hcloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the hcloud Terraform Provider.
    hcloud logo
    Hetzner Cloud v1.21.0 published on Tuesday, Nov 12, 2024 by Pulumi