Linode v4.30.1 published on Thursday, Nov 21, 2024 by Pulumi
linode.getVolumes
Explore with Pulumi AI
Provides information about Linode volumes that match a set of filters. For more information, see the Linode APIv4 docs.
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=[{
"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<Get
Volumes Filter> - Order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - Order
By string - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- Volumes
List<Get
Volumes Volume>
- Filters
[]Get
Volumes Filter - Order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - Order
By string - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- Volumes
[]Get
Volumes Volume
- filters
List<Get
Volumes Filter> - order String
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By String - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- volumes
List<Get
Volumes Volume>
- filters
Get
Volumes Filter[] - order string
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By string - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- volumes
Get
Volumes Volume[]
- filters
Sequence[Get
Volumes Filter] - order str
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order_
by str - The attribute to order the results by. See the Filterable Fields section for a list of valid fields.
- volumes
Sequence[Get
Volumes Volume]
- filters List<Property Map>
- order String
- The order in which results should be returned. (
asc
,desc
; defaultasc
) - order
By 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<Get
Volumes Filter> - Order string
- Order
By string - Volumes
List<Get
Volumes Volume>
- Id string
- The unique ID of this Volume.
- Filters
[]Get
Volumes Filter - Order string
- Order
By string - Volumes
[]Get
Volumes Volume
- id String
- The unique ID of this Volume.
- filters
List<Get
Volumes Filter> - order String
- order
By String - volumes
List<Get
Volumes Volume>
- id string
- The unique ID of this Volume.
- filters
Get
Volumes Filter[] - order string
- order
By string - volumes
Get
Volumes Volume[]
- id str
- The unique ID of this Volume.
- filters
Sequence[Get
Volumes Filter] - order str
- order_
by str - volumes
Sequence[Get
Volumes Volume]
- id String
- The unique ID of this Volume.
- filters List<Property Map>
- order String
- order
By 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.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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.
- Match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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.
- match
By string - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
- 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
; defaultexact
)
- 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.
- match
By String - The method to match the field by. (
exact
,regex
,substring
; defaultexact
)
GetVolumesVolume
- Created string
- When this Volume was created.
- Encryption string
- Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.
- Filesystem
Path 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.
- 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 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
) - 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.
- Encryption string
- Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.
- Filesystem
Path 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.
- 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 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
) - []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.
- encryption String
- Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.
- filesystem
Path 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.
- linode
Id 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
) - 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.
- encryption string
- Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.
- filesystem
Path 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.
- linode
Id 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
) - 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.
- encryption str
- Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.
- 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
) - 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.
- encryption String
- Whether Block Storage Disk Encryption is enabled or disabled on this Volume. Note: Block Storage Disk Encryption is not currently available to all users.
- filesystem
Path 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.
- linode
Id 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
) - 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.