Hetzner Cloud

v1.10.1 published on Wednesday, Aug 3, 2022 by Pulumi

getVolumes

Provides details about multiple Hetzner Cloud volumes.

Example Usage

using Pulumi;
using HCloud = Pulumi.HCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var volume_ = Output.Create(HCloud.GetVolumes.InvokeAsync());
        var volume3 = Output.Create(HCloud.GetVolumes.InvokeAsync(new HCloud.GetVolumesArgs
        {
            WithSelector = "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, nil, nil)
		if err != nil {
			return err
		}
		_, err = hcloud.GetVolumes(ctx, &GetVolumesArgs{
			WithSelector: pulumi.StringRef("key=value"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import java.util.*;
import java.io.*;
import java.nio.*;
import com.pulumi.*;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var volume_ = Output.of(HcloudFunctions.getVolumes());

        final var volume3 = Output.of(HcloudFunctions.getVolumes(GetVolumesArgs.builder()
            .withSelector("key=value")
            .build()));

    }
}
import pulumi
import pulumi_hcloud as hcloud

volume_ = hcloud.get_volumes()
volume3 = hcloud.get_volumes(with_selector="key=value")
import * as pulumi from "@pulumi/pulumi";
import * as hcloud from "@pulumi/hcloud";

const volume_ = pulumi.output(hcloud.getVolumes());
const volume3 = pulumi.output(hcloud.getVolumes({
    withSelector: "key=value",
}));
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, object>
LinuxDevice string
Name string
Size int
Location string
ServerId int
DeleteProtection bool
Id int
Labels map[string]interface{}
LinuxDevice string
Name string
Size int
Location string
ServerId int
deleteProtection Boolean
id Integer
labels Map<String,Object>
linuxDevice String
name String
size Integer
location String
serverId Integer
deleteProtection boolean
id number
labels {[key: string]: any}
linuxDevice string
name string
size number
location string
serverId number
delete_protection bool
id int
labels Mapping[str, Any]
linux_device str
name str
size int
location str
server_id int
deleteProtection Boolean
id Number
labels Map<Any>
linuxDevice String
name String
size Number
location String
serverId Number

Package Details

Repository
https://github.com/pulumi/pulumi-hcloud
License
Apache-2.0
Notes

This Pulumi package is based on the hcloud Terraform Provider.