The Automation API is now available. No CLI. No human-in-the-loop. Just your code. Learn More

GetSnapshot

Snapshots are saved instances of a block storage volume. Use this data source to retrieve the ID of a Civo snapshot for use in other resources.

Example Usage

using Pulumi;
using Civo = Pulumi.Civo;

class MyStack : Stack
{
    public MyStack()
    {
        var mysql_vm = Output.Create(Civo.GetSnapshot.InvokeAsync(new Civo.GetSnapshotArgs
        {
            Name = "mysql-vm",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-civo/sdk/go/civo"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "mysql-vm"
        _, err := civo.LookupSnapshot(ctx, &civo.LookupSnapshotArgs{
            Name: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_civo as civo

mysql_vm = civo.get_snapshot(name="mysql-vm")
import * as pulumi from "@pulumi/pulumi";
import * as civo from "@pulumi/civo";

const mysql_vm = pulumi.output(civo.getSnapshot({
    name: "mysql-vm",
}, { async: true }));

Using GetSnapshot

function getSnapshot(args: GetSnapshotArgs, opts?: InvokeOptions): Promise<GetSnapshotResult>
def get_snapshot(id: Optional[str] = None, name: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetSnapshotResult
func LookupSnapshot(ctx *Context, args *LookupSnapshotArgs, opts ...InvokeOption) (*LookupSnapshotResult, error)

Note: This function is named LookupSnapshot in the Go SDK.

public static class GetSnapshot {
    public static Task<GetSnapshotResult> InvokeAsync(GetSnapshotArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Id string

The ID of the snapshot.

Name string

The name of the snapshot.

Id string

The ID of the snapshot.

Name string

The name of the snapshot.

id string

The ID of the snapshot.

name string

The name of the snapshot.

id str

The ID of the snapshot.

name str

The name of the snapshot.

GetSnapshot Result

The following output properties are available:

CompletedAt string

The date where the snapshot was completed.

CronTiming string

A string with the cron format.

Hostname string

The hostname of the instance.

InstanceId string

The ID of the Instance from which the snapshot was be taken.

NextExecution string

if cron was define this date will be the next execution date.

Region string

The region where the snapshot was take.

RequestedAt string

The date where the snapshot was requested.

Safe bool

If is true the instance will be shut down during the snapshot if id false them not.

SizeGb int

The size of the snapshot in GB.

State string

The status of the snapshot.

TemplateId string

The template id.

Id string
Name string

The name of the snapshot.

CompletedAt string

The date where the snapshot was completed.

CronTiming string

A string with the cron format.

Hostname string

The hostname of the instance.

InstanceId string

The ID of the Instance from which the snapshot was be taken.

NextExecution string

if cron was define this date will be the next execution date.

Region string

The region where the snapshot was take.

RequestedAt string

The date where the snapshot was requested.

Safe bool

If is true the instance will be shut down during the snapshot if id false them not.

SizeGb int

The size of the snapshot in GB.

State string

The status of the snapshot.

TemplateId string

The template id.

Id string
Name string

The name of the snapshot.

completedAt string

The date where the snapshot was completed.

cronTiming string

A string with the cron format.

hostname string

The hostname of the instance.

instanceId string

The ID of the Instance from which the snapshot was be taken.

nextExecution string

if cron was define this date will be the next execution date.

region string

The region where the snapshot was take.

requestedAt string

The date where the snapshot was requested.

safe boolean

If is true the instance will be shut down during the snapshot if id false them not.

sizeGb number

The size of the snapshot in GB.

state string

The status of the snapshot.

templateId string

The template id.

id string
name string

The name of the snapshot.

completed_at str

The date where the snapshot was completed.

cron_timing str

A string with the cron format.

hostname str

The hostname of the instance.

instance_id str

The ID of the Instance from which the snapshot was be taken.

next_execution str

if cron was define this date will be the next execution date.

region str

The region where the snapshot was take.

requested_at str

The date where the snapshot was requested.

safe bool

If is true the instance will be shut down during the snapshot if id false them not.

size_gb int

The size of the snapshot in GB.

state str

The status of the snapshot.

template_id str

The template id.

id str
name str

The name of the snapshot.

Package Details

Repository
https://github.com/pulumi/pulumi-civo
License
Apache-2.0
Notes
This Pulumi package is based on the civo Terraform Provider.