1. Packages
  2. Volcengine
  3. API Docs
  4. ebs
  5. Volumes
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

volcengine.ebs.Volumes

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine

    Use this data source to query detailed information of volumes

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooZones = Volcengine.Ecs.Zones.Invoke();
    
        var fooVolume = new List<Volcengine.Ebs.Volume>();
        for (var rangeIndex = 0; rangeIndex < 3; rangeIndex++)
        {
            var range = new { Value = rangeIndex };
            fooVolume.Add(new Volcengine.Ebs.Volume($"fooVolume-{range.Value}", new()
            {
                VolumeName = $"acc-test-volume-{range.Value}",
                VolumeType = "ESSD_PL0",
                Description = "acc-test",
                Kind = "data",
                Size = 60,
                ZoneId = fooZones.Apply(zonesResult => zonesResult.Zones[0]?.Id),
                VolumeChargeType = "PostPaid",
                ProjectName = "default",
            }));
        }
        var fooVolumes = Volcengine.Ebs.Volumes.Invoke(new()
        {
            Ids = fooVolume.Select(__item => __item.Id).ToList(),
        });
    
    });
    
    package main
    
    import (
    	"fmt"
    
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ebs"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/ecs"
    )
    func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
    fooZones, err := ecs.Zones(ctx, nil, nil);
    if err != nil {
    return err
    }
    var fooVolume []*ebs.Volume
    for index := 0; index < 3; index++ {
        key0 := index
        val0 := index
    __res, err := ebs.NewVolume(ctx, fmt.Sprintf("fooVolume-%v", key0), &ebs.VolumeArgs{
    VolumeName: pulumi.String(fmt.Sprintf("acc-test-volume-%v", val0)),
    VolumeType: pulumi.String("ESSD_PL0"),
    Description: pulumi.String("acc-test"),
    Kind: pulumi.String("data"),
    Size: pulumi.Int(60),
    ZoneId: *pulumi.String(fooZones.Zones[0].Id),
    VolumeChargeType: pulumi.String("PostPaid"),
    ProjectName: pulumi.String("default"),
    })
    if err != nil {
    return err
    }
    fooVolume = append(fooVolume, __res)
    }
    _ = ebs.VolumesOutput(ctx, ebs.VolumesOutputArgs{
    Ids: %!v(PANIC=Format method: fatal: A failure has occurred: unlowered splat expression @ #-functions-volcengine:ebs-volumes:Volumes.pp:17,9-24),
    }, nil);
    return nil
    })
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.ecs.EcsFunctions;
    import com.pulumi.volcengine.ecs.inputs.ZonesArgs;
    import com.pulumi.volcengine.ebs.Volume;
    import com.pulumi.volcengine.ebs.VolumeArgs;
    import com.pulumi.volcengine.ebs.EbsFunctions;
    import com.pulumi.volcengine.ebs_volumes.inputs.VolumesArgs;
    import com.pulumi.codegen.internal.KeyedValue;
    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 fooZones = EcsFunctions.Zones();
    
            for (var i = 0; i < 3; i++) {
                new Volume("fooVolume-" + i, VolumeArgs.builder()            
                    .volumeName(String.format("acc-test-volume-%s", range.value()))
                    .volumeType("ESSD_PL0")
                    .description("acc-test")
                    .kind("data")
                    .size(60)
                    .zoneId(fooZones.applyValue(zonesResult -> zonesResult.zones()[0].id()))
                    .volumeChargeType("PostPaid")
                    .projectName("default")
                    .build());
    
            
    }
            final var fooVolumes = EbsFunctions.Volumes(VolumesArgs.builder()
                .ids(fooVolume.stream().map(element -> element.id()).collect(toList()))
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_zones = volcengine.ecs.zones()
    foo_volume = []
    for range in [{"value": i} for i in range(0, 3)]:
        foo_volume.append(volcengine.ebs.Volume(f"fooVolume-{range['value']}",
            volume_name=f"acc-test-volume-{range['value']}",
            volume_type="ESSD_PL0",
            description="acc-test",
            kind="data",
            size=60,
            zone_id=foo_zones.zones[0].id,
            volume_charge_type="PostPaid",
            project_name="default"))
    foo_volumes = volcengine.ebs.volumes_output(ids=[__item.id for __item in foo_volume])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooZones = volcengine.ecs.Zones({});
    const fooVolume: volcengine.ebs.Volume[] = [];
    for (const range = {value: 0}; range.value < 3; range.value++) {
        fooVolume.push(new volcengine.ebs.Volume(`fooVolume-${range.value}`, {
            volumeName: `acc-test-volume-${range.value}`,
            volumeType: "ESSD_PL0",
            description: "acc-test",
            kind: "data",
            size: 60,
            zoneId: fooZones.then(fooZones => fooZones.zones?.[0]?.id),
            volumeChargeType: "PostPaid",
            projectName: "default",
        }));
    }
    const fooVolumes = volcengine.ebs.VolumesOutput({
        ids: fooVolume.map(__item => __item.id),
    });
    

    Coming soon!

    Using Volumes

    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 volumes(args: VolumesArgs, opts?: InvokeOptions): Promise<VolumesResult>
    function volumesOutput(args: VolumesOutputArgs, opts?: InvokeOptions): Output<VolumesResult>
    def volumes(ids: Optional[Sequence[str]] = None,
                instance_id: Optional[str] = None,
                kind: Optional[str] = None,
                name_regex: Optional[str] = None,
                output_file: Optional[str] = None,
                tags: Optional[Sequence[VolumesTag]] = None,
                volume_name: Optional[str] = None,
                volume_status: Optional[str] = None,
                volume_type: Optional[str] = None,
                zone_id: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> VolumesResult
    def volumes_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                instance_id: Optional[pulumi.Input[str]] = None,
                kind: Optional[pulumi.Input[str]] = None,
                name_regex: Optional[pulumi.Input[str]] = None,
                output_file: Optional[pulumi.Input[str]] = None,
                tags: Optional[pulumi.Input[Sequence[pulumi.Input[VolumesTagArgs]]]] = None,
                volume_name: Optional[pulumi.Input[str]] = None,
                volume_status: Optional[pulumi.Input[str]] = None,
                volume_type: Optional[pulumi.Input[str]] = None,
                zone_id: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[VolumesResult]
    func Volumes(ctx *Context, args *VolumesArgs, opts ...InvokeOption) (*VolumesResult, error)
    func VolumesOutput(ctx *Context, args *VolumesOutputArgs, opts ...InvokeOption) VolumesResultOutput
    public static class Volumes 
    {
        public static Task<VolumesResult> InvokeAsync(VolumesArgs args, InvokeOptions? opts = null)
        public static Output<VolumesResult> Invoke(VolumesInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<VolumesResult> volumes(VolumesArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: volcengine:ebs:Volumes
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Ids List<string>
    A list of Volume IDs.
    InstanceId string
    The Id of instance.
    Kind string
    The Kind of Volume.
    NameRegex string
    A Name Regex of Volume.
    OutputFile string
    File name where to save data source results.
    Tags List<VolumesTag>
    Tags.
    VolumeName string
    The name of Volume.
    VolumeStatus string
    The Status of Volume, the value can be available or attaching or attached or detaching or creating or deleting or error or extending.
    VolumeType string
    The type of Volume.
    ZoneId string
    The Id of Zone.
    Ids []string
    A list of Volume IDs.
    InstanceId string
    The Id of instance.
    Kind string
    The Kind of Volume.
    NameRegex string
    A Name Regex of Volume.
    OutputFile string
    File name where to save data source results.
    Tags []VolumesTag
    Tags.
    VolumeName string
    The name of Volume.
    VolumeStatus string
    The Status of Volume, the value can be available or attaching or attached or detaching or creating or deleting or error or extending.
    VolumeType string
    The type of Volume.
    ZoneId string
    The Id of Zone.
    ids List<String>
    A list of Volume IDs.
    instanceId String
    The Id of instance.
    kind String
    The Kind of Volume.
    nameRegex String
    A Name Regex of Volume.
    outputFile String
    File name where to save data source results.
    tags List<VolumesTag>
    Tags.
    volumeName String
    The name of Volume.
    volumeStatus String
    The Status of Volume, the value can be available or attaching or attached or detaching or creating or deleting or error or extending.
    volumeType String
    The type of Volume.
    zoneId String
    The Id of Zone.
    ids string[]
    A list of Volume IDs.
    instanceId string
    The Id of instance.
    kind string
    The Kind of Volume.
    nameRegex string
    A Name Regex of Volume.
    outputFile string
    File name where to save data source results.
    tags VolumesTag[]
    Tags.
    volumeName string
    The name of Volume.
    volumeStatus string
    The Status of Volume, the value can be available or attaching or attached or detaching or creating or deleting or error or extending.
    volumeType string
    The type of Volume.
    zoneId string
    The Id of Zone.
    ids Sequence[str]
    A list of Volume IDs.
    instance_id str
    The Id of instance.
    kind str
    The Kind of Volume.
    name_regex str
    A Name Regex of Volume.
    output_file str
    File name where to save data source results.
    tags Sequence[VolumesTag]
    Tags.
    volume_name str
    The name of Volume.
    volume_status str
    The Status of Volume, the value can be available or attaching or attached or detaching or creating or deleting or error or extending.
    volume_type str
    The type of Volume.
    zone_id str
    The Id of Zone.
    ids List<String>
    A list of Volume IDs.
    instanceId String
    The Id of instance.
    kind String
    The Kind of Volume.
    nameRegex String
    A Name Regex of Volume.
    outputFile String
    File name where to save data source results.
    tags List<Property Map>
    Tags.
    volumeName String
    The name of Volume.
    volumeStatus String
    The Status of Volume, the value can be available or attaching or attached or detaching or creating or deleting or error or extending.
    volumeType String
    The type of Volume.
    zoneId String
    The Id of Zone.

    Volumes Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    TotalCount int
    The total count of Volume query.
    Volumes List<VolumesVolume>
    The collection of Volume query.
    Ids List<string>
    InstanceId string
    Kind string
    NameRegex string
    OutputFile string
    Tags List<VolumesTag>
    Tags.
    VolumeName string
    VolumeStatus string
    VolumeType string
    ZoneId string
    Id string
    The provider-assigned unique ID for this managed resource.
    TotalCount int
    The total count of Volume query.
    Volumes []VolumesVolume
    The collection of Volume query.
    Ids []string
    InstanceId string
    Kind string
    NameRegex string
    OutputFile string
    Tags []VolumesTag
    Tags.
    VolumeName string
    VolumeStatus string
    VolumeType string
    ZoneId string
    id String
    The provider-assigned unique ID for this managed resource.
    totalCount Integer
    The total count of Volume query.
    volumes List<VolumesVolume>
    The collection of Volume query.
    ids List<String>
    instanceId String
    kind String
    nameRegex String
    outputFile String
    tags List<VolumesTag>
    Tags.
    volumeName String
    volumeStatus String
    volumeType String
    zoneId String
    id string
    The provider-assigned unique ID for this managed resource.
    totalCount number
    The total count of Volume query.
    volumes VolumesVolume[]
    The collection of Volume query.
    ids string[]
    instanceId string
    kind string
    nameRegex string
    outputFile string
    tags VolumesTag[]
    Tags.
    volumeName string
    volumeStatus string
    volumeType string
    zoneId string
    id str
    The provider-assigned unique ID for this managed resource.
    total_count int
    The total count of Volume query.
    volumes Sequence[VolumesVolume]
    The collection of Volume query.
    ids Sequence[str]
    instance_id str
    kind str
    name_regex str
    output_file str
    tags Sequence[VolumesTag]
    Tags.
    volume_name str
    volume_status str
    volume_type str
    zone_id str
    id String
    The provider-assigned unique ID for this managed resource.
    totalCount Number
    The total count of Volume query.
    volumes List<Property Map>
    The collection of Volume query.
    ids List<String>
    instanceId String
    kind String
    nameRegex String
    outputFile String
    tags List<Property Map>
    Tags.
    volumeName String
    volumeStatus String
    volumeType String
    zoneId String

    Supporting Types

    VolumesTag

    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.
    key string
    The Key of Tags.
    value string
    The Value of Tags.
    key str
    The Key of Tags.
    value str
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.

    VolumesVolume

    BillingType int
    CreatedAt string
    DeleteWithInstance bool
    Description string
    DeviceName string
    ExpiredTime string
    Id string
    ImageId string
    InstanceId string
    The Id of instance.
    Kind string
    The Kind of Volume.
    PayType string
    RenewType int
    Size int
    Status string
    Tags List<VolumesVolumeTag>
    Tags.
    TradeStatus int
    UpdatedAt string
    VolumeId string
    VolumeName string
    The name of Volume.
    VolumeType string
    The type of Volume.
    ZoneId string
    The Id of Zone.
    BillingType int
    CreatedAt string
    DeleteWithInstance bool
    Description string
    DeviceName string
    ExpiredTime string
    Id string
    ImageId string
    InstanceId string
    The Id of instance.
    Kind string
    The Kind of Volume.
    PayType string
    RenewType int
    Size int
    Status string
    Tags []VolumesVolumeTag
    Tags.
    TradeStatus int
    UpdatedAt string
    VolumeId string
    VolumeName string
    The name of Volume.
    VolumeType string
    The type of Volume.
    ZoneId string
    The Id of Zone.
    billingType Integer
    createdAt String
    deleteWithInstance Boolean
    description String
    deviceName String
    expiredTime String
    id String
    imageId String
    instanceId String
    The Id of instance.
    kind String
    The Kind of Volume.
    payType String
    renewType Integer
    size Integer
    status String
    tags List<VolumesVolumeTag>
    Tags.
    tradeStatus Integer
    updatedAt String
    volumeId String
    volumeName String
    The name of Volume.
    volumeType String
    The type of Volume.
    zoneId String
    The Id of Zone.
    billingType number
    createdAt string
    deleteWithInstance boolean
    description string
    deviceName string
    expiredTime string
    id string
    imageId string
    instanceId string
    The Id of instance.
    kind string
    The Kind of Volume.
    payType string
    renewType number
    size number
    status string
    tags VolumesVolumeTag[]
    Tags.
    tradeStatus number
    updatedAt string
    volumeId string
    volumeName string
    The name of Volume.
    volumeType string
    The type of Volume.
    zoneId string
    The Id of Zone.
    billing_type int
    created_at str
    delete_with_instance bool
    description str
    device_name str
    expired_time str
    id str
    image_id str
    instance_id str
    The Id of instance.
    kind str
    The Kind of Volume.
    pay_type str
    renew_type int
    size int
    status str
    tags Sequence[VolumesVolumeTag]
    Tags.
    trade_status int
    updated_at str
    volume_id str
    volume_name str
    The name of Volume.
    volume_type str
    The type of Volume.
    zone_id str
    The Id of Zone.
    billingType Number
    createdAt String
    deleteWithInstance Boolean
    description String
    deviceName String
    expiredTime String
    id String
    imageId String
    instanceId String
    The Id of instance.
    kind String
    The Kind of Volume.
    payType String
    renewType Number
    size Number
    status String
    tags List<Property Map>
    Tags.
    tradeStatus Number
    updatedAt String
    volumeId String
    volumeName String
    The name of Volume.
    volumeType String
    The type of Volume.
    zoneId String
    The Id of Zone.

    VolumesVolumeTag

    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    Key string
    The Key of Tags.
    Value string
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.
    key string
    The Key of Tags.
    value string
    The Value of Tags.
    key str
    The Key of Tags.
    value str
    The Value of Tags.
    key String
    The Key of Tags.
    value String
    The Value of Tags.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.26 published on Friday, Sep 13, 2024 by Volcengine