Viewing docs for Packet v3.2.2
published on Thursday, Nov 12, 2020 by Pulumi
published on Thursday, Nov 12, 2020 by Pulumi
Viewing docs for Packet v3.2.2
published on Thursday, Nov 12, 2020 by Pulumi
published on Thursday, Nov 12, 2020 by Pulumi
Provides a Packet Block Storage Volume datasource to allow you to read existing volumes.
Example Usage
using Pulumi;
using Packet = Pulumi.Packet;
class MyStack : Stack
{
public MyStack()
{
var volume1 = Output.Create(Packet.GetVolume.InvokeAsync(new Packet.GetVolumeArgs
{
Name = "terraform-volume-1",
ProjectId = local.Project_id,
}));
this.VolumeSize = volume1.Apply(volume1 => volume1.Size);
}
[Output("volumeSize")]
public Output<string> VolumeSize { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-packet/sdk/v3/go/packet"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := "terraform-volume-1"
opt1 := local.Project_id
volume1, err := packet.LookupVolume(ctx, &packet.LookupVolumeArgs{
Name: &opt0,
ProjectId: &opt1,
}, nil)
if err != nil {
return err
}
ctx.Export("volumeSize", volume1.Size)
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as packet from "@pulumi/packet";
const volume1 = packet.getVolume({
name: "terraform-volume-1",
projectId: local.project_id,
});
export const volumeSize = volume1.then(volume1 => volume1.size);
import pulumi
import pulumi_packet as packet
volume1 = packet.get_volume(name="terraform-volume-1",
project_id=local["project_id"])
pulumi.export("volumeSize", volume1.size)
Example coming soon!
Using getVolume
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 getVolume(args: GetVolumeArgs, opts?: InvokeOptions): Promise<GetVolumeResult>
function getVolumeOutput(args: GetVolumeOutputArgs, opts?: InvokeOptions): Output<GetVolumeResult>def get_volume(name: Optional[str] = None,
project_id: Optional[str] = None,
volume_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVolumeResult
def get_volume_output(name: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[str]] = None,
volume_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVolumeResult]func LookupVolume(ctx *Context, args *LookupVolumeArgs, opts ...InvokeOption) (*LookupVolumeResult, error)
func LookupVolumeOutput(ctx *Context, args *LookupVolumeOutputArgs, opts ...InvokeOption) LookupVolumeResultOutput> Note: This function is named LookupVolume in the Go SDK.
public static class GetVolume
{
public static Task<GetVolumeResult> InvokeAsync(GetVolumeArgs args, InvokeOptions? opts = null)
public static Output<GetVolumeResult> Invoke(GetVolumeInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
public static Output<GetVolumeResult> getVolume(GetVolumeArgs args, InvokeOptions options)
fn::invoke:
function: packet:index/getVolume:getVolume
arguments:
# arguments dictionaryThe following arguments are supported:
- name str
- Name of volume for lookup
- project_
id str - The ID the parent Packet project (for lookup by name)
- volume_
id str - ID of volume for lookup
getVolume Result
The following output properties are available:
- Billing
Cycle string - The billing cycle, defaults to hourly
- Created string
- Description string
- Device
Ids List<string> - UUIDs of devices to which this volume is attached
- Facility string
- The facility slug the volume resides in
- Id string
- The provider-assigned unique ID for this managed resource.
- Locked bool
- Whether the volume is locked or not
- Name string
- The name of the volume
project_id- The project id the volume is in
- Plan string
- Performance plan the volume is on
- Project
Id string - Size int
- The size in GB of the volume
- Snapshot
Policies List<GetVolume Snapshot Policy> - State string
- The state of the volume
- Updated string
- Volume
Id string
- Billing
Cycle string - The billing cycle, defaults to hourly
- Created string
- Description string
- Device
Ids []string - UUIDs of devices to which this volume is attached
- Facility string
- The facility slug the volume resides in
- Id string
- The provider-assigned unique ID for this managed resource.
- Locked bool
- Whether the volume is locked or not
- Name string
- The name of the volume
project_id- The project id the volume is in
- Plan string
- Performance plan the volume is on
- Project
Id string - Size int
- The size in GB of the volume
- Snapshot
Policies []GetVolume Snapshot Policy - State string
- The state of the volume
- Updated string
- Volume
Id string
- billing
Cycle String - The billing cycle, defaults to hourly
- created String
- description String
- device
Ids List<String> - UUIDs of devices to which this volume is attached
- facility String
- The facility slug the volume resides in
- id String
- The provider-assigned unique ID for this managed resource.
- locked Boolean
- Whether the volume is locked or not
- name String
- The name of the volume
project_id- The project id the volume is in
- plan String
- Performance plan the volume is on
- project
Id String - size Integer
- The size in GB of the volume
- snapshot
Policies List<GetVolume Snapshot Policy> - state String
- The state of the volume
- updated String
- volume
Id String
- billing
Cycle string - The billing cycle, defaults to hourly
- created string
- description string
- device
Ids string[] - UUIDs of devices to which this volume is attached
- facility string
- The facility slug the volume resides in
- id string
- The provider-assigned unique ID for this managed resource.
- locked boolean
- Whether the volume is locked or not
- name string
- The name of the volume
project_id- The project id the volume is in
- plan string
- Performance plan the volume is on
- project
Id string - size number
- The size in GB of the volume
- snapshot
Policies GetVolume Snapshot Policy[] - state string
- The state of the volume
- updated string
- volume
Id string
- billing_
cycle str - The billing cycle, defaults to hourly
- created str
- description str
- device_
ids Sequence[str] - UUIDs of devices to which this volume is attached
- facility str
- The facility slug the volume resides in
- id str
- The provider-assigned unique ID for this managed resource.
- locked bool
- Whether the volume is locked or not
- name str
- The name of the volume
project_id- The project id the volume is in
- plan str
- Performance plan the volume is on
- project_
id str - size int
- The size in GB of the volume
- snapshot_
policies Sequence[GetVolume Snapshot Policy] - state str
- The state of the volume
- updated str
- volume_
id str
- billing
Cycle String - The billing cycle, defaults to hourly
- created String
- description String
- device
Ids List<String> - UUIDs of devices to which this volume is attached
- facility String
- The facility slug the volume resides in
- id String
- The provider-assigned unique ID for this managed resource.
- locked Boolean
- Whether the volume is locked or not
- name String
- The name of the volume
project_id- The project id the volume is in
- plan String
- Performance plan the volume is on
- project
Id String - size Number
- The size in GB of the volume
- snapshot
Policies List<Property Map> - state String
- The state of the volume
- updated String
- volume
Id String
Supporting Types
GetVolumeSnapshotPolicy
- Snapshot
Count int - Snapshot
Frequency string
- Snapshot
Count int - Snapshot
Frequency string
- snapshot
Count Integer - snapshot
Frequency String
- snapshot
Count number - snapshot
Frequency string
- snapshot_
count int - snapshot_
frequency str
- snapshot
Count Number - snapshot
Frequency String
Package Details
- Repository
- Packet pulumi/pulumi-packet
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
packetTerraform Provider.
Viewing docs for Packet v3.2.2
published on Thursday, Nov 12, 2020 by Pulumi
published on Thursday, Nov 12, 2020 by Pulumi
