1. Packages
  2. Vultr
  3. API Docs
  4. getSnapshot
Vultr v2.19.0 published on Friday, Jan 5, 2024 by dirien

vultr.getSnapshot

Explore with Pulumi AI

vultr logo
Vultr v2.19.0 published on Friday, Jan 5, 2024 by dirien

    Get information about a Vultr snapshot.

    Example Usage

    Get the information for a snapshot by

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vultr = Pulumi.Vultr;
    
    return await Deployment.RunAsync(() => 
    {
        var mySnapshot = Vultr.GetSnapshot.Invoke(new()
        {
            Filters = new[]
            {
                new Vultr.Inputs.GetSnapshotFilterInputArgs
                {
                    Name = "description",
                    Values = new[]
                    {
                        "my-snapshot-description",
                    },
                },
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/dirien/pulumi-vultr/sdk/v2/go/vultr"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := vultr.LookupSnapshot(ctx, &vultr.LookupSnapshotArgs{
    			Filters: []vultr.GetSnapshotFilter{
    				{
    					Name: "description",
    					Values: []string{
    						"my-snapshot-description",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vultr.VultrFunctions;
    import com.pulumi.vultr.inputs.GetSnapshotArgs;
    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 mySnapshot = VultrFunctions.getSnapshot(GetSnapshotArgs.builder()
                .filters(GetSnapshotFilterArgs.builder()
                    .name("description")
                    .values("my-snapshot-description")
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_vultr as vultr
    
    my_snapshot = vultr.get_snapshot(filters=[vultr.GetSnapshotFilterArgs(
        name="description",
        values=["my-snapshot-description"],
    )])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as vultr from "@pulumi/vultr";
    
    const mySnapshot = vultr.getSnapshot({
        filters: [{
            name: "description",
            values: ["my-snapshot-description"],
        }],
    });
    
    variables:
      mySnapshot:
        fn::invoke:
          Function: vultr:getSnapshot
          Arguments:
            filters:
              - name: description
                values:
                  - my-snapshot-description
    

    Using getSnapshot

    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 getSnapshot(args: GetSnapshotArgs, opts?: InvokeOptions): Promise<GetSnapshotResult>
    function getSnapshotOutput(args: GetSnapshotOutputArgs, opts?: InvokeOptions): Output<GetSnapshotResult>
    def get_snapshot(filters: Optional[Sequence[GetSnapshotFilter]] = None,
                     opts: Optional[InvokeOptions] = None) -> GetSnapshotResult
    def get_snapshot_output(filters: Optional[pulumi.Input[Sequence[pulumi.Input[GetSnapshotFilterArgs]]]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetSnapshotResult]
    func LookupSnapshot(ctx *Context, args *LookupSnapshotArgs, opts ...InvokeOption) (*LookupSnapshotResult, error)
    func LookupSnapshotOutput(ctx *Context, args *LookupSnapshotOutputArgs, opts ...InvokeOption) LookupSnapshotResultOutput

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

    public static class GetSnapshot 
    {
        public static Task<GetSnapshotResult> InvokeAsync(GetSnapshotArgs args, InvokeOptions? opts = null)
        public static Output<GetSnapshotResult> Invoke(GetSnapshotInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetSnapshotResult> getSnapshot(GetSnapshotArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: vultr:index/getSnapshot:getSnapshot
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<ediri.Vultr.Inputs.GetSnapshotFilter>
    Query parameters for finding snapshots.
    Filters []GetSnapshotFilter
    Query parameters for finding snapshots.
    filters List<GetSnapshotFilter>
    Query parameters for finding snapshots.
    filters GetSnapshotFilter[]
    Query parameters for finding snapshots.
    filters Sequence[GetSnapshotFilter]
    Query parameters for finding snapshots.
    filters List<Property Map>
    Query parameters for finding snapshots.

    getSnapshot Result

    The following output properties are available:

    AppId int
    The application ID of the snapshot.
    DateCreated string
    The date the snapshot was added to your Vultr account.
    Description string
    The description of the snapshot.
    Id string
    The provider-assigned unique ID for this managed resource.
    OsId int
    The operating system ID of the snapshot.
    Size int
    The size of the snapshot in bytes.
    Status string
    The status of the snapshot.
    Filters List<ediri.Vultr.Outputs.GetSnapshotFilter>
    AppId int
    The application ID of the snapshot.
    DateCreated string
    The date the snapshot was added to your Vultr account.
    Description string
    The description of the snapshot.
    Id string
    The provider-assigned unique ID for this managed resource.
    OsId int
    The operating system ID of the snapshot.
    Size int
    The size of the snapshot in bytes.
    Status string
    The status of the snapshot.
    Filters []GetSnapshotFilter
    appId Integer
    The application ID of the snapshot.
    dateCreated String
    The date the snapshot was added to your Vultr account.
    description String
    The description of the snapshot.
    id String
    The provider-assigned unique ID for this managed resource.
    osId Integer
    The operating system ID of the snapshot.
    size Integer
    The size of the snapshot in bytes.
    status String
    The status of the snapshot.
    filters List<GetSnapshotFilter>
    appId number
    The application ID of the snapshot.
    dateCreated string
    The date the snapshot was added to your Vultr account.
    description string
    The description of the snapshot.
    id string
    The provider-assigned unique ID for this managed resource.
    osId number
    The operating system ID of the snapshot.
    size number
    The size of the snapshot in bytes.
    status string
    The status of the snapshot.
    filters GetSnapshotFilter[]
    app_id int
    The application ID of the snapshot.
    date_created str
    The date the snapshot was added to your Vultr account.
    description str
    The description of the snapshot.
    id str
    The provider-assigned unique ID for this managed resource.
    os_id int
    The operating system ID of the snapshot.
    size int
    The size of the snapshot in bytes.
    status str
    The status of the snapshot.
    filters Sequence[GetSnapshotFilter]
    appId Number
    The application ID of the snapshot.
    dateCreated String
    The date the snapshot was added to your Vultr account.
    description String
    The description of the snapshot.
    id String
    The provider-assigned unique ID for this managed resource.
    osId Number
    The operating system ID of the snapshot.
    size Number
    The size of the snapshot in bytes.
    status String
    The status of the snapshot.
    filters List<Property Map>

    Supporting Types

    GetSnapshotFilter

    Name string
    Attribute name to filter with.
    Values List<string>
    One or more values filter with.
    Name string
    Attribute name to filter with.
    Values []string
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.
    name string
    Attribute name to filter with.
    values string[]
    One or more values filter with.
    name str
    Attribute name to filter with.
    values Sequence[str]
    One or more values filter with.
    name String
    Attribute name to filter with.
    values List<String>
    One or more values filter with.

    Package Details

    Repository
    vultr dirien/pulumi-vultr
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the vultr Terraform Provider.
    vultr logo
    Vultr v2.19.0 published on Friday, Jan 5, 2024 by dirien