Hetzner Cloud v1.20.4 published on Tuesday, Sep 24, 2024 by Pulumi
hcloud.getVolumes
Explore with Pulumi AI
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, nil, 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:
- With
Selector string - Label selector
- With
Statuses List<string> - List only volumes with the specified status, could contain
creating
oravailable
.
- With
Selector string - Label selector
- With
Statuses []string - List only volumes with the specified status, could contain
creating
oravailable
.
- with
Selector String - Label selector
- with
Statuses List<String> - List only volumes with the specified status, could contain
creating
oravailable
.
- with
Selector string - Label selector
- with
Statuses string[] - List only volumes with the specified status, could contain
creating
oravailable
.
- with_
selector str - Label selector
- with_
statuses Sequence[str] - List only volumes with the specified status, could contain
creating
oravailable
.
- with
Selector String - Label selector
- with
Statuses List<String> - List only volumes with the specified status, could contain
creating
oravailable
.
getVolumes Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Volumes
List<Pulumi.
HCloud. Outputs. Get Volumes Volume> - (list) List of all matching volumes. See
data.hcloud_volume
for schema. - With
Selector string - With
Statuses List<string>
- Id string
- The provider-assigned unique ID for this managed resource.
- Volumes
[]Get
Volumes Volume - (list) List of all matching volumes. See
data.hcloud_volume
for schema. - With
Selector string - With
Statuses []string
- id String
- The provider-assigned unique ID for this managed resource.
- volumes
List<Get
Volumes Volume> - (list) List of all matching volumes. See
data.hcloud_volume
for schema. - with
Selector String - with
Statuses List<String>
- id string
- The provider-assigned unique ID for this managed resource.
- volumes
Get
Volumes Volume[] - (list) List of all matching volumes. See
data.hcloud_volume
for schema. - with
Selector string - with
Statuses string[]
- id str
- The provider-assigned unique ID for this managed resource.
- volumes
Sequence[Get
Volumes Volume] - (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. - with
Selector String - with
Statuses List<String>
Supporting Types
GetVolumesVolume
- Delete
Protection bool - Id int
- Labels Dictionary<string, string>
- Linux
Device string - Name string
- Size int
- Location string
- Server
Id int
- Delete
Protection bool - Id int
- Labels map[string]string
- Linux
Device string - Name string
- Size int
- Location string
- Server
Id int
- delete
Protection Boolean - id Integer
- labels Map<String,String>
- linux
Device String - name String
- size Integer
- location String
- server
Id Integer
- delete
Protection boolean - id number
- labels {[key: string]: string}
- linux
Device string - name string
- size number
- location string
- server
Id number
- delete_
protection bool - id int
- labels Mapping[str, str]
- linux_
device str - name str
- size int
- location str
- server_
id int
- delete
Protection Boolean - id Number
- labels Map<String>
- linux
Device String - name String
- size Number
- location String
- server
Id Number
Package Details
- Repository
- Hetzner Cloud pulumi/pulumi-hcloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
hcloud
Terraform Provider.