OpenStack

Pulumi Official
Package maintained by Pulumi
v3.8.0 published on Monday, Feb 7, 2022 by Pulumi

getSnapshotV2

Use this data source to get information about an existing snapshot.

Example Usage

using Pulumi;
using OpenStack = Pulumi.OpenStack;

class MyStack : Stack
{
    public MyStack()
    {
        var snapshot1 = Output.Create(OpenStack.BlockStorage.GetSnapshotV2.InvokeAsync(new OpenStack.BlockStorage.GetSnapshotV2Args
        {
            MostRecent = true,
            Name = "snapshot_1",
        }));
    }

}
package main

import (
	"github.com/pulumi/pulumi-openstack/sdk/v3/go/openstack/blockstorage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		opt0 := true
		opt1 := "snapshot_1"
		_, err := blockstorage.GetSnapshotV2(ctx, &blockstorage.GetSnapshotV2Args{
			MostRecent: &opt0,
			Name:       &opt1,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_openstack as openstack

snapshot1 = openstack.blockstorage.get_snapshot_v2(most_recent=True,
    name="snapshot_1")
import * as pulumi from "@pulumi/pulumi";
import * as openstack from "@pulumi/openstack";

const snapshot1 = pulumi.output(openstack.blockstorage.getSnapshotV2({
    mostRecent: true,
    name: "snapshot_1",
}));

Coming soon!

Using getSnapshotV2

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 getSnapshotV2(args: GetSnapshotV2Args, opts?: InvokeOptions): Promise<GetSnapshotV2Result>
function getSnapshotV2Output(args: GetSnapshotV2OutputArgs, opts?: InvokeOptions): Output<GetSnapshotV2Result>
def get_snapshot_v2(most_recent: Optional[bool] = None,
                    name: Optional[str] = None,
                    region: Optional[str] = None,
                    status: Optional[str] = None,
                    volume_id: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetSnapshotV2Result
def get_snapshot_v2_output(most_recent: Optional[pulumi.Input[bool]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    region: Optional[pulumi.Input[str]] = None,
                    status: Optional[pulumi.Input[str]] = None,
                    volume_id: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotV2Result]
func GetSnapshotV2(ctx *Context, args *GetSnapshotV2Args, opts ...InvokeOption) (*GetSnapshotV2Result, error)
func GetSnapshotV2Output(ctx *Context, args *GetSnapshotV2OutputArgs, opts ...InvokeOption) GetSnapshotV2ResultOutput

> Note: This function is named GetSnapshotV2 in the Go SDK.

public static class GetSnapshotV2 
{
    public static Task<GetSnapshotV2Result> InvokeAsync(GetSnapshotV2Args args, InvokeOptions? opts = null)
    public static Output<GetSnapshotV2Result> Invoke(GetSnapshotV2InvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetSnapshotV2Result> getSnapshotV2(GetSnapshotV2Args args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: openstack:blockstorage/getSnapshotV2:getSnapshotV2
  Arguments:
    # Arguments dictionary

The following arguments are supported:

MostRecent bool

Pick the most recently created snapshot if there are multiple results.

Name string

The name of the snapshot.

Region string

The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.

Status string

The status of the snapshot.

VolumeId string

The ID of the snapshot's volume.

MostRecent bool

Pick the most recently created snapshot if there are multiple results.

Name string

The name of the snapshot.

Region string

The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.

Status string

The status of the snapshot.

VolumeId string

The ID of the snapshot's volume.

mostRecent Boolean

Pick the most recently created snapshot if there are multiple results.

name String

The name of the snapshot.

region String

The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.

status String

The status of the snapshot.

volumeId String

The ID of the snapshot's volume.

mostRecent boolean

Pick the most recently created snapshot if there are multiple results.

name string

The name of the snapshot.

region string

The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.

status string

The status of the snapshot.

volumeId string

The ID of the snapshot's volume.

most_recent bool

Pick the most recently created snapshot if there are multiple results.

name str

The name of the snapshot.

region str

The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.

status str

The status of the snapshot.

volume_id str

The ID of the snapshot's volume.

mostRecent Boolean

Pick the most recently created snapshot if there are multiple results.

name String

The name of the snapshot.

region String

The region in which to obtain the V2 Block Storage client. If omitted, the region argument of the provider is used.

status String

The status of the snapshot.

volumeId String

The ID of the snapshot's volume.

getSnapshotV2 Result

The following output properties are available:

Description string

The snapshot's description.

Id string

The provider-assigned unique ID for this managed resource.

Metadata Dictionary<string, object>

The snapshot's metadata.

Name string

See Argument Reference above.

Region string

See Argument Reference above.

Size int

The size of the snapshot.

Status string

See Argument Reference above.

VolumeId string

See Argument Reference above.

MostRecent bool
Description string

The snapshot's description.

Id string

The provider-assigned unique ID for this managed resource.

Metadata map[string]interface{}

The snapshot's metadata.

Name string

See Argument Reference above.

Region string

See Argument Reference above.

Size int

The size of the snapshot.

Status string

See Argument Reference above.

VolumeId string

See Argument Reference above.

MostRecent bool
description String

The snapshot's description.

id String

The provider-assigned unique ID for this managed resource.

metadata Map<String,Object>

The snapshot's metadata.

name String

See Argument Reference above.

region String

See Argument Reference above.

size Integer

The size of the snapshot.

status String

See Argument Reference above.

volumeId String

See Argument Reference above.

mostRecent Boolean
description string

The snapshot's description.

id string

The provider-assigned unique ID for this managed resource.

metadata {[key: string]: any}

The snapshot's metadata.

name string

See Argument Reference above.

region string

See Argument Reference above.

size number

The size of the snapshot.

status string

See Argument Reference above.

volumeId string

See Argument Reference above.

mostRecent boolean
description str

The snapshot's description.

id str

The provider-assigned unique ID for this managed resource.

metadata Mapping[str, Any]

The snapshot's metadata.

name str

See Argument Reference above.

region str

See Argument Reference above.

size int

The size of the snapshot.

status str

See Argument Reference above.

volume_id str

See Argument Reference above.

most_recent bool
description String

The snapshot's description.

id String

The provider-assigned unique ID for this managed resource.

metadata Map<Any>

The snapshot's metadata.

name String

See Argument Reference above.

region String

See Argument Reference above.

size Number

The size of the snapshot.

status String

See Argument Reference above.

volumeId String

See Argument Reference above.

mostRecent Boolean

Package Details

Repository
https://github.com/pulumi/pulumi-openstack
License
Apache-2.0
Notes

This Pulumi package is based on the openstack Terraform Provider.